Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AnalyticsDelayedSend.c
Go to the documentation of this file.
3{
4 INACTIVE, // outside this menu
5 IN_MENU, // inside this menu
6 OUT_MENU_WAITING, // we just closed the menu
7 OUT_MENU_SENDING // it was a while since we closed the menu
8}
9
10class SCR_AnalyticsDelayedSend
11{
12 protected static const int ANALYTICS_DELAY_SECONDS = 10;
14 protected bool m_bIsAdditive = false;
15 protected float m_fTimeSpentSeconds = 0;
16 protected float m_fDelayLeftSeconds = 0;
17
18 //------------------------------------------------------------------------------------------------
20 void Start()
21 {
24 if (!m_bIsAdditive)
26 }
27
28 //------------------------------------------------------------------------------------------------
35
36 //------------------------------------------------------------------------------------------------
40 {
41 return m_bIsAdditive;
42 }
43
44 //------------------------------------------------------------------------------------------------
47 void Update(float deltaSeconds)
48 {
49 switch (m_eState)
50 {
51 case SCR_EAnalyticsDelayedState.INACTIVE:
52 break;
53
54 case SCR_EAnalyticsDelayedState.IN_MENU:
55 m_fTimeSpentSeconds += deltaSeconds;
56 break;
57
58 case SCR_EAnalyticsDelayedState.OUT_MENU_WAITING:
59 m_fDelayLeftSeconds -= deltaSeconds;
60 if (m_fDelayLeftSeconds <= 0)
61 m_eState = SCR_EAnalyticsDelayedState.OUT_MENU_SENDING;
62 break;
63
64 case SCR_EAnalyticsDelayedState.OUT_MENU_SENDING:
65 break;
66 }
67 }
68
69 //------------------------------------------------------------------------------------------------
72 {
73 return m_eState == SCR_EAnalyticsDelayedState.OUT_MENU_SENDING;
74 }
75
76 //------------------------------------------------------------------------------------------------
79 {
81 }
82
83 //------------------------------------------------------------------------------------------------
87 {
88 return Math.Round(m_fTimeSpentSeconds);
89 }
90}
EAITargetClusterState m_eState
void Start()
Start this tracking time in this menu, adds it to previous time if we have not yet sended previous da...
int GetTimeSpent()
bool IsAdditive()
enum SCR_EAnalyticsDelayedState ANALYTICS_DELAY_SECONDS
bool IsReadyToSend()
Should we send our data already?
SCR_EAnalyticsDelayedState
void ResetReadyToSend()
We have sended our data, reset.
bool m_bIsAdditive
float m_fTimeSpentSeconds
float m_fDelayLeftSeconds
SCR_CampaignSeizingComponent SCR_SeizingComponent EnumLinear()] enum SCR_EBaseCaptureState
Definition Math.c:13
void Stop()
Stop tracking time in this menu, prepare for sending data.
@ INACTIVE
body is not simulated (sleeps)
Definition ActiveState.c:18