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

Private Member Functions

void DebugMonitorValues (PlayerBase player)
 
void Init ()
 
void OnScheduledTick (float deltatime)
 
void CheckValues ()
 
float GetBlood ()
 
float GetHealth ()
 
string GetLastDamage ()
 
void SetLastDamage (string value)
 
void CheckHealth ()
 
void CheckBlood ()
 
void CheckLastDamage ()
 
void SendValue (int value_type, Param param)
 
void ReceiveValue (int value_type, Param param)
 
void OnRPCFloat (ParamsReadContext ctx)
 
void OnRPCString (ParamsReadContext ctx)
 

Private Attributes

const int TYPE_HEALTH = 1
 
const int TYPE_BLOOD = 2
 
const int TYPE_BODY_TEMP = 3
 
const int TYPE_POSITION = 4
 
const int TYPE_LAST_DAMAGE = 5
 
const int LAST_DAMAGE_FALL = 1
 
const int LAST_DAMAGE_HIT = 2
 
const float VALUE_CHECK_INTERVAL = 1
 
const float SENSITIVTY_PERCENTAGE = 1
 
PlayerBase m_Player
 
float m_TimeSinceLastTick = VALUE_CHECK_INTERVAL + 1
 
string m_CurrentLastDamage
 
float m_LastHealthUpdate
 
float m_LastBloodUpdate
 
string m_lastDamageUpdate
 
float m_HealthMaxValue
 
float m_BloodMaxValue
 
float m_BloodClient
 
float m_HealthClient
 
string m_LastDamageClient
 

Detailed Description

Definition at line 1 of file DebugMonitorValues.c.

Constructor & Destructor Documentation

◆ DebugMonitorValues()

void DebugMonitorValues::DebugMonitorValues ( PlayerBase player)
inlineprivate

Definition at line 31 of file DebugMonitorValues.c.

32 {
34 Init();
35 }

References Init(), and m_Player.

Member Function Documentation

◆ CheckBlood()

void DebugMonitorValues::CheckBlood ( )
inlineprivate

Definition at line 100 of file DebugMonitorValues.c.

101 {
102 float blood_current = m_Player.GetHealth("", "Blood");
106
107 if (diff_abs > (SENSITIVTY_PERCENTAGE / 100))
108 {
110
113 }
114 }
void SendValue(int value_type, Param param)
const float SENSITIVTY_PERCENTAGE
Definition EnMath.c:7
static proto float AbsFloat(float f)
Returns absolute value.

References Math::AbsFloat(), m_BloodMaxValue, m_LastBloodUpdate, m_Player, SendValue(), SENSITIVTY_PERCENTAGE, and TYPE_BLOOD.

Referenced by CheckValues().

◆ CheckHealth()

◆ CheckLastDamage()

void DebugMonitorValues::CheckLastDamage ( )
inlineprivate

◆ CheckValues()

void DebugMonitorValues::CheckValues ( )
inlineprivate

Definition at line 57 of file DebugMonitorValues.c.

References CheckBlood(), CheckHealth(), and CheckLastDamage().

Referenced by OnScheduledTick().

◆ GetBlood()

float DebugMonitorValues::GetBlood ( )
inlineprivate

Definition at line 64 of file DebugMonitorValues.c.

65 {
66 return m_BloodClient;
67 }

References m_BloodClient.

◆ GetHealth()

float DebugMonitorValues::GetHealth ( )
inlineprivate

Definition at line 69 of file DebugMonitorValues.c.

70 {
71 return m_HealthClient;
72 }

References m_HealthClient.

◆ GetLastDamage()

string DebugMonitorValues::GetLastDamage ( )
inlineprivate

Definition at line 74 of file DebugMonitorValues.c.

75 {
76 return m_LastDamageClient;
77 }

References m_LastDamageClient.

◆ Init()

void DebugMonitorValues::Init ( )
inlineprivate

Definition at line 37 of file DebugMonitorValues.c.

38 {
39 m_HealthMaxValue = m_Player.GetMaxHealth("", "Health");
40 m_BloodMaxValue = m_Player.GetMaxHealth("", "Blood");
41 }

References m_BloodMaxValue, m_HealthMaxValue, and m_Player.

Referenced by DebugMonitorValues().

◆ OnRPCFloat()

void DebugMonitorValues::OnRPCFloat ( ParamsReadContext ctx)
inlineprivate

Definition at line 184 of file DebugMonitorValues.c.

185 {
187
191
193 }
static ref Param2< int, float > PARAM2_INT_FLOAT
void ReceiveValue(int value_type, Param param)

References CachedObjectsParams::PARAM2_INT_FLOAT, and ReceiveValue().

◆ OnRPCString()

void DebugMonitorValues::OnRPCString ( ParamsReadContext ctx)
inlineprivate

Definition at line 195 of file DebugMonitorValues.c.

196 {
198
202
204 }
static ref Param2< int, string > PARAM2_INT_STRING

References CachedObjectsParams::PARAM2_INT_STRING, and ReceiveValue().

◆ OnScheduledTick()

void DebugMonitorValues::OnScheduledTick ( float deltatime)
inlineprivate

Definition at line 43 of file DebugMonitorValues.c.

44 {
45 if (GetGame().IsClient()) return;
46 if (!GetGame().IsDebugMonitor()) return; // turned off in server config
47
49
51 {
54 }
55 }
const float VALUE_CHECK_INTERVAL
proto native CGame GetGame()

References CheckValues(), GetGame(), m_TimeSinceLastTick, and VALUE_CHECK_INTERVAL.

◆ ReceiveValue()

void DebugMonitorValues::ReceiveValue ( int value_type,
Param param )
inlineprivate

Definition at line 154 of file DebugMonitorValues.c.

155 {
156 GetGame().GetMission().CreateDebugMonitor();
157
158 switch (value_type)
159 {
161 {
163 //Print("ReceivedValue health " + valueHealth.param1.ToString());
165 }
166 break;
168 {
170 //Print("ReceivedValue blood " + valueBlood.param1.ToString());
171 m_BloodClient = valueBlood.param1;
172 }
173 break;
175 {
177 //Print("ReceivedValue lastdamage " + valueLastDamage.param1);
179 }
180 break;
181 }
182 }

References GetGame(), m_BloodClient, m_HealthClient, m_LastDamageClient, TYPE_BLOOD, TYPE_HEALTH, and TYPE_LAST_DAMAGE.

Referenced by OnRPCFloat(), and OnRPCString().

◆ SendValue()

void DebugMonitorValues::SendValue ( int value_type,
Param param )
inlineprivate

Definition at line 126 of file DebugMonitorValues.c.

127 {
128 switch (value_type)
129 {
132 {
134
137 //Print("SendingValue type " + value_type.ToString() + " value " + value_float.ToString());
138 GetGame().RPCSingleParam(m_Player, ERPCs.RPC_DEBUG_MONITOR_FLT, CachedObjectsParams.PARAM2_INT_FLOAT, true, m_Player.GetIdentity());
139 }
140 break;
142 {
144
147 //Print("SendingValue type " + value_type.ToString() + " value " + value_string);
148 GetGame().RPCSingleParam(m_Player, ERPCs.RPC_DEBUG_MONITOR_STR, CachedObjectsParams.PARAM2_INT_STRING, true, m_Player.GetIdentity());
149 }
150 break;
151 }
152 }
ERPCs
Definition ERPCs.c:2

References GetGame(), m_Player, CachedObjectsParams::PARAM2_INT_FLOAT, CachedObjectsParams::PARAM2_INT_STRING, TYPE_BLOOD, TYPE_HEALTH, and TYPE_LAST_DAMAGE.

Referenced by CheckBlood(), CheckHealth(), and CheckLastDamage().

◆ SetLastDamage()

void DebugMonitorValues::SetLastDamage ( string value)
inlineprivate

Definition at line 79 of file DebugMonitorValues.c.

80 {
82 }

References m_CurrentLastDamage.

Member Data Documentation

◆ LAST_DAMAGE_FALL

const int DebugMonitorValues::LAST_DAMAGE_FALL = 1
private

Definition at line 9 of file DebugMonitorValues.c.

◆ LAST_DAMAGE_HIT

const int DebugMonitorValues::LAST_DAMAGE_HIT = 2
private

Definition at line 10 of file DebugMonitorValues.c.

◆ m_BloodClient

float DebugMonitorValues::m_BloodClient
private

Definition at line 27 of file DebugMonitorValues.c.

Referenced by GetBlood(), and ReceiveValue().

◆ m_BloodMaxValue

float DebugMonitorValues::m_BloodMaxValue
private

Definition at line 25 of file DebugMonitorValues.c.

Referenced by CheckBlood(), and Init().

◆ m_CurrentLastDamage

string DebugMonitorValues::m_CurrentLastDamage
private

Definition at line 18 of file DebugMonitorValues.c.

Referenced by CheckLastDamage(), and SetLastDamage().

◆ m_HealthClient

float DebugMonitorValues::m_HealthClient
private

Definition at line 28 of file DebugMonitorValues.c.

Referenced by GetHealth(), and ReceiveValue().

◆ m_HealthMaxValue

float DebugMonitorValues::m_HealthMaxValue
private

Definition at line 24 of file DebugMonitorValues.c.

Referenced by CheckHealth(), and Init().

◆ m_LastBloodUpdate

float DebugMonitorValues::m_LastBloodUpdate
private

Definition at line 21 of file DebugMonitorValues.c.

Referenced by CheckBlood().

◆ m_LastDamageClient

string DebugMonitorValues::m_LastDamageClient
private

Definition at line 29 of file DebugMonitorValues.c.

Referenced by GetLastDamage(), and ReceiveValue().

◆ m_lastDamageUpdate

string DebugMonitorValues::m_lastDamageUpdate
private

Definition at line 22 of file DebugMonitorValues.c.

Referenced by CheckLastDamage().

◆ m_LastHealthUpdate

float DebugMonitorValues::m_LastHealthUpdate
private

Definition at line 20 of file DebugMonitorValues.c.

Referenced by CheckHealth().

◆ m_Player

PlayerBase DebugMonitorValues::m_Player
private

Definition at line 15 of file DebugMonitorValues.c.

Referenced by CheckBlood(), CheckHealth(), DebugMonitorValues(), Init(), and SendValue().

◆ m_TimeSinceLastTick

float DebugMonitorValues::m_TimeSinceLastTick = VALUE_CHECK_INTERVAL + 1
private

Definition at line 16 of file DebugMonitorValues.c.

Referenced by OnScheduledTick().

◆ SENSITIVTY_PERCENTAGE

const float DebugMonitorValues::SENSITIVTY_PERCENTAGE = 1
private

Definition at line 13 of file DebugMonitorValues.c.

Referenced by CheckBlood(), and CheckHealth().

◆ TYPE_BLOOD

const int DebugMonitorValues::TYPE_BLOOD = 2
private

Definition at line 4 of file DebugMonitorValues.c.

Referenced by CheckBlood(), ReceiveValue(), and SendValue().

◆ TYPE_BODY_TEMP

const int DebugMonitorValues::TYPE_BODY_TEMP = 3
private

Definition at line 5 of file DebugMonitorValues.c.

◆ TYPE_HEALTH

const int DebugMonitorValues::TYPE_HEALTH = 1
private

Definition at line 3 of file DebugMonitorValues.c.

Referenced by CheckHealth(), ReceiveValue(), and SendValue().

◆ TYPE_LAST_DAMAGE

const int DebugMonitorValues::TYPE_LAST_DAMAGE = 5
private

Definition at line 7 of file DebugMonitorValues.c.

Referenced by CheckLastDamage(), ReceiveValue(), and SendValue().

◆ TYPE_POSITION

const int DebugMonitorValues::TYPE_POSITION = 4
private

Definition at line 6 of file DebugMonitorValues.c.

◆ VALUE_CHECK_INTERVAL

const float DebugMonitorValues::VALUE_CHECK_INTERVAL = 1
private

Definition at line 12 of file DebugMonitorValues.c.

Referenced by OnScheduledTick().


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