~ruther/Nostale-Anonymizer

ref: 357547f83c1313e1f734cd0c601cc69ce6b93452 Nostale-Anonymizer/src/Anonymizer/Movers/IMover.cs -rw-r--r-- 1.3 KiB
357547f8 — František Boháček feat: add movers for bfe, ct, dm, rc, bf, sayi, sayitemt, sayt, spk, rest, raidfhp, raidfmp, ctl, suctl, ptctl, throw, tp, char_sc, die packets 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
35
36
37
38
39
40
41
42
43
44
45
46
//
//  IMover.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;

namespace Anonymizer.Movers;

/// <summary>
/// Moves a packet, anonymizes it.
/// </summary>
public interface IMover
{
    /// <summary>
    /// Check whether to handle given packet.
    /// </summary>
    /// <param name="packet">The packet to check.</param>
    /// <returns>Whether to handle that packet.</returns>
    public bool ShouldHandle(IPacket packet);

    /// <summary>
    /// Move the packet, anonymize it.
    /// </summary>
    /// <param name="anonymizer">The anonymizer to use.</param>
    /// <param name="packet">The packet.</param>
    /// <returns>Moved packet.</returns>
    public IPacket Move(IAnonymizer anonymizer, IPacket packet);
}

/// <summary>
/// Moves a packet, anonymizes it.
/// </summary>
/// <typeparam name="TPacket">The type of the packet.</typeparam>
public interface IMover<TPacket> : IMover
    where TPacket : IPacket
{
    /// <summary>
    /// Move the packet, anonymize it.
    /// </summary>
    /// <param name="anonymizer">The anonymizer.</param>
    /// <param name="packet">The packet to anonymize.</param>
    /// <returns>The new packet.</returns>
    public TPacket Move(IAnonymizer anonymizer, TPacket packet);
}
Do not follow this link