~ruther/NosSmooth

db8b2f15fc108a6907f0b5d4769dbe4218a081e7 — Rutherther 2 years ago 17c04fd
fix(packets): finfo contains just one update
2 files changed, 11 insertions(+), 34 deletions(-)

M Packets/NosSmooth.Packets/Server/Relations/FInfoPacket.cs
D Packets/NosSmooth.Packets/Server/Relations/FInfoSubPacket.cs
M Packets/NosSmooth.Packets/Server/Relations/FInfoPacket.cs => Packets/NosSmooth.Packets/Server/Relations/FInfoPacket.cs +11 -5
@@ 5,17 5,23 @@
//  Licensed under the MIT license. See LICENSE file in the project root for full license information.

using NosSmooth.PacketSerializer.Abstractions.Attributes;
using NosSmooth.PacketSerializer.Abstractions.Common;

namespace NosSmooth.Packets.Server.Relations;

/// <summary>
/// Information about friends of a character.
/// Information update of friend of a character.
/// </summary>
/// <param name="FriendSubPackets">The friends list.</param>
[PacketHeader("finfo", PacketSource.Server)]
/// <param name="PlayerId">The id of the friend.</param>
/// <param name="IsConnected">Whether the friend is connected.</param>
/// <param name="Name">The name of the friend.</param>[PacketHeader("finfo", PacketSource.Server)]
[GenerateSerializer(true)]
public record FInfoPacket
(
    [PacketListIndex(0, InnerSeparator = '.', ListSeparator = ' ')]
    IReadOnlyList<FInfoSubPacket> FriendSubPackets
    [PacketIndex(0)]
    long PlayerId,
    [PacketIndex(1)]
    bool IsConnected,
    [PacketIndex(2)]
    NameString Name
) : IPacket;
\ No newline at end of file

D Packets/NosSmooth.Packets/Server/Relations/FInfoSubPacket.cs => Packets/NosSmooth.Packets/Server/Relations/FInfoSubPacket.cs +0 -29
@@ 1,29 0,0 @@
//
//  FInfoSubPacket.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;
using NosSmooth.PacketSerializer.Abstractions.Common;

namespace NosSmooth.Packets.Server.Relations;

/// <summary>
/// A sub packet of <see cref="FInfoPacket"/>
/// containing information about a friend.
/// </summary>
/// <param name="PlayerId">The id of the friend.</param>
/// <param name="IsConnected">Whether the friend is connected.</param>
/// <param name="Name">The name of the friend.</param>
[PacketHeader(null, PacketSource.Server)]
[GenerateSerializer(true)]
public record FInfoSubPacket
(
    [PacketIndex(0)]
    long PlayerId,
    [PacketIndex(1)]
    bool IsConnected,
    [PacketIndex(2)]
    NameString Name
) : IPacket;
\ No newline at end of file

Do not follow this link