返回提交历史
Modified
config.json.example
+4
-0
Modified
src/services/configService.ts
+4
-0
Modified
src/services/missionInventoryUpdateService.ts
+3
-1
Modified
src/services/worldStateService.ts
+14
-3
XFEstudio/SpaceNinjaServer
feat: unfaithful bug fixes (#2267)
Closes #2257 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2267 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
9a034b1c
代码差异
4 个文件
+25
-4
@@ -58,6 +58,10 @@
58
58
"unlockAllSimarisResearchEntries": false,
59
59
"spoofMasteryRank": -1,
60
60
"nightwaveStandingMultiplier": 1,
61
"unfaithfulBugFixes": {
62
"ignore1999LastRegionPlayed": false,
63
"fixXtraCheeseTimer": false
64
},
61
65
"worldState": {
62
66
"creditBoost": false,
63
67
"affinityBoost": false,
@@ -65,6 +65,10 @@ export interface IConfig {
65
65
unlockAllSimarisResearchEntries?: boolean;
66
66
spoofMasteryRank?: number;
67
67
nightwaveStandingMultiplier?: number;
68
unfaithfulBugFixes?: {
69
ignore1999LastRegionPlayed?: boolean;
70
fixXtraCheeseTimer?: boolean;
71
};
68
72
worldState?: {
69
73
creditBoost?: boolean;
70
74
affinityBoost?: boolean;
@@ -268,7 +268,9 @@ export const addMissionInventoryUpdates = async (
268
268
addMissionComplete(inventory, value);
269
269
break;
270
270
case "LastRegionPlayed":
271
inventory.LastRegionPlayed = value;
271
if (!(config.unfaithfulBugFixes?.ignore1999LastRegionPlayed && value === "1999MapName")) {
272
inventory.LastRegionPlayed = value;
273
}
272
274
break;
273
275
case "RawUpgrades":
274
276
addMods(inventory, value);
@@ -1325,6 +1325,17 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
1325
1325
const cheeseInterval = hourInSeconds * 8;
1326
1326
const cheeseDuration = hourInSeconds * 2;
1327
1327
const cheeseIndex = Math.trunc(timeSecs / cheeseInterval);
1328
let cheeseStart = cheeseIndex * cheeseInterval;
1329
let cheeseEnd = cheeseStart + cheeseDuration;
1330
let cheeseNext = (cheeseIndex + 1) * cheeseInterval;
1331
// Live servers only update the start time once it happens, which makes the
1332
// client show a negative countdown during off-hours. Optionally adjust the
1333
// times so the next activation is always in the future.
1334
if (config.unfaithfulBugFixes?.fixXtraCheeseTimer && timeSecs >= cheeseEnd) {
1335
cheeseStart = cheeseNext;
1336
cheeseEnd = cheeseStart + cheeseDuration;
1337
cheeseNext += cheeseInterval;
1338
}
1328
1339
const tmp: ITmp = {
1329
1340
cavabegin: "1690761600",
1330
1341
PurchasePlatformLockEnabled: true,
@@ -1349,9 +1360,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
1349
1360
ennnd: true,
1350
1361
mbrt: true,
1351
1362
fbst: {
1352
a: cheeseIndex * cheeseInterval, // This has a bug where the client shows a negative time for "Xtra cheese starts in ..." until it refreshes the world state. This is because we're only providing the new activation as soon as that time/date is reached. However, this is 100% faithful to live.
1353
e: cheeseIndex * cheeseInterval + cheeseDuration,
1354
n: (cheeseIndex + 1) * cheeseInterval
1363
a: cheeseStart,
1364
e: cheeseEnd,
1365
n: cheeseNext
1355
1366
},
1356
1367
sfn: [550, 553, 554, 555][halfHour % 4]
1357
1368
};