Snowflake/RPG.Services.Gameserver/Modules/MissionModule.cs

30 lines
873 B
C#
Raw Normal View History

2024-01-19 14:45:18 +00:00
using RPG.GameCore.Excel;
using RPG.Network.Proto;
using RPG.Services.Gameserver.Modules.Attributes;
using RPG.Services.Gameserver.Session;
namespace RPG.Services.Gameserver.Modules;
internal class MissionModule : BaseModule
{
private readonly ExcelTables _excelTables;
public MissionModule(ModuleManager moduleManager, ExcelTables excelTables) : base(moduleManager)
2024-01-19 14:45:18 +00:00
{
_excelTables = excelTables;
}
[OnCommand(CmdType.CmdGetMissionDataCsReq)]
public Task OnCmdGetMissionDataCsReq(PlayerSession session, ReadOnlyMemory<byte> _)
{
GetMissionDataScRsp rsp = new();
foreach (ExcelRow row in _excelTables.GetAllRows(ExcelType.MainMission))
{
rsp.FinishedMainMissionIdList.Add(row.Id);
}
Send(session, CmdType.CmdGetMissionDataScRsp, rsp);
return Task.CompletedTask;
}
}