Unlock scene points & areas

This commit is contained in:
thexeondev 2024-01-04 23:08:29 +03:00
parent 2204bf42fe
commit 563a174b2a
2 changed files with 35 additions and 0 deletions

View file

@ -1,5 +1,6 @@
using NahidaImpact.Gameserver.Controllers.Attributes;
using NahidaImpact.Gameserver.Controllers.Result;
using NahidaImpact.Gameserver.Game;
using NahidaImpact.Gameserver.Game.Scene;
using NahidaImpact.Protocol;
@ -11,6 +12,39 @@ internal class SceneController : ControllerBase
// TODO: Scene management, Entity management!!!
public const uint WeaponEntityId = 100663300;
[NetCommand(CmdType.GetScenePointReq)]
public ValueTask<IResult> OnGetScenePointReq(SceneManager sceneManager, Player player)
{
GetScenePointRsp rsp = new()
{
SceneId = sceneManager.CurrentSceneId,
BelongUid = player.Uid
};
for (uint i = 1; i <= 777; i++)
{
rsp.UnlockedPointList.Add(i);
}
return ValueTask.FromResult(Response(CmdType.GetScenePointRsp, rsp));
}
[NetCommand(CmdType.GetSceneAreaReq)]
public ValueTask<IResult> OnGetSceneAreaReq(SceneManager sceneManager)
{
GetSceneAreaRsp rsp = new()
{
SceneId = sceneManager.CurrentSceneId
};
for (uint i = 1; i <= 20; i++)
{
rsp.AreaIdList.Add(i);
}
return ValueTask.FromResult(Response(CmdType.GetSceneAreaRsp, rsp));
}
[NetCommand(CmdType.PostEnterSceneReq)]
public async ValueTask<IResult> OnPostEnterSceneReq(SceneManager sceneManager)
{

View file

@ -11,6 +11,7 @@ namespace NahidaImpact.Gameserver.Game.Scene;
internal class SceneManager(NetSession session, Player player, EntityManager entityManager, EntityFactory entityFactory, BinDataCollection binData)
{
public uint EnterToken { get; private set; }
public uint CurrentSceneId => _sceneId;
private readonly BinDataCollection _binData = binData;