- changed disconnected playername to: *AI* - playername

This commit is contained in:
Mark Vejvoda 2012-06-11 23:50:30 +00:00
parent b965343496
commit c187d4d014
4 changed files with 7 additions and 4 deletions

View File

@ -831,10 +831,11 @@ void Commander::giveNetworkCommand(NetworkCommand* networkCommand) const {
int factionIndex = networkCommand->getUnitId();
int playerStatus = networkCommand->getCommandTypeId();
GameSettings *settings = world->getGameSettingsPtr();
if(playerStatus == 1) {
GameSettings *settings = world->getGameSettingsPtr();
settings->setNetworkPlayerGameStatus(factionIndex,1);
}
this->world->getStats()->setPlayerName(factionIndex,settings->getNetworkPlayerName(factionIndex));
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] found nctPlayerStatusChange\n",__FILE__,__FUNCTION__,__LINE__);

View File

@ -839,7 +839,7 @@ void Game::init(bool initForPreviewOnly) {
Map *map= world.getMap();
NetworkManager &networkManager= NetworkManager::getInstance();
GameSettings::playerDisconnectedText = "*" + lang.get("Disconnect") + "* - ";
GameSettings::playerDisconnectedText = "*" + lang.get("AI") + "* ";
if(map == NULL) {
throw megaglest_runtime_error("map == NULL");

View File

@ -1503,7 +1503,8 @@ void MenuStateConnectedGame::loadGameSettings(GameSettings *gameSettings) {
AIPlayerCount++;
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] i = %d, playername is AI (blank)\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,i);
gameSettings->setNetworkPlayerName(slotIndex, string("AI") + intToStr(AIPlayerCount));
Lang &lang= Lang::getInstance();
gameSettings->setNetworkPlayerName(slotIndex, lang.get("AI") + intToStr(AIPlayerCount));
labelPlayerNames[i].setText("");
}

View File

@ -3091,7 +3091,8 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool force
AIPlayerCount++;
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] i = %d, playername is AI (blank)\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,i);
gameSettings->setNetworkPlayerName(slotIndex, string("AI") + intToStr(AIPlayerCount));
Lang &lang= Lang::getInstance();
gameSettings->setNetworkPlayerName(slotIndex, lang.get("AI") + intToStr(AIPlayerCount));
labelPlayerNames[i].setText("");
}