Bazaar developer reference

CvDiplomacyAI::LogCloseEmbassy(PlayerTypes)

Defined in
CvDiplomacyAI.cpp, line 28332
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_LogCloseEmbassy

Hooks

static bool BeforeCvDiplomacyAI_LogCloseEmbassy(CvDiplomacyAI* self, PlayerTypes ePlayer);static void AfterCvDiplomacyAI_LogCloseEmbassy(CvDiplomacyAI* self, PlayerTypes ePlayer);static void ReplaceCvDiplomacyAI_LogCloseEmbassy(void (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_LogCloseEmbassy>(host, &BeforeCvDiplomacyAI_LogCloseEmbassy);CivRegisterAfter<CivHooks::CvDiplomacyAI_LogCloseEmbassy>(host, &AfterCvDiplomacyAI_LogCloseEmbassy);CivRegisterReplace<CivHooks::CvDiplomacyAI_LogCloseEmbassy>(host, &ReplaceCvDiplomacyAI_LogCloseEmbassy);

Code

28332void CvDiplomacyAI::LogCloseEmbassy(PlayerTypes ePlayer)28333{28334	if(GC.getLogging() && GC.getAILogging())28335	{28336		CvString strOutBuf;28337		CvString strBaseString;28338		CvString playerName;28339		CvString otherPlayerName;28340		CvString strDesc;28341		CvString strLogName;2834228343		// Find the name of this civ and city28344		playerName = GetPlayer()->getCivilizationShortDescription();2834528346		// Open the log file28347		if(GC.getPlayerAndCityAILogSplit())28348		{28349			strLogName = "DiplomacyAI_Messages_Log_" + playerName + ".csv";28350		}28351		else28352		{28353			strLogName = "DiplomacyAI_Messages_Log.csv";28354		}2835528356		FILogFile* pLog;28357		pLog = LOGFILEMGR.GetLog(strLogName, FILogFile::kDontTimeStamp);2835828359		// Get the leading info for this line28360		strBaseString.Format("%03d, ", GC.getGame().getElapsedGameTurns());28361		strBaseString += playerName + ", ";2836228363		otherPlayerName = GET_PLAYER(ePlayer).getCivilizationShortDescription();28364		strOutBuf = strBaseString + ",***** CLOSED EMBASSY @ " + otherPlayerName + "! *****";2836528366		pLog->Msg(strOutBuf);2836728368		OutputDebugString("\n");28369		OutputDebugString(strOutBuf);28370		OutputDebugString("\n");28371	}28372}

Calls

Called by