Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_MemoryNetworkedStat.c
Go to the documentation of this file.
3{
4 // Last checked local RAM.
5 protected int m_iLocalMemory;
6
7 // Last checked authority RAM.
8 protected int m_iAuthorityMemory;
9
10 //------------------------------------------------------------------------------------------------
12 {
13 if (m_iLocalMemory == 0)
14 return 0;
15
16 return m_iLocalMemory / 1024; // Division by 1024 for KB to MB conversion.
17 }
18
19 //------------------------------------------------------------------------------------------------
21 {
22 if (m_iAuthorityMemory == 0)
23 return 0;
24
25 return m_iAuthorityMemory / 1024; // Division by 1024 for KB to MB conversion.
26 }
27
28 //------------------------------------------------------------------------------------------------
29 override void UpdateStat()
30 {
31 int localMemory = System.MemoryAllocationKB();
32 if (localMemory == m_iLocalMemory)
33 return;
34
35 m_iLocalMemory = localMemory;
36
37 RplComponent rplComponent = m_Owner.GetRplComponent();
38 if (rplComponent && rplComponent.Role() == RplRole.Authority)
39 {
41 m_Owner.SetAuthorityStatValue(m_eStatType, m_iAuthorityMemory);
42 }
43
45 }
46
47 //------------------------------------------------------------------------------------------------
48 override void OnAuthorityStatValueSet(int value)
49 {
50 m_iAuthorityMemory = value;
52 }
53}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
SCR_NetworkedStatsComponent m_Owner
SCR_ENetworkedStatType m_eStatType
override void OnAuthorityStatValueSet(int value)
RplRole
Role of replicated node (and all items in it) within the replication system.
Definition RplRole.c:14