Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
scriptanalytics.c
Go to the documentation of this file.
1 // class binded to engine
3 {
4  string m_CharacterId;
5  int m_TimeInterval;
6  int m_DaytimeHour;
7  vector m_PositionStart;
8  vector m_PositionEnd;
9  float m_DistanceOnFoot;
10 
11  float m_DistanceVehicle;
12  float m_TimeVONIn;
13  float m_TimeVONOut;
14  int m_CntLootAny;
15  int m_CntLootFood;
16  int m_CntLootCloth;
17  int m_CntLootFirearm;
18  int m_CntLootAmmo;
19  int m_CntKillInfected;
20  int m_CntConsumedFood;
21  int m_CntConsumedWater;
22  int m_HealthRestored;
23  int m_CntFiredAmmo;
24  int m_CntCraftedItem;
25 
26  // listStatus // state metric of health, hunger, thirst, etc... when event is created/send
27  int m_HealthStatus;
28  int m_BloodStatus;
29  int m_SicknessStatus;
30  int m_TemperatureStatus;
31  int m_FoodStatus;
32  int m_HydrationStatus;
33 };
34 
35 // class binded to engine
37 {
38  string m_CharacterId;
39  int m_CharacterLifetime;
40  string m_Cause;
41  string m_WeaponName;
42  float m_Distance;
43  vector m_Position;
44 
45  int m_ListDamages[5];
46 };
47 
48 // class binded to engine
50 {
51  string m_CharacterId;
52  string m_WeaponName;
53  int m_KillDistance;
54  vector m_PositionKiller;
55  vector m_PositionVictim;
56 };
57 
58 // class binded to engine
60 {
61  string m_CharacterId;
62  string m_Reason;
63 };
64 
65 // class binded to engine
67 {
68  string m_CharacterId;
69  int m_Lifetime;
70  vector m_Position;
71  int m_Population;
72  int m_DaytimeHour;
73 };
74 
75 // class binded to engine
77 {
78  void StatsEventData(string eventName)
79  {
80  m_eventName = eventName;
81  m_valuesBool = new map<string, int>();
82  m_valuesInt = new map<string, int>();
83  m_valuesFloat = new map<string, float>();
84  m_valuesString = new map<string, string>();
85  m_valuesVector = new map<string, vector>();
86  }
87 
88  void AddBool(string key, bool value)
89  {
90  m_valuesBool.Insert(key, (int)value);
91  }
92 
93  void AddInt(string key, int value)
94  {
95  m_valuesInt.Insert(key, value);
96  }
97 
98  void AddFloat(string key, float value)
99  {
100  m_valuesFloat.Insert(key, value);
101  }
102 
103  void AddString(string key, string value)
104  {
105  m_valuesString.Insert(key, value);
106  }
107 
108  void AddVector(string key, vector value)
109  {
110  m_valuesVector.Insert(key, value);
111  }
112 
113  private string m_eventName;
114  private autoptr map<string, int> m_valuesBool;//TODO: use bool instead of int (problem with engine type binding)
115  private autoptr map<string, int> m_valuesInt;
116  private autoptr map<string, float> m_valuesFloat;
117  private autoptr map<string, string> m_valuesString;
118  private autoptr map<string, vector> m_valuesVector;
119 }
120 
121 
122 class ScriptAnalytics
123 {
125  static proto native void SendPlayerDeath(StatsEventDeathData data);
126 
128  static proto native void SendPlayerScoredKill(StatsEventScoredKillData data);
129 
131  static proto native void SendPlayerDisconnected(StatsEventDisconnectedData data);
132 
134  static proto native void SendPlayerMeasures(StatsEventMeasuresData data);
135 
137  static proto native void SendPlayerSpawned(StatsEventSpawnedData data);
138 
140  static proto native void SendEvent(StatsEventData data);
141 };
142 
143 
144 
146 {
147  // send stats data with log
148  static void PlayerDeath(StatsEventDeathData data)
149  {
150  ScriptAnalytics.SendPlayerDeath(data);
151  }
152 
153  // send stats data with log
154  static void PlayerScoredKill(StatsEventScoredKillData data)
155  {
156  ScriptAnalytics.SendPlayerScoredKill(data);
157  }
158 
159  // send stats data with log
160  static void PlayerDisconnected(StatsEventDisconnectedData data)
161  {
162  ScriptAnalytics.SendPlayerDisconnected(data);
163  }
164 
165  // send stats data with log
166  static void PlayerMeasures(StatsEventMeasuresData data)
167  {
168  ScriptAnalytics.SendPlayerMeasures(data);
169  }
170 
171  // send stats data with log
172  static void PlayerSpawned(StatsEventSpawnedData data)
173  {
174  ScriptAnalytics.SendPlayerSpawned(data);
175  }
176 }
SendPlayerDeath
class StatsEventData SendPlayerDeath(StatsEventDeathData data)
send event about death to statistic DB
SendEvent
void SendEvent(float time)
Definition: playersoundeventbase.c:151
map
map
Definition: controlsxboxnew.c:3
vector
Definition: enconvert.c:105
Analytics
Definition: scriptanalytics.c:145
StatsEventScoredKillData
Definition: scriptanalytics.c:49
StatsEventData
Definition: scriptanalytics.c:76
StatsEventDisconnectedData
Definition: scriptanalytics.c:59
StatsEventSpawnedData
Definition: scriptanalytics.c:66
StatsEventDeathData
Definition: scriptanalytics.c:36
StatsEventMeasuresData
Definition: scriptanalytics.c:2