diff options
author | Karel Kočí <cynerd@email.cz> | 2015-11-30 21:45:35 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2015-11-30 21:57:07 +0100 |
commit | 7b20981ab533727e6870347ac0324f6266b731b1 (patch) | |
tree | 798281ab28b262bca8e3ec1f9959869a2fba8fe6 | |
parent | 842bf710322f9e8b1cd5cac1b81e08d3d3840980 (diff) | |
download | mcserver-wrapper-7b20981ab533727e6870347ac0324f6266b731b1.tar.gz mcserver-wrapper-7b20981ab533727e6870347ac0324f6266b731b1.tar.bz2 mcserver-wrapper-7b20981ab533727e6870347ac0324f6266b731b1.zip |
Fix wrong variable access and missing player set
-rwxr-xr-x | mcwrapper | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -62,20 +62,24 @@ __STATUSSTRINGS__ = { def __user_join__(username): global playerCount + global playersFile + global players playerCount += 1 if conf.verbose_level >= 0: print("User '" + username + "' joined server.") - with open(conf.playersFile, 'a') as f: + with open(playersFile, 'a') as f: players.add(username) f.write(username + '\n') def __user_leave__(username): global playerCount + global playersFile + global players playerCount -= 1 if conf.verbose_level >= 0: print("User '" + username + "' left server.") players.remove(username) - with open(conf.playersFile, 'w') as f: + with open(playersFile, 'w') as f: f.writelines(players) if players: f.write('\n') @@ -102,6 +106,8 @@ def __server_start__(): pass global playerCount playerCount = 0 + global players + players = set() def __server_clean__(): if conf.verbose_level >= 0: |