RLG-Web: reduce polling further.
The ajaxstate object now reduces polling to 15-second intervals and stops entirely after one minute.
This commit is contained in:
parent
fbc86e7e12
commit
94e9fa330c
1 changed files with 12 additions and 3 deletions
15
rlgterm.js
15
rlgterm.js
|
|
@ -23,9 +23,17 @@ var ajaxstate = {
|
||||||
this.set(1000);
|
this.set(1000);
|
||||||
this.state = 1;
|
this.state = 1;
|
||||||
}
|
}
|
||||||
else {
|
else if (this.state < 4) {
|
||||||
this.set(4000);
|
this.set(4000);
|
||||||
this.state = 2;
|
this.state++;
|
||||||
|
}
|
||||||
|
else if (this.state < 8) {
|
||||||
|
this.set(15000);
|
||||||
|
this.state++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/* It's been over a minute. Stop polling. */
|
||||||
|
this.clear();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
posted: function (wasdata) {
|
posted: function (wasdata) {
|
||||||
|
|
@ -411,12 +419,13 @@ function formreg(ev) {
|
||||||
function logout() {
|
function logout() {
|
||||||
if (termemu.sessid == null)
|
if (termemu.sessid == null)
|
||||||
return;
|
return;
|
||||||
|
/* TODO IFACE2 If the end was unexpected, tell player the game was saved. */
|
||||||
termemu.sessid = null;
|
termemu.sessid = null;
|
||||||
|
ajaxstate.clear();
|
||||||
setTitle("Game over.");
|
setTitle("Game over.");
|
||||||
nsend = 0;
|
nsend = 0;
|
||||||
nrecv = 0;
|
nrecv = 0;
|
||||||
msgQ = [];
|
msgQ = [];
|
||||||
//document.getElementById("loginform").style.display = "block";
|
|
||||||
setmode("login");
|
setmode("login");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue