* Add files via upload

* Add files via upload

* Add files via upload
This commit is contained in:
User958568
2025-09-14 18:50:49 +03:00
committed by GitHub
parent 2e4310edf1
commit 793e55f9de
12 changed files with 417 additions and 17 deletions

View File

@@ -0,0 +1,39 @@
using EpinelPS.Data;
using EpinelPS.Database;
using EpinelPS.Utils;
namespace EpinelPS.LobbyServer.Minigame.PlaySoda
{
[PacketPath("/arcade/play-soda/challenge/finish/running")]
public class GetChallengeFinishRunning : LobbyMsgHandler
{
protected override async Task HandleAsync()
{
var request = await ReadData<ReqFinishArcadePlaySodaRunningChallenge>();
var user = GetUser();
var challengeStageId = GameData.Instance.EventPlaySodaChallengeModeTable.First(i => i.Value.game_type == EventPlaySodaGameType.Running).Key;
var arcadePlaySodaInfo = user.ArcadePlaySodaInfoList.First(i => i.ChallengeStageId == challengeStageId);
if (arcadePlaySodaInfo.UserRank < request.Score)
{
arcadePlaySodaInfo.UserRank = request.Score;
}
arcadePlaySodaInfo.AccumulatedScore += request.Score;
var pointValues = GetChallengeObtainPointReward.GetPointValues(arcadePlaySodaInfo.ChallengeStageId);
if (pointValues.Length > arcadePlaySodaInfo.LastRewardStep && arcadePlaySodaInfo.AccumulatedScore >= pointValues[arcadePlaySodaInfo.LastRewardStep])
{
arcadePlaySodaInfo.CanReceivePointReward = true;
}
await WriteDataAsync(new ResFinishArcadePlaySodaRunningChallenge());
JsonDb.Save();
}
}
}