Network: Add state checksum which is check in network sync

This commit is contained in:
Jonathan G Rennison
2019-08-05 19:16:51 +01:00
parent c941d2d2a6
commit a1d36b02f0
17 changed files with 76 additions and 2 deletions

View File

@@ -77,6 +77,7 @@
#include "string_func_extra.h"
#include "industry.h"
#include "cargopacket.h"
#include "core/checksum_func.hpp"
#include "linkgraph/linkgraphschedule.h"
#include "tracerestrict.h"
@@ -103,6 +104,8 @@ GameEventFlags _game_events_overall;
time_t _game_load_time;
SimpleChecksum64 _state_checksum;
/**
* Error handling for fatal user errors.
* @param s the string to print.
@@ -1749,6 +1752,11 @@ void StateGameLoop()
CallWindowGameTickEvent();
NewsLoop();
cur_company.Restore();
Company *c;
FOR_ALL_COMPANIES(c) {
UpdateStateChecksum(c->money);
}
}
assert(IsLocalCompany());