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): use `MISSION_TIME` if we don't have `CURRENT_MISSION_TIME` (#3837)

Closes #3827 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3837 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>

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

代码差异

1 个文件 +12 -1
Modified src/services/statsService.ts +12 -1
@@ -246,6 +246,18 @@ export const updateStats = async (
246 246 playerStats.TimePlayedSec += data;
247 247 break;
248 248
249 case "MISSION_TIME": {
250 if (!("CURRENT_MISSION_TIME" in (actionData as IStatsTimers))) {
251 let total = 0;
252 for (const missionTime of Object.values(data as IUploadEntry)) {
253 total += missionTime;
254 }
255 playerStats.TimePlayedSec ??= 0;
256 playerStats.TimePlayedSec += total;
257 }
258 break;
259 }
260
249 261 case "CIPHER_TIME":
250 262 playerStats.CipherTime ??= 0;
251 263 playerStats.CipherTime += data;
@@ -538,7 +550,6 @@ const ignoredCategories = [
538 550 "IN_SHIP_TIME",
539 551 "IN_SHIP_VIEW_TIME",
540 552 "MISSION_LOAD_TIME",
541 "MISSION_TIME",
542 553 "REGION_TIME",
543 554 "PLATFORM_TIME",
544 555 "PRE_DIE_TIME",