WutheringWaves/GameServer/Controllers/Controller.cs

22 lines
538 B
C#
Raw Normal View History

2024-02-09 22:15:05 +00:00
using GameServer.Network;
using GameServer.Network.Messages;
using Google.Protobuf;
using Protocol;
namespace GameServer.Controllers;
internal abstract class Controller
{
protected PlayerSession Session { get; }
public Controller(PlayerSession session)
{
Session = session;
}
protected static ResponseMessage Response<TProtoBuf>(MessageId messageId, TProtoBuf protoBuf) where TProtoBuf : IMessage<TProtoBuf> => new()
{
MessageId = messageId,
Payload = protoBuf.ToByteArray()
};
}