summaryrefslogtreecommitdiff
path: root/asciifarm/client/commandhandler.py
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2019-09-26 18:30:14 +0200
committertroido <troido@protonmail.com>2019-09-26 18:30:14 +0200
commit41ccee19d4522ae8f5eb0abdb4b9a67f0f415d69 (patch)
treeea4a8b152c861b815523eca3bb0cada843a41871 /asciifarm/client/commandhandler.py
parent207e51fc5b308d5ef967967ba2eec61a30a80057 (diff)
client -> server messages are now objects; better name validation; fixed concurrency bug
Diffstat (limited to 'asciifarm/client/commandhandler.py')
-rw-r--r--asciifarm/client/commandhandler.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/asciifarm/client/commandhandler.py b/asciifarm/client/commandhandler.py
index f2e94d1..0c3027f 100644
--- a/asciifarm/client/commandhandler.py
+++ b/asciifarm/client/commandhandler.py
@@ -17,7 +17,6 @@ class CommandHandler:
self.client = client
self.commands = {
- "send": self.send,
"input": self.input,
"move": self.move,
"say": self.say,
@@ -65,11 +64,8 @@ class CommandHandler:
# Commands
- def send(self, data):
- self.client.send(data)
-
def input(self, action):
- self.send(["input", action])
+ self.client.sendInput(action)
def move(self, direction):
self.input(["move", direction])
@@ -81,7 +77,7 @@ class CommandHandler:
self.input(["pick", option])
def chat(self, text):
- self.send(["chat", text])
+ self.client.sendChat( text)
def log(self, text):