X-Git-Url: https://plomlompom.com/repos/feed.xml?a=blobdiff_plain;ds=inline;f=plomrogue%2Fcommands.py;h=2061fe7b782560f50911753fcee3f1cf9395afac;hb=920a6e5b6e7d355aaaf0ae79ed194eab6e00b999;hp=dea4b63d4c4c69e0d42b8abc90a7c345c2945312;hpb=018bb0242ebd2b7e9fde170fae830376dea55e16;p=plomrogue2 diff --git a/plomrogue/commands.py b/plomrogue/commands.py index dea4b63..2061fe7 100644 --- a/plomrogue/commands.py +++ b/plomrogue/commands.py @@ -1,5 +1,5 @@ from plomrogue.misc import quote -from plomrogue.errors import GameError +from plomrogue.errors import GameError, ArgError @@ -96,7 +96,7 @@ def cmd_THING_PROTECTION(game, thing_id, protection_char, connection_id): if not t: raise GameError('thing of ID %s not found' % thing_id) t.protection = protection_char - game.changed = True + #game.changed = True cmd_THING_PROTECTION.argtypes = 'int:pos char' def cmd_SET_MAP_CONTROL_PASSWORD(game, tile_class, password, connection_id): @@ -108,7 +108,7 @@ def cmd_SET_MAP_CONTROL_PASSWORD(game, tile_class, password, connection_id): if tile_class == '.': raise GameError('tile class "." must remain unprotected') game.map_control_passwords[tile_class] = password - game.changed = True + #game.changed = True cmd_SET_MAP_CONTROL_PASSWORD.argtypes = 'char string' def cmd_NICK(game, nick, connection_id): @@ -151,6 +151,8 @@ def cmd_TURN(game, n): 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): @@ -312,5 +314,5 @@ def cmd_THING_BOTTLE_EMPTY(game, thing_id): raise GameError('thing of ID %s not found' % thing_id) if not t.type_ == 'Bottle': raise GameError('thing of ID %s not bottle' % thing_id) - t.full = False + t.empty() cmd_THING_BOTTLE_EMPTY.argtypes = 'int:pos'