From beeb1ab5b5e33ac9ff873e167fc4474b8a18301c Mon Sep 17 00:00:00 2001 From: Christian Heller <c.heller@plomlompom.de> Date: Tue, 17 Nov 2020 00:59:25 +0100 Subject: [PATCH] Fix chat command bug in web client. --- rogue_chat_nocanvas_monochrome.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) { -- 2.30.2