Files
EpinelPS/EpinelPS/LobbyServer/Event/CompleteEventScenario.cs
qmengz eea01945f9 Add event pass functionality and logging improvements (#59)
- Implement FastClearEventStage handler for fast clearing event stages.
- Enhance GetStoryDungeon handler to include team data and cleared stages.
- Modify GetInventoryData to streamline item processing.
- Introduce BuyEventPassRank and BuyPassRank handlers for purchasing event pass ranks.
- Add CompleteEventPassMission and CompletePassMission handlers for mission completion.
- Create ObtainEventPassReward and ObtainOneEventPassReward handlers for reward retrieval.
- Implement ObtainPassReward and ObtainOnePassReward handlers for general pass rewards.
- Add PassHelper class to manage pass-related logic, including obtaining rewards and completing missions.
- Update User and EventData models to support new pass functionality.
- Integrate log4net for improved logging capabilities throughout the application.
- Update game configuration for static data and resource URLs.
- Create log4net configuration file for logging setup.
2025-10-20 10:34:09 -04:00

37 lines
1.0 KiB
C#

using EpinelPS.Database;
using EpinelPS.Utils;
namespace EpinelPS.LobbyServer.Event
{
[PacketPath("/event/scenario/complete")]
public class CompleteEventScenario : LobbyMsgHandler
{
protected override async Task HandleAsync()
{
ReqSetEventScenarioComplete req = await ReadData<ReqSetEventScenarioComplete>();
User user = GetUser();
if (user.EventInfo.TryGetValue(req.EventId, out EventData? evt))
{
if (!evt.CompletedScenarios.Contains(req.ScenarioId))
{
evt.CompletedScenarios.Add(req.ScenarioId);
}
}
else
{
evt = new();
evt.CompletedScenarios.Add(req.ScenarioId);
user.EventInfo.Add(req.EventId, evt);
}
JsonDb.Save();
ResSetEventScenarioComplete response = new();
// TODO reward
await WriteDataAsync(response);
}
}
}