~ruther/NosSmooth

3ad07255c8dd7181455aea31ceee81a8990059e1 — František Boháček 3 years ago 4e771de
feat: add walk packet
1 files changed, 37 insertions(+), 0 deletions(-)

A Core/NosSmooth.Packets/Packets/Client/Movement/WalkPacket.cs
A Core/NosSmooth.Packets/Packets/Client/Movement/WalkPacket.cs => Core/NosSmooth.Packets/Packets/Client/Movement/WalkPacket.cs +37 -0
@@ 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;

/// <summary>
/// Packet sent when moving.
/// </summary>
/// <remarks>
/// 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.
/// </remarks>
/// <param name="PositionX">The position the character is walking to.</param>
/// <param name="PositionY"></param>
/// <param name="CheckSum">The check sum. Has value: (walkPacket.PositionX + walkPacket.PositionY) % 3 % 2. </param>
/// <param name="Speed">The movement speed.</param>
[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

Do not follow this link