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

◆ OnClientDisconnectedEvent()

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

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

583 {
584 bool disconnectNow = true;
585
586 // TODO: get out of vehicle
587 // using database and no saving if authorization failed
588 if (GetHive() && !authFailed)
589 {
590 if (player.IsAlive())
591 {
592 if (!m_LogoutPlayers.Contains(player) && !m_NewLogoutPlayers.Contains(player))
593 {
594 Print("[Logout]: New player " + identity.GetId() + " with logout time " + logoutTime.ToString());
595
596 // send statistics to client
597 player.StatSyncToClient();
598
599 // inform client about logout time
600 GetGame().SendLogoutTime(player, logoutTime);
601
602 // wait for some time before logout and save
603 LogoutInfo params = new LogoutInfo(GetGame().GetTime() + logoutTime * 1000, identity.GetId());
604
605 m_NewLogoutPlayers.Insert(player, params);
607
608 // allow reconnecting to old char only if not in cars, od ladders etc. as they cannot be properly synchronized for reconnect
609 //if (!player.GetCommand_Vehicle() && !player.GetCommand_Ladder())
610 //{
611 // GetGame().AddToReconnectCache(identity);
612 //}
613 // wait until logout timer runs out
614 disconnectNow = false;
615 }
616 return;
617 }
618 }
619
620 if (disconnectNow)
621 {
622 Print("[Logout]: New player " + identity.GetId() + " with instant logout");
623
624 // inform client about instant logout
625 GetGame().SendLogoutTime(player, 0);
626
627 PlayerDisconnected(player, identity, identity.GetId());
628 }
629 }
proto native Hive GetHive()
float GetTime()
Определения NotificationSystem.c:35
override ScriptCallQueue GetCallQueue(int call_category)
Определения DayZGame.c:1187
proto native void SendLogoutTime(Object player, int time)
Inform client about logout time (creates logout screen on specified client)
void AddNewPlayerLogout(PlayerBase player, notnull LogoutInfo info)
Определения missionServer.c:214
void PlayerDisconnected(PlayerBase player, PlayerIdentity identity, string uid)
Определения missionServer.c:631
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 CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.
const int CALL_CATEGORY_GAMEPLAY
Определения tools.c:10
Param2< int, string > LogoutInfo
int time of the logout end
Определения missionServer.c:3

Перекрестные ссылки AddNewPlayerLogout(), CALL_CATEGORY_GAMEPLAY, ScriptCallQueue::CallLater(), CGame::GetCallQueue(), GetGame(), GetHive(), PlayerIdentityBase::GetId(), GetTime(), m_LogoutPlayers, m_NewLogoutPlayers, PlayerDisconnected(), Print() и CGame::SendLogoutTime().

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