From f591544528e65f279b408fce2bc2403c728da2a7 Mon Sep 17 00:00:00 2001 From: mathusummut Date: Sat, 26 Jan 2019 15:42:40 +0100 Subject: [PATCH] Turned off pointless network warnings --- source/glest_game/game/commander.cpp | 20 ++++++++----------- source/glest_game/main/main.cpp | 7 +++++-- .../glest_game/network/client_interface.cpp | 8 ++++---- .../glest_game/network/server_interface.cpp | 3 +-- .../platform/common/platform_common.cpp | 7 ++----- 5 files changed, 20 insertions(+), 25 deletions(-) diff --git a/source/glest_game/game/commander.cpp b/source/glest_game/game/commander.cpp index 0ccc82169..07478b2d4 100644 --- a/source/glest_game/game/commander.cpp +++ b/source/glest_game/game/commander.cpp @@ -670,15 +670,13 @@ namespace Game { networkCommand->getUnitId()); SystemFlags::OutputDebug(SystemFlags::debugError, "%s\n", szMsg); SystemFlags::OutputDebug(SystemFlags::debugSystem, "%s\n", szMsg); - GameNetworkInterface * + /*GameNetworkInterface * gameNetworkInterface = NetworkManager::getInstance().getGameNetworkInterface(); if (gameNetworkInterface != NULL) { gameNetworkInterface-> sendTextMessage(szMsg, -1, true, ""); - } - /*throw - game_runtime_error(szBuf);*/ + }*/ return std::pair(crFailUndefined, ""); } } @@ -1611,14 +1609,12 @@ namespace Game { networkCommand->getUnitId()); SystemFlags::OutputDebug(SystemFlags::debugError, "%s\n", szMsg); SystemFlags::OutputDebug(SystemFlags::debugSystem, "%s\n", szMsg); - GameNetworkInterface * + /*GameNetworkInterface * gameNetworkInterface = NetworkManager::getInstance().getGameNetworkInterface(); if (gameNetworkInterface != NULL) - gameNetworkInterface->sendTextMessage(szMsg, -1, true, ""); + gameNetworkInterface->sendTextMessage(szMsg, -1, true, "");*/ - /*throw - game_runtime_error(szBuf);*/ return command; } @@ -1642,11 +1638,11 @@ namespace Game { //world->DumpWorldToLog(); // Broadcast the error if player is still connected and print locally. - GameNetworkInterface * + /*GameNetworkInterface * gameNetworkInterface = NetworkManager::getInstance().getGameNetworkInterface(); if (gameNetworkInterface != NULL) - gameNetworkInterface->sendTextMessage(szMsg, -1, true, ""); + gameNetworkInterface->sendTextMessage(szMsg, -1, true, "");*/ return command; } @@ -1685,11 +1681,11 @@ namespace Game { SystemFlags::OutputDebug(SystemFlags::debugError, "%s\n", szMsg); //world->DumpWorldToLog(); - GameNetworkInterface * + /*GameNetworkInterface * gameNetworkInterface = NetworkManager::getInstance().getGameNetworkInterface(); if (gameNetworkInterface != NULL) - gameNetworkInterface->sendTextMessage(szMsg, -1, true, ""); + gameNetworkInterface->sendTextMessage(szMsg, -1, true, "");*/ return command; } diff --git a/source/glest_game/main/main.cpp b/source/glest_game/main/main.cpp index efc7ee3be..5e3558792 100644 --- a/source/glest_game/main/main.cpp +++ b/source/glest_game/main/main.cpp @@ -121,9 +121,12 @@ void handleUnexpectedError(const char* message) { Game::Game* currentGame = Game::World::getCurrentGame(); if (currentGame != NULL && currentGame->isFlagType1BitEnabled(Game::FlagTypes1::ft1_allow_shared_team_resources)) return; - Game::GameNetworkInterface* gameNetworkInterface = Game::NetworkManager::getInstance().getGameNetworkInterface(); + printf("%s\n", message); + SystemFlags::OutputDebug(SystemFlags::debugSystem, "%s\n", message); + SystemFlags::OutputDebug(SystemFlags::debugError, "%s\n", message); + /*Game::GameNetworkInterface* gameNetworkInterface = Game::NetworkManager::getInstance().getGameNetworkInterface(); if (gameNetworkInterface != NULL) - gameNetworkInterface->sendTextMessage(message, -1, true, ""); + gameNetworkInterface->sendTextMessage(message, -1, true, "");*/ } namespace Game { diff --git a/source/glest_game/network/client_interface.cpp b/source/glest_game/network/client_interface.cpp index b01e43d03..93caa186d 100644 --- a/source/glest_game/network/client_interface.cpp +++ b/source/glest_game/network/client_interface.cpp @@ -487,14 +487,14 @@ namespace Game { lastNetworkCommandListSendTime = time(NULL); } - // Possible cause of out of synch since we have more commands that need + // Possible cause of out of sync since we have more commands that need // to be sent in this frame if (requestedCommands.empty() == false) { if (SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork, "In [%s::%s Line: %d] WARNING / ERROR, requestedCommands.size() = %d\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, requestedCommands.size()); - string sMsg = "may go out of synch: client requestedCommands.size() = " + intToStr(requestedCommands.size()); - sendTextMessage(sMsg, -1, true, ""); - sleep(0); + printf("May go out of synch: client requestedCommands.size() = %zd\n", requestedCommands.size()); + /*sendTextMessage(sMsg, -1, true, ""); + sleep(0);*/ } } catch (const game_runtime_error &ex) { SystemFlags::OutputDebug(SystemFlags::debugNetwork, "In [%s::%s Line: %d] Error [%s]\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, ex.what()); diff --git a/source/glest_game/network/server_interface.cpp b/source/glest_game/network/server_interface.cpp index 32b34eb57..5d64e5bd1 100644 --- a/source/glest_game/network/server_interface.cpp +++ b/source/glest_game/network/server_interface.cpp @@ -1680,8 +1680,7 @@ namespace Game { if (SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork, "In [%s::%s Line: %d] WARNING / ERROR, requestedCommands.size() = %d\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, requestedCommands.size()); SystemFlags::OutputDebug(SystemFlags::debugError, "In [%s::%s Line: %d] WARNING / ERROR, requestedCommands.size() = %d\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, requestedCommands.size()); - string sMsg = "may go out of synch: server requestedCommands.size() = " + intToStr(requestedCommands.size()); - sendTextMessage(sMsg, -1, true, ""); + printf("May go out of sync: server requestedCommands.size() = %zd\n", requestedCommands.size()); } // broadcast commands diff --git a/source/shared_lib/sources/platform/common/platform_common.cpp b/source/shared_lib/sources/platform/common/platform_common.cpp index 2499d3ae3..ca01b1a35 100644 --- a/source/shared_lib/sources/platform/common/platform_common.cpp +++ b/source/shared_lib/sources/platform/common/platform_common.cpp @@ -2245,12 +2245,9 @@ namespace Shared { char szMsg[8096]; snprintf(szMsg, 8096, "A value in memory has changed unexpectedly (expected %d, found %d). Game out of sync, try leaving and rejoining", expectedValue, actualValue); - printf("%s\n", szMsg); - SystemFlags::OutputDebug(SystemFlags::debugSystem, "%s\n", szMsg); - SystemFlags::OutputDebug(SystemFlags::debugError, "%s\n", szMsg); - /*void(*handler)(const char*) = unexpected_handler; + void(*handler)(const char*) = unexpected_handler; if (handler != NULL) - handler(szMsg);*/ + handler(szMsg); } void ValueCheckerVault::addItemToVault(const void *ptr, int value) {