~ruther/NosSmooth

ref: 040e6825fc3889fdb41ffa1554b74c2cf5857a9f NosSmooth/Samples/PacketInterceptor/TestResponder.cs -rw-r--r-- 570 bytes
040e6825 — František Boháček Initial commit 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");
    }
}
Do not follow this link