Snowflake/RPG.Services.Gameserver/Modules/BaseModule.cs
2024-01-19 17:45:18 +03:00

17 lines
573 B
C#

using Google.Protobuf;
using RPG.Network.Proto;
using RPG.Services.Gameserver.Session;
namespace RPG.Services.Gameserver.Modules;
internal abstract class BaseModule
{
protected static void Send<TBody>(PlayerSession session, CmdType cmdType, TBody body) where TBody : IMessage<TBody>
{
session.SendToService(RPGServiceType.Gateserver, ServiceCommandType.ForwardGameMessage, new CmdForwardGameMessage
{
SessionId = session.SessionId,
CmdType = (ushort)cmdType,
Payload = body.ToByteString()
});
}
}