WutheringWaves/GameServer/Controllers/Controller.cs

23 lines
595 B
C#
Raw Normal View History

global using GameServer.Controllers.Result;
using GameServer.Network;
2024-02-09 22:15:05 +00:00
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 RpcResult Response<TProtoBuf>(MessageId messageId, TProtoBuf protoBuf) where TProtoBuf : IMessage<TProtoBuf> => new(new ResponseMessage
2024-02-09 22:15:05 +00:00
{
MessageId = messageId,
Payload = protoBuf.ToByteArray()
});
2024-02-09 22:15:05 +00:00
}