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

◆ OnClientDisconnectedEvent()

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

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

642 {
643 bool disconnectNow = true;
644
645 // TODO: get out of vehicle
646 // using database and no saving if authorization failed
647 if (GetHive() && !authFailed)
648 {
649 if (player.IsAlive())
650 {
651 if (!m_LogoutPlayers.Contains(player) && !m_NewLogoutPlayers.Contains(player))
652 {
653 Print("[Logout]: New player " + identity.GetId() + " with logout time " + logoutTime.ToString());
654
655 // send statistics to client
656 player.StatSyncToClient();
657
658 // inform client about logout time
659 g_Game.SendLogoutTime(player, logoutTime);
660
661 // wait for some time before logout and save
662 LogoutInfo params = new LogoutInfo(g_Game.GetTime() + logoutTime * 1000, identity.GetId());
663
664 m_NewLogoutPlayers.Insert(player, params);
665 g_Game.GetCallQueue(CALL_CATEGORY_GAMEPLAY).Call(AddNewPlayerLogout, player, params);
666
667 // allow reconnecting to old char only if not in cars, od ladders etc. as they cannot be properly synchronized for reconnect
668 //if (!player.GetCommand_Vehicle() && !player.GetCommand_Ladder())
669 //{
670 // g_Game.AddToReconnectCache(identity);
671 //}
672 // wait until logout timer runs out
673 disconnectNow = false;
674 }
675 return;
676 }
677 }
678
679 if (disconnectNow)
680 {
681 Print("[Logout]: New player " + identity.GetId() + " with instant logout");
682
683 // inform client about instant logout
684 g_Game.SendLogoutTime(player, 0);
685
686 PlayerDisconnected(player, identity, identity.GetId());
687 }
688 }
DayZGame g_Game
Определения DayZGame.c:4074
proto native Hive GetHive()
void AddNewPlayerLogout(PlayerBase player, notnull LogoutInfo info)
Определения missionServer.c:267
void PlayerDisconnected(PlayerBase player, PlayerIdentity identity, string uid)
Определения missionServer.c:690
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.
static proto string ToString(void var, bool type=false, bool name=false, bool quotes=true)
Return string representation of variable.
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() и string::ToString().

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