DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ OnClientDisconnectedEvent()

void MissionBase::OnClientDisconnectedEvent ( PlayerIdentity identity,
PlayerBase player,
int logoutTime,
bool authFailed )
inlineprotected

См. определение в файле missionServer.c строка 628

629 {
630 bool disconnectNow = true;
631
632 // TODO: get out of vehicle
633 // using database and no saving if authorization failed
634 if (GetHive() && !authFailed)
635 {
636 if (player.IsAlive())
637 {
638 if (!m_LogoutPlayers.Contains(player) && !m_NewLogoutPlayers.Contains(player))
639 {
640 Print("[Logout]: New player " + identity.GetId() + " with logout time " + logoutTime.ToString());
641
642 // send statistics to client
643 player.StatSyncToClient();
644
645 // inform client about logout time
646 g_Game.SendLogoutTime(player, logoutTime);
647
648 // wait for some time before logout and save
649 LogoutInfo params = new LogoutInfo(g_Game.GetTime() + logoutTime * 1000, identity.GetId());
650
651 m_NewLogoutPlayers.Insert(player, params);
652 g_Game.GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(AddNewPlayerLogout, 0, false, player, params);
653
654 // allow reconnecting to old char only if not in cars, od ladders etc. as they cannot be properly synchronized for reconnect
655 //if (!player.GetCommand_Vehicle() && !player.GetCommand_Ladder())
656 //{
657 // g_Game.AddToReconnectCache(identity);
658 //}
659 // wait until logout timer runs out
660 disconnectNow = false;
661 }
662 return;
663 }
664 }
665
666 if (disconnectNow)
667 {
668 Print("[Logout]: New player " + identity.GetId() + " with instant logout");
669
670 // inform client about instant logout
671 g_Game.SendLogoutTime(player, 0);
672
673 PlayerDisconnected(player, identity, identity.GetId());
674 }
675 }
DayZGame g_Game
Определения DayZGame.c:3942
proto native Hive GetHive()
void AddNewPlayerLogout(PlayerBase player, notnull LogoutInfo info)
Определения missionServer.c:260
void PlayerDisconnected(PlayerBase player, PlayerIdentity identity, string uid)
Определения missionServer.c:677
ref map< PlayerBase, ref LogoutInfo > m_NewLogoutPlayers
Определения missionServer.c:10
ref map< PlayerBase, ref LogoutInfo > m_LogoutPlayers
Определения missionServer.c:9
proto string GetId()
unique id of player (hashed steamID, database Xbox id...) can be used in database or logs
proto void Print(void var)
Prints content of variable to console/log.
const int CALL_CATEGORY_GAMEPLAY
Определения 3_Game/DayZ/tools/tools.c:10
Param2< int, string > LogoutInfo
int time of the logout end
Определения missionServer.c:3

Перекрестные ссылки AddNewPlayerLogout(), CALL_CATEGORY_GAMEPLAY, g_Game, GetHive(), PlayerIdentityBase::GetId(), m_LogoutPlayers, m_NewLogoutPlayers, PlayerDisconnected() и Print().

Используется в OnEvent().