Files
DanhengServer-OpenSource/GameServer/Server/Packet/Recv/GridFight/HandlerGridFightBuyExpCsReq.cs
2025-10-26 12:06:07 +08:00

23 lines
771 B
C#

using EggLink.DanhengServer.GameServer.Game.GridFight.Component;
using EggLink.DanhengServer.Kcp;
namespace EggLink.DanhengServer.GameServer.Server.Packet.Recv.GridFight;
[Opcode(CmdIds.GridFightBuyExpCsReq)]
public class HandlerGridFightBuyExpCsReq : Handler
{
public override async Task OnHandle(Connection connection, byte[] header, byte[] data)
{
var gridFight = connection.Player?.GridFightManager?.GridFightInstance;
if (gridFight == null)
{
await connection.SendPacket(CmdIds.GridFightBuyExpScRsp);
return;
}
var basicComp = gridFight.GetComponent<GridFightBasicComponent>();
await basicComp.BuyLevelExp();
await connection.SendPacket(CmdIds.GridFightBuyExpScRsp);
}
}