Bazaar developer reference

CvDiplomacyAI::LogOpenEmbassy(PlayerTypes)

Defined in
CvDiplomacyAI.cpp, line 28289
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_LogOpenEmbassy

Hooks

static bool BeforeCvDiplomacyAI_LogOpenEmbassy(CvDiplomacyAI* self, PlayerTypes ePlayer);static void AfterCvDiplomacyAI_LogOpenEmbassy(CvDiplomacyAI* self, PlayerTypes ePlayer);static void ReplaceCvDiplomacyAI_LogOpenEmbassy(void (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_LogOpenEmbassy>(host, &BeforeCvDiplomacyAI_LogOpenEmbassy);CivRegisterAfter<CivHooks::CvDiplomacyAI_LogOpenEmbassy>(host, &AfterCvDiplomacyAI_LogOpenEmbassy);CivRegisterReplace<CivHooks::CvDiplomacyAI_LogOpenEmbassy>(host, &ReplaceCvDiplomacyAI_LogOpenEmbassy);

Code

28289void CvDiplomacyAI::LogOpenEmbassy(PlayerTypes ePlayer)28290{28291	if(GC.getLogging() && GC.getAILogging())28292	{28293		CvString strOutBuf;28294		CvString strBaseString;28295		CvString playerName;28296		CvString otherPlayerName;28297		CvString strDesc;28298		CvString strLogName;2829928300		// Find the name of this civ and city28301		playerName = GetPlayer()->getCivilizationShortDescription();2830228303		// Open the log file28304		if(GC.getPlayerAndCityAILogSplit())28305		{28306			strLogName = "DiplomacyAI_Messages_Log_" + playerName + ".csv";28307		}28308		else28309		{28310			strLogName = "DiplomacyAI_Messages_Log.csv";28311		}2831228313		FILogFile* pLog;28314		pLog = LOGFILEMGR.GetLog(strLogName, FILogFile::kDontTimeStamp);2831528316		// Get the leading info for this line28317		strBaseString.Format("%03d, ", GC.getGame().getElapsedGameTurns());28318		strBaseString += playerName + ", ";2831928320		otherPlayerName = GET_PLAYER(ePlayer).getCivilizationShortDescription();28321		strOutBuf = strBaseString + ",***** OPENED EMBASSY @ " + otherPlayerName + "! *****";2832228323		pLog->Msg(strOutBuf);2832428325		OutputDebugString("\n");28326		OutputDebugString(strOutBuf);28327		OutputDebugString("\n");28328	}28329}

Calls

Called by