From a5f93e53f6bac1d5dfc0e5eb97ef038098423508 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sat, 12 Feb 2022 17:21:40 +0100 Subject: [PATCH] feat(packets): add sp point and cooldown packets --- .../Server/Specialists/SdPacket.cs | 24 ++++++++++++++ .../Server/Specialists/SpPacket.cs | 33 +++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 Packets/NosSmooth.Packets/Server/Specialists/SdPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Specialists/SpPacket.cs diff --git a/Packets/NosSmooth.Packets/Server/Specialists/SdPacket.cs b/Packets/NosSmooth.Packets/Server/Specialists/SdPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..9b80823c9dee615cb55e2dc457dc960321477696 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Specialists/SdPacket.cs @@ -0,0 +1,24 @@ +// +// SdPacket.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.Specialists; + +/// +/// Packet for sp cooldown. +/// +/// +/// Doesn't block putting on the sp. Just shows loading on the character icon. +/// +/// The cooldown. +[PacketHeader("sd", PacketSource.Server)] +[GenerateSerializer(true)] +public record SdPacket +( + [PacketIndex(0)] + short Cooldown +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Specialists/SpPacket.cs b/Packets/NosSmooth.Packets/Server/Specialists/SpPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..e3f841381a22c5beb4e418159a0fa384623102a3 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Specialists/SpPacket.cs @@ -0,0 +1,33 @@ +// +// SpPacket.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.Specialists; + +/// +/// Packet with information about sp points. +/// +/// +/// Sent on login, on sp change, on points change. +/// +/// The additional sp points used after sp points are 0. +/// The maximum of additional sp points. +/// The sp points that decrease upon using sp. +/// The maximum of sp points. +[PacketHeader("sp", PacketSource.Server)] +[GenerateSerializer(true)] +public record SpPacket +( + [PacketIndex(0)] + int AdditionalSpPoints, + [PacketIndex(1)] + int MaxAdditionalSpPoints, + [PacketIndex(2)] + int SpPoints, + [PacketIndex(3)] + int MaxSpPoints +) : IPacket; \ No newline at end of file