From 9b3c4959ad3a6b2792f86da54400b960f181788e Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sun, 1 Jan 2023 11:49:51 +0100 Subject: [PATCH] feat(packets): add support for st buff vnums with levels --- .../Server/Entities/StPacket.cs | 4 ++-- .../Server/Entities/StSubPacket.cs | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 Packets/NosSmooth.Packets/Server/Entities/StSubPacket.cs diff --git a/Packets/NosSmooth.Packets/Server/Entities/StPacket.cs b/Packets/NosSmooth.Packets/Server/Entities/StPacket.cs index 46bf2cf9c0de977dc835d356c7bf92529f8ea1fa..7184edf9ada590fda7f1c766381207e0e562422b 100644 --- a/Packets/NosSmooth.Packets/Server/Entities/StPacket.cs +++ b/Packets/NosSmooth.Packets/Server/Entities/StPacket.cs @@ -41,6 +41,6 @@ public record StPacket long Hp, [PacketIndex(7)] long Mp, - [PacketListIndex(8, ListSeparator = ' ', IsOptional = true)] - IReadOnlyList? BuffVNums + [PacketListIndex(8, ListSeparator = ' ', InnerSeparator = '.', IsOptional = true)] + IReadOnlyList? BuffVNums ) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Entities/StSubPacket.cs b/Packets/NosSmooth.Packets/Server/Entities/StSubPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..922568b25bc3953ebfaf564c46cfc73d717c08ab --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Entities/StSubPacket.cs @@ -0,0 +1,22 @@ +// +// StSubPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Entities; + +/// +/// A sub packet for representing buff card id and level. +/// +/// The buff card id. +/// The buff level. +public record StSubPacket +( + [PacketIndex(0)] + short CardId, + [PacketIndex(1, IsOptional = true)] + short? Level +) : IPacket; \ No newline at end of file