mirror of
https://github.com/webbukkit/dynmap.git
synced 2025-02-20 14:01:48 +01:00
Merge pull request #327 from mikeprimm/master
Make "server update failed" red banner happen after 3rd consecutive read fail,not first
This commit is contained in:
commit
1465795f97
@ -96,6 +96,7 @@ DynMap.prototype = {
|
|||||||
serverday: false,
|
serverday: false,
|
||||||
inittime: new Date().getTime(),
|
inittime: new Date().getTime(),
|
||||||
followingPlayer: '',
|
followingPlayer: '',
|
||||||
|
missedupdates: 0,
|
||||||
formatUrl: function(name, options) {
|
formatUrl: function(name, options) {
|
||||||
var url = this.options.url[name];
|
var url = this.options.url[name];
|
||||||
$.each(options, function(n,v) {
|
$.each(options, function(n,v) {
|
||||||
@ -483,13 +484,16 @@ DynMap.prototype = {
|
|||||||
$(me).trigger('worldupdated', [ update ]);
|
$(me).trigger('worldupdated', [ update ]);
|
||||||
|
|
||||||
me.lasttimestamp = update.timestamp;
|
me.lasttimestamp = update.timestamp;
|
||||||
|
me.missedupdates = 0;
|
||||||
setTimeout(function() { me.update(); }, me.options.updaterate);
|
setTimeout(function() { me.update(); }, me.options.updaterate);
|
||||||
}, function(status, statusText, request) {
|
}, function(status, statusText, request) {
|
||||||
me.alertbox
|
me.missedupdates++;
|
||||||
.text('Could not update map: ' + (statusText || 'Could not connect to server'))
|
if(me.missedupdates > 2) {
|
||||||
.show();
|
me.alertbox
|
||||||
$(me).trigger('worldupdatefailed');
|
.text('Could not update map: ' + (statusText || 'Could not connect to server'))
|
||||||
|
.show();
|
||||||
|
$(me).trigger('worldupdatefailed');
|
||||||
|
}
|
||||||
setTimeout(function() { me.update(); }, me.options.updaterate);
|
setTimeout(function() { me.update(); }, me.options.updaterate);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user