Bazaar developer reference

CvDiplomacyAI::LogFriendRequestDenounce(PlayerTypes, PlayerTypes, bool)

Defined in
CvDiplomacyAI.cpp, line 25651
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_LogFriendRequestDenounce

Hooks

static bool BeforeCvDiplomacyAI_LogFriendRequestDenounce(CvDiplomacyAI* self, PlayerTypes ePlayer, PlayerTypes eAgainstPlayer, bool bAgreed);static void AfterCvDiplomacyAI_LogFriendRequestDenounce(CvDiplomacyAI* self, PlayerTypes ePlayer, PlayerTypes eAgainstPlayer, bool bAgreed);static void ReplaceCvDiplomacyAI_LogFriendRequestDenounce(void (*original)(CvDiplomacyAI*, PlayerTypes, PlayerTypes, bool), CvDiplomacyAI* self, PlayerTypes ePlayer, PlayerTypes eAgainstPlayer, bool bAgreed);CivRegisterBefore<CivHooks::CvDiplomacyAI_LogFriendRequestDenounce>(host, &BeforeCvDiplomacyAI_LogFriendRequestDenounce);CivRegisterAfter<CivHooks::CvDiplomacyAI_LogFriendRequestDenounce>(host, &AfterCvDiplomacyAI_LogFriendRequestDenounce);CivRegisterReplace<CivHooks::CvDiplomacyAI_LogFriendRequestDenounce>(host, &ReplaceCvDiplomacyAI_LogFriendRequestDenounce);

Code

25650/// Log friend asks another to denounce someone25651void CvDiplomacyAI::LogFriendRequestDenounce(PlayerTypes ePlayer, PlayerTypes eAgainstPlayer, bool bAgreed)25652{25653	if(GC.getLogging() && GC.getAILogging())25654	{25655		CvString strOutBuf;25656		CvString strBaseString;25657		CvString playerName;25658		CvString strDesc;25659		CvString strLogName;2566025661		// Find the name of this civ and city25662		playerName = GetPlayer()->getCivilizationShortDescription();2566325664		// Open the log file25665		if(GC.getPlayerAndCityAILogSplit())25666		{25667			strLogName = "DiplomacyAI_Messages_Log_" + playerName + ".csv";25668		}25669		else25670		{25671			strLogName = "DiplomacyAI_Messages_Log.csv";25672		}2567325674		FILogFile* pLog;25675		pLog = LOGFILEMGR.GetLog(strLogName, FILogFile::kDontTimeStamp);2567625677		// Get the leading info for this line25678		strBaseString.Format("%03d, ", GC.getGame().getElapsedGameTurns());25679		strBaseString += playerName + ", ";2568025681		CvString otherPlayerName = GET_PLAYER(ePlayer).getCivilizationShortDescription();25682		CvString againstPlayerName = GET_PLAYER(eAgainstPlayer).getCivilizationShortDescription();2568325684		// Did they actually agree?25685		if(bAgreed)25686			strOutBuf = strBaseString + ",***** CONVINCED " + otherPlayerName + " TO DENOUNCE " + againstPlayerName + "! *****";25687		else25688			strOutBuf = strBaseString + ", ASKED " + otherPlayerName + " TO DENOUNCE " + againstPlayerName + "!";2568925690		pLog->Msg(strOutBuf);2569125692		OutputDebugString("\n");25693		OutputDebugString(strOutBuf);25694		OutputDebugString("\n");25695	}25696}

Calls

Called by