- fix min player for headless game message

This commit is contained in:
Mark Vejvoda 2012-10-06 17:50:27 +00:00
parent a7fe72a46c
commit c5ac0cc8e3
4 changed files with 8 additions and 1 deletions

View File

@ -391,7 +391,7 @@ void Ai::update() {
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld [ruleIdx = %d, before rule->test()]\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis(),ruleIdx);
//printf("???? Testing AI Faction # %d RULE Name[%s]\n",aiInterface->getFactionIndex(),rule->getName().c_str());
//printf("Testing AI Faction # %d RULE Name[%s]\n",aiInterface->getFactionIndex(),rule->getName().c_str());
if(rule->test()) {
if(outputAIBehaviourToConsole()) printf("\n\nYYYYY Executing AI Faction # %d RULE Name[%s]\n\n",aiInterface->getFactionIndex(),rule->getName().c_str());

View File

@ -461,6 +461,8 @@ void ChatManager::updateNetwork() {
playerName = this->manualPlayerNameOverride;
}
//printf("Network chat msg from: [%d - %s] [%s]\n",msg.chatPlayerIndex,gameNetworkInterface->getHumanPlayerName().c_str(),this->manualPlayerNameOverride.c_str());
if(StartsWith(msg.chatText,"*")){
if(msg.chatText.find(playerName) != string::npos){
CoreData &coreData= CoreData::getInstance();

View File

@ -1965,6 +1965,9 @@ void Renderer::renderConsoleLine3D(int lineIndex, int xPosition, int yPosition,
if(playerName != lineInfo->originalPlayerName && lineInfo->originalPlayerName != "") {
playerName = lineInfo->originalPlayerName;
}
if(playerName == GameConstants::NETWORK_SLOT_UNCONNECTED_SLOTNAME) {
playerName = lang.get("SystemUser");
}
//printf("playerName [%s], line [%s]\n",playerName.c_str(),line.c_str());
//string headerLine = "*" + playerName + ":";

View File

@ -1564,6 +1564,8 @@ bool ClientInterface::shouldDiscardNetworkMessage(NetworkMessageType networkMess
string ClientInterface::getHumanPlayerName(int index) {
string result = Config::getInstance().getString("NetPlayerName",Socket::getHostName().c_str());
//printf("Client getHumanPlayerName index = %d, gameSettings.getThisFactionIndex() = %d\n",index,gameSettings.getThisFactionIndex());
if(index >= 0 || gameSettings.getThisFactionIndex() >= 0) {
if(index < 0) {
index = gameSettings.getThisFactionIndex();