using Google.Protobuf; using RPG.Network.Proto; using RPG.Services.Core.Network; using RPG.Services.Core.Network.Command; namespace RPG.Services.Core.Session; public abstract class RPGSession { private readonly ServiceBox _serviceBox; public ulong SessionId { get; } public uint PlayerUid { get; set; } public RPGSession(ulong sessionId, ServiceBox serviceBox) { SessionId = sessionId; _serviceBox = serviceBox; } public void SendToService
(RPGServiceType target, ServiceCommandType commandType, TBody body) where TBody : IMessage { ServiceCommand command = new(_serviceBox.CurrentType, commandType, body.ToByteArray()); byte[] commandBuffer = GC.AllocateUninitializedArray