From 3ad07255c8dd7181455aea31ceee81a8990059e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Boh=C3=A1=C4=8Dek?= Date: Sat, 1 Jan 2022 00:20:03 +0100 Subject: [PATCH] feat: add walk packet --- .../Packets/Client/Movement/WalkPacket.cs | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Core/NosSmooth.Packets/Packets/Client/Movement/WalkPacket.cs diff --git a/Core/NosSmooth.Packets/Packets/Client/Movement/WalkPacket.cs b/Core/NosSmooth.Packets/Packets/Client/Movement/WalkPacket.cs new file mode 100644 index 0000000..3a5df83 --- /dev/null +++ b/Core/NosSmooth.Packets/Packets/Client/Movement/WalkPacket.cs @@ -0,0 +1,37 @@ +// +// WalkPacket.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.Packets.Attributes; + +namespace NosSmooth.Packets.Packets.Client.Movement; + +/// +/// Packet sent when moving. +/// +/// +/// This packet is sent every x seconds +/// when moving. The packet is sent before the +/// player has actually reached the position. +/// +/// The server should respond with "at" packet. +/// +/// The position the character is walking to. +/// +/// The check sum. Has value: (walkPacket.PositionX + walkPacket.PositionY) % 3 % 2. +/// The movement speed. +[PacketHeader("walk", PacketSource.Client)] +[GenerateSerializer] +public record WalkPacket +( + [PacketIndex(0)] + short PositionX, + [PacketIndex(2)] + short PositionY, + [PacketIndex(3)] + byte CheckSum, + [PacketIndex(4)] + short Speed +) : IPacket; \ No newline at end of file -- 2.48.1