# HG changeset patch # User John "Elwin" Edwards # Date 1339005209 25200 # Node ID b06a14876645af296d266e1f48ec68d71406ff63 # Parent 353be34de307ed89ce48749c51a29307521f6ffc RLG-Web: reduce polling further. The ajaxstate object now reduces polling to 15-second intervals and stops entirely after one minute. diff -r 353be34de307 -r b06a14876645 rlgterm.js --- a/rlgterm.js Wed Jun 06 10:08:31 2012 -0700 +++ b/rlgterm.js Wed Jun 06 10:53:29 2012 -0700 @@ -23,9 +23,17 @@ 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 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; }