try to fix the headless server show itself connected

This commit is contained in:
Titus Tscharntke
2012-10-03 22:16:12 +00:00
parent afcd787774
commit 61f4bcaacd

View File

@@ -3178,6 +3178,12 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool force
if(ct != ctClosed) {
int slotIndex = factionCount;
if (ct == ctHuman && this->headlessServerMode == true) {
// switch slot to network, because no human in headless mode
ct = ctNetwork;
}
gameSettings->setFactionControl(slotIndex, ct);
if(ct == ctHuman) {
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] i = %d, slotIndex = %d, getHumanPlayerName(i) [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,i,slotIndex,getHumanPlayerName(i).c_str());
@@ -3218,7 +3224,6 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool force
gameSettings->setTeam(slotIndex, listBoxTeams[i].getSelectedItemIndex());
gameSettings->setStartLocationIndex(slotIndex, i);
if(listBoxControls[i].getSelectedItemIndex() == ctNetwork || listBoxControls[i].getSelectedItemIndex() == ctNetworkUnassigned) {
if(serverInterface->getSlot(i) != NULL &&
serverInterface->getSlot(i)->isConnected()) {