Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AIDebugMessage.c
Go to the documentation of this file.
2 {
3  NONE = 0,
4  UTILITY = 1,
5  MAILBOX = 2,
6  COMBAT = 3,
7  INFO = 4,
8  ACTION = 5,
9  THREAT = 6,
10  WEAPON = 7,
11  LOOK = 8,
12  CLUSTER = 9,
13  REACTION = 10,
14  COMMS = 11
15 };
16 
18 {
19  // Texts which match EAIDebugMsgType, make sure they all have same length so they are printed nicely
20  static const ref array<string> s_aAiDebugMsgTypeLabels = {
21  "NONE ",
22  "UTIL ",
23  "MAIL ",
24  "COMBAT",
25  "INFO ",
26  "ACTION",
27  "THREAT",
28  "WEAPON",
29  "LOOK ",
30  "CLUSTR",
31  "REACT ",
32  "COMMS "
33  };
34 
35  int m_Hours;
36  int m_Minutes;
37  int m_Seconds;
38  int m_TimestampMs; // Total amount of milliseconds since game start
39 
40  EAIDebugMsgType m_Type;
41  LogLevel m_LogLevel;
42 
43  string m_Message;
44 
45  void SCR_AIDebugMessage(string message, EAIDebugMsgType type = EAIDebugMsgType.NONE, LogLevel logLevel = LogLevel.NORMAL)
46  {
47  m_Message = message;
48  m_LogLevel = logLevel;
49  m_Type = type;
50  System.GetHourMinuteSecond(m_Hours, m_Minutes, m_Seconds);
51  m_TimestampMs = System.GetTickCount();
52  }
53 
54  string FormatMessage()
55  {
56  /*
57  string logLevelStr;
58  switch (m_LogLevel)
59  {
60  case LogLevel.SPAM: logLevelStr = "S"; break;
61  case LogLevel.VERBOSE: logLevelStr = "V"; break;
62  case LogLevel.DEBUG: logLevelStr = "D"; break;
63  case LogLevel.NORMAL: logLevelStr = "N"; break;
64  case LogLevel.WARNING: logLevelStr = "W"; break;
65  case LogLevel.ERROR: logLevelStr = "E"; break;
66  case LogLevel.FATAL: logLevelStr = "F"; break;
67  }
68  */
69 
70  int timestampMsCurrent = System.GetTickCount();
71  float tDeltaSeconds = (timestampMsCurrent - m_TimestampMs) / 1000.0;
72 
73  return string.Format("(%1:%2:%3 %4 T-%5s) %6 %7",
74  m_Hours.ToString(2),
75  m_Minutes.ToString(2),
76  m_Seconds.ToString(2),
77  m_TimestampMs.ToString(6),
78  tDeltaSeconds.ToString(5, 1),
79  s_aAiDebugMsgTypeLabels[m_Type],
80  //logLevelStr,
81  m_Message
82  );
83  }
84 };
EAIDebugMsgType
EAIDebugMsgType
Definition: SCR_AIDebugMessage.c:1
COMMS
@ COMMS
Definition: SCR_AIDebugMessage.c:14
COMBAT
@ COMBAT
Definition: SCR_AIDebugMessage.c:6
CLUSTER
@ CLUSTER
Definition: SCR_AIDebugMessage.c:12
MAILBOX
@ MAILBOX
Definition: SCR_AIDebugMessage.c:5
m_Type
protected EEditableEntityType m_Type
Definition: SCR_EntitiesToolbarEditorUIComponent.c:3
SCR_AIDebugMessage
Definition: SCR_AIDebugMessage.c:17
THREAT
@ THREAT
Definition: SCR_AIDebugMessage.c:9
type
EDamageType type
Definition: SCR_DestructibleTreeV2.c:32
REACTION
@ REACTION
Definition: SCR_AIDebugMessage.c:13
LOOK
@ LOOK
Definition: SCR_AIDebugMessage.c:11
INFO
@ INFO
Definition: SCR_AIDebugMessage.c:7
WEAPON
@ WEAPON
Definition: SCR_AIDebugMessage.c:10
UTILITY
@ UTILITY
Definition: SCR_AIDebugMessage.c:4
NONE
@ NONE
Definition: SCR_AIDebugMessage.c:3
ACTION
@ ACTION
Definition: SCR_AIDebugMessage.c:8