home
·
contact
·
privacy
projects
/
plomrogue2
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c102402
)
Limit annotation length.
author
Christian Heller
<c.heller@plomlompom.de>
Sun, 6 Dec 2020 17:19:30 +0000
(18:19 +0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Sun, 6 Dec 2020 17:19:30 +0000
(18:19 +0100)
plomrogue/commands.py
patch
|
blob
|
history
diff --git
a/plomrogue/commands.py
b/plomrogue/commands.py
index dc2e6ead099deb9c2a873f93e3309bd327d7d464..2061fe7b782560f50911753fcee3f1cf9395afac 100644
(file)
--- a/
plomrogue/commands.py
+++ b/
plomrogue/commands.py
@@
-1,5
+1,5
@@
from plomrogue.misc import quote
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):
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):
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):