home
·
contact
·
privacy
projects
/
plomrogue2
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
In web client, only reconnect if websocket.readyState != 1.
[plomrogue2]
/
rogue_chat.html
diff --git
a/rogue_chat.html
b/rogue_chat.html
index ebe64f2041fe4a4f755da1bea1a670185c23cdc2..1b62a81ad77c63aa1fc8b3f37697aab52c8f3759 100644
(file)
--- a/
rogue_chat.html
+++ b/
rogue_chat.html
@@
-454,7
+454,6
@@
let server = {
this.url = url;
this.websocket = new WebSocket(this.url);
this.websocket.onopen = function(event) {
this.url = url;
this.websocket = new WebSocket(this.url);
this.websocket.onopen = function(event) {
- server.connected = true;
game.thing_types = {};
game.terrains = {};
server.send(['TASKS']);
game.thing_types = {};
game.terrains = {};
server.send(['TASKS']);
@@
-464,7
+463,6
@@
let server = {
tui.switch_mode('login');
};
this.websocket.onclose = function(event) {
tui.switch_mode('login');
};
this.websocket.onclose = function(event) {
- server.connected = false;
tui.switch_mode('waiting_for_server');
tui.log_msg("@ server disconnected :(");
};
tui.switch_mode('waiting_for_server');
tui.log_msg("@ server disconnected :(");
};
@@
-1660,13
+1658,13
@@
for (let key_selector of key_selectors) {
}, false);
}
window.setInterval(function() {
}, false);
}
window.setInterval(function() {
- if (server.
connected
) {
+ if (server.
websocket.readyState == 1
) {
server.send(['PING']);
} else {
server.reconnect_to(server.url);
tui.log_msg('@ attempting reconnect …')
}
server.send(['PING']);
} else {
server.reconnect_to(server.url);
tui.log_msg('@ attempting reconnect …')
}
-},
5
000);
+},
1
000);
window.setInterval(function() {
let val = "?";
let span_decoration = "none";
window.setInterval(function() {
let val = "?";
let span_decoration = "none";