from plomrogue.misc import quote
-from plomrogue.errors import GameError
+from plomrogue.errors import GameError, ArgError
cmd_SPAWN_POINT.argtypes = 'yx_tuple yx_tuple:nonneg'
def cmd_LOGIN(game, nick, connection_id):
- # TODO filter newlines
for t in [t for t in game.things if t.type_ == 'Player' and t.name == nick]:
raise GameError('name already in use')
if game.get_player(connection_id):
cmd_TURN.argtypes = 'int:nonneg'
def cmd_ANNOTATE(game, yx, msg, pw, connection_id):
+ if len(msg) > 500:
+ raise ArgError('annotation text must be <= 500 characters')
player = game.get_player(connection_id)
big_yx, little_yx = player.fov_stencil.source_yxyx(yx)
if not player.fov_test(big_yx, little_yx):