DayZ 1.24
Loading...
Searching...
No Matches
Debug.c
Go to the documentation of this file.
1// TODO:
2// 1. Alredy exist some key in array / map
3// 2. Object is null (check object & log error)
4// 3. Debug version only
5// 4. Destructor of static classes
6// 5. Debug Console Interface:
7// - Clear Log
8// - Filter
9// - Log per frame
10// 6. Per frame log ?
11// 7. Zapis do fajlu
12
13class Debug
14{
15 static private const string LOG_DEBUG = "Debug";
16 static private const string LOG_DEBUG_ACTION = "Action";
17 static private const string LOG_DEBUG_SYMPTOM = "Symptom";
18 static private const string LOG_DEBUG_INV_MOVE = "Inv Move";
19 static private const string LOG_DEBUG_INV_RESERVATION = "Inv Rrsv";
20 static private const string LOG_DEBUG_INV_HFSM = "HFSM";
21 static private const string LOG_DEBUG_QUICKBAR = "Quickbar";
22 static private const string LOG_DEBUG_BASEBUILDING = "Base Building";
23 static private const string LOG_DEBUG_BLEEDING_CHANCES = "Bleeding";
24 static private const string LOG_DEBUG_TRIGGER = "Trigger";
25 static private const string LOG_DEBUG_PARTICLE = "Particle";
26 static private const string LOG_DEBUG_TF = "TestFramework";
27 static private const string LOG_DEBUG_WEIGHT = "Weight";
28 static private const string LOG_DEBUG_MELEE = "Melee";
29 static private const string LOG_DEBUG_WEATHER = "Weather";
30
31 static private const string LOG_INFO = "Info";
32 static private const string LOG_WARNING = "Warning";
33 static private const string LOG_ERROR = "Error";
34 static private const string LOG_DEFAULT = "n/a";
35
37
40
41
43 {
44 if (!entity)
45 return "";
46
47 Object obj;
48 if (CastTo(obj, entity))
49 return obj.GetDebugNameNative();
50
51 return entity.GetDebugName();
52 }
53
54 static void InitCanvas()
55 {
57 {
58 m_DebugLayoutCanvas = GetGame().GetWorkspace().CreateWidgets("gui/layouts/debug/day_z_debugcanvas.layout");
59 m_CanvasDebug = CanvasWidget.Cast(m_DebugLayoutCanvas.FindAnyWidget("CanvasWidget"));
60 }
61 }
62
63 static void ClearCanvas()
64 {
65 if (m_CanvasDebug)
66 m_CanvasDebug.Clear();
67 }
68
69 static void CanvasDrawLine(float x1, float y1, float x2, float y2, float width, int color)
70 {
71 InitCanvas();
72 m_CanvasDebug.DrawLine(x1, y1, x2, y2, width, color);
73 }
74
86 static void CanvasDrawPoint(float x1, float y1, int color)
87 {
88 CanvasDrawLine(x1, y1, x1 + 1, y1, 1, color);
89 }
90
91 static void Init()
92 {
94 }
95
96 static void DestroyAllShapes()
97 {
98 for (int i = 0; i < m_DebugShapes.Count(); ++i)
99 {
100 if (m_DebugShapes.Get(i))
101 m_DebugShapes.Get(i).Destroy();
102 }
103
104 m_DebugShapes.Clear();
105 }
106
108 {
109 if (!shape) return;
110 for (int i = 0; i < m_DebugShapes.Count(); i++)
111 {
113
114 if (found_shape && found_shape == shape)
115 {
116 found_shape.Destroy();
117 m_DebugShapes.Remove(i); // Mandatory! Otherwise the Destroy() function causes crash!
118 shape = null;
119 return;
120 }
121 }
122 }
133 static void Log(string message = LOG_DEFAULT, string plugin = LOG_DEFAULT, string author = LOG_DEFAULT, string label = LOG_DEFAULT, string entity = LOG_DEFAULT)
134 {
136
137#ifdef LOG_TO_RPT
138 if (res.Length() > 0)
139 PrintToRPT("" + res);
140#endif
141 }
142
143 static void ActionLog(string message = LOG_DEFAULT, string plugin = LOG_DEFAULT, string author = LOG_DEFAULT, string label = LOG_DEFAULT, string entity = LOG_DEFAULT)
144 {
146
147#ifdef LOG_TO_RPT
148 if (res.Length() > 0)
149 PrintToRPT("" + res);
150#endif
151 }
152
153 static void SymptomLog(string message = LOG_DEFAULT, string plugin = LOG_DEFAULT, string author = LOG_DEFAULT, string label = LOG_DEFAULT, string entity = LOG_DEFAULT)
154 {
156
157#ifdef LOG_TO_RPT
158 if (res.Length() > 0)
159 PrintToRPT("" + res);
160#endif
161 }
162
163 static void InventoryMoveLog(string message = LOG_DEFAULT, string plugin = LOG_DEFAULT, string author = LOG_DEFAULT, string label = LOG_DEFAULT, string entity = LOG_DEFAULT)
164 {
166
167#ifdef LOG_TO_RPT
168 if (res.Length() > 0)
169 PrintToRPT("" + res);
170#endif
171 }
172
174 {
176
177#ifdef LOG_TO_RPT
178 if (res.Length() > 0)
179 PrintToRPT("" + res);
180#endif
181 }
182
183 static void InventoryHFSMLog(string message = LOG_DEFAULT, string plugin = LOG_DEFAULT, string author = LOG_DEFAULT, string label = LOG_DEFAULT, string entity = LOG_DEFAULT)
184 {
186
187#ifdef LOG_TO_RPT
188 if (res.Length() > 0)
189 PrintToRPT("" + res);
190#endif
191 }
192
193 static void QuickbarLog(string message = LOG_DEFAULT, string plugin = LOG_DEFAULT, string author = LOG_DEFAULT, string label = LOG_DEFAULT, string entity = LOG_DEFAULT)
194 {
196
197#ifdef LOG_TO_RPT
198 if (res.Length() > 0)
199 PrintToRPT("" + res);
200#endif
201 }
202
203 static void BaseBuildingLog(string message = LOG_DEFAULT, string plugin = LOG_DEFAULT, string author = LOG_DEFAULT, string label = LOG_DEFAULT, string entity = LOG_DEFAULT)
204 {
206
207#ifdef LOG_TO_RPT
208 if (res.Length() > 0)
209 PrintToRPT("" + res);
210#endif
211 }
212
213 static void BleedingChancesLog(string message = LOG_DEFAULT, string plugin = LOG_DEFAULT, string author = LOG_DEFAULT, string label = LOG_DEFAULT, string entity = LOG_DEFAULT)
214 {
216
217#ifdef LOG_TO_RPT
218 if (res.Length() > 0)
219 PrintToRPT("" + res);
220#endif
221 }
222
223 static void TriggerLog(string message = LOG_DEFAULT, string plugin = LOG_DEFAULT, string author = LOG_DEFAULT, string label = LOG_DEFAULT, string entity = LOG_DEFAULT)
224 {
226
227#ifdef LOG_TO_RPT
228 if (res.Length() > 0)
229 PrintToRPT("" + res);
230#endif
231 }
232
233 static void ParticleLog(string message = LOG_DEFAULT, Managed caller = null, string function = "", Managed entity = null)
234 {
236
237#ifdef LOG_TO_RPT
238 if (res.Length() > 0)
239 PrintToRPT("" + res);
240#endif
241 }
242
243 static void TFLog(string message = LOG_DEFAULT, TestFramework caller = null, string function = "")
244 {
246
247#ifdef LOG_TO_RPT
248 if (res.Length() > 0)
249 PrintToRPT("" + res);
250#endif
251 }
252
253 static void WeightLog(string message = LOG_DEFAULT, Managed caller = null, string function = "", Managed entity = null)
254 {
255 /*
256 string res = LogMessage(LOG_DEBUG_WEIGHT, GetDebugName(caller), GetDebugName(entity), "", function, message);
257
258 #ifdef LOG_TO_RPT
259 if (res.Length() > 0)
260 {
261 PrintToRPT("" + res);
262 }
263 #endif
264 */
265 }
266
267 static void MeleeLog(Entity entity, string message = LOG_DEFAULT, string plugin = LOG_DEFAULT, string author = LOG_DEFAULT, string label = LOG_DEFAULT)
268 {
269 string logMessage = string.Format("%1: %2", entity.GetSimulationTimeStamp(), message);
271
272#ifdef LOG_TO_RPT
273 if (res.Length() > 0)
274 PrintToRPT("" + res);
275#endif
276 }
277
278 static void WeatherLog(string message = LOG_DEFAULT, string plugin = LOG_DEFAULT, string author = LOG_DEFAULT, string label = LOG_DEFAULT, string entity = LOG_DEFAULT)
279 {
281 return;
282
284
285#ifdef LOG_TO_RPT
286 if (res.Length() > 0)
287 PrintToRPT("" + res);
288#endif
289 }
290
301 static void LogInfo(string message = LOG_DEFAULT, string plugin = LOG_DEFAULT, string author = LOG_DEFAULT, string label = LOG_DEFAULT, string entity = LOG_DEFAULT)
302 {
304
305#ifdef LOG_TO_RPT
306 if (res.Length() > 0)
307 PrintToRPT("" + res);
308#endif
309 }
310
321 static void LogWarning(string message = LOG_DEFAULT, string plugin = LOG_DEFAULT, string author = LOG_DEFAULT, string label = LOG_DEFAULT, string entity = LOG_DEFAULT)
322 {
324
325#ifdef LOG_TO_RPT
326 if (res.Length() > 0)
327 PrintToRPT("" + res);
328#endif
329 }
330
341 static void LogError(string message = LOG_DEFAULT, string plugin = LOG_DEFAULT, string author = LOG_DEFAULT, string label = LOG_DEFAULT, string entity = LOG_DEFAULT)
342 {
344
345#ifdef LOG_TO_RPT
346 if (res.Length() > 0)
347 PrintToRPT("" + res);
348#endif
349 }
350
351 static void LogArrayInt(array<int> arr = NULL, string plugin = LOG_DEFAULT, string author = LOG_DEFAULT, string label = LOG_DEFAULT, string entity = LOG_DEFAULT)
352 {
353 if (arr == null)
354 return;
355
356 string res;
357
358 for (int i = 0; i < arr.Count(); i++)
359 res += LogMessage(LOG_DEBUG, plugin, entity, author, label, arr.Get(i).ToString());
360
361#ifdef LOG_TO_RPT
362 if (res.Length() > 0)
363 PrintToRPT("" + res);
364#endif
365 }
366
368 {
369 if (arr == null)
370 return;
371
372 string res;
373
374 for (int i = 0; i < arr.Count(); i++)
376
377#ifdef LOG_TO_RPT
378 if (res.Length() > 0)
379 PrintToRPT("" + res);
380#endif
381 }
382
384 {
386 return;
387
389
390#ifdef LOG_TO_RPT
391 if (message.Length() > 0)
392 PrintToRPT("" + message);
393#endif
394 }
395
396 static void ClearScriptLogs()
397 {
398 ClearLogs();
399 }
400
401 static Shape DrawBox(vector pos1, vector pos2, int color = 0x1fff7f7f)
402 {
403 return DrawBoxEx(pos1, pos2, color, ShapeFlags.TRANSP | ShapeFlags.NOZWRITE);
404 }
405
406 static Shape DrawBoxEx(vector pos1, vector pos2, int color = 0x1fff7f7f, ShapeFlags flags = ShapeFlags.TRANSP | ShapeFlags.NOZWRITE)
407 {
408 Shape shape = Shape.Create(ShapeType.BBOX, color, flags, pos1, pos2);
409 if ((flags & ShapeFlags.ONCE) == 0)
410 m_DebugShapes.Insert(shape);
411 return shape;
412 }
413
414 static Shape DrawCube(vector pos, float size = 1, int color = 0x1fff7f7f)
415 {
416 vector min = pos;
417 vector max = pos;
418
419 float size_h = size * 0.5;
420
421 min[0] = min[0] - size_h;
422 min[1] = min[1] - size_h;
423 min[2] = min[2] - size_h;
424
425 max[0] = max[0] + size_h;
426 max[1] = max[1] + size_h;
427 max[2] = max[2] + size_h;
428
429 Shape shape = Shape.Create(ShapeType.DIAMOND, color, ShapeFlags.TRANSP | ShapeFlags.NOZWRITE, min, max);
430 m_DebugShapes.Insert(shape);
431 return shape;
432 }
433
434 static Shape DrawSphere(vector pos, float size = 1, int color = 0x1fff7f7f, ShapeFlags flags = ShapeFlags.TRANSP | ShapeFlags.NOOUTLINE)
435 {
436 Shape shape = Shape.CreateSphere(color, flags, pos, size);
437 if ((flags & ShapeFlags.ONCE) == 0)
438 m_DebugShapes.Insert(shape);
439 return shape;
440 }
441
442 static Shape DrawFrustum(float horizontalAngle, float verticalAngle, float length, int color = 0x1fff7f7f, ShapeFlags flags = ShapeFlags.TRANSP | ShapeFlags.WIREFRAME)
443 {
444 Shape shape = Shape.CreateFrustum(horizontalAngle, verticalAngle, length, color, flags);
445 if ((flags & ShapeFlags.ONCE) == 0)
446 m_DebugShapes.Insert(shape);
447 return shape;
448 }
449
450 static Shape DrawCylinder(vector pos, float radius, float height = 1, int color = 0x1fff7f7f, ShapeFlags flags = ShapeFlags.TRANSP | ShapeFlags.NOOUTLINE)
451 {
452 Shape shape = Shape.CreateCylinder(color, flags, pos, radius, height);
453 if ((flags & ShapeFlags.ONCE) == 0)
454 m_DebugShapes.Insert(shape);
455 return shape;
456 }
457
458 static array<Shape> DrawCone(vector pos, float lenght, float halfAngle, float offsetAngle, int color = 0xFFFFFFFF, int flags = 0)
459 {
461
464
465 // Left side
466 shapes.Insert(Debug.DrawLine(pos, endL, color, flags));
467 // Rigth side
468 shapes.Insert(Debug.DrawLine(pos, endR, color, flags));
469 // Top side
470 shapes.Insert(Debug.DrawLine(endL, endR, color, flags));
471 // Middle (height) line
472 shapes.Insert(Debug.DrawLine(pos, pos + Vector(Math.Cos(offsetAngle), 0, Math.Sin(offsetAngle)).Normalized() * lenght, color, flags));
473
474 return shapes;
475 }
476
489 static Shape DrawLine(vector from, vector to, int color = 0xFFFFFFFF, int flags = 0)
490 {
491 vector pts[2]
492 pts[0] = from;
493 pts[1] = to;
494
495 Shape shape = Shape.CreateLines(color, flags, pts, 2);
496 if ((flags & ShapeFlags.ONCE) == 0)
497 m_DebugShapes.Insert(shape);
498 //m_DebugShapes.Debug();
499 return shape;
500 }
501
502 static Shape DrawLines(vector[] positions, int count, int color = 0xFFFFFFFF, int flags = 0)
503 {
504
505 Shape shape = Shape.CreateLines(color, flags, positions, count);
506 if ((flags & ShapeFlags.ONCE) == 0)
507 m_DebugShapes.Insert(shape);
508 return shape;
509 }
510
511 static Shape DrawArrow(vector from, vector to, float size = 0.5, int color = 0xFFFFFFFF, int flags = 0)
512 {
513 Shape shape = Shape.CreateArrow(from, to, size, color, flags);
514 m_DebugShapes.Insert(shape);
515 return shape;
516 }
517
518
537
545 {
548
549 filtered_classes.Clear();
550
551 search_string.ToLower();
552
553 for (int s = 0; s < searching_in.Count(); ++s)
554 {
555 string config_path = searching_in.Get(s);
556
557 int objects_count = GetGame().ConfigGetChildrenCount(config_path);
558 for (int i = 0; i < objects_count; i++)
559 {
560 string childName;
561 GetGame().ConfigGetChildName(config_path, i, childName);
562
563 if (only_public)
564 {
565 int scope = GetGame().ConfigGetInt(config_path + " " + childName + " scope");
566 if (scope == 0)
567 continue;
568 }
569
570 string nchName = childName;
571 nchName.ToLower();
572
573 if (nchName.Contains(search_string) != -1)
575 }
576 }
577 }
578
579 //---------------------------------------------------------------
580 //-------private
581
582 static private bool m_EnabledLogs;
583
584 static private string LogMessage(string level, string plugin, string entity, string author, string label, string message)
585 {
586 if (GetGame() == null || !LogManager.IsLogsEnable())
587 return string.Empty;
588
589 bool is_server_log = (GetGame().IsServer() && GetGame().IsMultiplayer());
590
591
592 // Formation output to external file
593 // %date{MM-dd HH:mm:ss} | %Enviroment | %Level | %Module | %Entity | %Author | %Label | %Message
594 string date = GetDate();
595 string env = "Client";
596 string msg = string.Empty;
597
598 if (is_server_log)
599 env = "Server";
600
601 msg = string.Format("%1 | %2 | %3 | %4 | %5 | %6 | %7", date, env, level, plugin, entity, label, message);
602
603 if (is_server_log)
604 {
605 SaveLog(msg);
606#ifdef DEVELOPER //not sendig log to clients on stable
609#endif
610 }
611 else
612 SaveLog(msg);
613
614 return msg;
615 }
616
617 static private void SaveLog(string log_message)
618 {
619#ifndef SERVER
622#endif
623
625 if (fileHandle == 0)
626 return;
627
630
631#ifndef LOG_TO_RPT
632#ifdef DIAG_DEVELOPER
633 Print(string.Format("%1", log_message));
634#endif
635#endif
636 }
637
638 static void ClearLogs()
639 {
640 if (FileExist(GetFileName()))
641 {
643 if (fileHandle == 0)
644 return;
645
646 FPrintln(fileHandle, "");
648 }
649 }
650
651 static string GetFileName()
652 {
654 }
655
656 static private string GetDate()
657 {
658 int year;
659 int month;
660 int day;
661 int hour;
662 int minute;
663 int second;
664
667
668 string date = month.ToStringLen(2) + "-" + day.ToStringLen(2) + " " + hour.ToStringLen(2) + ":" + minute.ToStringLen(2) + ":" + second.ToStringLen(2);
669
670 return date;
671 }
672};
673
675{
676 static bool m_DoLogs;
682 static bool m_DoSyncLog;
683 static bool m_DoQuickbarLog;
685 static bool m_DoWeaponLog;
686 static bool m_DoWeatherLog;
688
689 static void Init()
690 {
691#ifdef DIAG_DEVELOPER
692 m_DoLogs = true;
693#else
694 m_DoLogs = IsCLIParam("doLogs");
695#endif
696
697 m_DoActionDebugLog = IsCLIParam("doActionLog");
698 m_DoSymptomDebugLog = IsCLIParam("doSymptomLog");
699 m_DoInventoryMoveLog = IsCLIParam("doInvMoveLog");
700 m_DoInventoryReservationLog = IsCLIParam("doInvReservLog");
701 m_DoInventoryHFSMLog = IsCLIParam("doInvHFSMLog");
702 m_DoSyncLog = IsCLIParam("doSyncLog");
703 m_DoQuickbarLog = IsCLIParam("doQuickbarLog");
704 m_DoBaseBuildingLog = IsCLIParam("doBaseBuildingLog");
705 m_DoWeaponLog = IsCLIParam("doWeaponLog");
706 m_DoWeatherLog = IsCLIParam("doWeatherLog");
707 }
708
709 static bool IsLogsEnable()
710 {
711 return m_DoLogs;
712 }
713
714 static void SetLogsEnabled(bool enable)
715 {
717 }
718
719 static bool IsActionLogEnable()
720 {
721 return m_DoActionDebugLog;
722 }
723
724 static void ActionLogEnable(bool enable)
725 {
727 }
728
730 {
732 }
733
735 {
737 }
738
743
748
750 {
752 }
753
755 {
757 }
758
759 static bool IsSyncLogEnable()
760 {
761 return m_DoSyncLog;
762 }
763
764 static void SyncLogEnable(bool enable)
765 {
767 }
768
770 {
771 return m_DoQuickbarLog;
772 }
773
774 static void QuickbarLogEnable(bool enable)
775 {
777 }
778
780 {
781 return m_DoBaseBuildingLog;
782 }
783
785 {
787 }
788
789 static bool IsSymptomLogEnable()
790 {
791 return m_DoSymptomDebugLog;
792 }
793
794 static void SymptomLogEnable(bool enable)
795 {
797 }
798
799 static bool IsWeaponLogEnable()
800 {
801 return m_DoWeaponLog;
802 }
803
804 static void WeaponLogEnable(bool enable)
805 {
807 }
808
810 {
811 return m_DoWeatherLog;
812 }
813
815 {
817 }
818
820 {
822 }
823}
824
826{
827 NONE = 0,
832}
833
834class WeightDebug
835{
838
839 //-------------------------------------------------------------
841 {
842 if (!m_WeightDebugData.Get(entity))
843 {
846 return data;
847 }
848 return m_WeightDebugData.Get(entity);
849 }
850 //-------------------------------------------------------------
851 static void ClearWeightDebug()
852 {
853 m_WeightDebugData.Clear();
854 }
855 //-------------------------------------------------------------
857 {
858 GameInventory inv = entity.GetInventory();
859 if (!inv)
860 return;
862 inv.EnumerateInventory(InventoryTraversalType.PREORDER, items);
863 for (int i = 0; i < items.Count(); i++)
864 {
865 EntityAI item = items.Get(i);
866 if (m_WeightDebugData.Get(item))
867 m_WeightDebugData.Get(item).Output();
868 }
869 }
870 //-------------------------------------------------------------
872 {
873 m_VerbosityFlags = type;
874 }
875}
876
878{
880 string m_Weight;
883 //-------------------------------------------------------------
885 {
886 m_Classname = entity.GetType();
887 m_InventoryDepth = entity.GetHierarchyLevel();
888 }
889 //-------------------------------------------------------------
890 void SetWeight(float weight)
891 {
892 m_Weight = weight.ToString();
893 }
894 //-------------------------------------------------------------
896 {
898 }
899
900 //-------------------------------------------------------------
902 {
903 m_CalcDetails += "+ " + details;
904 }
905 //-------------------------------------------------------------
906 void Output()
907 {
908 string spaces;
909 for (int i = 0; i < m_InventoryDepth; i++)
910 spaces += "--------";
911
912 Print(spaces + ">" + m_Classname + " Overall entity weight: " + m_Weight + " Calculation details:" + m_CalcDetails);
913 }
914 //-------------------------------------------------------------
915
916}
static void ClearWeightDebug()
Definition Debug.c:851
class LogManager RECALC_FORCED
static void PrintAll(EntityAI entity)
Definition Debug.c:856
static WeightDebugData GetWeightDebug(EntityAI entity)
Definition Debug.c:840
static void SetVerbosityFlags(WeightDebugType type)
Definition Debug.c:871
class LogManager SET_DIRTY_FLAG
class LogManager NONE
class LogManager DUMP_STACK
class LogManager RECALC_DIRTY
static WeightDebugType m_VerbosityFlags
Definition Debug.c:837
class LogManager m_WeightDebugData
Dispatcher GetDispatcher()
Definition Dispatcher.c:20
const CallID CALL_ID_SEND_LOG
Definition Dispatcher.c:3
const CallID CALL_ID_SCR_CNSL_ADD_PRINT
Definition Dispatcher.c:6
Param CallMethod(CallID call_id, Param params)
Definition Dispatcher.c:36
static ref Param1< string > PARAM1_STRING
Definition Debug.c:14
ref array< Shape > m_DebugShapes
Definition Debug.c:36
const string LOG_DEBUG_MELEE
Definition Debug.c:28
const string LOG_DEBUG_BLEEDING_CHANCES
Definition Debug.c:23
static void BaseBuildingLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:203
const string LOG_DEBUG_INV_RESERVATION
Definition Debug.c:19
static void TFLog(string message=LOG_DEFAULT, TestFramework caller=null, string function="")
Definition Debug.c:243
static Shape DrawLines(vector[] positions, int count, int color=0xFFFFFFFF, int flags=0)
Definition Debug.c:502
static void InitCanvas()
Definition Debug.c:54
bool m_EnabledLogs
Definition Debug.c:582
static void QuickbarLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:193
const string LOG_DEBUG_ACTION
Definition Debug.c:16
static void GetBaseConfigClasses(out TStringArray base_classes)
Returns some of base config classes strings like CfgVehicles, CfgWeapons, etc. for searching purposes...
Definition Debug.c:523
const string LOG_DEBUG
Definition Debug.c:15
string GetDate()
Definition Debug.c:656
static CanvasWidget m_CanvasDebug
Definition Debug.c:39
const string LOG_DEBUG_PARTICLE
Definition Debug.c:25
static void SymptomLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:153
static Shape DrawCylinder(vector pos, float radius, float height=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
Definition Debug.c:450
static void InventoryReservationLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:173
static void ParticleLog(string message=LOG_DEFAULT, Managed caller=null, string function="", Managed entity=null)
Definition Debug.c:233
static Shape DrawBox(vector pos1, vector pos2, int color=0x1fff7f7f)
Definition Debug.c:401
static string GetFileName()
Definition Debug.c:651
const string LOG_DEBUG_WEIGHT
Definition Debug.c:27
const string LOG_DEBUG_TF
Definition Debug.c:26
static void LogWarning(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as warning message.
Definition Debug.c:321
static void CanvasDrawLine(float x1, float y1, float x2, float y2, float width, int color)
Definition Debug.c:69
static void ClearLogs()
Definition Debug.c:638
static void LogInfo(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Definition Debug.c:301
const string LOG_DEBUG_WEATHER
Definition Debug.c:29
static void BleedingChancesLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:213
static Shape DrawSphere(vector pos, float size=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
Definition Debug.c:434
static void GetFiltredConfigClasses(string search_string, out TStringArray filtered_classes, bool only_public=true)
Returns config classes containing search_string in name.
Definition Debug.c:544
static void WeightLog(string message=LOG_DEFAULT, Managed caller=null, string function="", Managed entity=null)
Definition Debug.c:253
static void LogError(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as error message.
Definition Debug.c:341
static void MeleeLog(Entity entity, string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT)
Definition Debug.c:267
static Shape DrawFrustum(float horizontalAngle, float verticalAngle, float length, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.WIREFRAME)
Definition Debug.c:442
const string LOG_DEBUG_BASEBUILDING
Definition Debug.c:22
const string LOG_DEBUG_TRIGGER
Definition Debug.c:24
const string LOG_DEBUG_QUICKBAR
Definition Debug.c:21
static Shape DrawCube(vector pos, float size=1, int color=0x1fff7f7f)
Definition Debug.c:414
void SaveLog(string log_message)
Definition Debug.c:617
const string LOG_INFO
Definition Debug.c:31
static void ClearCanvas()
Definition Debug.c:63
const string LOG_DEBUG_SYMPTOM
Definition Debug.c:17
static void ReceivedLogMessageFromServer(string message)
Definition Debug.c:383
static Shape DrawArrow(vector from, vector to, float size=0.5, int color=0xFFFFFFFF, int flags=0)
Definition Debug.c:511
static void TriggerLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:223
const string LOG_DEBUG_INV_MOVE
Definition Debug.c:18
static array< Shape > DrawCone(vector pos, float lenght, float halfAngle, float offsetAngle, int color=0xFFFFFFFF, int flags=0)
Definition Debug.c:458
static void CanvasDrawPoint(float x1, float y1, int color)
Draws a "point" on the screen at x,y coordinates Debug.ClearCanvas(); for(int i = 0; i < 700;i++) { f...
Definition Debug.c:86
const string LOG_WARNING
Definition Debug.c:32
static void InventoryHFSMLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:183
static void DestroyAllShapes()
Definition Debug.c:96
static Shape DrawBoxEx(vector pos1, vector pos2, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOZWRITE)
Definition Debug.c:406
static void WeatherLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:278
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Definition Debug.c:133
static void LogArrayInt(array< int > arr=NULL, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:351
static void ClearScriptLogs()
Definition Debug.c:396
const string LOG_DEFAULT
Definition Debug.c:34
static Widget m_DebugLayoutCanvas
Definition Debug.c:38
static void Init()
Definition Debug.c:91
static void LogArrayString(array< string > arr=NULL, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:367
static void InventoryMoveLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:163
const string LOG_ERROR
Definition Debug.c:33
static void RemoveShape(out Shape shape)
Definition Debug.c:107
static string GetDebugName(Managed entity)
Definition Debug.c:42
const string LOG_DEBUG_INV_HFSM
Definition Debug.c:20
string LogMessage(string level, string plugin, string entity, string author, string label, string message)
DEPRECATED.
Definition Debug.c:584
static Shape DrawLine(vector from, vector to, int color=0xFFFFFFFF, int flags=0)
Definition Debug.c:489
static void ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:143
Param CallMethod(CallID call_id, Param params)
Definition Dispatcher.c:15
Definition Camera.c:2
script counterpart to engine's class Inventory
Definition Inventory.c:79
static void InventoryHFSMLogEnable(bool enable)
Definition Debug.c:754
static void InventoryReservationLogEnable(bool enable)
Definition Debug.c:744
static void SymptomLogEnable(bool enable)
Definition Debug.c:794
static void SyncLogEnable(bool enable)
Definition Debug.c:764
static bool IsWeaponLogEnable()
Definition Debug.c:799
static bool m_DoSyncLog
Definition Debug.c:682
static void BleedingChancesLogEnable(bool enable)
Definition Debug.c:819
static bool m_DoActionDebugLog
Definition Debug.c:677
static bool m_DoLogs
Definition Debug.c:676
static bool m_DoInventoryHFSMLog
Definition Debug.c:681
static void WeaponLogEnable(bool enable)
Definition Debug.c:804
static void Init()
Definition Debug.c:689
static bool m_DoSymptomDebugLog
Definition Debug.c:678
static bool IsBaseBuildingLogEnable()
Definition Debug.c:779
static bool m_DoInventoryReservationLog
Definition Debug.c:680
static bool IsWeatherLogEnabled()
Definition Debug.c:809
static void SetLogsEnabled(bool enable)
Definition Debug.c:714
static bool IsInventoryReservationLogEnable()
Definition Debug.c:739
static bool IsSymptomLogEnable()
Definition Debug.c:789
static bool IsSyncLogEnable()
Definition Debug.c:759
static bool IsInventoryHFSMLogEnable()
Definition Debug.c:749
static bool IsLogsEnable()
Definition Debug.c:709
static bool m_DoBleedingChanceLog
Definition Debug.c:687
static bool m_DoBaseBuildingLog
Definition Debug.c:684
static void QuickbarLogEnable(bool enable)
Definition Debug.c:774
static void ActionLogEnable(bool enable)
Definition Debug.c:724
static void InventoryMoveLogEnable(bool enable)
Definition Debug.c:734
static bool m_DoWeatherLog
Definition Debug.c:686
static bool IsBleedingChancesLogEnable()
Definition Debug.c:814
static bool IsInventoryMoveLogEnable()
Definition Debug.c:729
static bool IsActionLogEnable()
Definition Debug.c:719
static void BaseBuildingLogEnable(bool enable)
Definition Debug.c:784
static bool m_DoWeaponLog
Definition Debug.c:685
static bool IsQuickbarLogEnable()
Definition Debug.c:769
static bool m_DoInventoryMoveLog
Definition Debug.c:679
static bool m_DoQuickbarLog
Definition Debug.c:683
TODO doc.
Definition EnScript.c:118
Definition EnMath.c:7
string m_Weight
Definition Debug.c:880
string m_CalcDetails
Definition Debug.c:882
void AddCalcDetails(string details)
Definition Debug.c:901
string m_Classname
Definition Debug.c:879
void SetCalcDetails(string details)
Definition Debug.c:895
void Output()
Definition Debug.c:906
void SetWeight(float weight)
Definition Debug.c:890
void WeightDebugData(EntityAI entity)
Definition Debug.c:884
int m_InventoryDepth
Definition Debug.c:881
override string GetDebugName()
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
Definition gameplay.c:6
proto native CGame GetGame()
const string CFG_FILE_SCRIPT_LOG_EXT
Definition constants.c:237
proto void Print(void var)
Prints content of variable to console/log.
proto void PrintToRPT(void var)
Prints content of variable to RPT file (performance warning - each write means fflush!...
ShapeType
Definition EnDebug.c:116
ShapeFlags
Definition EnDebug.c:126
class DiagMenu Shape
don't call destructor directly. Use Destroy() instead
array< string > TStringArray
Definition EnScript.c:666
FileMode
Definition EnSystem.c:383
proto void CloseFile(FileHandle file)
Close the File.
proto FileHandle OpenFile(string name, FileMode mode)
Opens File.
proto bool FileExist(string name)
Check existence of file.
proto void FPrintln(FileHandle file, void var)
Write to file and add new line.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto void ConePoints(vector origin, float length, float halfAngle, float angleOffset, out vector leftPoint, out vector rightPoint)
Calculates the points of a right 2D cone in 3D space.
static proto float Cos(float angle)
Returns cosinus of angle in radians.
static proto float Sin(float angle)
Returns sinus of angle in radians.
const string CFG_SOUND_SETS
Definition constants.c:217
const string CFG_AMMO
Definition constants.c:212
const string CFG_VEHICLESPATH
Definition constants.c:209
const string CFG_NONAI_VEHICLES
Definition constants.c:218
const string CFG_SOUND_SHADERS
Definition constants.c:216
const string CFG_SOUND_TABLES
Definition constants.c:219
const string CFG_SURFACES
Definition constants.c:214
const string CFG_WEAPONSPATH
Definition constants.c:210
const string CFG_WORLDS
Definition constants.c:213
const string CFG_MAGAZINESPATH
Definition constants.c:211
static const string Empty
Definition EnString.c:7
proto void GetYearMonthDay(out int year, out int month, out int day)
Returns world date.
proto void GetHourMinuteSecond(out int hour, out int minute, out int second)
Returns world time.
proto native bool IsCLIParam(string param)
Returns if command line argument is present.