From 7b20981ab533727e6870347ac0324f6266b731b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 30 Nov 2015 21:45:35 +0100 Subject: Fix wrong variable access and missing player set --- mcwrapper | 10 ++++++++-- 1 file 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: -- cgit v1.2.3