From 1d4308ac71d879a74d17fc3877f0e1c7d9303686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 10 Jan 2017 18:53:28 +0100 Subject: Fix for player names with spaces and exit error --- mcwrapper/players.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mcwrapper/players.py') 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: -- cgit v1.2.3