fix: Warn when sending empty gumps (#2563)
### Summary Generates a console warning when users receive an empty gump. This will help prevent client side leaks.
This commit is contained in:
parent
b2c59191bd
commit
64e6fe5da8
12 changed files with 114 additions and 0 deletions
|
|
@ -30,6 +30,7 @@ public abstract class StaticGump<TSelf> : BaseGump where TSelf : StaticGump<TSel
|
|||
private static byte[] _compressedStringsData;
|
||||
|
||||
private static bool _hasDynamicStrings;
|
||||
private static bool _cachedHasVisualElements;
|
||||
private static int _staticStringsCount;
|
||||
private static byte[] _staticStrings;
|
||||
|
||||
|
|
@ -72,6 +73,7 @@ public abstract class StaticGump<TSelf> : BaseGump where TSelf : StaticGump<TSel
|
|||
|
||||
if (Cached && _compressedLayoutData != null)
|
||||
{
|
||||
HasVisualElements = _cachedHasVisualElements;
|
||||
writer.Write(_compressedLayoutData);
|
||||
|
||||
if (_compressedStringsData != null)
|
||||
|
|
@ -116,6 +118,7 @@ public abstract class StaticGump<TSelf> : BaseGump where TSelf : StaticGump<TSel
|
|||
BuildLayout(ref gumpBuilder);
|
||||
gumpBuilder.FinalizeLayout();
|
||||
|
||||
HasVisualElements = _cachedHasVisualElements = gumpBuilder.HasVisualElements;
|
||||
_switches = gumpBuilder.Switches;
|
||||
_textEntries = gumpBuilder.TextEntries;
|
||||
_staticStringsCount = gumpBuilder._stringsCount;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue