From f0da609e7fa96bf62985402fb0cd08bcaf06a566 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Fri, 28 May 2010 00:57:24 +0000 Subject: [PATCH] trying to track down network bugs --- source/glest_game/game/commander.cpp | 12 ++++++++++++ source/glest_game/network/network_interface.cpp | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/source/glest_game/game/commander.cpp b/source/glest_game/game/commander.cpp index 7c160b70d..57e99faed 100644 --- a/source/glest_game/game/commander.cpp +++ b/source/glest_game/game/commander.cpp @@ -332,6 +332,8 @@ void Commander::giveNetworkCommand(NetworkCommand* networkCommand) const { Command* command= buildCommand(networkCommand); + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); + unit->giveCommand(command, networkCommand->getWantQueue()); SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] found nctGiveCommand networkCommand->getUnitId() = %d\n",__FILE__,__FUNCTION__,__LINE__,networkCommand->getUnitId()); @@ -362,6 +364,8 @@ void Commander::giveNetworkCommand(NetworkCommand* networkCommand) const { Command* Commander::buildCommand(const NetworkCommand* networkCommand) const{ assert(networkCommand->getNetworkCommandType()==nctGiveCommand); + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); + if(world == NULL) { char szBuf[1024]=""; sprintf(szBuf,"In [%s::%s Line: %d] world == NULL for unit with id: %d",__FILE__,__FUNCTION__,__LINE__,networkCommand->getUnitId()); @@ -372,6 +376,8 @@ Command* Commander::buildCommand(const NetworkCommand* networkCommand) const{ const CommandType* ct= NULL; const Unit* unit= world->findUnitById(networkCommand->getUnitId()); + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); + //validate unit if(unit == NULL) { char szBuf[1024]=""; @@ -405,6 +411,8 @@ Command* Commander::buildCommand(const NetworkCommand* networkCommand) const{ throw runtime_error(sError); } + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); + CardinalDir facing; // get facing/target ... the target might be dead due to lag, cope with it if (ct->getClass() == ccBuild) { @@ -415,6 +423,8 @@ Command* Commander::buildCommand(const NetworkCommand* networkCommand) const{ target= world->findUnitById(networkCommand->getTargetId()); } + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); + //create command Command *command= NULL; if(unitType!=NULL){ @@ -427,6 +437,8 @@ Command* Commander::buildCommand(const NetworkCommand* networkCommand) const{ command= new Command(ct, target); } + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); + //issue command return command; } diff --git a/source/glest_game/network/network_interface.cpp b/source/glest_game/network/network_interface.cpp index 370f3c051..a97b73652 100644 --- a/source/glest_game/network/network_interface.cpp +++ b/source/glest_game/network/network_interface.cpp @@ -32,7 +32,7 @@ namespace Glest{ namespace Game{ // class NetworkInterface // ===================================================== -const int NetworkInterface::readyWaitTimeout= 60000; //1 minute +const int NetworkInterface::readyWaitTimeout= 120000; // 2 minutes bool NetworkInterface::allowGameDataSynchCheck = false; bool NetworkInterface::allowDownloadDataSynch = false;