diff --git a/source/glest_game/game/game_constants.h b/source/glest_game/game/game_constants.h index eae4d3959..8facaf80d 100644 --- a/source/glest_game/game/game_constants.h +++ b/source/glest_game/game/game_constants.h @@ -37,7 +37,7 @@ public: static const int serverPort= 61357; static const int updateFps= 40; static const int cameraFps= 100; - static const int networkFramePeriod= 10; + static const int networkFramePeriod= 20; static const int networkExtraLatency= 200; static const int maxClientConnectHandshakeSecs= 10; diff --git a/source/glest_game/network/client_interface.cpp b/source/glest_game/network/client_interface.cpp index 0bc9e5aa5..68cf844c5 100755 --- a/source/glest_game/network/client_interface.cpp +++ b/source/glest_game/network/client_interface.cpp @@ -111,6 +111,16 @@ void ClientInterface::update() sendMessage(&networkMessageCommandList); } + // Possible cause of out of synch since we have more commands that need + // to be sent in this frame + if(!requestedCommands.empty()) { + char szBuf[1024]=""; + SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] WARNING / ERROR, requestedCommands.size() = %d\n",__FILE__,__FUNCTION__,requestedCommands.size()); + + string sMsg = Config::getInstance().getString("NetPlayerName",Socket::getHostName().c_str()) + " may go out of synch: client requestedCommands.size() = " + intToStr(requestedCommands.size()); + sendTextMessage(sMsg,-1); + } + //clear chat variables chatText.clear(); chatSender.clear(); diff --git a/source/glest_game/network/server_interface.cpp b/source/glest_game/network/server_interface.cpp index 7409aba43..bf0b71aa4 100644 --- a/source/glest_game/network/server_interface.cpp +++ b/source/glest_game/network/server_interface.cpp @@ -424,6 +424,16 @@ void ServerInterface::updateKeyframe(int frameCount){ } } + // Possible cause of out of synch since we have more commands that need + // to be sent in this frame + if(!requestedCommands.empty()) { + char szBuf[1024]=""; + SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] WARNING / ERROR, requestedCommands.size() = %d\n",__FILE__,__FUNCTION__,requestedCommands.size()); + + string sMsg = Config::getInstance().getString("NetPlayerName",Socket::getHostName().c_str()) + " may go out of synch: server requestedCommands.size() = " + intToStr(requestedCommands.size()); + sendTextMessage(sMsg,-1); + } + if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] build command list took %d msecs, networkMessageCommandList.getCommandCount() = %d, frameCount = %d\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis(),networkMessageCommandList.getCommandCount(),frameCount); //broadcast commands diff --git a/source/shared_lib/sources/platform/posix/socket.cpp b/source/shared_lib/sources/platform/posix/socket.cpp index 937483cad..796005751 100644 --- a/source/shared_lib/sources/platform/posix/socket.cpp +++ b/source/shared_lib/sources/platform/posix/socket.cpp @@ -1753,7 +1753,9 @@ void BroadCastSocketThread::execute() { float Socket::getAveragePingMS(std::string host, int pingCount) { double result = -1; + return result; +/* const bool debugPingOutput = false; char szCmd[1024]=""; #ifdef WIN32 @@ -1852,6 +1854,7 @@ float Socket::getAveragePingMS(std::string host, int pingCount) { } } return result; +*/ } std::string Socket::getIpAddress() {