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:
John "Elwin" Edwards 2012-06-06 10:53:29 -07:00
parent fbc86e7e12
commit 94e9fa330c

View file

@ -23,9 +23,17 @@ var ajaxstate = {
this.set(1000);
this.state = 1;
}
else {
else if (this.state < 4) {
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) {
@ -411,12 +419,13 @@ function formreg(ev) {
function logout() {
if (termemu.sessid == null)
return;
/* TODO IFACE2 If the end was unexpected, tell player the game was saved. */
termemu.sessid = null;
ajaxstate.clear();
setTitle("Game over.");
nsend = 0;
nrecv = 0;
msgQ = [];
//document.getElementById("loginform").style.display = "block";
setmode("login");
return;
}