diff options
author | Karel Kočí <cynerd@email.cz> | 2016-01-08 17:05:52 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2016-01-08 17:05:52 +0100 |
commit | 852b2bfa78c02de39cdf6a04959dce526c15b352 (patch) | |
tree | 1f86c5163abb381a64fc0af22df33bb2c91b3922 /mcwrapper | |
parent | 9073bf1ccac68cfaa93d4bbe5c9b1b3fe98fcd8c (diff) | |
download | mcserver-wrapper-852b2bfa78c02de39cdf6a04959dce526c15b352.tar.gz mcserver-wrapper-852b2bfa78c02de39cdf6a04959dce526c15b352.tar.bz2 mcserver-wrapper-852b2bfa78c02de39cdf6a04959dce526c15b352.zip |
Fix exit hangup when timeout enabled
Diffstat (limited to 'mcwrapper')
-rwxr-xr-x | mcwrapper | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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() |