From 852b2bfa78c02de39cdf6a04959dce526c15b352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 8 Jan 2016 17:05:52 +0100 Subject: Fix exit hangup when timeout enabled --- mcwrapper | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'mcwrapper') diff --git a/mcwrapper b/mcwrapper index ddf1d8d..9e137ae 100755 --- a/mcwrapper +++ b/mcwrapper @@ -190,6 +190,7 @@ class MCServer: if self.running(): self.prc.stdin.write(bytes("/stop\n", sys.getdefaultencoding())) self.prc.stdin.flush() + self.__autoshutdown_disable__() def running(self): "Returns True if mc server is running. Othervise False." if self.status != 0: @@ -198,10 +199,13 @@ class MCServer: return False def write_to_terminal(self, text): "Write to server terminal. If server not running it does nothing" - if self.running(): + if self.statis == 2: info(self.identifier + ": Input: " + ln, 1) self.prc.write(bytes(line, sys.getdefaultencoding())) self.prc.flush() + return True + else: + return False def join(self): "Join execution untill server exits." self.outpuThread.join() -- cgit v1.2.3