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
Parse ARGUMENT_ERROR.
[plomrogue2-experiments]
/
new2
/
rogue_chat.html
diff --git
a/new2/rogue_chat.html
b/new2/rogue_chat.html
index 7ba548b119f19cfaf74b373faed4084ea2ba0548..dd9cc8d9c4a3c46db9328721912a1959f404f124 100644
(file)
--- a/
new2/rogue_chat.html
+++ b/
new2/rogue_chat.html
@@
-226,14
+226,18
@@
websocket.onmessage = function (event) {
tui.log_msg(tokens[1]);
} else if (tokens[0] === 'UNHANDLED_INPUT') {
tui.log_msg('unknown command');
tui.log_msg(tokens[1]);
} else if (tokens[0] === 'UNHANDLED_INPUT') {
tui.log_msg('unknown command');
+ } else if (tokens[0] === 'ARGUMENT_ERROR') {
+ tui.log_msg('syntax error: ' + tokens[1]);
} else if (tokens[0] === 'GAME_ERROR') {
tui.log_msg('game error: ' + tokens[1]);
} else if (tokens[0] === 'GAME_ERROR') {
tui.log_msg('game error: ' + tokens[1]);
- } else if (tokens[0] === '
GAME_ERROR
') {
-
tui.log_msg('game error: ' + tokens[1]
);
+ } else if (tokens[0] === '
PONG
') {
+
console.log('PONG'
);
} else {
tui.log_msg('unhandled input: ' + event.data);
}
}
} else {
tui.log_msg('unhandled input: ' + event.data);
}
}
+
+window.setInterval(function() { websocket.send('PING') }, 30000);
</script>
</body>
</html>
</script>
</body>
</html>