DayZ 1.24
Loading...
Searching...
No Matches
SyncPlayerList Class Reference
Collaboration diagram for SyncPlayerList:
[legend]

Private Member Functions

void CreatePlayerList ()
 

Static Private Member Functions

static SyncPlayerList Compare (SyncPlayerList a, SyncPlayerList b)
 

Private Attributes

ref array< ref SyncPlayerm_PlayerList
 

Detailed Description

Definition at line 1 of file SyncPlayerList.c.

Member Function Documentation

◆ Compare()

static SyncPlayerList SyncPlayerList::Compare ( SyncPlayerList a,
SyncPlayerList b )
inlinestaticprivate

Definition at line 25 of file SyncPlayerList.c.

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)
34 }
35 else if (a && a.m_PlayerList && !b)
36 {
37 foreach (SyncPlayer player4 : a.m_PlayerList)
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 }
ref array< ref SyncPlayer > m_PlayerList

References m_PlayerList.

Referenced by ClientData::SyncEvent_OnRecievedPlayerList().

◆ CreatePlayerList()

void SyncPlayerList::CreatePlayerList ( )
inlineprivate

Definition at line 5 of file SyncPlayerList.c.

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 }
proto native CGame GetGame()

References GetGame(), and m_PlayerList.

Member Data Documentation

◆ m_PlayerList

ref array<ref SyncPlayer> SyncPlayerList::m_PlayerList
private

Definition at line 3 of file SyncPlayerList.c.

Referenced by Compare(), and CreatePlayerList().


The documentation for this class was generated from the following file: