DayZ
1.29
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
SyncPlayerList.c
См. документацию.
1
class
SyncPlayerList
2
{
3
ref
array<ref SyncPlayer>
m_PlayerList
;
4
5
void
CreatePlayerList
()
6
{
7
if
(
g_Game
.IsServer())
8
{
9
m_PlayerList
=
new
array<ref SyncPlayer>
();
10
11
array<PlayerIdentity>
identities =
new
array<PlayerIdentity>
();
12
g_Game
.GetPlayerIndentities(identities);
13
14
foreach
(
auto
identity : identities)
15
{
16
SyncPlayer
sync_player =
new
SyncPlayer
;
17
sync_player.
m_Identity
= identity;
18
sync_player.
m_UID
= identity.GetPlainId();
19
sync_player.
m_PlayerName
= identity.GetPlainName();
20
m_PlayerList
.Insert(sync_player);
21
}
22
}
23
}
24
25
static
SyncPlayerList
Compare
(
SyncPlayerList
a,
SyncPlayerList
b)
26
{
27
SyncPlayerList
new_list =
new
SyncPlayerList
;
28
new_list.
m_PlayerList
=
new
array<ref SyncPlayer>
;
29
30
if
(!a && b && b.
m_PlayerList
)
31
{
32
foreach
(
SyncPlayer
player3 : b.
m_PlayerList
)
33
{
34
new_list.
m_PlayerList
.Insert(player3);
35
}
36
}
37
else
if
(a && a.
m_PlayerList
&& !b)
38
{
39
foreach
(
SyncPlayer
player4 : a.
m_PlayerList
)
40
{
41
new_list.
m_PlayerList
.Insert(player4);
42
}
43
}
44
else
if
(a && a.
m_PlayerList
&& b && b.
m_PlayerList
)
45
{
46
array<ref SyncPlayer>
array_a = a.
m_PlayerList
;
47
array<ref SyncPlayer>
array_b = b.
m_PlayerList
;
48
49
foreach
(
SyncPlayer
player : array_b)
50
{
51
bool
found =
false
;
52
foreach
(
SyncPlayer
player2 : array_a)
53
{
54
if
(player.m_UID == player2.m_UID)
55
{
56
found =
true
;
57
break
;
58
}
59
}
60
61
if
(!found)
62
{
63
new_list.
m_PlayerList
.Insert(player);
64
}
65
}
66
}
67
return
new_list;
68
}
69
}
g_Game
DayZGame g_Game
Определения
DayZGame.c:3942
SyncPlayer::m_PlayerName
string m_PlayerName
Определения
SyncPlayer.c:11
SyncPlayer::m_Identity
PlayerIdentity m_Identity
Определения
SyncPlayer.c:3
SyncPlayer::m_UID
string m_UID
Keeping for backwards compatability with mods.
Определения
SyncPlayer.c:8
SyncPlayer
Определения
SyncPlayer.c:2
SyncPlayerList::CreatePlayerList
void CreatePlayerList()
Определения
SyncPlayerList.c:5
SyncPlayerList::m_PlayerList
ref array< ref SyncPlayer > m_PlayerList
Определения
SyncPlayerList.c:3
SyncPlayerList::Compare
static SyncPlayerList Compare(SyncPlayerList a, SyncPlayerList b)
Определения
SyncPlayerList.c:25
SyncPlayerList
Определения
SyncPlayerList.c:2
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Определения
IsBoxCollidingGeometryProxyClasses.c:28
Ishodniki
scripts
3_Game
DayZ
Client
SyncPlayerList.c
Создано системой
1.13.2