Drops now land on the ground as gadgets and are picked up with F instead of appearing in the bag out of nowhere. Chests, ore, crystals and plants all spawn and can be interacted with. Monsters load by scene group rather than by a radius around each one, so a camp shows up as a camp and nothing pops into existence mid fight. The group anchors come out of the scene Lua, which also killed four invented tuning constants. The gateway was creating a whole new session for every handshake datagram, and the client retransmits those until it gets an answer. That is where the piles of duplicated monsters and the chests coming back from the dead were coming from. Also: monster level scales to the party now, path queries return an actual two point path instead of an empty one, NpcTalk closes properly, and the ability and combat invocations are no longer echoed back to the client that sent them.
134 lines
5.2 KiB
C#
134 lines
5.2 KiB
C#
using Yuanshen.Gameserver.Controllers.Attributes;
|
|
using Yuanshen.Gameserver.Controllers.Result;
|
|
using Yuanshen.Protocol;
|
|
|
|
namespace Yuanshen.Gameserver.Controllers;
|
|
|
|
[NetController]
|
|
internal sealed class StubController : ControllerBase
|
|
{
|
|
private const int PathComplete = 1;
|
|
private const int PathFailed = 3;
|
|
|
|
[NetCommand(CmdType.ClientFpsStatusNotify)]
|
|
public ValueTask<IResult> OnClientFpsStatusNotify() => ValueTask.FromResult(Ok());
|
|
|
|
[NetCommand(CmdType.EntityAbilityConfigHashNotify)]
|
|
public ValueTask<IResult> OnEntityAbilityConfigHashNotify() => ValueTask.FromResult(Ok());
|
|
|
|
[NetCommand(CmdType.MonsterAIConfigHashNotify)]
|
|
public ValueTask<IResult> OnMonsterAIConfigHashNotify() => ValueTask.FromResult(Ok());
|
|
|
|
[NetCommand(CmdType.EvtEntityRenderersChangedNotify)]
|
|
public ValueTask<IResult> OnEvtEntityRenderersChangedNotify() => ValueTask.FromResult(Ok());
|
|
|
|
[NetCommand(CmdType.EvtAiSyncCombatThreatInfoNotify)]
|
|
public ValueTask<IResult> OnEvtAiSyncCombatThreatInfoNotify() => ValueTask.FromResult(Ok());
|
|
|
|
[NetCommand(CmdType.PlayerSetPauseReq)]
|
|
public ValueTask<IResult> OnPlayerSetPauseReq()
|
|
=> ValueTask.FromResult(Response(CmdType.PlayerSetPauseRsp, new PlayerSetPauseRsp { Retcode = Retcode.RET_SUCC }));
|
|
|
|
[NetCommand(CmdType.PathfindingEnterSceneReq)]
|
|
public ValueTask<IResult> OnPathfindingEnterSceneReq()
|
|
=> ValueTask.FromResult(Response(CmdType.PathfindingEnterSceneRsp,
|
|
new PathfindingEnterSceneRsp { Retcode = Retcode.RET_SUCC }));
|
|
|
|
[NetCommand(CmdType.PersonalLineAllDataReq)]
|
|
public ValueTask<IResult> OnPersonalLineAllDataReq()
|
|
=> ValueTask.FromResult(Response(CmdType.PersonalLineAllDataRsp,
|
|
new PersonalLineAllDataRsp { Retcode = Retcode.RET_SUCC }));
|
|
|
|
[NetCommand(CmdType.GetAllActivatedBargainDataReq)]
|
|
public ValueTask<IResult> OnGetAllActivatedBargainDataReq()
|
|
=> ValueTask.FromResult(Response(CmdType.GetAllActivatedBargainDataRsp,
|
|
new GetAllActivatedBargainDataRsp { Retcode = Retcode.RET_SUCC }));
|
|
|
|
[NetCommand(CmdType.GetInvestigationMonsterReq)]
|
|
public ValueTask<IResult> OnGetInvestigationMonsterReq()
|
|
=> ValueTask.FromResult(Response(CmdType.GetInvestigationMonsterRsp,
|
|
new GetInvestigationMonsterRsp { Retcode = Retcode.RET_SUCC }));
|
|
|
|
[NetCommand(CmdType.GetPlayerFriendListReq)]
|
|
public ValueTask<IResult> OnGetPlayerFriendListReq()
|
|
=> ValueTask.FromResult(Response(CmdType.GetPlayerFriendListRsp,
|
|
new GetPlayerFriendListRsp { Retcode = Retcode.RET_SUCC }));
|
|
|
|
[NetCommand(CmdType.SceneGetAreaExplorePercentReq)]
|
|
public ValueTask<IResult> OnSceneGetAreaExplorePercentReq()
|
|
{
|
|
SceneGetAreaExplorePercentReq req = Packet!.DecodeBody<SceneGetAreaExplorePercentReq>();
|
|
|
|
return ValueTask.FromResult(Response(CmdType.SceneGetAreaExplorePercentRsp, new SceneGetAreaExplorePercentRsp
|
|
{
|
|
Retcode = Retcode.RET_SUCC,
|
|
AreaId = req.AreaId,
|
|
ExplorePercent = 0
|
|
}));
|
|
}
|
|
|
|
[NetCommand(CmdType.AvatarFetterLevelRewardReq)]
|
|
public ValueTask<IResult> OnAvatarFetterLevelRewardReq()
|
|
{
|
|
AvatarFetterLevelRewardReq req = Packet!.DecodeBody<AvatarFetterLevelRewardReq>();
|
|
|
|
return ValueTask.FromResult(Response(CmdType.AvatarFetterLevelRewardRsp, new AvatarFetterLevelRewardRsp
|
|
{
|
|
Retcode = Retcode.RET_SUCC,
|
|
AvatarGuid = req.AvatarGuid,
|
|
FetterLevel = req.FetterLevel
|
|
}));
|
|
}
|
|
|
|
[NetCommand(CmdType.QueryPathReq)]
|
|
public ValueTask<IResult> OnQueryPathReq()
|
|
{
|
|
QueryPathReq req = Packet!.DecodeBody<QueryPathReq>();
|
|
|
|
QueryPathRsp rsp = new()
|
|
{
|
|
Retcode = Retcode.RET_SUCC,
|
|
QueryId = req.QueryId,
|
|
QueryStatus = PathFailed
|
|
};
|
|
|
|
Vector? destination = req.DestinationPos.LastOrDefault();
|
|
|
|
if (req.SourcePos is not null && destination is not null)
|
|
{
|
|
rsp.QueryStatus = PathComplete;
|
|
rsp.Corners.Add(req.SourcePos);
|
|
rsp.Corners.Add(destination);
|
|
}
|
|
|
|
return ValueTask.FromResult(Response(CmdType.QueryPathRsp, rsp));
|
|
}
|
|
|
|
[NetCommand(CmdType.NpcTalkReq)]
|
|
public ValueTask<IResult> OnNpcTalkReq()
|
|
{
|
|
NpcTalkReq req = Packet!.DecodeBody<NpcTalkReq>();
|
|
|
|
return ValueTask.FromResult(Response(CmdType.NpcTalkRsp, new NpcTalkRsp
|
|
{
|
|
Retcode = Retcode.RET_SUCC,
|
|
NpcEntityId = req.NpcEntityId,
|
|
CurTalkId = req.TalkId
|
|
}));
|
|
}
|
|
|
|
[NetCommand(CmdType.ClientLockGameTimeNotify)]
|
|
public ValueTask<IResult> OnClientLockGameTimeNotify() => ValueTask.FromResult(Ok());
|
|
|
|
[NetCommand(CmdType.EnterTransPointRegionNotify)]
|
|
public ValueTask<IResult> OnEnterTransPointRegionNotify() => ValueTask.FromResult(Ok());
|
|
|
|
[NetCommand(CmdType.ExitTransPointRegionNotify)]
|
|
public ValueTask<IResult> OnExitTransPointRegionNotify() => ValueTask.FromResult(Ok());
|
|
|
|
[NetCommand(CmdType.EntityAiSyncNotify)]
|
|
public ValueTask<IResult> OnEntityAiSyncNotify() => ValueTask.FromResult(Ok());
|
|
|
|
[NetCommand(CmdType.ObstacleModifyNotify)]
|
|
public ValueTask<IResult> OnObstacleModifyNotify() => ValueTask.FromResult(Ok());
|
|
}
|