move log events to a label

This commit is contained in:
Beu 2023-08-28 01:32:16 +02:00
parent d111eacbd7
commit a2640c6bb8

View File

@ -146,9 +146,10 @@ foreach (Event in UIManager.PendingEvents) {
}
}
case "DebugMode.VarInsp.Dump.Teams0": {
// prevent to dump Net_DebugMode_Logs in the dump
declare Text tmp = Net_DebugMode_Logs;
Net_DebugMode_Logs = "";
Net_DebugMode_Logs = Prefix ^ "Teams[0] dump:\n" ^ Dbg_DumpDeclareForVariables(Teams[0], False) ^"\n" ^ tmp;
Net_DebugMode_Logs = Prefix ^ "Teams[0] dump:\n" ^ Dbg_DumpDeclareForVariables(Teams[0], False) ^"\n" ^ Net_DebugMode_Logs;
}
case "DebugMode.VarInsp.Dump.UIAll": {
Net_DebugMode_Logs = Prefix ^ "UIAll dump:\n" ^ Dbg_DumpDeclareForVariables(UIManager.UIAll, False) ^"\n" ^ Net_DebugMode_Logs;
@ -226,7 +227,27 @@ foreach (Event in UIManager.PendingEvents) {
}
}
+++DebugMode_LogEvents+++
***
***DebugMode_LogEvents***
***
foreach (Event in PendingEvents) {
+++DebugMode_PendingEvents+++
}
foreach (Event in XmlRpc.PendingEvents) {
+++DebugMode_XmlRpcPendingEvents+++
}
declare Events::K_RaceEvent[] RacePendingEvents = Race::GetPendingEvents();
foreach (Event in RacePendingEvents) {
+++DebugMode_RacePendingEvents+++
}
***
***DebugMode_PendingEvents***
***
+++DebugMode_LogFormat+++
Net_DebugMode_Logs = Prefix ^ "CSmMode PendingEvent: " ^ Event.Type ^"\n" ^ Net_DebugMode_Logs;
if (Event.Type == CSmModeEvent::EType::OnPlayerAdded) {
@ -234,19 +255,20 @@ foreach (Event in PendingEvents) {
Layers::Attach(C_DebugMode_MainUI, Event.Player);
}
}
}
***
foreach (Event in XmlRpc.PendingEvents) {
***DebugMode_XmlRpcPendingEvents***
***
+++DebugMode_LogFormat+++
if (Event.Type == CXmlRpcEvent::EType::CallbackArray) {
Net_DebugMode_Logs = Prefix ^ "XmlRpc PendingEvent: " ^ Event.ParamArray1 ^"\n" ^ Net_DebugMode_Logs;
} else {
Net_DebugMode_Logs = Prefix ^ "XmlRpc PendingEvent: " ^ Event.Param1 ^"\n" ^ Net_DebugMode_Logs;
}
}
***
declare RacePendingEvents = Race::GetPendingEvents();
foreach (Event in RacePendingEvents) {
***DebugMode_RacePendingEvents***
***
+++DebugMode_LogFormat+++
declare Text Type = "Unknown";
switch (Event.Type) {
@ -258,7 +280,6 @@ foreach (Event in RacePendingEvents) {
case 6: Type = "Eliminated";
}
Net_DebugMode_Logs = Prefix ^ "Race Pending Event: " ^ Type ^"\n" ^ Net_DebugMode_Logs;
}
***
***DebugMode_LogFormat***
@ -283,7 +304,6 @@ if (TL::Length(Net_DebugMode_Logs) > 1000000) {
Net_DebugMode_Logs = TL::SubString(Net_DebugMode_Logs, 0, 1000000);
}
declare netwrite Integer Net_DebugMode_Logs_Serial for Teams[0];
Net_DebugMode_Logs_Serial += 1;
***