From 41ccee19d4522ae8f5eb0abdb4b9a67f0f415d69 Mon Sep 17 00:00:00 2001 From: troido Date: Thu, 26 Sep 2019 18:30:14 +0200 Subject: client -> server messages are now objects; better name validation; fixed concurrency bug --- asciifarm/client/commandhandler.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'asciifarm/client/commandhandler.py') 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): -- cgit