Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
clientdata.c
Go to the documentation of this file.
2{
6
10
12
13 static void ResetClientData()
14 {
15 if ( m_PlayerBaseList )
16 m_PlayerBaseList.Clear();
17 if ( m_PlayerList && m_PlayerList.m_PlayerList )
18 m_PlayerList.m_PlayerList.Clear();
19 if ( m_LastNewPlayers && m_LastNewPlayers.m_PlayerList )
20 m_LastNewPlayers.m_PlayerList.Clear();
21 }
22
23 static void AddPlayerBase( Man player )
24 {
25 if ( m_PlayerBaseList && player != g_Game.GetPlayer() )
26 m_PlayerBaseList.Insert( player );
27 }
28
29 static void RemovePlayerBase( Man player )
30 {
31 if ( m_PlayerBaseList )
32 m_PlayerBaseList.RemoveItem( player );
33 }
34
36 {
37 foreach (auto sync_player : player_list.m_PlayerList)
38 {
39 PlayerIdentity identity = sync_player.m_Identity;
40 if (!identity)
41 {
42 ErrorEx("PlayerIdentity not synchronized before SyncPlayer", ErrorExSeverity.WARNING);
43 continue;
44 }
45
46 sync_player.m_UID = identity.GetPlainId();
47 sync_player.m_PlayerName = identity.GetPlainName();
48 }
49 }
50
52 {
53 if (m_PlayerList && m_PlayerList.m_PlayerList)
54 {
55 //Print("SyncEvent_OnRecievedPlayerList | " + m_PlayerList.m_PlayerList.Count());
56 }
57
58 SyncPlayerList new_players = SyncPlayerList.Compare(m_PlayerList, player_list);
59
60 if ( !m_LastNewPlayers )
61 {
62 m_LastNewPlayers = player_list;
63 }
64 else
65 {
67 }
68
69 m_PlayerList = SyncPlayerList.Compare(player_list, null);
70
71 #ifdef PLATFORM_CONSOLE
72 #ifndef PLATFORM_WINDOWS // if app is not on Windows with -XBOX parameter
73 array<string> newPlayersSimple = GetSimplePlayerList( new_players );
74 OnlineServices.LoadPermissions( newPlayersSimple );
76
77 if ( new_players.m_PlayerList.Count() > 0 )
78 {
80 }
81
82 if ( g_Game.GetGameState() == DayZGameState.IN_GAME )
83 {
85 }
86 #endif
87 #endif
88
89 SyncEvent_OnPlayerListUpdate.Invoke( player_list );
90 }
91
93 {
95 if ( m_PlayerList && m_PlayerList.m_PlayerList )
96 {
97 for ( int i = 0; i < m_PlayerList.m_PlayerList.Count(); i++ )
98 {
99 SyncPlayer player = m_PlayerList.m_PlayerList.Get( i );
100 ids.Insert( player.m_UID );
101 }
102 }
103
104 return ids;
105 }
106
108 {
110 if ( list )
111 {
112 for ( int i = 0; i < list.m_PlayerList.Count(); i++ )
113 {
114 SyncPlayer player = list.m_PlayerList.Get( i );
115 ids.Insert( player.m_UID );
116 }
117 }
118
119 return ids;
120 }
121
122 static void SyncEvent_OnEntityKilled( SyncEntityKillInfo entity_killed_data )
123 {
124 SyncEvent_OnEntityKilled.Invoke(entity_killed_data.m_EntityVictim, entity_killed_data.m_EntityKiller, entity_killed_data.m_EntitySource, entity_killed_data.m_IsHeadShot );
125 }
126
128 {
129 SyncEvent_OnPlayerIgnitedFireplace.Invoke(igante_type);
130 }
131}
proto native BiosSessionService GetSessionService()
proto native void OnSessionPlayerListUpdate(array< string > newPlayers)
Alerts engine that players in current session have changed.
static void AddPlayerBase(Man player)
Definition clientdata.c:23
static void SyncEvent_OnPlayerIgnitedFireplace(EFireIgniteType igante_type)
Definition clientdata.c:127
static ref array< Man > m_PlayerBaseList
Definition clientdata.c:7
static ref SyncPlayerList m_PlayerList
Definition clientdata.c:8
static void SyncEvent_OnRecievedPlayerList(SyncPlayerList player_list)
Definition clientdata.c:51
static ref OnlineServices m_OnlineServices
Definition clientdata.c:11
static ref ScriptInvoker SyncEvent_OnPlayerListUpdate
Definition clientdata.c:3
static void RemovePlayerBase(Man player)
Definition clientdata.c:29
static void SyncEvent_OnEntityKilled(SyncEntityKillInfo entity_killed_data)
Definition clientdata.c:122
static ref ScriptInvoker SyncEvent_OnPlayerIgnitedFireplace
Definition clientdata.c:5
static ref SyncPlayerList m_LastNewPlayers
Definition clientdata.c:9
static array< string > GetSimplePlayerList()
Definition clientdata.c:92
static array< string > GetSimplePlayerList(SyncPlayerList list)
Definition clientdata.c:107
static void SyncEvent_PreprocessPlayerList(SyncPlayerList player_list)
Definition clientdata.c:35
static void ResetClientData()
Definition clientdata.c:13
static ref ScriptInvoker SyncEvent_OnEntityKilled
Definition clientdata.c:4
static bool GetMultiplayState()
static BiosClientServices m_ClientServices
static void SetMultiplayState(bool state)
static void LoadPermissions(array< string > player_list)
static void LoadFriends()
proto string GetPlainName()
nick without any processing
proto string GetPlainId()
plaintext unique id of player (cannot be used in database or logs)
The class that will be instanced (moddable).
Definition gameplay.c:389
ScriptInvoker Class provide list of callbacks usage:
Definition tools.c:116
string m_UID
Keeping for backwards compatability with mods.
Definition syncplayer.c:8
static SyncPlayerList Compare(SyncPlayerList a, SyncPlayerList b)
ref array< ref SyncPlayer > m_PlayerList
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DayZGame g_Game
Definition dayzgame.c:3942
EFireIgniteType
ErrorExSeverity
Definition endebug.c:62
enum ShapeType ErrorEx