Compare commits

...

2 commits

Author SHA1 Message Date
thexeondev
ac277d019a Merge branch 'master' of https://git.xeondev.com/xeon/NahidaImpact 2024-01-04 23:09:05 +03:00
thexeondev
563a174b2a Unlock scene points & areas 2024-01-04 23:08:29 +03:00
2 changed files with 35 additions and 0 deletions

View file

@ -1,5 +1,6 @@
using NahidaImpact.Gameserver.Controllers.Attributes; using NahidaImpact.Gameserver.Controllers.Attributes;
using NahidaImpact.Gameserver.Controllers.Result; using NahidaImpact.Gameserver.Controllers.Result;
using NahidaImpact.Gameserver.Game;
using NahidaImpact.Gameserver.Game.Scene; using NahidaImpact.Gameserver.Game.Scene;
using NahidaImpact.Protocol; using NahidaImpact.Protocol;
@ -11,6 +12,39 @@ internal class SceneController : ControllerBase
// TODO: Scene management, Entity management!!! // TODO: Scene management, Entity management!!!
public const uint WeaponEntityId = 100663300; 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)] [NetCommand(CmdType.PostEnterSceneReq)]
public async ValueTask<IResult> OnPostEnterSceneReq(SceneManager sceneManager) 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) internal class SceneManager(NetSession session, Player player, EntityManager entityManager, EntityFactory entityFactory, BinDataCollection binData)
{ {
public uint EnterToken { get; private set; } public uint EnterToken { get; private set; }
public uint CurrentSceneId => _sceneId;
private readonly BinDataCollection _binData = binData; private readonly BinDataCollection _binData = binData;