update server crc log count
This commit is contained in:
parent
1d16d57c74
commit
b716cea3e7
|
@ -1709,13 +1709,15 @@ void Game::update() {
|
|||
if(isNetworkGame == true && NetworkManager::getInstance().getGameNetworkInterface() != NULL) {
|
||||
GameSettings *settings = world.getGameSettingsPtr();
|
||||
if(settings != NULL && (settings->getFlagTypes1() & ft1_network_synch_checks) == ft1_network_synch_checks) {
|
||||
NetworkInterface *netIntf = NetworkManager::getInstance().getGameNetworkInterface();
|
||||
for(int index = 0; index < GameConstants::maxPlayers; ++index) {
|
||||
NetworkManager &networkManager = NetworkManager::getInstance();
|
||||
NetworkRole role = networkManager.getNetworkRole();
|
||||
|
||||
NetworkInterface *netIntf = networkManager.getGameNetworkInterface();
|
||||
for(int index = 0; index < GameConstants::maxPlayers; ++index) {
|
||||
if(index < world.getFactionCount()) {
|
||||
Faction *faction = world.getFaction(index);
|
||||
netIntf->setNetworkPlayerFactionCRC(index,faction->getCRC().getSum());
|
||||
faction->addCRC_DetailsForWorldFrame(world.getFrameCount());
|
||||
faction->addCRC_DetailsForWorldFrame(world.getFrameCount(),role == nrServer);
|
||||
}
|
||||
else {
|
||||
netIntf->setNetworkPlayerFactionCRC(index,0);
|
||||
|
|
|
@ -2299,8 +2299,11 @@ Checksum Faction::getCRC() {
|
|||
return crcForFaction;
|
||||
}
|
||||
|
||||
void Faction::addCRC_DetailsForWorldFrame(int worldFrameCount) {
|
||||
const int MAX_FRAME_CACHE = 1500;
|
||||
void Faction::addCRC_DetailsForWorldFrame(int worldFrameCount,bool isNetworkServer) {
|
||||
int MAX_FRAME_CACHE = 1500;
|
||||
if(isNetworkServer == true) {
|
||||
MAX_FRAME_CACHE += 700;
|
||||
}
|
||||
crcWorldFrameDetails[worldFrameCount] = this->toString(true);
|
||||
//if(worldFrameCount <= 0) printf("Adding world frame: %d log entries: %lld\n",worldFrameCount,(long long int)crcWorldFrameDetails.size());
|
||||
|
||||
|
|
|
@ -372,7 +372,7 @@ public:
|
|||
void clearCaches();
|
||||
|
||||
Checksum getCRC();
|
||||
void addCRC_DetailsForWorldFrame(int worldFrameCount);
|
||||
void addCRC_DetailsForWorldFrame(int worldFrameCount,bool isNetworkServer);
|
||||
string getCRC_DetailsForWorldFrame(int worldFrameCount);
|
||||
std::pair<int,string> getCRC_DetailsForWorldFrameIndex(int worldFrameIndex);
|
||||
string getCRC_DetailsForWorldFrames();
|
||||
|
|
Loading…
Reference in New Issue
Block a user