"""
from inspect import signature
- from plomrogue.errors import GameError, ArgError
+ from plomrogue.errors import GameError, ArgError, PlayError
from plomrogue.misc import quote
def answer(connection_id, msg):
# f.write(input_ + '\n')
except ArgError as e:
answer(connection_id, 'ARGUMENT_ERROR ' + quote(str(e)))
+ except PlayError as e:
+ answer(connection_id, 'PLAY_ERROR ' + quote(str(e)))
except GameError as e:
answer(connection_id, 'GAME_ERROR ' + quote(str(e)))
if connection_id:
self.server.clients[connection_id].put(msg)
else:
- for c in self.server.clients.values():
- c.put(msg)
+ for c_id in self.game.sessions:
+ client = self.server.clients[c_id]
+ client.put(msg)