Add client desync log to server desync log output

This commit is contained in:
Jonathan G Rennison
2019-05-21 18:58:13 +01:00
parent cb0ca43eae
commit 97baff6fd8
12 changed files with 112 additions and 14 deletions

View File

@@ -1171,7 +1171,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_ERROR(Packet *p
NetworkAdminClientError(this->client_id, errorno);
if (errorno == NETWORK_ERROR_DESYNC) {
CrashLog::DesyncCrashLog();
CrashLog::DesyncCrashLog(&(this->desync_log), nullptr);
// have the server and all clients run some sanity checks
NetworkSendCommand(0, 0, 0, CMD_DESYNC_CHECK, nullptr, nullptr, _local_company, 0);
@@ -1180,6 +1180,16 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_ERROR(Packet *p
return this->CloseConnection(NETWORK_RECV_STATUS_CONN_LOST);
}
NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_DESYNC_LOG(Packet *p)
{
uint size = p->Recv_uint16();
this->desync_log.resize(this->desync_log.size() + size);
p->Recv_binary(const_cast<char *>(this->desync_log.data() + this->desync_log.size() - size), size);
DEBUG(net, 2, "Received %u bytes of client desync log", size);
this->receive_limit += p->size;
return NETWORK_RECV_STATUS_OKAY;
}
NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_QUIT(Packet *p)
{
/* The client wants to leave. Display this and report it to the other