CvDiplomacyAI::LogDenounce(PlayerTypes, bool, bool)
- Defined in
- CvDiplomacyAI.cpp, line 25602
- Class
- CvDiplomacyAI
- Hook name
CivHooks::CvDiplomacyAI_LogDenounce
Hooks
static bool BeforeCvDiplomacyAI_LogDenounce(CvDiplomacyAI* self, PlayerTypes ePlayer, bool bBackstab, bool bRefusal);static void AfterCvDiplomacyAI_LogDenounce(CvDiplomacyAI* self, PlayerTypes ePlayer, bool bBackstab, bool bRefusal);static void ReplaceCvDiplomacyAI_LogDenounce(void (*original)(CvDiplomacyAI*, PlayerTypes, bool, bool), CvDiplomacyAI* self, PlayerTypes ePlayer, bool bBackstab, bool bRefusal);CivRegisterBefore<CivHooks::CvDiplomacyAI_LogDenounce>(host, &BeforeCvDiplomacyAI_LogDenounce);CivRegisterAfter<CivHooks::CvDiplomacyAI_LogDenounce>(host, &AfterCvDiplomacyAI_LogDenounce);CivRegisterReplace<CivHooks::CvDiplomacyAI_LogDenounce>(host, &ReplaceCvDiplomacyAI_LogDenounce);
Code
25601/// Log working with a player25602void CvDiplomacyAI::LogDenounce(PlayerTypes ePlayer, bool bBackstab, bool bRefusal)25603{25604 if(GC.getLogging() && GC.getAILogging())25605 {25606 CvString strOutBuf;25607 CvString strBaseString;25608 CvString playerName;25609 CvString strDesc;25610 CvString strLogName;2561125612 // Find the name of this civ and city25613 playerName = GetPlayer()->getCivilizationShortDescription();2561425615 // Open the log file25616 if(GC.getPlayerAndCityAILogSplit())25617 {25618 strLogName = "DiplomacyAI_Messages_Log_" + playerName + ".csv";25619 }25620 else25621 {25622 strLogName = "DiplomacyAI_Messages_Log.csv";25623 }2562425625 FILogFile* pLog;25626 pLog = LOGFILEMGR.GetLog(strLogName, FILogFile::kDontTimeStamp);2562725628 // Get the leading info for this line25629 strBaseString.Format("%03d, ", GC.getGame().getElapsedGameTurns());25630 strBaseString += playerName + ", ";2563125632 CvString otherPlayerName = GET_PLAYER(ePlayer).getCivilizationShortDescription();25633 //CvString againstPlayerName = GET_PLAYER(eAgainstPlayer).getCivilizationShortDescription();2563425635 if(bBackstab)25636 strOutBuf = strBaseString + ",***** BACKSTABBED " + otherPlayerName + "! *****";25637 else if(bRefusal)25638 strOutBuf = strBaseString + ",***** REFUSED TO FORGIVE " + otherPlayerName + "! *****";25639 else25640 strOutBuf = strBaseString + ",***** DENOUNCED " + otherPlayerName + "! *****";2564125642 pLog->Msg(strOutBuf);2564325644 OutputDebugString("\n");25645 OutputDebugString(strOutBuf);25646 OutputDebugString("\n");25647 }25648}
Calls
- CvDiplomacyAI::GetPlayer()
- CvGame::getElapsedGameTurns() const
- CvGlobals::getAILogging()
- CvGlobals::getGame()
- CvGlobals::getLogging()
- CvGlobals::getPlayerAndCityAILogSplit()
- CvPlayer::getCivilizationShortDescription() const
- CvPlayerAI::getPlayer(PlayerTypes)
CvString::CvStringCvString::CvStringCvString::FormatCvString::operator const char *CvString::operator=CvString::operator=FILogFile::MsgFILogFileMgr::GetInstanceFILogFileMgr::GetLogstd::basic_string::operator+=std::operator+std::operator+std::operator+