home
·
contact
·
privacy
projects
/
plomrogue2-experiments
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix single char chat messages.
[plomrogue2-experiments]
/
new2
/
rogue_chat_nocanvas_monochrome.html
diff --git
a/new2/rogue_chat_nocanvas_monochrome.html
b/new2/rogue_chat_nocanvas_monochrome.html
index 72ebf78d97c7c0dc2100192ecf57aa94540a8f92..0ec239426a1b5814470543f7904de03e4900761f 100644
(file)
--- a/
new2/rogue_chat_nocanvas_monochrome.html
+++ b/
new2/rogue_chat_nocanvas_monochrome.html
@@
-149,7
+149,7
@@
let unparser = {
let quoted = ['"'];
for (let i = 0; i < str.length; i++) {
let c = str[i];
let quoted = ['"'];
for (let i = 0; i < str.length; i++) {
let c = str[i];
- if (
c in ['"', '\\']
) {
+ if (
['"', '\\'].includes(c)
) {
quoted.push('\\');
};
quoted.push(c);
quoted.push('\\');
};
quoted.push(c);
@@
-413,11
+413,8
@@
server.websocket.onmessage = function (event) {
tui.log_msg('# ' + tokens[1], 1);
} else if (tokens[0] === 'PLAYER_ID') {
game.player_id = parseInt(tokens[1]);
tui.log_msg('# ' + tokens[1], 1);
} else if (tokens[0] === 'PLAYER_ID') {
game.player_id = parseInt(tokens[1]);
- } else if (tokens[0] === 'META') {
- tui.log_msg('@ ' + tokens[1]);
} else if (tokens[0] === 'LOGIN_OK') {
server.send(['GET_GAMESTATE']);
} else if (tokens[0] === 'LOGIN_OK') {
server.send(['GET_GAMESTATE']);
- tui.log_msg('@ ' + tokens[1]);
tui.log_help();
tui.switch_mode(mode_play);
} else if (tokens[0] === 'ANNOTATION') {
tui.log_help();
tui.switch_mode(mode_play);
} else if (tokens[0] === 'ANNOTATION') {
@@
-530,9
+527,11
@@
document.addEventListener('keydown', (event) => {
} else {
tui.log_msg('? unknown command');
}
} else {
tui.log_msg('? unknown command');
}
-
} else {
-
server.send(['ALL', tui.input]);
+ } else {
+ server.send(['ALL', tui.input]);
}
}
+ } else if (tui.input.length > 0) {
+ server.send(['ALL', tui.input]);
}
tui.empty_input();
tui.full_refresh();
}
tui.empty_input();
tui.full_refresh();