aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2016-01-08 17:05:52 +0100
committerKarel Kočí <cynerd@email.cz>2016-01-08 17:05:52 +0100
commit852b2bfa78c02de39cdf6a04959dce526c15b352 (patch)
tree1f86c5163abb381a64fc0af22df33bb2c91b3922
parent9073bf1ccac68cfaa93d4bbe5c9b1b3fe98fcd8c (diff)
downloadmcserver-wrapper-852b2bfa78c02de39cdf6a04959dce526c15b352.tar.gz
mcserver-wrapper-852b2bfa78c02de39cdf6a04959dce526c15b352.tar.bz2
mcserver-wrapper-852b2bfa78c02de39cdf6a04959dce526c15b352.zip
Fix exit hangup when timeout enabled
-rwxr-xr-xmcwrapper6
1 files changed, 5 insertions, 1 deletions
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()