From: Christian Heller Date: Tue, 10 Nov 2020 10:45:07 +0000 (+0100) Subject: Fix arg order for passwords. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/%7B%7Bprefix%7D%7D/%7B%7Bdb.prefix%7D%7D/day?a=commitdiff_plain;h=46108644f062458df5b0540f806abffab650683f;p=plomrogue2 Fix arg order for passwords. --- diff --git a/plomrogue/commands.py b/plomrogue/commands.py index c2bcc0a..85ec5d3 100644 --- a/plomrogue/commands.py +++ b/plomrogue/commands.py @@ -72,7 +72,7 @@ def cmd_TURN(game, n): game.turn = n cmd_TURN.argtypes = 'int:nonneg' -def cmd_ANNOTATE(game, pw, yx, msg, connection_id): +def cmd_ANNOTATE(game, yx, msg, pw=None, connection_id=None): if connection_id and not game.can_do_tile_with_pw(yx, pw): raise GameError('wrong password for tile') if msg == ' ': @@ -81,9 +81,9 @@ def cmd_ANNOTATE(game, pw, yx, msg, connection_id): else: game.annotations[yx] = msg game.changed = True -cmd_ANNOTATE.argtypes = 'string yx_tuple:nonneg string' +cmd_ANNOTATE.argtypes = 'yx_tuple:nonneg string string' -def cmd_PORTAL(game, pw, yx, msg, connection_id): +def cmd_PORTAL(game, yx, msg, pw=None, connection_id=None): if connection_id and not game.can_do_tile_with_pw(yx, pw): raise GameError('wrong password for tile') if msg == ' ': @@ -92,7 +92,7 @@ def cmd_PORTAL(game, pw, yx, msg, connection_id): else: game.portals[yx] = msg game.changed = True -cmd_PORTAL.argtypes = 'string yx_tuple:nonneg string' +cmd_PORTAL.argtypes = 'yx_tuple:nonneg string string' def cmd_GET_ANNOTATION(game, yx, connection_id): annotation = '(none)'; diff --git a/rogue_chat_curses.py b/rogue_chat_curses.py index 7ff7446..b09dcc7 100755 --- a/rogue_chat_curses.py +++ b/rogue_chat_curses.py @@ -636,15 +636,15 @@ class TUI: elif self.mode == self.mode_annotate and key == '\n': if self.input_ == '': self.input_ = ' ' - self.send('ANNOTATE %s %s %s' % (quote(self.password), - self.explorer, quote(self.input_))) + self.send('ANNOTATE %s %s %s' % (self.explorer, quote(self.input_), + quote(self.password)) self.input_ = "" self.switch_mode('study', keep_position=True) elif self.mode == self.mode_portal and key == '\n': if self.input_ == '': self.input_ = ' ' - self.send('PORTAL %s %s %s' % (quote(self.password), - self.explorer, quote(self.input_))) + self.send('PORTAL %s %s %s' % (self.explorer, quote(self.input_), + quote(self.password))) self.input_ = "" self.switch_mode('study', keep_position=True) elif self.mode == self.mode_teleport and key == '\n': diff --git a/rogue_chat_nocanvas_monochrome.html b/rogue_chat_nocanvas_monochrome.html index 28d3773..085c8a2 100644 --- a/rogue_chat_nocanvas_monochrome.html +++ b/rogue_chat_nocanvas_monochrome.html @@ -709,13 +709,13 @@ let explorer = { if (msg.length == 0) { msg = " "; // triggers annotation deletion } - server.send(["ANNOTATE", tui.password, unparser.to_yx(explorer.position), msg]); + server.send(["ANNOTATE", unparser.to_yx(explorer.position), msg, tui.password]); }, set_portal: function(msg) { if (msg.length == 0) { msg = " "; // triggers portal deletion } - server.send(["PORTAL", tui.password, unparser.to_yx(explorer.position), msg]); + server.send(["PORTAL", unparser.to_yx(explorer.position), msg, tui.password]); } }