Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_NetworkedStatsTest.c
Go to the documentation of this file.
1 [ComponentEditorProps(category: "GameScripted/Misc", description: "")]
2 class SCR_NetworkedStatsTestComponentClass : ScriptComponentClass
3 {
4 }
5 
6 class SCR_NetworkedStatsTestComponent : ScriptComponent
7 {
8  SCR_NetworkedStatsComponent statsComponent;
9 
10  //------------------------------------------------------------------------------------------------
11  override void EOnInit(IEntity owner)
12  {
13  if (SCR_Global.IsEditMode())
14  return;
15 
16  statsComponent = SCR_NetworkedStatsComponent.Cast(owner.FindComponent(SCR_NetworkedStatsComponent));
17  statsComponent.GetNetworkedStatPrefabData().GetOnStatsChanged(true).Insert(OnStatUpdate);
18  }
19 
20  //------------------------------------------------------------------------------------------------
23  {
24  SCR_FPSNetworkedStat fpsStat = SCR_FPSNetworkedStat.Cast(stat);
25  SCR_MemoryNetworkedStat memoryStat = SCR_MemoryNetworkedStat.Cast(stat);
26 
27  if (fpsStat)
28  {
29  Print("Local FPS: " + fpsStat.GetLastCheckedLocalFPS());
30  Print("Authority FPS: " + fpsStat.GetLastCheckedAuthorityFPS());
31  }
32  else if (memoryStat)
33  {
34  Print("Local Memory: " + memoryStat.GetLastCheckedLocalMemory());
35  Print("Authority Memory: " + memoryStat.GetLastCheckedAuthorityMemory());
36  }
37  }
38 
39  //------------------------------------------------------------------------------------------------
40  override void OnPostInit(IEntity owner)
41  {
42  SetEventMask(owner, EntityEvent.INIT);
43  }
44 }
ComponentEditorProps
SCR_FragmentEntityClass ComponentEditorProps
ScriptComponent
SCR_SiteSlotEntityClass ScriptComponent
SCR_FPSNetworkedStat
Definition: SCR_ServerFPSNetworkedStat.c:2
statsComponent
SCR_NetworkedStatsTestComponentClass statsComponent
OnPostInit
override void OnPostInit(IEntity owner)
Editable Mine.
Definition: SCR_NetworkedStatsTest.c:40
SCR_MemoryNetworkedStat
Definition: SCR_MemoryNetworkedStat.c:2
OnStatUpdate
void OnStatUpdate(SCR_BaseNetworkedStat stat)
Definition: SCR_NetworkedStatsTest.c:22
EOnInit
override void EOnInit(IEntity owner)
Initialise this component with data from FactionsManager.
Definition: SCR_NetworkedStatsTest.c:11
SCR_Global
Definition: Functions.c:6
SCR_BaseNetworkedStat
Definition: SCR_BaseNetworkedStat.c:2
SCR_NetworkedStatsTestComponentClass
Definition: SCR_NetworkedStatsTest.c:2
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180