DayZ 1.24
Loading...
Searching...
No Matches
PluginRemotePlayerDebugServer.c
Go to the documentation of this file.
2{
4
7 float m_AccuTime;
8 const int INTERVAL = 1;
9
12
13 override void OnUpdate(float delta_time)
14 {
15#ifdef SERVER
16 if (m_ClientList.Count() != 0)
17 {
18 m_AccuTime += delta_time;
19
20 if (m_AccuTime > INTERVAL)
21 {
22 m_AccuTime = 0;
23 SendDebug();
24 }
25 }
26#endif
27 }
28
30 {
31 m_Watching = enable;
32 }
33
35 {
36 return m_Watching;
37 }
38
40 {
42 GetGame().GetPlayers(players);
43 m_PlayerDebugStats.Clear();
44
45 foreach (Man playerMan : players)
46 {
49 m_PlayerDebugStats.Insert(rpd);
50 }
51 }
52
53 void SendDebug()
54 {
55#ifdef DIAG_DEVELOPER
56 GatherPlayerInfo();
58
59 for (int i = 0; i < m_ClientList.Count(); ++i)
60 {
61 PlayerBase player = m_ClientList[i];
62 if (player)
63 {
64 ScriptRPC rpc = new ScriptRPC();
66
68 {
69 if (player2)
70 player_damage.Insert(value);
71
72 //int xs = 1 + 1;
73 }
74
75 rpc.Write(player_damage);
76
77 rpc.Send(player, ERPCs.DEV_PLAYER_DEBUG_DATA, true, player.GetIdentity());
78 m_PlayerDebugDamage.Clear();
79 }
80 else
81 {
82 m_ClientList.Remove(i);
83 --i;
84 }
85 }
86#endif
87 }
88
89
91 {
92 if (!GetWatching() || !damageResult)
93 return;
94
95 float damage_global = damageResult.GetDamage("", "");
96 float damage_blood = damageResult.GetDamage("", "Blood");
97 float damage_shock = damageResult.GetDamage("", "Shock");
98
99 if (m_PlayerDebugDamage.Contains(player))
101 else
102 {
106 }
107 }
108
109
111 {
112 int index = m_ClientList.Find(player);
113
114 if (enable)
115 {
116 m_ClientList.Insert(player);
117 SetWatching(true);
118 }
119 else if (index != -1 && m_ClientList.Count() != 0)
120 m_ClientList.Remove(index);
121
122 if (m_ClientList.Count() == 0)
123 SetWatching(false);
124 }
125
127 {
128 bool enable;
129 ctx.Read(enable);
130 OnRequestReceived(player, enable);
131 }
132}
ERPCs
Definition ERPCs.c:2
ref map< PlayerBase, ref RemotePlayerDamageDebug > m_PlayerDebugDamage
ref array< ref RemotePlayerStatDebug > m_PlayerDebugStats
void RemotePlayerStatDebug(PlayerBase player)
void OnDamageEvent(PlayerBase player, TotalDamageResult damageResult)
void SetWatching(bool enable)
void OnRPC(ParamsReadContext ctx, PlayerBase player)
void OnRequestReceived(PlayerBase player, bool enable)
eRemoteDebugType m_DebugType
override void OnUpdate(float delta_time)
Serialization general interface. Serializer API works with:
Definition Serializer.c:56
proto native CGame GetGame()