aboutsummaryrefslogtreecommitdiff
path: root/mcwrapper
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2017-01-10 18:53:28 +0100
committerKarel Kočí <cynerd@email.cz>2017-01-10 18:53:28 +0100
commit1d4308ac71d879a74d17fc3877f0e1c7d9303686 (patch)
treec173177ce5364a61a5c4b80f9f4bd05d84d61cbc /mcwrapper
parent8596801b5c8aa702142909b1634823c6d1623dac (diff)
downloadmcserver-wrapper-1d4308ac71d879a74d17fc3877f0e1c7d9303686.tar.gz
mcserver-wrapper-1d4308ac71d879a74d17fc3877f0e1c7d9303686.tar.bz2
mcserver-wrapper-1d4308ac71d879a74d17fc3877f0e1c7d9303686.zip
Fix for player names with spaces and exit error
Diffstat (limited to 'mcwrapper')
-rw-r--r--mcwrapper/alarm.py2
-rw-r--r--mcwrapper/players.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/mcwrapper/alarm.py b/mcwrapper/alarm.py
index de61741..d11c37f 100644
--- a/mcwrapper/alarm.py
+++ b/mcwrapper/alarm.py
@@ -61,6 +61,6 @@ def set(name, t, handler, repeat=False, arg=None):
def unset(name):
- if name in __update__:
+ if name in __alarms__:
__alarms__.pop(name)
__update__()
diff --git a/mcwrapper/players.py b/mcwrapper/players.py
index c3dabb4..ef1528d 100644
--- a/mcwrapper/players.py
+++ b/mcwrapper/players.py
@@ -13,7 +13,7 @@ class MCPlayers:
self.wrapper = wrapper
wrapper.hook_start(self.__reset__)
wrapper.hook_stop(self.__reset__)
- wrapper.hook_line('logged in with entity id', self.__user_join__)
+ wrapper.hook_line('joined the game', self.__user_join__)
wrapper.hook_line('left the game', self.__user_leave__)
self.file_export = file_export
self.__reset__()
@@ -30,7 +30,7 @@ class MCPlayers:
def __user_join__(self, line):
username = line[len('[00:00:00] [Server thread/INFO]: '):]
- username = username[:username.index('[')]
+ username = username[:username.index(' joined the game')]
prints.info("User '" + username + "' joined server.")
self.players.add(username)
if self.file_export:
@@ -39,7 +39,7 @@ class MCPlayers:
def __user_leave__(self, line):
username = line[len('[00:00:00] [Server thread/INFO]: '):]
- username = username[:username.index(' ')]
+ username = username[:username.index(' left the game')]
prints.info("User '" + username + "' left server.")
self.players.remove(username)
if self.file_export: