From 325ea2515af9ef1dfa56281cb79515105f8acae0 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Mon, 31 Jan 2011 23:36:13 +0000 Subject: [PATCH] - nicely formatted out of synch messages (one per line).. all for tomreyn's happiness :) --- source/glest_game/game/commander.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/glest_game/game/commander.cpp b/source/glest_game/game/commander.cpp index c19d4631..b8627912 100644 --- a/source/glest_game/game/commander.cpp +++ b/source/glest_game/game/commander.cpp @@ -664,12 +664,17 @@ Command* Commander::buildCommand(const NetworkCommand* networkCommand) const { GameNetworkInterface *gameNetworkInterface= NetworkManager::getInstance().getGameNetworkInterface(); if(gameNetworkInterface != NULL && gameNetworkInterface->isConnected() == true) { char szMsg[1024]=""; - sprintf(szMsg,"Player detected an error: Unit / Faction mismatch for unitId: %d\nLocal faction index = %d, remote index = %d. Game out of synch.",networkCommand->getUnitId(),unit->getFaction()->getIndex(),networkCommand->getUnitFactionIndex()); + sprintf(szMsg,"Player detected an error: Unit / Faction mismatch for unitId: %d",networkCommand->getUnitId()); gameNetworkInterface->sendTextMessage(szMsg,-1, true); + sprintf(szMsg,"Local faction index = %d, remote index = %d. Game out of synch.",unit->getFaction()->getIndex(),networkCommand->getUnitFactionIndex()); + gameNetworkInterface->sendTextMessage(szMsg,-1, true); + } else { char szMsg[1024]=""; - sprintf(szMsg,"Player detected an error: Connection lost, possible Unit / Faction mismatch for unitId: %d\nLocal faction index = %d, remote index = %d. Game out of synch.",networkCommand->getUnitId(),unit->getFaction()->getIndex(),networkCommand->getUnitFactionIndex()); + sprintf(szMsg,"Player detected an error: Connection lost, possible Unit / Faction mismatch for unitId: %d",networkCommand->getUnitId()); + gameNetworkInterface->sendTextMessage(szMsg,-1, true); + sprintf(szMsg,"Local faction index = %d, remote index = %d. Game out of synch.",unit->getFaction()->getIndex(),networkCommand->getUnitFactionIndex()); gameNetworkInterface->sendTextMessage(szMsg,-1, true); }