From: Christian Heller <c.heller@plomlompom.de> Date: Mon, 16 Nov 2020 23:59:25 +0000 (+0100) Subject: Fix chat command bug in web client. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/%7B%7Bdb.prefix%7D%7D/%7B%7B%20web_path%20%7D%7D/static/todo?a=commitdiff_plain;h=beeb1ab5b5e33ac9ff873e167fc4474b8a18301c;p=plomrogue2 Fix chat command bug in web client. --- diff --git a/rogue_chat_nocanvas_monochrome.html b/rogue_chat_nocanvas_monochrome.html index d6e8a6e..c50a12f 100644 --- a/rogue_chat_nocanvas_monochrome.html +++ b/rogue_chat_nocanvas_monochrome.html @@ -61,6 +61,7 @@ terminal columns: <input id="n_cols" type="number" step=4 min=80 value=80 /> <script> "use strict"; let websocket_location = "wss://plomlompom.com/rogue_chat/"; +//let websocket_location = "ws://localhost:8000/"; let rows_selector = document.getElementById("n_rows"); let cols_selector = document.getElementById("n_cols"); @@ -891,7 +892,7 @@ tui.inputEl.addEventListener('keydown', (event) => { tui.password = tui.inputEl.value tui.switch_mode(mode_play); } else if (tui.mode == mode_chat && event.key == 'Enter') { - let [tokens, token_starts] = parser.tokenize(tui.inputEl.value); + let tokens = parser.tokenize(tui.inputEl.value); if (tokens.length > 0 && tokens[0].length > 0) { if (tui.inputEl.value[0][0] == '/') { if (tokens[0].slice(1) == 'play' || tokens[0][1] == tui.keys.switch_to_play) {