yuanshen/Yuanshen.Gameserver/Controllers/ControllerBase.cs
wisedev fc2ac1050f First working version of the server
KCP gameserver with packet dispatch, scene streaming, combat, gacha and the
shop, plus a small HTTP server for the login flow and the wish history page.

Game data under assets is pulled out of the client instead of being typed by
hand. The excel tables come from the packed bin container and the spawn points
from the compiled scene scripts.
2026-09-04 02:10:50 +03:00

25 lines
639 B
C#

using Yuanshen.Gameserver.Controllers.Result;
using Yuanshen.Gameserver.Network;
using Yuanshen.Protocol;
using Google.Protobuf;
namespace Yuanshen.Gameserver.Controllers;
internal abstract class ControllerBase
{
public NetPacket? Packet { get; set; }
protected IResult Ok()
{
return new SinglePacketResult(null);
}
protected IResult Response<TMessage>(CmdType cmdType, TMessage message) where TMessage : IMessage
{
return new SinglePacketResult(new()
{
CmdType = cmdType,
Head = Memory<byte>.Empty,
Body = message.ToByteArray()
});
}
}