From caf312bb887b024678f864b9e6b3c9fd2ef02157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Boh=C3=A1=C4=8Dek?= Date: Sat, 21 Jan 2023 20:31:31 +0100 Subject: [PATCH] feat(packets): remove ExtraSpace from CList packet and replace it with allowing multiple separators --- .../NosSmooth.Packets/Server/Login/CListPacket.cs | 13 +++++-------- .../Converters/Packets/CListPacketConverterTests.cs | 2 -- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Packets/NosSmooth.Packets/Server/Login/CListPacket.cs b/Packets/NosSmooth.Packets/Server/Login/CListPacket.cs index 6dbe97f..504a7ae 100644 --- a/Packets/NosSmooth.Packets/Server/Login/CListPacket.cs +++ b/Packets/NosSmooth.Packets/Server/Login/CListPacket.cs @@ -33,7 +33,6 @@ namespace NosSmooth.Packets.Server.Login; /// The hero level of the character. /// The equipment of the player. /// The job level of the character. -/// There is an extra space in the packet, for the converter to work correctly, this should be an empty string. TODO add Prefix field to PacketIndex and put Prefix ' ' on Unknown2. /// Unknown, seems to be always 1. /// Unknown, seems to be always 1. /// The pets of the character. @@ -65,18 +64,16 @@ public record CListPacket byte HeroLevel, [PacketIndex(10, InnerSeparator = '.')] CListEquipmentSubPacket EquipmentSubPacket, - [PacketIndex(11)] + [PacketIndex(11, AllowMultipleSeparators = true)] byte JobLevel, [PacketIndex(12)] - string ExtraSpace, - [PacketIndex(13)] byte Unknown2, - [PacketIndex(14)] + [PacketIndex(13)] byte Unknown3, - [PacketListIndex(15, ListSeparator = '.', InnerSeparator = '.')] + [PacketListIndex(14, ListSeparator = '.', InnerSeparator = '.')] IReadOnlyList>> PetsSubPacket, - [PacketIndex(16)] + [PacketIndex(15)] byte HatDesign, - [PacketIndex(17)] + [PacketIndex(16)] byte Unknown4 ) : IPacket; \ No newline at end of file diff --git a/Tests/NosSmooth.Packets.Tests/Converters/Packets/CListPacketConverterTests.cs b/Tests/NosSmooth.Packets.Tests/Converters/Packets/CListPacketConverterTests.cs index c7a1222..3657cbc 100644 --- a/Tests/NosSmooth.Packets.Tests/Converters/Packets/CListPacketConverterTests.cs +++ b/Tests/NosSmooth.Packets.Tests/Converters/Packets/CListPacketConverterTests.cs @@ -69,7 +69,6 @@ public class CListPacketConverterTests null ), 99, - string.Empty, 1, 1, new OptionalWrapper>[] @@ -151,7 +150,6 @@ public class CListPacketConverterTests null ), 99, - string.Empty, 1, 1, new List>>(new OptionalWrapper>[] -- 2.49.0