XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

SpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 1 Star 0
返回提交历史

XFEstudio/SpaceNinjaServer

chore(stats): cut key path (#3988)

Closes #3986 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3988 Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com> Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>

25637724
AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
提交于

代码差异

1 个文件 +6 -3
Modified src/services/statsService.ts +6 -3
@@ -296,17 +296,20 @@ export const updateStats = async (
296 296 case "MISSION_SCORE":
297 297 playerStats.Missions ??= [];
298 298 for (const [type, highScore] of Object.entries(data as IUploadEntry)) {
299 const mission = playerStats.Missions.find(element => element.type === type);
299 const cType = type.startsWith("/Lotus/Types/Keys/")
300 ? type.replace("/Lotus/Types/Keys/", "")
301 : type;
302 const mission = playerStats.Missions.find(element => element.type === cType);
300 303 if (mission) {
301 304 if (highScore > mission.highScore) {
302 305 mission.highScore = highScore;
303 306 }
304 307 } else {
305 playerStats.Missions.push({ type: type, highScore });
308 playerStats.Missions.push({ type: cType, highScore });
306 309 }
307 310 await submitLeaderboardScore(
308 311 "weekly",
309 type,
312 cType,
310 313 accountOwnerId,
311 314 payload.displayName,
312 315 highScore,