3 private static const string LOG_DEBUG =
"Debug";
37 if (CastTo(obj, entity))
38 return obj.GetDebugNameNative();
40 return entity.GetDebugName();
58 static void CanvasDrawLine(
float x1,
float y1,
float x2,
float y2,
float width,
int color)
118 for (
int i = 0; i < nDebugShapes; ++i)
122 if (foundShape && foundShape == shape)
124 foundShape.Destroy();
138 for (
int i = 0; i < nDebugTextsSS; ++i)
142 if (foundText && foundText == text)
158 for (
int i = 0; i < nDebugTextsWS; ++i)
162 if (foundText && foundText == text)
251 string logMessage =
string.Format(
"%1: %2", entity.GetSimulationTimeStamp(), message);
315 int nArr = arr.Count();
316 for (
int i = 0; i < nArr; ++i)
327 int nArr = arr.Count();
328 for (
int i = 0; i < nArr; ++i)
367 float size_h = size * 0.5;
369 min[0] = min[0] - size_h;
370 min[1] = min[1] - size_h;
371 min[2] = min[2] - size_h;
373 max[0] = max[0] + size_h;
374 max[1] = max[1] + size_h;
375 max[2] = max[2] + size_h;
384 Shape shape =
Shape.CreateSphere(color, flags, pos, size);
392 Shape shape =
Shape.CreateFrustum(horizontalAngle, verticalAngle, length, color, flags);
400 Shape shape =
Shape.CreateCylinder(color, flags, pos, radius, height);
427 foreach (
Shape shape : shapes)
467 Shape shape =
Shape.CreateLines(color, flags, pts, 2);
477 Shape shape =
Shape.CreateLines(color, flags, positions, count);
485 Shape shape =
Shape.CreateArrow(from, to, size, color, flags);
516 base_classes.Clear();
540 filtered_classes.Clear();
544 int nSearchingIn = searching_in.Count();
545 for (
int s = 0; s < nSearchingIn; ++s )
547 string config_path = searching_in.Get(s);
549 int objects_count =
g_Game.ConfigGetChildrenCount(config_path);
550 for (
int i = 0; i < objects_count; i++)
553 g_Game.ConfigGetChildName(config_path, i, childName);
557 int scope =
g_Game.ConfigGetInt( config_path +
" " + childName +
" scope" );
564 string nchName = childName;
567 if ( nchName.
Contains(search_string) != -1)
569 filtered_classes.Insert(childName);
580 private static string LogMessage(
string level,
string plugin,
string entity,
string author,
string label,
string message)
585 bool is_server_log = (
g_Game.IsServer() &&
g_Game.IsMultiplayer() );
591 string env =
"Client";
592 string msg =
string.Empty;
599 msg =
string.
Format(
"%1 | %2 | %3 | %4 | %5 | %6 | %7", date, env, level, plugin, entity, label, message);
606 Param1<string> msg_p =
new Param1<string>(msg);
618 private static void SaveLog(
string log_message)
620 if (log_message.
Length() == 0)
651 Print(
string.Format(
"%1", log_message));
685 string date = month.ToStringLen(2) +
"-" + day.ToStringLen(2) +
" " + hour.ToStringLen(2) +
":" + minute.ToStringLen(2) +
":" + second.ToStringLen(2);
708 #ifdef ENABLE_LOGGING
880 int nItems = items.Count();
881 for(
int i = 0; i < nItems; ++i)
static ref Param1< string > PARAM1_STRING
static void TriggerLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static void SymptomLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static void TFLog(string message=LOG_DEFAULT, TestFramework caller=null, string function="")
static void GetFiltredConfigClasses(string search_string, out TStringArray filtered_classes, bool only_public=true)
Returns config classes containing search_string in name.
static DebugTextWorldSpace DrawTextWS(string text, vector position, float size=20.0, int color=0xFFFFFFFF, int bgColor=0x00000000, DebugTextFlags flags=DebugTextFlags.DEFAULT, int priority=1000)
static DebugTextScreenSpace DrawTextSS(string text, float x, float y, float size=20.0, int color=0xFFFFFFFF, int bgColor=0x00000000, DebugTextFlags flags=DebugTextFlags.DEFAULT, int priority=1000)
static const string LOG_DEBUG_INV_RESERVATION
static void RemoveTextSS(out DebugTextScreenSpace text)
static const string LOG_DEBUG_PARTICLE
static Shape DrawLines(vector[] positions, int count, int color=0xFFFFFFFF, int flags=0)
static Shape DrawBoxEx(vector pos1, vector pos2, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOZWRITE)
static void CleanupDrawShapes(array< Shape > shapes)
static Shape DrawArrow(vector from, vector to, float size=0.5, int color=0xFFFFFFFF, int flags=0)
static const string LOG_ERROR
static string GetDebugName(Managed entity)
static void WeatherLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static void CanvasDrawLine(float x1, float y1, float x2, float y2, float width, int color)
static ref array< ref DebugTextWorldSpace > m_DebugTextsWS
static void MeleeLog(Entity entity, string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT)
static void ClearScriptLogs()
static void DestroyAllShapes()
static const string LOG_DEBUG_MELEE
static void LogArrayString(array< string > arr=NULL, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static const string LOG_DEBUG_SYMPTOM
static void RemoveShape(out Shape shape)
static string GetFileName()
static string LogMessage(string level, string plugin, string entity, string author, string label, string message)
DEPRECATED.
static const string LOG_DEBUG_INV_HFSM
static void SaveLog(string log_message)
static void DestroyAllTextSS()
static Shape DrawLine(vector from, vector to, int color=0xFFFFFFFF, int flags=0)
DrawLine \nFlags: ShapeFlags.NOZBUFFER ShapeFlags.NOZUPDATE ShapeFlags.DOUBLESIDE ShapeFlags....
static Shape DrawCube(vector pos, float size=1, int color=0x1fff7f7f)
static void WeightLog(string message=LOG_DEFAULT, Managed caller=null, string function="", Managed entity=null)
static void BaseBuildingLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static const string LOG_INFO
static void RemoveTextWS(out DebugTextWorldSpace text)
static Shape DrawFrustum(float horizontalAngle, float verticalAngle, float length, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.WIREFRAME)
static void DestroyAllTextWS()
static void InventoryReservationLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static Widget m_DebugLayoutCanvas
static const string LOG_DEBUG_QUICKBAR
static const string LOG_WARNING
static void ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static CanvasWidget m_CanvasDebug
static const string LOG_DEBUG_BASEBUILDING
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.
static const string LOG_DEBUG
static const string LOG_DEBUG_ACTION
static void InventoryHFSMLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static Shape DrawBox(vector pos1, vector pos2, int color=0x1fff7f7f)
static void CleanupTextsSS(array< ref DebugTextScreenSpace > texts)
static void InventoryMoveLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static Shape DrawSphere(vector pos, float size=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
static ref array< ref DebugTextScreenSpace > m_DebugTextsSS
static void BleedingChancesLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static array< Shape > DrawCone(vector pos, float lenght, float halfAngle, float offsetAngle, int color=0xFFFFFFFF, int flags=0)
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.
static void QuickbarLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static const string LOG_DEBUG_TRIGGER
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.
static const string LOG_DEBUG_WEATHER
static void LogArrayInt(array< int > arr=NULL, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static const string LOG_DEBUG_TF
static Shape DrawCylinder(vector pos, float radius, float height=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
static bool m_EnabledLogs
static void GetBaseConfigClasses(out TStringArray base_classes)
Returns some of base config classes strings like CfgVehicles, CfgWeapons, etc.
static ref array< Shape > m_DebugShapes
static void ReceivedLogMessageFromServer(string message)
static const string LOG_DEBUG_INV_MOVE
static const string LOG_DEBUG_WEIGHT
static void ClearCanvas()
static const string LOG_DEFAULT
static void CleanupTextsWS(array< ref DebugTextWorldSpace > texts)
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...
static const string LOG_DEBUG_BLEEDING_CHANCES
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.
static void ParticleLog(string message=LOG_DEFAULT, Managed caller=null, string function="", Managed entity=null)
static proto DebugTextScreenSpace Create(string text, DebugTextFlags flags, float x, float y, float size=20.0, int color=0xFFFFFFFF, int bgColor=0x00000000, int priority=1000)
Creates a text instance.
static proto DebugTextWorldSpace Create(string text, DebugTextFlags flags, float x, float y, float z, float size=20.0, int color=0xFFFFFFFF, int bgColor=0x00000000, int priority=1000)
Creates a text instance.
Param CallMethod(CallID call_id, Param params)
script counterpart to engine's class Inventory
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
static void QuickbarLogEnable(bool enable)
static void BaseBuildingLogEnable(bool enable)
static bool IsInventoryHFSMLogEnable()
static bool m_DoInventoryReservationLog
static void SymptomLogEnable(bool enable)
static void InventoryMoveLogEnable(bool enable)
static bool IsInventoryMoveLogEnable()
static void InventoryHFSMLogEnable(bool enable)
static bool IsWeaponLogEnable()
static bool IsLogsEnable()
static bool IsWeatherLogEnabled()
static void ActionLogEnable(bool enable)
static void SetLogsEnabled(bool enable)
static bool m_DoActionDebugLog
static void SyncLogEnable(bool enable)
static bool IsActionLogEnable()
static bool m_DoSymptomDebugLog
static bool m_DoInventoryMoveLog
static bool m_DoBleedingChanceLog
static bool m_DoBaseBuildingLog
static bool m_DoWeaponLog
static bool IsInventoryReservationLogEnable()
static bool IsQuickbarLogEnable()
static bool IsSyncLogEnable()
static bool m_DoWeatherLog
static bool IsSymptomLogEnable()
static bool IsBaseBuildingLogEnable()
static void BleedingChancesLogEnable(bool enable)
static void WeaponLogEnable(bool enable)
static bool m_DoInventoryHFSMLog
static void InventoryReservationLogEnable(bool enable)
static bool m_DoQuickbarLog
static bool IsBleedingChancesLogEnable()
void SetWeight(float weight)
void WeightDebugData(EntityAI entity)
void SetCalcDetails(string details)
void AddCalcDetails(string details)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto string ToString(bool simple=true)
override string GetDebugName()
Dispatcher GetDispatcher()
const CallID CALL_ID_SEND_LOG
const CallID CALL_ID_SCR_CNSL_ADD_PRINT
Param CallMethod(CallID call_id, Param params)
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
const string CFG_FILE_SCRIPT_LOG_EXT
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!...
array< string > TStringArray
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.
@ NONE
body is not in simulation, nor in collision world
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.
bool Contains(string sample)
Returns true if sample is substring of string.
static const string Empty
proto int ToLower()
Changes string to lowercase.
proto native int Length()
Returns length of string.
proto void GetYearMonthDay(out int year, out int month, out int day)
Returns system date.
proto void GetHourMinuteSecond(out int hour, out int minute, out int second)
Returns system time.
proto native bool IsCLIParam(string param)
Returns if command line argument is present.