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