Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AnalyticsDataCollectionModule.c
Go to the documentation of this file.
3{
4 [Attribute("1", UIWidgets.Slider, desc: "Seconds between updates of the module")]
5 float m_fUpdatePeriod;
6
7 protected float m_fTimeSinceUpdate = 0;
8
9 protected bool m_bIsEnabled = true;
10
11 //------------------------------------------------------------------------------------------------
13 {
14 Enable();
15 }
16
17 //------------------------------------------------------------------------------------------------
18 void Update(float timeTick);
19
20 //------------------------------------------------------------------------------------------------
21 protected void AddInvokers(IEntity player);
22
23 //------------------------------------------------------------------------------------------------
24 protected void RemoveInvokers(IEntity player);
25
26 //------------------------------------------------------------------------------------------------
27 void OnPlayerSpawned(SCR_SpawnRequestComponent requestComponent, int playerId, SCR_SpawnData data, IEntity controlledEntity)
28 {
29 AddInvokers(controlledEntity);
30 }
31
32 //------------------------------------------------------------------------------------------------
33 void OnPlayerDisconnected(int playerId, KickCauseCode cause, IEntity controlledEntity = null)
34 {
35 if (!controlledEntity)
36 controlledEntity = GetGame().GetPlayerManager().GetPlayerControlledEntity(playerId);
37
38 if (controlledEntity)
39 RemoveInvokers(controlledEntity);
40 }
41
42 //------------------------------------------------------------------------------------------------
43 void OnPlayerConnected(int playerId);
44
45 //------------------------------------------------------------------------------------------------
46 void OnControllableDestroyed(notnull SCR_InstigatorContextData instigatorContextData);
47
48 //------------------------------------------------------------------------------------------------
50
51 //------------------------------------------------------------------------------------------------
52 void OnGameEnd();
53
54 //------------------------------------------------------------------------------------------------
56 {
57 //If the previous entity exists, remove the invokers from it
58 if (from)
59 RemoveInvokers(from);
60
61 //If there's no entity yet we can assume the player disconnected or it hasn't spawned.
62 //In this case we do nothing and keep listening to the spawn invoker.
63 //Otherwise, we add the invokers to the 'to' entity
64 if (to)
65 AddInvokers(to);
66 }
67
68 //------------------------------------------------------------------------------------------------
72
73 //------------------------------------------------------------------------------------------------
75 {
76 SCR_DataCollectorComponent dataCollector = GetGame().GetDataCollector();
77 if (!dataCollector)
78 return null;
79
80 SCR_SessionData sessionData = dataCollector.GetSessionData();
81 if (!sessionData)
82 return null;
83
84 sessionData.SetSessionTimeAndPlayers();
85
86 SCR_SessionDataEvent sessionEvent = sessionData.GetSessionDataEvent();
87 if (!sessionEvent)
88 return null;
89
90 return sessionEvent;
91 }
92
93 //------------------------------------------------------------------------------------------------
94 bool IsEnabled()
95 {
96 return m_bIsEnabled;
97 }
98
99 //------------------------------------------------------------------------------------------------
100 void Enable()
101 {
102 m_bIsEnabled = true;
103 }
104
105 //------------------------------------------------------------------------------------------------
106 void Disable()
107 {
108 m_bIsEnabled = false;
109 }
110
111 #ifdef ENABLE_DIAG
112 //------------------------------------------------------------------------------------------------
113 void DrawContent()
114 {
115 if (!m_bIsEnabled)
116 DbgUI.Text("Module disabled!");
117 }
118 #endif
119}
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Get all prefabs that have the spawner data
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition DbgUI.c:66
void OnControlledEntityChanged(IEntity from, IEntity to)
void OnPlayerSpawned(SCR_SpawnRequestComponent requestComponent, int playerId, SCR_SpawnData data, IEntity controlledEntity)
void OnControllableDestroyed(notnull SCR_InstigatorContextData instigatorContextData)
void OnPlayerDisconnected(int playerId, KickCauseCode cause, IEntity controlledEntity=null)
void RemoveInvokers(IEntity player)
void OnPlayerConnected(int playerId)
void AddInvokers(IEntity player)
SCR_SessionDataEvent GetSessionDataEvent()
void SetSessionTimeAndPlayers()
SCR_FieldOfViewSettings Attribute