Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
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  //------------------------------------------------------------------------------------------------
11  int GetLastCheckedLocalMemory()
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  //------------------------------------------------------------------------------------------------
20  int GetLastCheckedAuthorityMemory()
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  {
40  m_iAuthorityMemory = m_iLocalMemory;
41  m_Owner.SetAuthorityStatValue(m_eStatType, m_iAuthorityMemory);
42  }
43 
44  InvokeStatValueChange();
45  }
46 
47  //------------------------------------------------------------------------------------------------
48  override void OnAuthorityStatValueSet(int value)
49  {
50  m_iAuthorityMemory = value;
51  InvokeStatValueChange();
52  }
53 }
SCR_MemoryNetworkedStat
Definition: SCR_MemoryNetworkedStat.c:2
SCR_BaseNetworkedStat
Definition: SCR_BaseNetworkedStat.c:2
m_Owner
SCR_AIGroupUtilityComponentClass m_Owner
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468