Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
clientdata.c
Go to the documentation of this file.
1
class
ClientData
2
{
3
static
ref
ScriptInvoker
SyncEvent_OnPlayerListUpdate
=
new
ScriptInvoker
();
4
static
ref
ScriptInvoker
SyncEvent_OnEntityKilled
=
new
ScriptInvoker
();
5
static
ref
ScriptInvoker
SyncEvent_OnPlayerIgnitedFireplace
=
new
ScriptInvoker
();
6
7
static
ref
array<Man>
m_PlayerBaseList
=
new
array<Man>
;
8
static
ref
SyncPlayerList
m_PlayerList
;
9
static
ref
SyncPlayerList
m_LastNewPlayers
;
10
11
static
ref
OnlineServices
m_OnlineServices
;
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
35
static
void
SyncEvent_PreprocessPlayerList
(
SyncPlayerList
player_list)
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
51
static
void
SyncEvent_OnRecievedPlayerList
(
SyncPlayerList
player_list )
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
{
66
m_LastNewPlayers
=
SyncPlayerList
.
Compare
(
m_LastNewPlayers
, new_players );
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 );
75
OnlineServices
.
m_ClientServices
.
GetSessionService
().
OnSessionPlayerListUpdate
(newPlayersSimple);
76
77
if
( new_players.
m_PlayerList
.Count() > 0 )
78
{
79
OnlineServices
.
LoadFriends
();
80
}
81
82
if
(
g_Game
.GetGameState() == DayZGameState.IN_GAME )
83
{
84
OnlineServices
.
SetMultiplayState
(
OnlineServices
.
GetMultiplayState
());
85
}
86
#endif
87
#endif
88
89
SyncEvent_OnPlayerListUpdate
.Invoke( player_list );
90
}
91
92
static
array<string>
GetSimplePlayerList
()
93
{
94
array<string>
ids =
new
array<string>
;
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
107
static
array<string>
GetSimplePlayerList
(
SyncPlayerList
list )
108
{
109
array<string>
ids =
new
array<string>
;
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
127
static
void
SyncEvent_OnPlayerIgnitedFireplace
(
EFireIgniteType
igante_type )
128
{
129
SyncEvent_OnPlayerIgnitedFireplace
.Invoke(igante_type);
130
}
131
}
BiosClientServices::GetSessionService
proto native BiosSessionService GetSessionService()
BiosSessionService::OnSessionPlayerListUpdate
proto native void OnSessionPlayerListUpdate(array< string > newPlayers)
Alerts engine that players in current session have changed.
ClientData
Definition
clientdata.c:2
ClientData::AddPlayerBase
static void AddPlayerBase(Man player)
Definition
clientdata.c:23
ClientData::SyncEvent_OnPlayerIgnitedFireplace
static void SyncEvent_OnPlayerIgnitedFireplace(EFireIgniteType igante_type)
Definition
clientdata.c:127
ClientData::m_PlayerBaseList
static ref array< Man > m_PlayerBaseList
Definition
clientdata.c:7
ClientData::m_PlayerList
static ref SyncPlayerList m_PlayerList
Definition
clientdata.c:8
ClientData::SyncEvent_OnRecievedPlayerList
static void SyncEvent_OnRecievedPlayerList(SyncPlayerList player_list)
Definition
clientdata.c:51
ClientData::m_OnlineServices
static ref OnlineServices m_OnlineServices
Definition
clientdata.c:11
ClientData::SyncEvent_OnPlayerListUpdate
static ref ScriptInvoker SyncEvent_OnPlayerListUpdate
Definition
clientdata.c:3
ClientData::RemovePlayerBase
static void RemovePlayerBase(Man player)
Definition
clientdata.c:29
ClientData::SyncEvent_OnEntityKilled
static void SyncEvent_OnEntityKilled(SyncEntityKillInfo entity_killed_data)
Definition
clientdata.c:122
ClientData::SyncEvent_OnPlayerIgnitedFireplace
static ref ScriptInvoker SyncEvent_OnPlayerIgnitedFireplace
Definition
clientdata.c:5
ClientData::m_LastNewPlayers
static ref SyncPlayerList m_LastNewPlayers
Definition
clientdata.c:9
ClientData::GetSimplePlayerList
static array< string > GetSimplePlayerList()
Definition
clientdata.c:92
ClientData::GetSimplePlayerList
static array< string > GetSimplePlayerList(SyncPlayerList list)
Definition
clientdata.c:107
ClientData::SyncEvent_PreprocessPlayerList
static void SyncEvent_PreprocessPlayerList(SyncPlayerList player_list)
Definition
clientdata.c:35
ClientData::ResetClientData
static void ResetClientData()
Definition
clientdata.c:13
ClientData::SyncEvent_OnEntityKilled
static ref ScriptInvoker SyncEvent_OnEntityKilled
Definition
clientdata.c:4
OnlineServices
Definition
onlineservices.c:2
OnlineServices::GetMultiplayState
static bool GetMultiplayState()
Definition
onlineservices.c:515
OnlineServices::m_ClientServices
static BiosClientServices m_ClientServices
Definition
onlineservices.c:10
OnlineServices::SetMultiplayState
static void SetMultiplayState(bool state)
Definition
onlineservices.c:520
OnlineServices::LoadPermissions
static void LoadPermissions(array< string > player_list)
Definition
onlineservices.c:314
OnlineServices::LoadFriends
static void LoadFriends()
Definition
onlineservices.c:237
PlayerIdentityBase::GetPlainName
proto string GetPlainName()
nick without any processing
PlayerIdentityBase::GetPlainId
proto string GetPlainId()
plaintext unique id of player (cannot be used in database or logs)
PlayerIdentity
The class that will be instanced (moddable).
Definition
gameplay.c:389
ScriptInvoker
ScriptInvoker Class provide list of callbacks usage:
Definition
tools.c:116
SyncEntityKillInfo
Definition
syncentitykill.c:2
SyncEntityKillInfo::m_EntityVictim
EntityAI m_EntityVictim
Definition
syncentitykill.c:3
SyncEntityKillInfo::m_EntityKiller
EntityAI m_EntityKiller
Definition
syncentitykill.c:4
SyncEntityKillInfo::m_EntitySource
EntityAI m_EntitySource
Definition
syncentitykill.c:5
SyncEntityKillInfo::m_IsHeadShot
bool m_IsHeadShot
Definition
syncentitykill.c:6
SyncPlayer
Definition
syncplayer.c:2
SyncPlayer::m_UID
string m_UID
Keeping for backwards compatability with mods.
Definition
syncplayer.c:8
SyncPlayerList
Definition
syncplayerlist.c:2
SyncPlayerList::Compare
static SyncPlayerList Compare(SyncPlayerList a, SyncPlayerList b)
Definition
syncplayerlist.c:25
SyncPlayerList::m_PlayerList
ref array< ref SyncPlayer > m_PlayerList
Definition
syncplayerlist.c:3
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition
isboxcollidinggeometryproxyclasses.c:28
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
EFireIgniteType
EFireIgniteType
Definition
efireignitetype.c:2
ErrorExSeverity
ErrorExSeverity
Definition
endebug.c:62
ErrorEx
enum ShapeType ErrorEx
Games
Dayz
scripts
3_game
client
clientdata.c
Generated by
1.17.0