Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_SessionData.c
Go to the documentation of this file.
2{
3 //DataEvent to send stats to the database for tracking purposes
5
6 protected int m_iSessionStartedTick;
7
8 //------------------------------------------------------------------------------------------------
9 protected float CalculateSessionDuration()
10 {
11 return System.GetTickCount(m_iSessionStartedTick) * 0.001;
12 }
13
14 //------------------------------------------------------------------------------------------------
20
21 //------------------------------------------------------------------------------------------------
23 {
24 m_DataEvent.amt_time_session = CalculateSessionDuration();
25
26 PlayerManager playerManager = GetGame().GetPlayerManager();
27 if (playerManager)
28 m_DataEvent.amt_players = playerManager.GetPlayerCount();
29 }
30
31 //------------------------------------------------------------------------------------------------
36 {
38 return GetSessionDataEvent();
39 }
40
41 //------------------------------------------------------------------------------------------------
43 {
44 m_iSessionStartedTick = System.GetTickCount();
45
46 ServerInfo serverInfo = GetGame().GetServerInfo();
47 if (serverInfo)
48 m_DataEvent.amt_max_player_slots = serverInfo.GetPlayerLimit();
49
50 FactionManager factionManager = GetGame().GetFactionManager();
51 if (factionManager)
52 {
53 array<Faction> factionList = {};
54 array<string> factionNames = {};
55
56 factionManager.GetFactionsList(factionList);
57 foreach (Faction faction : factionList)
58 {
59 factionNames.Insert(faction.GetFactionKey());
60 }
61
62 m_DataEvent.array_name_faction = SCR_AnalyticsDataCollectionHelper.GetShortDataArray(factionNames.ToString());
63 }
64
65 PlayerManager playerManager = GetGame().GetPlayerManager();
66 if (playerManager)
67 m_DataEvent.amt_players = playerManager.GetPlayerCount();
68 }
69}
ArmaReforgerScripted GetGame()
Definition game.c:1398
ref SCR_SessionDataEvent m_DataEvent
Managed GetDataEventStats()
float CalculateSessionDuration()
SCR_SessionDataEvent GetSessionDataEvent()
void SetSessionTimeAndPlayers()