~ruther/NosSmooth

ref: c6be7bd2a809904ae8a4259b0fa2512051b4d4e1 NosSmooth/Core/NosSmooth.Packets/Packets/Server/Entities/InPacket.cs -rw-r--r-- 2.3 KiB
c6be7bd2 — František Boháček chore: remove NosCore dependency 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
//  InPacket.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;
using NosSmooth.Packets.Common;
using NosSmooth.Packets.Enums;

namespace NosSmooth.Packets.Packets.Server.Entities;

/// <summary>
/// There is a new entity on the map present.
/// </summary>
/// <param name="EntityType">The type of the entity.</param>
/// <param name="Name">The name of the entity, present only for players.</param>
/// <param name="VNum">The vnum of the entity, present only for non players.</param>
/// <param name="Unknown">Unknown value present only for players. It's always "-".</param>
/// <param name="EntityId">The id of the entity.</param>
/// <param name="PositionX">The x coordinate the entity is at.</param>
/// <param name="PositionY">The y coordinate the entity is at.</param>
/// <param name="Direction">The direction the entity is looking, present only for non-objects.</param>
/// <param name="PlayerSubPacket">The player data sub packet present only for players.</param>
/// <param name="ItemSubPacket">The item data sub packet present only for objects.</param>
/// <param name="NonPlayerSubPacket">The non player data sub packet present only for npcs and monsters.</param>
[PacketHeader("in", PacketSource.Server)]
[GenerateSerializer]
public record InPacket
(
    [PacketIndex(0)]
    EntityType EntityType,
    [PacketConditionalIndex(1, "EntityType", false,  EntityType.Player)]
    NameString? Name,
    [PacketConditionalIndex(2, "EntityType", true, EntityType.Player)]
    long? VNum,
    [PacketConditionalIndex(3, "EntityType", false, EntityType.Player)]
    string? Unknown,
    [PacketIndex(4)]
    long EntityId,
    [PacketIndex(5)]
    short PositionX,
    [PacketIndex(6)]
    short PositionY,
    [PacketConditionalIndex(7, "EntityType", true, EntityType.Object)]
    byte? Direction,
    [PacketConditionalIndex(8, "EntityType", false, EntityType.Player, InnerSeparator = ' ')]
    InPlayerSubPacket? PlayerSubPacket,
    [PacketConditionalIndex(9, "EntityType", false, EntityType.Object, InnerSeparator = ' ')]
    InItemSubPacket? ItemSubPacket,
    [PacketConditionalIndex(10, "EntityType", true, EntityType.Player, EntityType.Object, InnerSeparator = ' ')]
    InNonPlayerSubPacket? NonPlayerSubPacket
) : IPacket;
Do not follow this link