@@ -830,12 +830,15 @@ DEF_GAME_RECEIVE_COMMAND(Client, PACKET_
this->savegame = NULL;
lf->Reset();
/* The map is done downloading, load it */
bool load_success = SafeLoad(NULL, SL_LOAD, GM_NORMAL, NO_DIRECTORY, lf);
/* Long savegame loads shouldn't affect the lag calculation! */
this->last_packet = _realtime_tick;
if (!load_success) {
DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0);
_switch_mode_errorstr = STR_NETWORK_ERROR_SAVEGAMEERROR;
return NETWORK_RECV_STATUS_SAVEGAME;
}
/* If the savegame has successfully loaded, ALL windows have been removed,
@@ -1130,20 +1133,20 @@ void ClientNetworkGameSocketHandler::Che
/* Only once we're authorized we can expect a steady stream of packets. */
if (this->status < STATUS_AUTHORIZED) return;
/* It might... sometimes occur that the realtime ticker overflows. */
if (_realtime_tick < this->last_packet) this->last_packet = _realtime_tick;
/* Lag is in milliseconds; 2 seconds are roughly the server's
* "you're slow" threshold (1 game day). */
/* Lag is in milliseconds; 5 seconds are roughly twice the
* server's "you're slow" threshold (1 game day). */
uint lag = (_realtime_tick - this->last_packet) / 1000;
if (lag < 2) return;
if (lag < 5) return;
/* 10 seconds are (way) more than 4 game days after which
/* 20 seconds are (way) more than 4 game days after which
* the server will forcefully disconnect you. */
if (lag > 10) {
if (lag > 20) {
this->NetworkGameSocketHandler::CloseConnection();
_switch_mode_errorstr = STR_NETWORK_ERROR_LOSTCONNECTION;
return;
/* Prevent showing the lag message every tick; just update it when needed. */
Status change: