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)
Dispatcher GetDispatcher()
const CallID CALL_ID_SEND_LOG
const CallID CALL_ID_SCR_CNSL_ADD_PRINT
Param CallMethod(CallID call_id, Param params)
static ref Param1< string > PARAM1_STRING
static ref array< Shape > m_DebugShapes
static const string LOG_DEBUG_MELEE
static const string LOG_DEBUG_BLEEDING_CHANCES
static void CleanupTextsWS(array< ref DebugTextWorldSpace > texts)
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_DEBUG_INV_RESERVATION
static void TFLog(string message=LOG_DEFAULT, TestFramework caller=null, string function="")
static Shape DrawLines(vector[] positions, int count, int color=0xFFFFFFFF, int flags=0)
static void RemoveTextWS(out DebugTextWorldSpace text)
static bool m_EnabledLogs
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_ACTION
static void GetBaseConfigClasses(out TStringArray base_classes)
Returns some of base config classes strings like CfgVehicles, CfgWeapons, etc. for searching purposes...
static const string LOG_DEBUG
static CanvasWidget m_CanvasDebug
static const string LOG_DEBUG_PARTICLE
static void SymptomLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static Shape DrawCylinder(vector pos, float radius, float height=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
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 void InventoryReservationLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static void ParticleLog(string message=LOG_DEFAULT, Managed caller=null, string function="", Managed entity=null)
static Shape DrawBox(vector pos1, vector pos2, int color=0x1fff7f7f)
static ref array< ref DebugTextScreenSpace > m_DebugTextsSS
static string GetFileName()
static const string LOG_DEBUG_WEIGHT
static const string LOG_DEBUG_TF
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 CanvasDrawLine(float x1, float y1, float x2, float y2, float width, int color)
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 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 void BleedingChancesLog(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 void DestroyAllTextWS()
static void GetFiltredConfigClasses(string search_string, out TStringArray filtered_classes, bool only_public=true)
Returns config classes containing search_string in name.
static void RemoveTextSS(out DebugTextScreenSpace text)
static void WeightLog(string message=LOG_DEFAULT, Managed caller=null, string function="", Managed entity=null)
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 void MeleeLog(Entity entity, string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT)
static Shape DrawFrustum(float horizontalAngle, float verticalAngle, float length, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.WIREFRAME)
static const string LOG_DEBUG_BASEBUILDING
static const string LOG_DEBUG_TRIGGER
static void SaveLog(string log_message)
static const string LOG_DEBUG_QUICKBAR
static Shape DrawCube(vector pos, float size=1, int color=0x1fff7f7f)
static const string LOG_INFO
static void ClearCanvas()
static const string LOG_DEBUG_SYMPTOM
static void ReceivedLogMessageFromServer(string message)
static Shape DrawArrow(vector from, vector to, float size=0.5, int color=0xFFFFFFFF, int flags=0)
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 CleanupDrawShapes(array< Shape > shapes)
static const string LOG_DEBUG_INV_MOVE
static array< Shape > DrawCone(vector pos, float lenght, float halfAngle, float offsetAngle, int color=0xFFFFFFFF, int flags=0)
static void CleanupTextsSS(array< ref DebugTextScreenSpace > 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_WARNING
static void InventoryHFSMLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static void DestroyAllShapes()
static Shape DrawBoxEx(vector pos1, vector pos2, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOZWRITE)
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 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 LogArrayInt(array< int > arr=NULL, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static void ClearScriptLogs()
static const string LOG_DEFAULT
static ref array< ref DebugTextWorldSpace > m_DebugTextsWS
static Widget m_DebugLayoutCanvas
static void LogArrayString(array< string > arr=NULL, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static void InventoryMoveLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static const string LOG_ERROR
static void RemoveShape(out Shape shape)
static string GetDebugName(Managed entity)
static const string LOG_DEBUG_INV_HFSM
static Shape DrawLine(vector from, vector to, int color=0xFFFFFFFF, int flags=0)
static string LogMessage(string level, string plugin, string entity, string author, string label, string message)
DEPRECATED.
static void ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static void DestroyAllTextSS()
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)
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)
Param CallMethod(CallID call_id, Param params)
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
script counterpart to engine's class Inventory
static void InventoryHFSMLogEnable(bool enable)
static void InventoryReservationLogEnable(bool enable)
static void SymptomLogEnable(bool enable)
static void SyncLogEnable(bool enable)
static bool IsWeaponLogEnable()
static void BleedingChancesLogEnable(bool enable)
static bool m_DoActionDebugLog
static bool m_DoInventoryHFSMLog
static void WeaponLogEnable(bool enable)
static bool m_DoSymptomDebugLog
static bool IsBaseBuildingLogEnable()
static bool m_DoInventoryReservationLog
static bool IsWeatherLogEnabled()
static void SetLogsEnabled(bool enable)
static bool IsInventoryReservationLogEnable()
static bool IsSymptomLogEnable()
static bool IsSyncLogEnable()
static bool IsInventoryHFSMLogEnable()
static bool IsLogsEnable()
static bool m_DoBleedingChanceLog
static bool m_DoBaseBuildingLog
static void QuickbarLogEnable(bool enable)
static void ActionLogEnable(bool enable)
static void InventoryMoveLogEnable(bool enable)
static bool m_DoWeatherLog
static bool IsBleedingChancesLogEnable()
static bool IsInventoryMoveLogEnable()
static bool IsActionLogEnable()
static void BaseBuildingLogEnable(bool enable)
static bool m_DoWeaponLog
static bool IsQuickbarLogEnable()
static bool m_DoInventoryMoveLog
static bool m_DoQuickbarLog
void AddCalcDetails(string details)
void SetCalcDetails(string details)
void SetWeight(float weight)
void WeightDebugData(EntityAI entity)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto string ToString(bool simple=true)
override string GetDebugName()
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
proto native int Length()
Returns length of string.
bool Contains(string sample)
Returns true if sample is substring of string.
static const string Empty
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.
proto int ToLower()
Changes string to lowercase. Returns length.
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.