rglterm.js: reduce the server polling.

For roguelike games, most output will directly result from and follow
immediately after input from the user.  In other situations, data
should not be expected.
This commit is contained in:
John "Elwin" Edwards 2012-06-05 22:33:41 -07:00
parent dec7bc108a
commit 520226a343

View file

@ -15,30 +15,28 @@ var ajaxstate = {
this.timerID = window.setTimeout(getData, ms);
},
gotdata: function () {
this.set(100);
this.state = 0;
this.set(1000);
this.state = 1;
},
gotnothing: function () {
if (this.state == 0) {
this.set(100);
this.set(1000);
this.state = 1;
}
else if (this.state == 1) {
this.set(300);
else {
this.set(4000);
this.state = 2;
}
else if (this.state == 2) {
},
posted: function (wasdata) {
if (wasdata) {
this.set(1000);
this.state = 3;
this.state = 1;
}
else {
this.set(5000);
this.state = 3;
this.set(200);
this.state = 0;
}
},
posted: function () {
this.set(100);
this.state = 0;
}
};