~ruther/NosSmooth

ref: 419415627683d961c9a0f060e4e52d422baea40e NosSmooth/Extensions/NosSmooth.Extensions.Pathfinding/Responders/CInfoPacketResponder.cs -rw-r--r-- 1004 bytes
41941562 — Rutherther feat(pathfinding): save mates state 2 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
//
//  CInfoPacketResponder.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.Core.Packets;
using NosSmooth.Packets.Server.Character;
using Remora.Results;

namespace NosSmooth.Extensions.Pathfinding.Responders;

/// <inheritdoc />
public class CInfoPacketResponder : IPacketResponder<CInfoPacket>
{
    private readonly PathfinderState _state;

    /// <summary>
    /// Initializes a new instance of the <see cref="CInfoPacketResponder"/> class.
    /// </summary>
    /// <param name="state">The state.</param>
    public CInfoPacketResponder(PathfinderState state)
    {
        _state = state;

    }

    /// <inheritdoc />
    public Task<Result> Respond(PacketEventArgs<CInfoPacket> packetArgs, CancellationToken ct = default)
    {
        _state.SetCharacterId(packetArgs.Packet.CharacterId);
        return Task.FromResult(Result.FromSuccess());
    }
}
Do not follow this link