~ruther/NosSmooth

ref: 3ad07255c8dd7181455aea31ceee81a8990059e1 NosSmooth/Core/NosSmooth.Packets/Packets/Client/Movement/WalkPacket.cs -rw-r--r-- 1.1 KiB
3ad07255 — František Boháček feat: add walk packet 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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;
Do not follow this link