Make server and all clients run desync checks if a client desyncs.

This commit is contained in:
Jonathan G Rennison
2015-11-23 19:47:59 +00:00
parent 69c89c4881
commit f6a8f27501
5 changed files with 40 additions and 6 deletions

View File

@@ -256,6 +256,9 @@ void ClientNetworkGameSocketHandler::ClientError(NetworkRecvStatus res)
DEBUG(desync, 1, "sync_err: %08x; %02x; %02X", _date, _date_fract, _tick_skip_counter);
DEBUG(net, 0, "Sync error detected!");
my_client->ClientError(NETWORK_RECV_STATUS_DESYNC);
extern void CheckCaches(bool force_check);
CheckCaches(true);
return false;
}

View File

@@ -1179,6 +1179,11 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_ERROR(Packet *p
NetworkAdminClientError(this->client_id, errorno);
if (errorno == NETWORK_ERROR_DESYNC) {
// have the server and all clients run some sanity checks
NetworkSendCommand(0, 0, 0, CMD_DESYNC_CHECK, NULL, NULL, _local_company, 0);
}
return this->CloseConnection(NETWORK_RECV_STATUS_CONN_LOST);
}