9 protected ref array<ref SCR_AnalyticsDataCollectionModule> m_aModules;
19 protected int m_iCurrentModuleId;
21 protected ref array<string> m_aModuleNames;
28 RplComponent rplComponent = RplComponent.Cast(
GetOwner().FindComponent(RplComponent));
29 bool isMaster = (rplComponent && rplComponent.IsMaster());
34 Print(
"AnalyticsDataCollectionComponent: OnGameModeStart: m_Owner is null. Can't add the EntityEvent.FRAME flag thus data collector might not work properly.",
LogLevel.ERROR);
53 RplComponent rplComponent = RplComponent.Cast(
GetOwner().FindComponent(RplComponent));
54 bool isMaster = (rplComponent && rplComponent.IsMaster());
60 module.OnGameModeEnd();
76 SCR_DataCollectorComponent dataCollector =
GetGame().GetDataCollector();
78 dataCollector.RemovePlayer(playerId);
82 module.OnPlayerConnected(playerId);
94 module.OnPlayerDisconnected(playerId, cause);
104 int playerId = requestComponent.GetPlayerId();
107 Print(
"AnalyticsDataCollectionComponent: OnPlayerSpawnFinalize_S: playerId is 0.",
LogLevel.ERROR);
113 module.OnPlayerSpawned(requestComponent, playerId, data, entity);
122 module.OnControllableDestroyed(instigatorContextData);
132 for (
int i = m_aModules.Count() - 1; i >= 0; i--)
135 return m_aModules[i];
154 if (!m_aModules.IsIndexValid(
id))
157 return m_aModules.Get(
id);
177 module.Update(timeSlice);
180 module.SessionMeasures();
196 SCR_DataCollectorComponent dataCollector =
GetGame().GetDataCollector();
210 GetGame().GetStatsApi().SessionMeasures(sessionEvent);
228 super.OnDelete(owner);
231 DisconnectFromDiagSystem(owner);
237 protected void RegisterToDiag()
240 DiagMenu.RegisterMenu(
SCR_DebugMenuID.DEBUGUI_ANALYTICS_DATA_COLLECTION,
"Analytics Data Collection",
"Statistics");
241 DiagMenu.RegisterBool(
SCR_DebugMenuID.DEBUGUI_ANALYTICS_DATA_COLLECTION_ENABLE_DIAG,
"",
"Enable debug menu",
"Analytics Data Collection");
242 m_aModuleNames =
new array<string>();
244 foreach (SCR_AnalyticsDataCollectionModule module : m_aModules)
246 m_aModuleNames.Insert(SCR_AnalyticsDataCollectionHelper.GetShortModuleName(module.ToString()));
253 if (!DiagMenu.GetBool(
SCR_DebugMenuID.DEBUGUI_ANALYTICS_DATA_COLLECTION_ENABLE_DIAG))
262 if (m_aModules.IsEmpty())
264 DbgUI.Text(
"No Analytics Data Collection modules found.");
269 int selectedModuleId = m_iCurrentModuleId;
271 DbgUI.Begin(
"SCR_AnalyticsDataCollectionComponent");
273 DbgUI.Combo(
"Module: ", selectedModuleId, m_aModuleNames);
275 if (selectedModuleId != m_iCurrentModuleId)
276 OnSetCurrentModule(selectedModuleId);
278 if (DbgUI.Button(
"Enable Module"))
283 if (DbgUI.Button(
"Disable Module"))
288 m_CurrentModule.DrawContent();
294 void OnSetCurrentModule(
int id)
296 int newModuleId = Math.ClampInt(
id, 0, m_aModules.Count() - 1);
297 if (m_iCurrentModuleId == newModuleId)
300 m_iCurrentModuleId = newModuleId;
ArmaReforgerScripted GetGame()
void DisableAllModules()
Disables all analytics data collection modules.
SCR_AnalyticsDataCollectionModule GetModuleById(int id)
override void OnGameModeEnd(SCR_GameModeEndData data)
float m_fSessionMeasuresTimer
array< ref SCR_AnalyticsDataCollectionModule > GetAllModules()
override void OnGameEnd()
Called on all machines when the world ends.
SCR_AnalyticsDataCollectionModule FindModule(typename type)
int m_iSessionMeasuresInterval
void SCR_BaseGameModeComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
override void OnGameModeStart()
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
Get all prefabs that have the spawner data
void OnControllableDestroyed(IEntity entity, IEntity killerEntity, Instigator instigator, notnull SCR_InstigatorContextData instigatorContextData)
override void EOnFrame(IEntity owner, float timeSlice)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
override void OnPlayerSpawnFinalize_S(SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, SCR_SpawnData data, IEntity entity)
enum EVehicleType IEntity
SCR_SessionDataEvent GetSessionDataEvent()
void SetSessionTimeAndPlayers()
IEntity GetOwner()
Owner entity of the fuel tank.
override void EOnDiag(IEntity owner, float timeSlice)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
SCR_FieldOfViewSettings Attribute
EntityEvent
Various entity events.
override void OnPlayerDisconnected(int playerId, KickCauseCode cause, int timeout)
void OnPlayerConnected(int playerId)