From 9382473294289c397609bcf8f64e6387508ff9de Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Sat, 5 Mar 2011 20:15:28 +0000 Subject: [PATCH] - attempt to make a few tweaks for more smooth network play --- source/glest_game/network/server_interface.cpp | 2 +- source/shared_lib/sources/platform/posix/ircclient.cpp | 2 +- source/shared_lib/sources/platform/posix/socket.cpp | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/glest_game/network/server_interface.cpp b/source/glest_game/network/server_interface.cpp index 6ef342d4..c28435da 100644 --- a/source/glest_game/network/server_interface.cpp +++ b/source/glest_game/network/server_interface.cpp @@ -1194,7 +1194,7 @@ bool ServerInterface::launchGame(const GameSettings *gameSettings) { } if(bOkToStart == true) { - bool useInGameBlockingClientSockets = Config::getInstance().getBool("EnableInGameBlockingSockets","false"); + bool useInGameBlockingClientSockets = Config::getInstance().getBool("EnableInGameBlockingSockets","true"); if(useInGameBlockingClientSockets == true) { SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); for(int i= 0; i < GameConstants::maxPlayers; ++i) { diff --git a/source/shared_lib/sources/platform/posix/ircclient.cpp b/source/shared_lib/sources/platform/posix/ircclient.cpp index 06ec2c56..d949c8c8 100644 --- a/source/shared_lib/sources/platform/posix/ircclient.cpp +++ b/source/shared_lib/sources/platform/posix/ircclient.cpp @@ -460,7 +460,7 @@ void IRCThread::execute() { ircSession=NULL; if(argv.size() != 3) { - if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("===> IRC Usage: : got params [%ld]\n",argv.size()); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("===> IRC Usage: : got params [%ld]\n",(long int)argv.size()); return; } diff --git a/source/shared_lib/sources/platform/posix/socket.cpp b/source/shared_lib/sources/platform/posix/socket.cpp index 5ce05077..ae620565 100644 --- a/source/shared_lib/sources/platform/posix/socket.cpp +++ b/source/shared_lib/sources/platform/posix/socket.cpp @@ -1380,6 +1380,7 @@ bool Socket::isConnected() { //if the socket is not writable then it is not conencted if(isWritable() == false) { + SystemFlags::OutputDebug(SystemFlags::debugNetwork,"[%s::%s Line: %d] ERROR isWritable failed.\n",__FILE__,__FUNCTION__,__LINE__); return false; } //if the socket is readable it is connected if we can read a byte from it @@ -1387,6 +1388,7 @@ bool Socket::isConnected() { char tmp; int err = peek(&tmp, 1, false); if(err <= 0 && err != PLATFORM_SOCKET_TRY_AGAIN) { + SystemFlags::OutputDebug(SystemFlags::debugNetwork,"[%s::%s Line: %d] ERROR Peek failed, err = %d, error = %s\n",__FILE__,__FUNCTION__,__LINE__,err,getLastSocketErrorFormattedText().c_str()); return false; } }