home · contact · privacy
Only force password-crotection on non-god-mode calls.
authorChristian Heller <c.heller@plomlompom.de>
Tue, 10 Nov 2020 10:43:09 +0000 (11:43 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 10 Nov 2020 10:43:09 +0000 (11:43 +0100)
plomrogue/commands.py

index f6744aca92e037d132effc9ebd0b8dcae9e05d13..c2bcc0a4858076568f0f7609a4f69f1efa3528d4 100644 (file)
@@ -73,7 +73,7 @@ def cmd_TURN(game, n):
 cmd_TURN.argtypes = 'int:nonneg'
 
 def cmd_ANNOTATE(game, pw, yx, msg, connection_id):
-    if not game.can_do_tile_with_pw(yx, pw):
+    if connection_id and not game.can_do_tile_with_pw(yx, pw):
         raise GameError('wrong password for tile')
     if msg == ' ':
         if yx in game.annotations:
@@ -84,7 +84,7 @@ def cmd_ANNOTATE(game, pw, yx, msg, connection_id):
 cmd_ANNOTATE.argtypes = 'string yx_tuple:nonneg string'
 
 def cmd_PORTAL(game, pw, yx, msg, connection_id):
-    if not game.can_do_tile_with_pw(yx, pw):
+    if connection_id and not game.can_do_tile_with_pw(yx, pw):
         raise GameError('wrong password for tile')
     if msg == ' ':
         if yx in game.portals: