From 66bc98c106f0e9daea5096b9427251b55edab7f7 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Wed, 9 Jan 2013 23:34:37 +0000 Subject: [PATCH] - bugfix for nig's client disconnect error --- source/glest_game/network/client_interface.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/glest_game/network/client_interface.cpp b/source/glest_game/network/client_interface.cpp index 04d8b789..b0b37d3a 100644 --- a/source/glest_game/network/client_interface.cpp +++ b/source/glest_game/network/client_interface.cpp @@ -154,6 +154,7 @@ void ClientInterface::update() { Chrono chrono; if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled) chrono.start(); + bool wasConncted = this->isConnected(); try { NetworkMessageCommandList networkMessageCommandList(currentFrameCount); @@ -194,9 +195,14 @@ void ClientInterface::update() { } catch(const megaglest_runtime_error &ex) { if(this->isConnected() == false) { - string sErr = string(extractFileFromDirectoryPath(__FILE__).c_str()) + "::" + string(__FUNCTION__) + " network error: " + string(ex.what()); + SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] Error [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,ex.what()); + SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] Error [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,ex.what()); + + if(wasConncted == false) { + string sErr = string(extractFileFromDirectoryPath(__FILE__).c_str()) + "::" + string(__FUNCTION__) + " network error: " + string(ex.what()); + DisplayErrorMessage(sErr); + } - DisplayErrorMessage(sErr); quit= true; } else {