aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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: