summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-12-29 21:50:25 +0000
committerrubidium <rubidium@openttd.org>2008-12-29 21:50:25 +0000
commitf55995f1ef882b80bbda8828da378f635e8fceff (patch)
treeaec6feff3be34ba1d2dd8bd06c23da37e33ff3c1 /src/network
parent1892994ab21cdd4e44c450ef1c5bbdcbb647ae36 (diff)
downloadopenttd-f55995f1ef882b80bbda8828da378f635e8fceff.tar.xz
(svn r14772) -Codechange: make the "dump log of game to reproduce" desync debug stuff a runtime configurable debug option instead of a compile time option.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network.cpp8
-rw-r--r--src/network/network_data.cpp2
2 files changed, 4 insertions, 6 deletions
diff --git a/src/network/network.cpp b/src/network/network.cpp
index c6935638a..7bc562a86 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -213,7 +213,7 @@ void NetworkTextMessage(NetworkAction action, ConsoleColour color, bool self_sen
SetDParam(2, data);
GetString(message, strid, lastof(message));
- DebugDumpCommands("ddc:cmsg:%d;%d;%s\n", _date, _date_fract, message);
+ DEBUG(desync, 1, "msg: %d; %d; %s\n", _date, _date_fract, message);
IConsolePrintF(color, "%s", message);
NetworkAddChatMessage(color, duration, "%s", message);
}
@@ -964,7 +964,7 @@ static bool NetworkDoClientLoop()
if (_sync_seed_1 != _random.state[0]) {
#endif
NetworkError(STR_NETWORK_ERR_DESYNC);
- DebugDumpCommands("ddc:serr:%d;%d\n", _date, _date_fract);
+ DEBUG(desync, 1, "sync_err: %d; %d\n", _date, _date_fract);
DEBUG(net, 0, "Sync error detected!");
NetworkClientError(NETWORK_RECV_STATUS_DESYNC, GetNetworkClientSocket(0));
return false;
@@ -1032,10 +1032,10 @@ void NetworkGameLoop()
char buff[4096];
if (fgets(buff, lengthof(buff), f) == NULL) break;
- if (strncmp(buff, "ddc:cmd:", 8) != 0) continue;
+ if (strncmp(buff, "cmd: ", 8) != 0) continue;
cp = MallocT<CommandPacket>(1);
int company;
- sscanf(&buff[8], "%d;%d;%d;%d;%d;%d;%d;%s", &next_date, &next_date_fract, &company, &cp->tile, &cp->p1, &cp->p2, &cp->cmd, cp->text);
+ sscanf(&buff[8], "%d; %d; %d; %d; %d; %d; %d; %s", &next_date, &next_date_fract, &company, &cp->tile, &cp->p1, &cp->p2, &cp->cmd, cp->text);
cp->company = (CompanyID)company;
}
#endif /* DEBUG_DUMP_COMMANDS */
diff --git a/src/network/network_data.cpp b/src/network/network_data.cpp
index 42358f284..cdcf0ba39 100644
--- a/src/network/network_data.cpp
+++ b/src/network/network_data.cpp
@@ -102,8 +102,6 @@ void NetworkExecuteCommand(CommandPacket *cp)
cp->callback = 0;
}
- DebugDumpCommands("ddc:cmd:%d;%d;%d;%d;%d;%d;%d;%s\n", _date, _date_fract, (int)cp->company, cp->tile, cp->p1, cp->p2, cp->cmd, cp->text);
-
DoCommandP(cp->tile, cp->p1, cp->p2, cp->cmd | CMD_NETWORK_COMMAND, _callback_table[cp->callback], cp->text, cp->my_cmd);
}