aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2016-01-08 17:47:36 +0100
committerKarel Kočí <cynerd@email.cz>2016-01-08 17:47:36 +0100
commit30c9d38bd7333299b1ce5d49fbe24684394b4a97 (patch)
treef670977cf61d8f493d11ee1d30a2e72fa8942a99
parent852b2bfa78c02de39cdf6a04959dce526c15b352 (diff)
downloadmcserver-wrapper-30c9d38bd7333299b1ce5d49fbe24684394b4a97.tar.gz
mcserver-wrapper-30c9d38bd7333299b1ce5d49fbe24684394b4a97.tar.bz2
mcserver-wrapper-30c9d38bd7333299b1ce5d49fbe24684394b4a97.zip
Fix exception when writing to input pipe
-rwxr-xr-xmcwrapper8
1 files changed, 4 insertions, 4 deletions
diff --git a/mcwrapper b/mcwrapper
index 9e137ae..fda83fa 100755
--- a/mcwrapper
+++ b/mcwrapper
@@ -199,10 +199,10 @@ class MCServer:
return False
def write_to_terminal(self, text):
"Write to server terminal. If server not running it does nothing"
- if self.statis == 2:
- info(self.identifier + ": Input: " + ln, 1)
- self.prc.write(bytes(line, sys.getdefaultencoding()))
- self.prc.flush()
+ if self.status == 2:
+ info(self.identifier + ": Input: " + text, 1)
+ self.prc.stdin.write(bytes(text, sys.getdefaultencoding()))
+ self.prc.stdin.flush()
return True
else:
return False