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.
25 lines
639 B
C#
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()
|
|
});
|
|
}
|
|
}
|