DayZ 1.24
Loading...
Searching...
No Matches
SyncPlayerList.c
Go to the documentation of this file.
2{
4
6 {
7 if (GetGame().IsServer())
8 {
10
12 GetGame().GetPlayerIndentities(identities);
13
14 foreach (auto identity : identities)
15 {
17 sync_player.m_Identity = identity;
18 sync_player.m_UID = identity.GetPlainId();
19 sync_player.m_PlayerName = identity.GetPlainName();
21 }
22 }
23 }
24
26 {
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 new_list.m_PlayerList.Insert(player3);
34 }
35 else if (a && a.m_PlayerList && !b)
36 {
37 foreach (SyncPlayer player4 : a.m_PlayerList)
38 new_list.m_PlayerList.Insert(player4);
39 }
40 else if (a && a.m_PlayerList && b && b.m_PlayerList)
41 {
44
45 foreach (SyncPlayer player : array_b)
46 {
47 bool found = false;
48 foreach (SyncPlayer player2 : array_a)
49 {
50 if (player.m_UID == player2.m_UID)
51 {
52 found = true;
53 break;
54 }
55 }
56
57 if (!found)
58 new_list.m_PlayerList.Insert(player);
59 }
60 }
61 return new_list;
62 }
63}
void CreatePlayerList()
ref array< ref SyncPlayer > m_PlayerList
static SyncPlayerList Compare(SyncPlayerList a, SyncPlayerList b)
proto native CGame GetGame()