using NahidaImpact.Gameserver.Controllers.Attributes; using NahidaImpact.Gameserver.Controllers.Result; using NahidaImpact.Gameserver.Game.Scene; using NahidaImpact.Protocol; namespace NahidaImpact.Gameserver.Controllers; [NetController] internal class SceneController : ControllerBase { // TODO: Scene management, Entity management!!! public const uint WeaponEntityId = 100663300; [NetCommand(CmdType.PostEnterSceneReq)] public async ValueTask OnPostEnterSceneReq(SceneManager sceneManager) { await sceneManager.OnEnterStateChanged(SceneEnterState.PostEnter); return Response(CmdType.PostEnterSceneRsp, new PostEnterSceneRsp { EnterSceneToken = sceneManager.EnterToken }); } [NetCommand(CmdType.EnterSceneDoneReq)] public async ValueTask OnEnterSceneDoneReq(SceneManager sceneManager) { await sceneManager.OnEnterStateChanged(SceneEnterState.EnterDone); return Response(CmdType.EnterSceneDoneRsp, new EnterSceneDoneRsp { EnterSceneToken = sceneManager.EnterToken }); } [NetCommand(CmdType.SceneInitFinishReq)] public async ValueTask OnSceneInitFinishReq(SceneManager sceneManager) { await sceneManager.OnEnterStateChanged(SceneEnterState.InitFinished); return Response(CmdType.SceneInitFinishRsp, new SceneInitFinishRsp { EnterSceneToken = sceneManager.EnterToken }); } [NetCommand(CmdType.EnterSceneReadyReq)] public async ValueTask OnEnterSceneReadyReq(SceneManager sceneManager) { await sceneManager.OnEnterStateChanged(SceneEnterState.ReadyToEnter); return Response(CmdType.EnterSceneReadyRsp, new EnterSceneReadyRsp { EnterSceneToken = sceneManager.EnterToken }); } }