From: Christian Heller Date: Sun, 6 Dec 2020 17:19:30 +0000 (+0100) Subject: Limit annotation length. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/%7B%7Bdb.prefix%7D%7D/static/%7B%7Bprefix%7D%7D/%7B%7Btodo.comment%7D%7D?a=commitdiff_plain;h=920a6e5b6e7d355aaaf0ae79ed194eab6e00b999;p=plomrogue2 Limit annotation length. --- diff --git a/plomrogue/commands.py b/plomrogue/commands.py index dc2e6ea..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 @@ -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):