- added more perf logging
This commit is contained in:
parent
3002baf657
commit
71d8eb2e67
|
@ -2859,6 +2859,9 @@ void MenuStateConnectedGame::update() {
|
||||||
//printf("#2 admin key [%d] client key [%d]\n",settings->getMasterserver_admin(),clientInterface->getSessionKey());
|
//printf("#2 admin key [%d] client key [%d]\n",settings->getMasterserver_admin(),clientInterface->getSessionKey());
|
||||||
broadCastGameSettingsToHeadlessServer(false);
|
broadCastGameSettingsToHeadlessServer(false);
|
||||||
|
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
|
||||||
|
|
||||||
bool notCurrentlySwitching=(( difftime((long int) time(NULL), broadcastServerSettingsDelayTimer)) >= HEADLESSSERVER_BROADCAST_SETTINGS_SECONDS );
|
bool notCurrentlySwitching=(( difftime((long int) time(NULL), broadcastServerSettingsDelayTimer)) >= HEADLESSSERVER_BROADCAST_SETTINGS_SECONDS );
|
||||||
bool receiveAllowedNow=difftime((long int) time(NULL), noReceiveTimer) > 2 ;
|
bool receiveAllowedNow=difftime((long int) time(NULL), noReceiveTimer) > 2 ;
|
||||||
bool newMessage= lastGameSettingsReceivedCount < clientInterface->getGameSettingsReceivedCount();
|
bool newMessage= lastGameSettingsReceivedCount < clientInterface->getGameSettingsReceivedCount();
|
||||||
|
@ -3017,6 +3020,9 @@ void MenuStateConnectedGame::update() {
|
||||||
lastCheckedCRCTilesetName = displayedGamesettings.getTileset();
|
lastCheckedCRCTilesetName = displayedGamesettings.getTileset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
|
||||||
|
|
||||||
uint32 techCRC = lastCheckedCRCTechtreeValue;
|
uint32 techCRC = lastCheckedCRCTechtreeValue;
|
||||||
if(lastCheckedCRCTechtreeName != displayedGamesettings.getTech() &&
|
if(lastCheckedCRCTechtreeName != displayedGamesettings.getTech() &&
|
||||||
displayedGamesettings.getTech() != "") {
|
displayedGamesettings.getTech() != "") {
|
||||||
|
@ -3045,12 +3051,19 @@ void MenuStateConnectedGame::update() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
|
||||||
|
|
||||||
// Test data synch
|
// Test data synch
|
||||||
//techCRC++;
|
//techCRC++;
|
||||||
lastCheckedCRCTechtreeValue = techCRC;
|
lastCheckedCRCTechtreeValue = techCRC;
|
||||||
lastCheckedCRCTechtreeName = displayedGamesettings.getTech();
|
lastCheckedCRCTechtreeName = displayedGamesettings.getTech();
|
||||||
|
|
||||||
loadFactions(&displayedGamesettings,false);
|
loadFactions(&displayedGamesettings,false);
|
||||||
|
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
|
||||||
|
|
||||||
factionCRCList.clear();
|
factionCRCList.clear();
|
||||||
for(unsigned int factionIdx = 0; factionIdx < factionFiles.size(); ++factionIdx) {
|
for(unsigned int factionIdx = 0; factionIdx < factionFiles.size(); ++factionIdx) {
|
||||||
string factionName = factionFiles[factionIdx];
|
string factionName = factionFiles[factionIdx];
|
||||||
|
@ -3091,8 +3104,14 @@ void MenuStateConnectedGame::update() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//console.addLine("Found factions: " + intToStr(factionCRCList.size()));
|
//console.addLine("Found factions: " + intToStr(factionCRCList.size()));
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
|
||||||
|
|
||||||
uint32 mapCRC = lastCheckedCRCMapValue;
|
uint32 mapCRC = lastCheckedCRCMapValue;
|
||||||
if(lastCheckedCRCMapName != displayedGamesettings.getMap() &&
|
if(lastCheckedCRCMapName != displayedGamesettings.getMap() &&
|
||||||
displayedGamesettings.getMap() != "") {
|
displayedGamesettings.getMap() != "") {
|
||||||
|
@ -3109,6 +3128,9 @@ void MenuStateConnectedGame::update() {
|
||||||
}
|
}
|
||||||
safeMutexFTPProgress.ReleaseLock();
|
safeMutexFTPProgress.ReleaseLock();
|
||||||
|
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
|
||||||
|
|
||||||
bool dataSynchMismatch = ((mapCRC != 0 && mapCRC != displayedGamesettings.getMapCRC()) ||
|
bool dataSynchMismatch = ((mapCRC != 0 && mapCRC != displayedGamesettings.getMapCRC()) ||
|
||||||
(tilesetCRC != 0 && tilesetCRC != displayedGamesettings.getTilesetCRC()) ||
|
(tilesetCRC != 0 && tilesetCRC != displayedGamesettings.getTilesetCRC()) ||
|
||||||
(techCRC != 0 && techCRC != displayedGamesettings.getTechCRC()));
|
(techCRC != 0 && techCRC != displayedGamesettings.getTechCRC()));
|
||||||
|
@ -3174,6 +3196,9 @@ void MenuStateConnectedGame::update() {
|
||||||
clientInterface->sendTextMessage(msg,-1,localEcho,languageList[i]);
|
clientInterface->sendTextMessage(msg,-1,localEcho,languageList[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
|
||||||
|
|
||||||
const int MAX_CHAT_TEXT_LINE_LENGTH = 110;
|
const int MAX_CHAT_TEXT_LINE_LENGTH = 110;
|
||||||
//const vector<string> languageList = clientInterface->getGameSettings()->getUniqueNetworkPlayerLanguages();
|
//const vector<string> languageList = clientInterface->getGameSettings()->getUniqueNetworkPlayerLanguages();
|
||||||
for(unsigned int i = 0; i < languageList.size(); ++i) {
|
for(unsigned int i = 0; i < languageList.size(); ++i) {
|
||||||
|
@ -3297,6 +3322,9 @@ void MenuStateConnectedGame::update() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3326,6 +3354,9 @@ void MenuStateConnectedGame::update() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
|
||||||
|
|
||||||
if(clientInterface->getNetworkGameDataSynchCheckOkTile() == false) {
|
if(clientInterface->getNetworkGameDataSynchCheckOkTile() == false) {
|
||||||
label = label + " tile";
|
label = label + " tile";
|
||||||
if(updateDataSynchDetailText == true &&
|
if(updateDataSynchDetailText == true &&
|
||||||
|
@ -3336,6 +3367,9 @@ void MenuStateConnectedGame::update() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
|
||||||
|
|
||||||
if(clientInterface->getNetworkGameDataSynchCheckOkTech() == false) {
|
if(clientInterface->getNetworkGameDataSynchCheckOkTech() == false) {
|
||||||
label = label + " techtree";
|
label = label + " techtree";
|
||||||
|
|
||||||
|
@ -3358,6 +3392,9 @@ void MenuStateConnectedGame::update() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
|
||||||
|
|
||||||
if(clientInterface->getReceivedDataSynchCheck() == true) {
|
if(clientInterface->getReceivedDataSynchCheck() == true) {
|
||||||
updateDataSynchDetailText = false;
|
updateDataSynchDetailText = false;
|
||||||
}
|
}
|
||||||
|
@ -3445,6 +3482,10 @@ void MenuStateConnectedGame::update() {
|
||||||
if ( difftime((long int)time(NULL),noReceiveTimer) < 3 || difftime((long int)time(NULL),broadcastServerSettingsDelayTimer) < HEADLESSSERVER_BROADCAST_SETTINGS_SECONDS){
|
if ( difftime((long int)time(NULL),noReceiveTimer) < 3 || difftime((long int)time(NULL),broadcastServerSettingsDelayTimer) < HEADLESSSERVER_BROADCAST_SETTINGS_SECONDS){
|
||||||
// copy my current settings in UI to displayedSettings;
|
// copy my current settings in UI to displayedSettings;
|
||||||
loadGameSettings(&displayedGamesettings);
|
loadGameSettings(&displayedGamesettings);
|
||||||
|
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
|
||||||
|
|
||||||
// check if there are any changed fields from others clients
|
// check if there are any changed fields from others clients
|
||||||
if(isHeadlessAdmin()){
|
if(isHeadlessAdmin()){
|
||||||
//printf("I am headless admin and will restore only some parts\n");
|
//printf("I am headless admin and will restore only some parts\n");
|
||||||
|
@ -3488,10 +3529,17 @@ void MenuStateConnectedGame::update() {
|
||||||
originalGamesettings.setNetworkPlayerName(i,networkPlayerName);
|
originalGamesettings.setNetworkPlayerName(i,networkPlayerName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
|
||||||
|
|
||||||
setupUIFromGameSettings(&displayedGamesettings, errorOnMissingData);
|
setupUIFromGameSettings(&displayedGamesettings, errorOnMissingData);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// do nothing
|
// do nothing
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
|
||||||
|
|
||||||
setupUIFromGameSettings(&displayedGamesettings, errorOnMissingData);
|
setupUIFromGameSettings(&displayedGamesettings, errorOnMissingData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3510,6 +3558,9 @@ void MenuStateConnectedGame::update() {
|
||||||
clientInterface->getReadyForInGameJoin() == true &&
|
clientInterface->getReadyForInGameJoin() == true &&
|
||||||
ftpClientThread != NULL) {
|
ftpClientThread != NULL) {
|
||||||
|
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
|
||||||
|
|
||||||
MutexSafeWrapper safeMutexFTPProgress((ftpClientThread != NULL ? ftpClientThread->getProgressMutex() : NULL),string(__FILE__) + "_" + intToStr(__LINE__));
|
MutexSafeWrapper safeMutexFTPProgress((ftpClientThread != NULL ? ftpClientThread->getProgressMutex() : NULL),string(__FILE__) + "_" + intToStr(__LINE__));
|
||||||
if(readyToJoinInProgressGame == false) {
|
if(readyToJoinInProgressGame == false) {
|
||||||
if(getInProgressSavedGameFromFTPServer == "") {
|
if(getInProgressSavedGameFromFTPServer == "") {
|
||||||
|
@ -3544,6 +3595,9 @@ void MenuStateConnectedGame::update() {
|
||||||
GameSettings gameSettings = *clientInterface->getGameSettings();
|
GameSettings gameSettings = *clientInterface->getGameSettings();
|
||||||
loadGameSettings(&gameSettings);
|
loadGameSettings(&gameSettings);
|
||||||
|
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
|
||||||
|
|
||||||
Game::loadGame(saveGameFile,program,false,&gameSettings);
|
Game::loadGame(saveGameFile,program,false,&gameSettings);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user