mirror of
https://github.com/sebastian-heinz/mhf-server.git
synced 2025-04-03 13:28:30 +08:00
23 lines
667 B
C#
23 lines
667 B
C#
using Mhf.Server.Model;
|
|
|
|
namespace Mhf.Server.Packet
|
|
{
|
|
public abstract class ClientHandlerDeserializer<T> : ClientHandler
|
|
{
|
|
private readonly IPacketDeserializer<T> _deserializer;
|
|
|
|
protected ClientHandlerDeserializer(MhfServer server, IPacketDeserializer<T> deserializer) : base(server)
|
|
{
|
|
_deserializer = deserializer;
|
|
}
|
|
|
|
public override void Handle(MhfClient client, MhfPacket requestPacket)
|
|
{
|
|
T request = _deserializer.Deserialize(requestPacket);
|
|
HandleRequest(client, request);
|
|
}
|
|
|
|
public abstract void HandleRequest(MhfClient client, T request);
|
|
}
|
|
}
|