From 3773736212410afc74e5829e44f009483596a101 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Thu, 15 Nov 2012 14:45:22 +0000 Subject: [PATCH] - bugfix for headless admin to get message in his own language (if possible) --- source/glest_game/graphics/renderer.cpp | 4 ++-- source/glest_game/network/connection_slot.cpp | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/source/glest_game/graphics/renderer.cpp b/source/glest_game/graphics/renderer.cpp index bbdf6650..91dd3e37 100644 --- a/source/glest_game/graphics/renderer.cpp +++ b/source/glest_game/graphics/renderer.cpp @@ -6809,8 +6809,8 @@ void Renderer::selectUsingSelectionBuffer(Selection::UnitContainer &units, //glGetIntegerv(GL_VIEWPORT, view); gluPickMatrix(x, y, w, h, view); - //gluPerspective(perspFov, metrics.getAspectRatio(), perspNearPlane, perspFarPlane); - gluPerspective(perspFov, metrics.getAspectRatio(), 0.0001, 1000.0); + gluPerspective(perspFov, metrics.getAspectRatio(), perspNearPlane, perspFarPlane); + //gluPerspective(perspFov, metrics.getAspectRatio(), 0.0001, 1000.0); //gluPerspective(perspFov, (float)view[2]/(float)view[3], perspNearPlane, perspFarPlane); loadGameCameraMatrix(); diff --git a/source/glest_game/network/connection_slot.cpp b/source/glest_game/network/connection_slot.cpp index 8669f966..dfe7538c 100644 --- a/source/glest_game/network/connection_slot.cpp +++ b/source/glest_game/network/connection_slot.cpp @@ -839,12 +839,11 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) { if(networkMessageLaunch.getMessageType() == nmtLaunch && this->serverInterface->getConnectedSlotCount() < minHeadLessPlayersRequired) { Lang &lang= Lang::getInstance(); - const vector languageList = this->gameSettings.getUniqueNetworkPlayerLanguages(); + const vector languageList = this->serverInterface->getGameSettings()->getUniqueNetworkPlayerLanguages(); for(unsigned int i = 0; i < languageList.size(); ++i) { - char szBuf[4096]=""; - + char szBuf[4096]=""; string msgTemplate = "You must have have at least %d player(s) connected to start this game!"; - if(lang.hasString("HeadlessAdminRequiresMorePlayers") == true) { + if(lang.hasString("HeadlessAdminRequiresMorePlayers",languageList[i]) == true) { msgTemplate = lang.get("HeadlessAdminRequiresMorePlayers",languageList[i]); } #ifdef WIN32 @@ -857,6 +856,8 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) { string sMsg = szBuf; bool echoLocal = lang.isLanguageLocal(languageList[i]); this->serverInterface->sendTextMessage(sMsg,-1, echoLocal, languageList[i], this->getPlayerIndex()); + + //printf("Lang [%s] msgTemplate [%s] echoLocal = %d\n",languageList[i].c_str(),msgTemplate.c_str(),echoLocal); } } else {