From d8baa1342c4ddce823724b758c5b3e4547e84e90 Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 8 Apr 2010 21:14:49 +0000 Subject: (svn r19589) -Change: add some more useful information to the desync log and unify the formatting --- src/network/network.cpp | 4 ++-- src/network/network_server.cpp | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/network') diff --git a/src/network/network.cpp b/src/network/network.cpp index b591e0ecd..73548d2b1 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -249,7 +249,7 @@ void NetworkTextMessage(NetworkAction action, ConsoleColour colour, bool self_se SetDParam(2, data); GetString(message, strid, lastof(message)); - DEBUG(desync, 1, "msg: %d; %d; %s\n", _date, _date_fract, message); + DEBUG(desync, 1, "msg: %08x; %02x; %s", _date, _date_fract, message); IConsolePrintF(colour, "%s", message); NetworkAddChatMessage((TextColour)colour, duration, "%s", message); } @@ -1024,7 +1024,7 @@ static bool NetworkDoClientLoop() if (_sync_seed_1 != _random.state[0]) { #endif NetworkError(STR_NETWORK_ERROR_DESYNC); - DEBUG(desync, 1, "sync_err: %d; %d\n", _date, _date_fract); + DEBUG(desync, 1, "sync_err: %08x; %02x", _date, _date_fract); DEBUG(net, 0, "Sync error detected!"); NetworkClientError(NETWORK_RECV_STATUS_DESYNC, NetworkClientSocket::Get(0)); return false; diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 94c2911f2..127ac1b90 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -716,6 +716,7 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_JOIN) strecpy(ci->client_name, name, lastof(ci->client_name)); ci->client_playas = playas; ci->client_lang = client_lang; + DEBUG(desync, 1, "client: %08x; %02x; %02x; %04x", _date, _date_fract, (int)ci->client_playas, ci->index); /* Make sure companies to which people try to join are not autocleaned */ if (Company::IsValidID(playas)) _network_company_states[playas].months_empty = 0; @@ -1396,6 +1397,8 @@ void NetworkUpdateClientInfo(ClientID client_id) if (ci == NULL) return; + DEBUG(desync, 1, "client: %08x; %02x; %02x; %04x", _date, _date_fract, (int)ci->client_playas, client_id); + FOR_ALL_CLIENT_SOCKETS(cs) { SEND_COMMAND(PACKET_SERVER_CLIENT_INFO)(cs, ci); } -- cgit v1.2.3-70-g09d2