feat: skip to last token of nested levels if possible
2 files changed, 18 insertions(+), 0 deletions(-) M Core/NosSmooth.PacketSerializersGenerator/AttributeGenerators/PacketIndexAttributeGenerator.cs M Core/NosSmooth.Packets/Converters/Special/ListTypeConverter.cs
M Core/NosSmooth.PacketSerializersGenerator/AttributeGenerators/PacketIndexAttributeGenerator.cs => Core/NosSmooth.PacketSerializersGenerator/AttributeGenerators/PacketIndexAttributeGenerator.cs +9 -0
@@ 95,6 95,15 @@ if ({parameterInfo.Name}Result.Entity is null) {{ if (pushedLevel) { // If we know that we are not on the last token in the item level, just skip to the end of the item. // Note that if this is the case, then that means the converter is either corrupted // or the packet has more fields. textWriter.WriteLine($@" while (stringEnumerator.IsOnLastToken() == false) {{ stringEnumerator.GetNextToken(); }} "); textWriter.WriteLine("stringEnumerator.PopLevel();"); }
M Core/NosSmooth.Packets/Converters/Special/ListTypeConverter.cs => Core/NosSmooth.Packets/Converters/Special/ListTypeConverter.cs +9 -0
@@ 53,6 53,15 @@ public class ListTypeConverter : ISpecialTypeConverter } var result = _typeConverterRepository.Deserialize(genericType, stringEnumerator); // If we know that we are not on the last token in the item level, just skip to the end of the item. // Note that if this is the case, then that means the converter is either corrupted // or the packet has more fields. while (stringEnumerator.IsOnLastToken() == false) { stringEnumerator.GetNextToken(); } stringEnumerator.PopLevel(); if (!result.IsSuccess) {