(svn r10462) -Add: a command dumper/loader that could be enabled compile-time and server side only to aid debugging some desyncs, i.e. dump the stream of commands so it could be replayed in exactly the same way later. This should primarily be used to make desyncs more easily reproducable, so it can be properly debugged.
This commit is contained in:
@@ -13,6 +13,9 @@
|
||||
#include "network/network_server.h"
|
||||
#include "functions.h"
|
||||
#include "currency.h"
|
||||
#ifdef DEBUG_DUMP_COMMANDS
|
||||
#include "saveload.h"
|
||||
#endif
|
||||
|
||||
Year _cur_year;
|
||||
Month _cur_month;
|
||||
@@ -259,6 +262,12 @@ void IncreaseDate()
|
||||
|
||||
/* yes, call various monthly loops */
|
||||
if (_game_mode != GM_MENU) {
|
||||
#ifdef DEBUG_DUMP_COMMANDS
|
||||
char name[MAX_PATH];
|
||||
snprintf(name, lengthof(name), "dmp_cmds_%d.sav", _date);
|
||||
SaveOrLoad(name, SL_SAVE, AUTOSAVE_DIR);
|
||||
debug_dump_commands("ddc:save:%s\n", name);
|
||||
#endif /* DUMP_COMMANDS */
|
||||
if (_opt.autosave != 0 && (_cur_month % _autosave_months[_opt.autosave]) == 0) {
|
||||
_do_autosave = true;
|
||||
RedrawAutosave();
|
||||
|
Reference in New Issue
Block a user