aboutsummaryrefslogtreecommitdiff
path: root/mcwrapper
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2015-11-30 21:45:35 +0100
committerKarel Kočí <cynerd@email.cz>2015-11-30 21:57:07 +0100
commit7b20981ab533727e6870347ac0324f6266b731b1 (patch)
tree798281ab28b262bca8e3ec1f9959869a2fba8fe6 /mcwrapper
parent842bf710322f9e8b1cd5cac1b81e08d3d3840980 (diff)
downloadmcserver-wrapper-7b20981ab533727e6870347ac0324f6266b731b1.tar.gz
mcserver-wrapper-7b20981ab533727e6870347ac0324f6266b731b1.tar.bz2
mcserver-wrapper-7b20981ab533727e6870347ac0324f6266b731b1.zip
Fix wrong variable access and missing player set
Diffstat (limited to 'mcwrapper')
-rwxr-xr-xmcwrapper10
1 files changed, 8 insertions, 2 deletions
diff --git a/mcwrapper b/mcwrapper
index 99de0b3..fcba062 100755
--- a/mcwrapper
+++ b/mcwrapper
@@ -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: