~ruther/NosSmooth

ref: 21a2c9bc5a3c1dd022d4e942dd5929e8e1331bcc NosSmooth/Samples/PacketInterceptor/TestResponder.cs -rw-r--r-- 591 bytes
21a2c9bc — František Boháček feat: add Packets and PacketTests projects 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
using NosCore.Packets.Interfaces;
using NosCore.Packets.ServerPackets.MiniMap;
using NosSmooth.Core.Client;
using NosSmooth.Core.Packets;
using Remora.Results;

namespace PacketInterceptor;

public class TestResponder : IEveryPacketResponder
{
    private readonly INostaleClient _client;

    public TestResponder(INostaleClient client)
    {
        _client = client;
    }
    
    public async Task<Result> Respond<TPacket>(TPacket packet, CancellationToken ct = default) where TPacket : IPacket
    {
        return await _client.SendPacketAsync("test");
    }
}