DayZ 1.24
Loading...
Searching...
No Matches
AnalyticsManagerClient Class Reference
Collaboration diagram for AnalyticsManagerClient:
[legend]

Private Member Functions

void RegisterEvents ()
 
void UnregisterEvents ()
 
void OnActionEat ()
 
void OnActionDrink ()
 
void OnActionCookedSteak ()
 
void OnActionFinishedShaveSelf ()
 
void OnActionFinishedGutDeer ()
 
void OnActionRestrain ()
 
void OnActionBandageTarget ()
 
void OnItemAttachedAtPlayer (EntityAI item, string slot_name)
 
void Event_OnPlayerIgnitedFireplace (EFireIgniteType ignite_type)
 
void Event_OnEntityKilled (EntityAI victim, EntityAI killer, EntityAI source, bool is_headshot)
 

Static Private Attributes

static const int GEAR_COUNT = 3
 
static string m_FullGear [GEAR_COUNT] = {"Shoulder", "Melee", "Back"}
 

Detailed Description

Definition at line 1 of file AnalyticsManagerClient.c.

Member Function Documentation

◆ Event_OnEntityKilled()

void AnalyticsManagerClient::Event_OnEntityKilled ( EntityAI victim,
EntityAI killer,
EntityAI source,
bool is_headshot )
inlineprivate

Definition at line 169 of file AnalyticsManagerClient.c.

170 {
171 if (killer != null && killer.IsPlayer() && killer.GetID() == GetGame().GetPlayer().GetID())
173 }
int GetID()
Get the ID registered in SEffectManager.
Definition Effect.c:517
PlayerBase GetPlayer()
static void OnPlayerKilled(EntityAI victim, EntityAI killer, EntityAI source, bool is_headshot)
proto native CGame GetGame()

References GetGame(), GetID(), GetPlayer(), and Achievements::OnPlayerKilled().

Referenced by RegisterEvents(), and UnregisterEvents().

◆ Event_OnPlayerIgnitedFireplace()

void AnalyticsManagerClient::Event_OnPlayerIgnitedFireplace ( EFireIgniteType ignite_type)
inlineprivate

Definition at line 144 of file AnalyticsManagerClient.c.

145 {
146 switch (ignite_type)
147 {
148 case EFireIgniteType.Matchbox:
149 {
151 break;
152 }
153 case EFireIgniteType.Roadflare:
154 {
156 break;
157 }
158 case EFireIgniteType.HandDrill:
159 {
161 break;
162 }
163 }
164 }
EFireIgniteType
static void OnActionIgniteRoadflare()
static void OnActionIgniteMatchbox()
static void OnActionIgniteDrill()

References Achievements::OnActionIgniteDrill(), Achievements::OnActionIgniteMatchbox(), and Achievements::OnActionIgniteRoadflare().

Referenced by RegisterEvents(), and UnregisterEvents().

◆ OnActionBandageTarget()

void AnalyticsManagerClient::OnActionBandageTarget ( )
inlineprivate

Definition at line 69 of file AnalyticsManagerClient.c.

70 {
72 }
static void OnActionMedsSurvivor()

References Achievements::OnActionMedsSurvivor().

◆ OnActionCookedSteak()

void AnalyticsManagerClient::OnActionCookedSteak ( )
inlineprivate

Definition at line 37 of file AnalyticsManagerClient.c.

38 {
40 }
static void OnCookedSteak()

References Achievements::OnCookedSteak().

◆ OnActionDrink()

void AnalyticsManagerClient::OnActionDrink ( )
inlineprivate

Definition at line 29 of file AnalyticsManagerClient.c.

30 {
32 }
static void OnActionDrink()

References Achievements::OnActionDrink().

◆ OnActionEat()

void AnalyticsManagerClient::OnActionEat ( )
inlineprivate

Definition at line 21 of file AnalyticsManagerClient.c.

22 {
24 }
static void OnActionEat()

References Achievements::OnActionEat().

◆ OnActionFinishedGutDeer()

void AnalyticsManagerClient::OnActionFinishedGutDeer ( )
inlineprivate

Definition at line 53 of file AnalyticsManagerClient.c.

54 {
56 }
static void OnActionGutDeer()

References Achievements::OnActionGutDeer().

◆ OnActionFinishedShaveSelf()

void AnalyticsManagerClient::OnActionFinishedShaveSelf ( )
inlineprivate

Definition at line 45 of file AnalyticsManagerClient.c.

46 {
48 }
static void OnActionShave()

References Achievements::OnActionShave().

◆ OnActionRestrain()

void AnalyticsManagerClient::OnActionRestrain ( )
inlineprivate

Definition at line 61 of file AnalyticsManagerClient.c.

62 {
64 }
static void OnActionHandcuff()

References Achievements::OnActionHandcuff().

◆ OnItemAttachedAtPlayer()

void AnalyticsManagerClient::OnItemAttachedAtPlayer ( EntityAI item,
string slot_name )
inlineprivate

Definition at line 77 of file AnalyticsManagerClient.c.

78 {
79 bool weapon_present;
80 bool melee_present;
83
84 if (GetDayZGame().GetGameState() != DayZGameState.IN_GAME)
85 return;
86
87 Man player = GetGame().GetPlayer();
88 if (!player)
89 return;
90
91 inventory = player.GetHumanInventory();
92
93 if (player && inventory)
94 {
95 for (int i = 0; i < GEAR_COUNT; ++i)
96 {
98 EntityAI att_item = inventory.FindAttachment(slot_id); // Boris V [27.2.2019]: Consider using player.GetItemOnSlot(m_FullGear[i]) instead.
99
100 if (!att_item)
101 {
102 //Print("index: "+ i +" slot_id: "+ slot_id +" = "+ att_item + " EMPTY");
103 continue;
104 }
105
106 //checks for firearm
107 if (att_item.IsWeapon())
108 weapon_present = true;
109 //checks for melee weapon
110 else if (!att_item.IsWeapon() && att_item.GetInventory().HasInventorySlot(InventorySlots.GetSlotIdFromString("Melee")))
111 melee_present = true;
112 //checks for backpack
113 else if (!att_item.IsWeapon() && att_item.GetInventory().HasInventorySlot(InventorySlots.GetSlotIdFromString("Back")))
114 backpack_present = true;
115 //Print("index: "+ i +" slot_id: "+ slot_id +" = "+ att_item + " ATTACHED");
116 }
117
118 //separate check for hand slot; TODO remove duplicates
119 att_item = inventory.GetEntityInHands();
120 if (att_item)
121 {
122 //checks for firearm
123 if (att_item.IsWeapon())
124 weapon_present = true;
125 //checks for melee weapon
126 else if (!att_item.IsWeapon() && att_item.GetInventory().HasInventorySlot(InventorySlots.GetSlotIdFromString("Melee")))
127 melee_present = true;
128 //checks for backpack
129 else if (!att_item.IsWeapon() && att_item.GetInventory().HasInventorySlot(InventorySlots.GetSlotIdFromString("Back")))
130 backpack_present = true;
131 }
132
134 {
135 //Print("---EAchievementActionId.ACTION_EQUIP_GEAR");
137 }
138 }
139 }
DayZGame GetDayZGame()
Definition DayZGame.c:3530
static void OnEquippedFullGear()
static string m_FullGear[GEAR_COUNT]
inventory for plain man/human
provides access to slot configuration
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id

References GEAR_COUNT, GetDayZGame(), GetGame(), InventorySlots::GetSlotIdFromString(), m_FullGear, and Achievements::OnEquippedFullGear().

◆ RegisterEvents()

void AnalyticsManagerClient::RegisterEvents ( )
inlineprivate

Definition at line 6 of file AnalyticsManagerClient.c.

7 {
10 }
void Event_OnEntityKilled(EntityAI victim, EntityAI killer, EntityAI source, bool is_headshot)
void Event_OnPlayerIgnitedFireplace(EFireIgniteType ignite_type)
static ref ScriptInvoker SyncEvent_OnPlayerIgnitedFireplace
Definition ClientData.c:5
static ref ScriptInvoker SyncEvent_OnEntityKilled
Definition ClientData.c:4

References Event_OnEntityKilled(), Event_OnPlayerIgnitedFireplace(), ClientData::SyncEvent_OnEntityKilled, and ClientData::SyncEvent_OnPlayerIgnitedFireplace.

◆ UnregisterEvents()

Member Data Documentation

◆ GEAR_COUNT

const int AnalyticsManagerClient::GEAR_COUNT = 3
staticprivate

Definition at line 3 of file AnalyticsManagerClient.c.

Referenced by OnItemAttachedAtPlayer().

◆ m_FullGear

string AnalyticsManagerClient::m_FullGear[GEAR_COUNT] = {"Shoulder", "Melee", "Back"}
staticprivate

Definition at line 4 of file AnalyticsManagerClient.c.

4{"Shoulder", "Melee", "Back"};

Referenced by OnItemAttachedAtPlayer().


The documentation for this class was generated from the following file: