Bazaar developer reference

CvDiplomacyAI::LogDoF(PlayerTypes)

Defined in
CvDiplomacyAI.cpp, line 25558
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_LogDoF

Hooks

static bool BeforeCvDiplomacyAI_LogDoF(CvDiplomacyAI* self, PlayerTypes ePlayer);static void AfterCvDiplomacyAI_LogDoF(CvDiplomacyAI* self, PlayerTypes ePlayer);static void ReplaceCvDiplomacyAI_LogDoF(void (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_LogDoF>(host, &BeforeCvDiplomacyAI_LogDoF);CivRegisterAfter<CivHooks::CvDiplomacyAI_LogDoF>(host, &AfterCvDiplomacyAI_LogDoF);CivRegisterReplace<CivHooks::CvDiplomacyAI_LogDoF>(host, &ReplaceCvDiplomacyAI_LogDoF);

Code

25557/// Log working with a player25558void CvDiplomacyAI::LogDoF(PlayerTypes ePlayer)25559{25560	if(GC.getLogging() && GC.getAILogging())25561	{25562		CvString strOutBuf;25563		CvString strBaseString;25564		CvString playerName;25565		CvString otherPlayerName;25566		CvString strDesc;25567		CvString strLogName;2556825569		// Find the name of this civ and city25570		playerName = GetPlayer()->getCivilizationShortDescription();2557125572		// Open the log file25573		if(GC.getPlayerAndCityAILogSplit())25574		{25575			strLogName = "DiplomacyAI_Messages_Log_" + playerName + ".csv";25576		}25577		else25578		{25579			strLogName = "DiplomacyAI_Messages_Log.csv";25580		}2558125582		FILogFile* pLog;25583		pLog = LOGFILEMGR.GetLog(strLogName, FILogFile::kDontTimeStamp);2558425585		// Get the leading info for this line25586		strBaseString.Format("%03d, ", GC.getGame().getElapsedGameTurns());25587		strBaseString += playerName + ", ";2558825589		otherPlayerName = GET_PLAYER(ePlayer).getCivilizationShortDescription();25590		strOutBuf = strBaseString + ",***** NOW FRIENDS " + otherPlayerName + "! *****";2559125592		pLog->Msg(strOutBuf);2559325594		OutputDebugString("\n");25595		OutputDebugString(strOutBuf);25596		OutputDebugString("\n");25597	}25598}

Calls

Called by