- bugfixes for headless mode so player can switch slots but admin cannot start game if we have a net player in an unassigned network slot

This commit is contained in:
Mark Vejvoda 2011-10-15 01:39:59 +00:00
parent 3b8d07fc8d
commit bea263229b
2 changed files with 13 additions and 1 deletions

View File

@ -940,6 +940,17 @@ void MenuStateConnectedGame::broadCastGameSettingsToMasterserver() {
NetworkManager &networkManager= NetworkManager::getInstance();
ClientInterface *clientInterface = networkManager.getClientInterface();
for(int i = 0; i < mapInfo.players; ++i) {
if(listBoxControls[i].getSelectedItemIndex() == ctNetworkUnassigned) {
listBoxControls[i].setSelectedItemIndex(ctNetwork);
}
}
for(int i = mapInfo.players; i < GameConstants::maxPlayers; ++i) {
if(listBoxControls[i].getSelectedItemIndex() == ctNetwork) {
listBoxControls[i].setSelectedItemIndex(ctNetworkUnassigned);
}
}
GameSettings gameSettings = *clientInterface->getGameSettings();
loadGameSettings(&gameSettings);
@ -1005,6 +1016,7 @@ void MenuStateConnectedGame::mouseClickAdmin(int x, int y, MouseButton mouseButt
loadMapInfo(Map::getMapPath(getCurrentMapFile(),"",false), &mapInfo, true);
labelMapInfo.setText(mapInfo.desc);
//updateControlers();
//updateNetworkSlots();

View File

@ -1,4 +1,3 @@
// ==============================================================
// This file is part of Glest (www.glest.org)
//
// Copyright (C) 2001-2005 Marti<74>o Figueroa
@ -1816,6 +1815,7 @@ void MenuStateCustomGame::update() {
}
if(this->masterserverMode == true && serverInterface->getMasterserverAdminRequestLaunch() == true) {
serverInterface->setMasterserverAdminRequestLaunch(false);
safeMutex.ReleaseLock();
PlayNow(false);