DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл PluginRemotePlayerDebugClient.c

См. исходные тексты.

Перечисления

enum  eRemoteDebugType { NONE , DAMAGE_ONLY , ALL }
 

Функции

override void OnInit ()
 
override void OnUpdate (float delta_time)
 
void InitWidgets ()
 
void EnableWidgets (bool enable)
 
void UpdateWidgetsStats ()
 
void UpdateDamageWidget (int index, PlayerBase player)
 
void UpdateDistanceWidget (int index, PlayerBase other_player)
 
void UpdateStatsWidget (int index, RemotePlayerStatDebug rpd)
 
void RequestPlayerInfo (PlayerBase player, int type)
 
void MergeDamage (array< ref RemotePlayerDamageDebug > delta)
 
void DebugDamage (PlayerBase player)
 
void OnRPC (ParamsReadContext ctx)
 

Переменные

enum eRemoteDebugType MAX_SIMULTANIOUS_PLAYERS = 10
 
ref array< ref RemotePlayerStatDebugm_PlayerDebugStats = new array<ref RemotePlayerStatDebug>
 
ref map< PlayerBase, ref RemotePlayerDamageDebugm_PlayerDebugDamage = new map<PlayerBase,ref RemotePlayerDamageDebug>
 
ref Widget m_RootWidget [MAX_SIMULTANIOUS_PLAYERS]
 
ref Widget m_RootWidgetDamage [MAX_SIMULTANIOUS_PLAYERS]
 
ref TextListboxWidget m_StatListWidgets [MAX_SIMULTANIOUS_PLAYERS]
 
ref TextListboxWidget m_DamageListWidgets [MAX_SIMULTANIOUS_PLAYERS]
 
ref TextWidget m_DistanceWidget [MAX_SIMULTANIOUS_PLAYERS]
 
eRemoteDebugType m_DebugType
 

Перечисления

◆ eRemoteDebugType

Элементы перечислений
NONE 
DAMAGE_ONLY 
ALL 
2{
3 NONE,
5 ALL,
6}
@ DAMAGE_ONLY
Definition PluginRemotePlayerDebugClient.c:4
@ ALL
Definition PluginRemotePlayerDebugClient.c:5
@ NONE
Definition PluginRemotePlayerDebugClient.c:3

Функции

◆ DebugDamage()

void DebugDamage ( PlayerBase player)
199 {
200 for (int i = 0; i < m_PlayerDebugStats.Count(); i++)
201 {
202 player = m_PlayerDebugStats.Get(i).GetPlayer();
203
204 PrintString("player:" + player.ToString() );
205 m_PlayerDebugStats.Get(i).Debug();
206 PrintString("-------------------------------------");
207 }
208
209 for (i = 0; i < m_PlayerDebugDamage.Count(); i++)
210 {
211 PrintString("-------------------------------------");
212 if( m_PlayerDebugDamage.GetElement(i) ) m_PlayerDebugDamage.GetElement(i).Debug();
213 PrintString("-------------------------------------");
214 }
215
216 for (i = 0; i < m_PlayerDebugDamage.Count();i++)
217 {
218 PrintString("------------Debug Damage Start--------------");
221 obj.Debug();
222 PrintString("-------------Debug Damage End-------------");
223 }
224 }
ref map< PlayerBase, ref RemotePlayerDamageDebug > m_PlayerDebugDamage
Definition PluginRemotePlayerDebugClient.c:12
ref array< ref RemotePlayerStatDebug > m_PlayerDebugStats
Definition PluginRemotePlayerDebugClient.c:11
Definition EntityAI.c:95
Definition PlayerBaseClient.c:2
Definition RemotePlayerDamageDebug.c:2
void Debug()
Definition RemotePlayerDamageDebug.c:63
void PrintString(string s)
Helper for printing out string expression. Example: PrintString("Hello " + var);.
Definition EnScript.c:345

Перекрестные ссылки RemotePlayerDamageDebug::Debug(), m_PlayerDebugDamage, m_PlayerDebugStats и PrintString().

◆ EnableWidgets()

void EnableWidgets ( bool enable)
48 {
49 for (int i = 0; i < MAX_SIMULTANIOUS_PLAYERS; ++i)
50 {
51 m_RootWidget[i].Show(enable);
53 }
54 }
ref Widget m_RootWidget[MAX_SIMULTANIOUS_PLAYERS]
Definition PluginRemotePlayerDebugClient.c:14
enum eRemoteDebugType MAX_SIMULTANIOUS_PLAYERS
ref Widget m_RootWidgetDamage[MAX_SIMULTANIOUS_PLAYERS]
Definition PluginRemotePlayerDebugClient.c:15

Перекрестные ссылки m_RootWidget, m_RootWidgetDamage и MAX_SIMULTANIOUS_PLAYERS.

Используется в RequestPlayerInfo().

◆ InitWidgets()

void InitWidgets ( )
36 {
37 for (int i = 0; i < MAX_SIMULTANIOUS_PLAYERS; ++i)
38 {
39 m_RootWidget[i] = GetGame().GetWorkspace().CreateWidgets("gui/layouts/debug/day_z_debug_remoteinfo.layout");
40 m_RootWidgetDamage[i] = GetGame().GetWorkspace().CreateWidgets("gui/layouts/debug/day_z_debug_remoteinfo_damage.layout");
42 m_StatListWidgets[i] = TextListboxWidget.Cast(m_RootWidget[i].FindAnyWidget("TextListboxWidget0"));
44 }
45 }
ref TextWidget m_DistanceWidget[MAX_SIMULTANIOUS_PLAYERS]
Definition PluginRemotePlayerDebugClient.c:18
ref TextListboxWidget m_StatListWidgets[MAX_SIMULTANIOUS_PLAYERS]
Definition PluginRemotePlayerDebugClient.c:16
ref TextListboxWidget m_DamageListWidgets[MAX_SIMULTANIOUS_PLAYERS]
Definition PluginRemotePlayerDebugClient.c:17
Definition EnWidgets.c:220
proto native CGame GetGame()
proto native Widget FindAnyWidget(string pathname)

Перекрестные ссылки FindAnyWidget(), GetGame(), m_DamageListWidgets, m_DistanceWidget, m_RootWidget, m_RootWidgetDamage, m_StatListWidgets и MAX_SIMULTANIOUS_PLAYERS.

Используется в OnInit().

◆ MergeDamage()

void MergeDamage ( array< ref RemotePlayerDamageDebug > delta)
169 {
171 {
172 PlayerBase playerDelta = valueDelta.GetPlayer();
173
174 if ( m_PlayerDebugDamage.Contains(null) )
175 {
176 //cleans up garbage
178 }
179
180 if ( m_PlayerDebugDamage.Contains(playerDelta) )
181 {
184 valueDelta.GetReversed(damageList);
185
186 foreach (DamageData data : damageList)
187 {
188 valueLocal.InsertDamageObject( data );
189 }
190 }
191 else
192 {
194 }
195 }
196 }
Definition DamageData.c:2

Перекрестные ссылки m_PlayerDebugDamage.

Используется в OnRPC().

◆ OnInit()

override void OnInit ( )
22 {
23 #ifndef NO_GUI
25 #endif
26 }
void InitWidgets()
Definition PluginRemotePlayerDebugClient.c:35

Перекрестные ссылки InitWidgets().

◆ OnRPC()

void OnRPC ( ParamsReadContext ctx)
227 {
229
231
232 ctx.Read(player_damage);
234 for (int x = 0; x < player_damage.Count(); x++)
235 {
237 if (value)
238 {
239 player = value.GetPlayer();
240 PrintString("debug damage: "+x.ToString() + "," + player.ToString());
241 value.Debug();
242
243 int xs = 1 + 1;
244 }
245 }
246
247 if (player_damage.Count() > 0 ) MergeDamage(player_damage);
248 }
Icon x
void MergeDamage(array< ref RemotePlayerDamageDebug > delta)
Definition PluginRemotePlayerDebugClient.c:168

Перекрестные ссылки m_PlayerDebugStats, MergeDamage(), PrintString() и x.

◆ OnUpdate()

override void OnUpdate ( float delta_time)
29 {
30 #ifndef NO_GUI
32 #endif
33 }
eRemoteDebugType m_DebugType
Definition PluginRemotePlayerDebugClient.c:19
void UpdateWidgetsStats()
Definition PluginRemotePlayerDebugClient.c:56

Перекрестные ссылки m_DebugType и UpdateWidgetsStats().

◆ RequestPlayerInfo()

void RequestPlayerInfo ( PlayerBase player,
int type )
149 {
150#ifdef DIAG_DEVELOPER
151 if (type == 0)
152 {
153 EnableWidgets(false);
154 }
155 /*
156 else
157 {
158 EnableWidgets(true);
159 }
160 */
161 ScriptRPC rpc = new ScriptRPC();
162 m_DebugType = type;
163 rpc.Write(type);
164 rpc.Send( player, ERPCs.DEV_PLAYER_DEBUG_REQUEST, true, player.GetIdentity() );
165#endif
166 }
ERPCs
Definition ERPCs.c:2
void EnableWidgets(bool enable)
Definition PluginRemotePlayerDebugClient.c:47
Definition gameplay.c:105

Перекрестные ссылки EnableWidgets() и m_DebugType.

◆ UpdateDamageWidget()

void UpdateDamageWidget ( int index,
PlayerBase player )
97 {
99 if (m_PlayerDebugDamage.Contains(player))
100 {
102 value.GetReversed(damage_list);
103
104 m_DamageListWidgets[index].ClearItems();
105 if (damage_list.Count() > 0)
106 {
107 m_DamageListWidgets[index].Show(true);
108 for (int i = 0; i < damage_list.Count(); ++i)
109 {
111 float value_global = data.GetValueGlobal();
112 float value_blood = data.GetValueBlood();
113 float value_shock = data.GetValueShock();
114
115 m_DamageListWidgets[index].AddItem( value_global.ToString(), null, 0, i );
116 m_DamageListWidgets[index].SetItem( i, value_blood.ToString(), null, 1 );
117 m_DamageListWidgets[index].SetItem( i, value_shock.ToString(), null, 2 );
118 }
119 }
120 else
121 {
122 m_DamageListWidgets[index].Show(false);
123 }
124 }
125 }

Перекрестные ссылки m_DamageListWidgets и m_PlayerDebugDamage.

Используется в UpdateWidgetsStats().

◆ UpdateDistanceWidget()

void UpdateDistanceWidget ( int index,
PlayerBase other_player )
128 {
129 float distance = vector.Distance(GetGame().GetCurrentCameraPosition(), other_player.GetPosition());
130 m_DistanceWidget[index].SetText(distance.ToString() + "m");
131 }
Definition EnConvert.c:106
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.

Перекрестные ссылки vector::Distance(), GetGame() и m_DistanceWidget.

Используется в UpdateWidgetsStats().

◆ UpdateStatsWidget()

void UpdateStatsWidget ( int index,
RemotePlayerStatDebug rpd )
134 {
137 rpd.SerializeNames(names, m_DebugType);
138 rpd.SerializeValues(values,m_DebugType);
139 m_StatListWidgets[index].ClearItems();
140
141 for (int i = 0; i < names.Count(); ++i)
142 {
143 m_StatListWidgets[index].AddItem( names.Get(i), null, 0, i );
144 m_StatListWidgets[index].SetItem( i, values.Get(i), null, 1 );
145 }
146 }

Перекрестные ссылки m_DebugType и m_StatListWidgets.

Используется в UpdateWidgetsStats().

◆ UpdateWidgetsStats()

void UpdateWidgetsStats ( )
57 {
58 int i = 0;
59 for (; i < m_PlayerDebugStats.Count(); ++i)
60 {
62 PlayerBase player = rpd.GetPlayer();
63
64 if (player)
65 {
66 vector pos = player.GetPosition();
67 vector screen_pos_stats = GetGame().GetScreenPos(pos + "0 0 0");
68 vector screen_pos_damage = GetGame().GetScreenPos(pos + "0 2 0");
71
72 if (screen_pos_stats[2] > 0 && screen_pos_stats[0] > 0 && screen_pos_stats[1] > 0)
73 {
74 m_RootWidget[i].Show(true);
75 m_RootWidgetDamage[i].Show(true);
79 }
80 else
81 {
82 m_RootWidget[i].Show(false);
83 m_RootWidgetDamage[i].Show(false);
84 }
85
86 }
87 }
88 for (; i < MAX_SIMULTANIOUS_PLAYERS; ++i)
89 {
90 m_RootWidget[i].Show(false);
91 m_RootWidgetDamage[i].Show(false);
92 }
93 }
void UpdateDistanceWidget(int index, PlayerBase other_player)
Definition PluginRemotePlayerDebugClient.c:127
void UpdateStatsWidget(int index, RemotePlayerStatDebug rpd)
Definition PluginRemotePlayerDebugClient.c:133
void UpdateDamageWidget(int index, PlayerBase player)
Definition PluginRemotePlayerDebugClient.c:96
void RemotePlayerStatDebug(PlayerBase player)
Definition RemotePlayerStatDebug.c:16

Перекрестные ссылки GetGame(), m_PlayerDebugStats, m_RootWidget, m_RootWidgetDamage, MAX_SIMULTANIOUS_PLAYERS, RemotePlayerStatDebug(), UpdateDamageWidget(), UpdateDistanceWidget() и UpdateStatsWidget().

Используется в OnUpdate().

Переменные

◆ m_DamageListWidgets

Используется в InitWidgets() и UpdateDamageWidget().

◆ m_DebugType

eRemoteDebugType m_DebugType

Используется в OnUpdate(), RequestPlayerInfo() и UpdateStatsWidget().

◆ m_DistanceWidget

◆ m_PlayerDebugDamage

◆ m_PlayerDebugStats

◆ m_RootWidget

◆ m_RootWidgetDamage

ref Widget m_RootWidgetDamage[MAX_SIMULTANIOUS_PLAYERS]

Используется в EnableWidgets(), InitWidgets() и UpdateWidgetsStats().

◆ m_StatListWidgets

◆ MAX_SIMULTANIOUS_PLAYERS

enum eRemoteDebugType MAX_SIMULTANIOUS_PLAYERS = 10

Используется в EnableWidgets(), InitWidgets() и UpdateWidgetsStats().