Changeset - r14968:7248d069d855
[Not reviewed]
master
0 7 0
rubidium - 14 years ago 2010-04-08 21:14:49
rubidium@openttd.org
(svn r19589) -Change: add some more useful information to the desync log and unify the formatting
7 files changed with 13 insertions and 10 deletions:
0 comments (0 inline, 0 general)
src/command.cpp
Show inline comments
 
@@ -632,7 +632,7 @@ CommandCost DoCommandPInternal(TileIndex
 
		return_dcpi(CommandCost(), false);
 
	}
 
#endif /* ENABLE_NETWORK */
 
	DEBUG(desync, 1, "cmd: %08x; %08x; %1x; %06x; %08x; %08x; %04x; %s\n", _date, _date_fract, (int)_current_company, tile, p1, p2, cmd & ~CMD_NETWORK_COMMAND, text);
 
	DEBUG(desync, 1, "cmd: %08x; %02x; %02x; %06x; %08x; %08x; %08x; %s", _date, _date_fract, (int)_current_company, tile, p1, p2, cmd & ~CMD_NETWORK_COMMAND, text);
 

	
 
	/* Actually try and execute the command. If no cost-type is given
 
	 * use the construction one */
src/debug.cpp
Show inline comments
 
@@ -93,7 +93,7 @@ static void debug_print(const char *dbg,
 
		static FILE *f = FioFOpenFile("commands-out.log", "wb", AUTOSAVE_DIR);
 
		if (f == NULL) return;
 

	
 
		fprintf(f, "%s%s", GetLogPrefix(), buf);
 
		fprintf(f, "%s%s\n", GetLogPrefix(), buf);
 
		fflush(f);
 
	}
 
}
src/genworld.cpp
Show inline comments
 
@@ -176,7 +176,7 @@ static void _GenerateWorld(void *)
 
		ShowNewGRFError();
 

	
 
		if (_network_dedicated) DEBUG(net, 0, "Map generated, starting game");
 
		DEBUG(desync, 1, "new_map: %i\n", _settings_game.game_creation.generation_seed);
 
		DEBUG(desync, 1, "new_map: %08x", _settings_game.game_creation.generation_seed);
 

	
 
		if (_settings_client.gui.pause_on_newgame && _game_mode == GM_NORMAL) DoCommandP(0, PM_PAUSED_NORMAL, 1, CMD_PAUSE);
 
		if (_debug_desync_level > 0) {
src/network/network.cpp
Show inline comments
 
@@ -249,7 +249,7 @@ void NetworkTextMessage(NetworkAction ac
 
	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;
src/network/network_server.cpp
Show inline comments
 
@@ -716,6 +716,7 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT
 
	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 cl
 

	
 
	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);
 
	}
src/openttd.cpp
Show inline comments
 
@@ -1117,7 +1117,7 @@ static void CheckCaches()
 
				RoadVehUpdateCache(rv);
 

	
 
				if (memcmp(&cache, &rv->rcache, sizeof(RoadVehicleCache)) != 0) {
 
					DEBUG(desync, 2, "cache mismatch: vehicle %i, company %i, unit number %i\n", v->index, (int)v->owner, v->unitnumber);
 
					DEBUG(desync, 2, "cache mismatch: vehicle %i, company %i, unit number %i", v->index, (int)v->owner, v->unitnumber);
 
				}
 
			} break;
 

	
 
@@ -1135,7 +1135,7 @@ static void CheckCaches()
 
				length = 0;
 
				for (Train *u = t; u != NULL; u = u->Next()) {
 
					if (memcmp(&wagons[length], &u->tcache, sizeof(TrainCache)) != 0) {
 
						DEBUG(desync, 2, "cache mismatch: vehicle %i, company %i, unit number %i, wagon %i\n", v->index, (int)v->owner, v->unitnumber, length);
 
						DEBUG(desync, 2, "cache mismatch: vehicle %i, company %i, unit number %i, wagon %i", v->index, (int)v->owner, v->unitnumber, length);
 
					}
 
					length++;
 
				}
 
@@ -1151,7 +1151,7 @@ static void CheckCaches()
 
				UpdateAircraftCache(a);
 

	
 
				if (memcmp(&cache, &a->acache, sizeof(AircraftCache)) != 0) {
 
					DEBUG(desync, 2, "cache mismatch: vehicle %i, company %i, unit number %i\n", v->index, (int)v->owner, v->unitnumber);
 
					DEBUG(desync, 2, "cache mismatch: vehicle %i, company %i, unit number %i", v->index, (int)v->owner, v->unitnumber);
 
				}
 
			} break;
 

	
src/saveload/saveload.cpp
Show inline comments
 
@@ -1884,7 +1884,7 @@ SaveOrLoadResult SaveOrLoad(const char *
 
		/* General tactic is to first save the game to memory, then use an available writer
 
		 * to write it to file, either in threaded mode if possible, or single-threaded */
 
		if (mode == SL_SAVE) { // SAVE game
 
			DEBUG(desync, 1, "save: %s\n", filename);
 
			DEBUG(desync, 1, "save: %s", filename);
 

	
 
			_sl.write_bytes = WriteMem;
 
			_sl.excpt_uninit = UnInitMem;
 
@@ -1908,7 +1908,7 @@ SaveOrLoadResult SaveOrLoad(const char *
 
			}
 
		} else { // LOAD game
 
			assert(mode == SL_LOAD);
 
			DEBUG(desync, 1, "load: %s\n", filename);
 
			DEBUG(desync, 1, "load: %s", filename);
 

	
 
			/* Can't fseek to 0 as in tar files that is not correct */
 
			long pos = ftell(_sl.fh);
0 comments (0 inline, 0 general)