From 920a6e5b6e7d355aaaf0ae79ed194eab6e00b999 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sun, 6 Dec 2020 18:19:30 +0100 Subject: [PATCH] Limit annotation length. --- plomrogue/commands.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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): -- 2.30.2