home · contact · privacy
Limit annotation length.
[plomrogue2] / plomrogue / commands.py
index dc2e6ead099deb9c2a873f93e3309bd327d7d464..2061fe7b782560f50911753fcee3f1cf9395afac 100644 (file)
@@ -1,5 +1,5 @@
 from plomrogue.misc import quote
-from plomrogue.errors import GameError
+from plomrogue.errors import GameError, ArgError
 
 
 
@@ -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):