返回提交历史
Modified
src/services/worldStateService.ts
+3
-11
XFEstudio/SpaceNinjaServer
fix: correct Activation/Expiry date for Ghoul Emergence (#2777)
Closes #2775 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2777 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>
791ae389
代码差异
1 个文件
+3
-11
@@ -2803,7 +2803,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
2803
2803
2804
2804
const activeStartDay = day - ghoulsCycleDay + 17;
2805
2805
const activeEndDay = activeStartDay + 5;
2806
const dayWithFraction = (timeMs - EPOCH) / 86400000;
2806
const dayWithFraction = (timeMs - EPOCH) / unixTimesInMs.day;
2807
2807
2808
2808
const progress = (dayWithFraction - activeStartDay) / (activeEndDay - activeStartDay);
2809
2809
const healthPct = 1 - Math.min(Math.max(progress, 0), 1);
@@ -2814,22 +2814,14 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
2814
2814
$date: {
2815
2815
$numberLong: config.worldState?.ghoulEmergenceOverride
2816
2816
? "1753204900185"
2817
: Date.UTC(
2818
date.getUTCFullYear(),
2819
date.getUTCMonth(),
2820
date.getUTCDate() + activeStartDay
2821
).toString()
2817
: (EPOCH + activeStartDay * unixTimesInMs.day).toString()
2822
2818
}
2823
2819
},
2824
2820
Expiry: {
2825
2821
$date: {
2826
2822
$numberLong: config.worldState?.ghoulEmergenceOverride
2827
2823
? "2000000000000"
2828
: Date.UTC(
2829
date.getUTCFullYear(),
2830
date.getUTCMonth(),
2831
date.getUTCDate() + activeEndDay
2832
).toString()
2824
: (EPOCH + activeEndDay * unixTimesInMs.day).toString()
2833
2825
}
2834
2826
},
2835
2827
HealthPct: config.worldState?.ghoulEmergenceOverride ? 1 : healthPct,