- added LAN IP in custom Menu

- Updated readme and other text files with more accurate info (thanks Tomreyn)
- Disabled ability to zoom out when game is over if in a network game (creates to much LAG and instability)
This commit is contained in:
Mark Vejvoda 2010-07-10 06:14:31 +00:00
parent f40dd94b1d
commit 031bfd2f60
4 changed files with 35 additions and 8 deletions

View File

@ -1382,9 +1382,14 @@ void Game::checkWinnerStandard(){
if(this->gameSettings.getEnableObserverModeAtEndGame() == true) {
// Let the poor user watch everything unfold
world.setFogOfWar(false);
//gameCamera.setClampBounds(false);
Renderer::getInstance().setPhotoMode(true);
gameCamera.setMaxHeight(500);
// This caused too much LAG for network games
if(this->gameSettings.isNetworkGame() == false) {
Renderer::getInstance().setPhotoMode(true);
gameCamera.setMaxHeight(500);
}
// END
// but don't let him cheat via teamchat
chatManager.setDisableTeamMode(true);
}
@ -1413,9 +1418,13 @@ void Game::checkWinnerStandard(){
if(this->gameSettings.getEnableObserverModeAtEndGame() == true) {
// Let the happy winner view everything left in the world
world.setFogOfWar(false);
//gameCamera.setClampBounds(false);
Renderer::getInstance().setPhotoMode(true);
gameCamera.setMaxHeight(500);
// This caused too much LAG for network games
if(this->gameSettings.isNetworkGame() == false) {
Renderer::getInstance().setPhotoMode(true);
gameCamera.setMaxHeight(500);
}
// END
}
showWinMessageBox();

View File

@ -131,6 +131,22 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu, b
mapFiles = results;
std::for_each(results.begin(), results.end(), FormatString());
labelLocalIP.init(410, networkHeadPos+30);
string ipText = "none";
std::vector<std::string> ipList = Socket::getLocalIPAddressList();
if(ipList.size() > 0) {
ipText = "";
for(int idx = 0; idx < ipList.size(); idx++) {
string ip = ipList[idx];
if(ipText != "") {
ipText += ", ";
}
ipText += ip;
}
}
labelLocalIP.setText(lang.get("LanIP") + ipText);
labelMap.init(100, mapHeadPos);
listBoxMap.init(100, mapPos, 200);
listBoxMap.setItems(results);
@ -687,6 +703,7 @@ void MenuStateCustomGame::render(){
renderer.renderLabel(&labelNetStatus[i]);
}
}
renderer.renderLabel(&labelLocalIP);
renderer.renderLabel(&labelMap);
renderer.renderLabel(&labelFogOfWar);
renderer.renderLabel(&labelTileset);

View File

@ -36,6 +36,7 @@ private:
GraphicLabel labelMapInfo;
GraphicLabel labelEnableObserverMode;
GraphicLabel labelEnableServerControlledAI;
GraphicLabel labelLocalIP;
GraphicListBox listBoxMap;

View File

@ -564,13 +564,13 @@ void ConnectionSlot::signalUpdate(ConnectionSlotEvent *event) {
bool ConnectionSlot::updateCompleted() {
assert(slotThreadWorker != NULL);
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] playerIndex = %d\n",__FILE__,__FUNCTION__,__LINE__,playerIndex);
//SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] playerIndex = %d\n",__FILE__,__FUNCTION__,__LINE__,playerIndex);
bool waitingForThread = (slotThreadWorker->isSignalCompleted() == false &&
slotThreadWorker->getQuitStatus() == false &&
slotThreadWorker->getRunningStatus() == true);
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] playerIndex = %d, waitingForThread = %d\n",__FILE__,__FUNCTION__,__LINE__,playerIndex,waitingForThread);
//SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] playerIndex = %d, waitingForThread = %d\n",__FILE__,__FUNCTION__,__LINE__,playerIndex,waitingForThread);
return (waitingForThread == false);
}