using Yuanshen.Gameserver.Controllers.Attributes; using Yuanshen.Gameserver.Controllers.Result; using Yuanshen.Gameserver.Game; using Yuanshen.Protocol; using Microsoft.Extensions.Logging; namespace Yuanshen.Gameserver.Controllers; [NetController] internal sealed class AbilityController : ControllerBase { [NetCommand(CmdType.AbilityInvocationsNotify)] public ValueTask OnAbilityInvocationsNotify() => ValueTask.FromResult(Ok()); [NetCommand(CmdType.ClientAbilityChangeNotify)] public ValueTask OnClientAbilityChangeNotify() => ValueTask.FromResult(Ok()); [NetCommand(CmdType.ClientAbilityInitFinishNotify)] public async ValueTask OnClientAbilityInitFinishNotify(Player player, SceneManager scene) { ClientAbilityInitFinishNotify notify = Packet!.DecodeBody(); GameMonster? monster = player.Monsters.FirstOrDefault(candidate => candidate.EntityId == notify.EntityId); if (monster is not null) await scene.SyncMonsterLevelAsync(monster); return Ok(); } [NetCommand(CmdType.EvtDoSkillSuccNotify)] public ValueTask OnEvtDoSkillSuccNotify(ILogger logger) { logger.LogDebug("DoSkillSucc raw={body}", Convert.ToHexString(Packet!.Body.Span)); return ValueTask.FromResult(Ok()); } }