CvPlayer::reconnected()
- Defined in
- CvPlayer.cpp, line 27809
- Class
- CvPlayer
- Hook name
CivHooks::CvPlayer_reconnected
Hooks
static bool BeforeCvPlayer_reconnected(CvPlayer* self);static void AfterCvPlayer_reconnected(CvPlayer* self);static void ReplaceCvPlayer_reconnected(void (*original)(CvPlayer*), CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_reconnected>(host, &BeforeCvPlayer_reconnected);CivRegisterAfter<CivHooks::CvPlayer_reconnected>(host, &AfterCvPlayer_reconnected);CivRegisterReplace<CivHooks::CvPlayer_reconnected>(host, &ReplaceCvPlayer_reconnected);
Code
27809void CvPlayer::reconnected()27810{27811 //Preserve observer status for the connecting human player's slot.27812 if(CvPreGame::slotStatus(GetID()) != SS_OBSERVER){27813 CvPreGame::setSlotStatus(GetID(), SS_TAKEN);27814 }2781527816 CvPreGame::VerifyHandicap(GetID()); //verify the handicap because we might have replaced an ai.2781727818 CvGame& kGame = GC.getGame();27819 bool isMultiplayer = kGame.isGameMultiPlayer();27820 if(isMultiplayer && !isLocalPlayer())27821 {27822 FAutoArchive& archive = getSyncArchive();27823 archive.clearDelta();2782427825 Localization::String connectString = Localization::Lookup("TXT_KEY_PLAYER_CONNECTING");27826 connectString << getNameKey();2782727828 CvNotifications* pNotifications = GET_PLAYER(kGame.getActivePlayer()).GetNotifications();27829 if(pNotifications)27830 {27831 pNotifications->Add(NOTIFICATION_PLAYER_CONNECTING, connectString.toUTF8(), connectString.toUTF8(), -1, -1, GetID());27832 }27833 }27834}
Calls
- CvGame::getActivePlayer() const
- CvGame::isGameMultiPlayer() const
- CvGlobals::getGame()
- CvNotifications::Add(NotificationTypes, const char *, const char *, int, int, int, int)
- CvPlayer::GetID() const
- CvPlayer::getNameKey() const
- CvPlayer::GetNotifications() const
- CvPlayer::getSyncArchive()
- CvPlayer::isLocalPlayer() const
- CvPlayerAI::getPlayer(PlayerTypes)
- CvPreGame::setSlotStatus(PlayerTypes, SlotStatus)
- CvPreGame::slotStatus(PlayerTypes)
- CvPreGame::VerifyHandicap(PlayerTypes)
FAutoArchive::clearDeltaLocalization::LookupLocalization::String::toUTF8operator<<