Closed ncskrypt closed 2 years ago
Fix Sysmessage Log Behavior
100
5
waitforsysmsg
if insysmsg
!
insysmsg
waitforsysmsg! (text) [timeout] if insysmsg! (text)
Currently Razor clear ALL PRIOR messages in log INCLUDING UNMATCHED entries.
waitforsysmsg 'text'
if insysmsg 'text'
Additionally, the message log is trimmed down to 15 anytime it exceeds 25+ messages.
15
25+
25
10/25
Relevant Code that handles this: https://github.com/UOOutlands/Razor/blob/14e5096e251e7d8fd9f7fb003818ff9df09b8cb6/Razor/Core/SystemMessages.cs#L30
public static void Add(string text) { if (string.IsNullOrEmpty(text)) { return; } Messages.Add(text); if (Messages.Count >= 25) { Messages.RemoveRange(0, 10); } }
https://github.com/UOOutlands/Razor/blob/14e5096e251e7d8fd9f7fb003818ff9df09b8cb6/Razor/Core/SystemMessages.cs#L45
public static bool Exists(string text) { if (string.IsNullOrEmpty(text)) { return false; } for (int i = Messages.Count - 1; i >= 0; i--) { if (Messages[i].IndexOf(text, StringComparison.OrdinalIgnoreCase) != -1) { Messages.RemoveRange(0, i + 1); return true; } } return false; }
Issue with the code pushed recently for this enhancement.
It is only removing the first occurrence. It should remove all occurrences of that exact same message.
Fix Sysmessage Log Behavior
100
. Trim by5
when log exceeds cap.waitforsysmsg
if insysmsg
returns true.!
Override forinsysmsg
waitforsysmsg
to prevent any clearing/consumption.Currently Razor clear ALL PRIOR messages in log INCLUDING UNMATCHED entries.
waitforsysmsg 'text'
followed byif insysmsg 'text'
as it will return false.Additionally, the message log is trimmed down to
15
anytime it exceeds25+
messages.25
is quite low of a cap. Wiping out10/25
(40%) of the log seems excessive.Relevant Code that handles this: https://github.com/UOOutlands/Razor/blob/14e5096e251e7d8fd9f7fb003818ff9df09b8cb6/Razor/Core/SystemMessages.cs#L30
https://github.com/UOOutlands/Razor/blob/14e5096e251e7d8fd9f7fb003818ff9df09b8cb6/Razor/Core/SystemMessages.cs#L45