diff options
author | Karel Kočí <cynerd@email.cz> | 2016-01-08 17:47:36 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2016-01-08 17:47:36 +0100 |
commit | 30c9d38bd7333299b1ce5d49fbe24684394b4a97 (patch) | |
tree | f670977cf61d8f493d11ee1d30a2e72fa8942a99 | |
parent | 852b2bfa78c02de39cdf6a04959dce526c15b352 (diff) | |
download | mcserver-wrapper-30c9d38bd7333299b1ce5d49fbe24684394b4a97.tar.gz mcserver-wrapper-30c9d38bd7333299b1ce5d49fbe24684394b4a97.tar.bz2 mcserver-wrapper-30c9d38bd7333299b1ce5d49fbe24684394b4a97.zip |
Fix exception when writing to input pipe
-rwxr-xr-x | mcwrapper | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 |