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

XFESpaceNinjaServer

A simple server for a small space ninja game

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

XFEstudio/XFESpaceNinjaServer

feat: xtra cheese rotation (#2191)

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. Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2191 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

cccf6f04
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

1 个文件 +10 -1
Modified src/services/worldStateService.ts +10 -1
@@ -1297,8 +1297,12 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
1297 1297 pushVoidStorms(worldState.VoidStorms, hour);
1298 1298 }
1299 1299
1300 // Sentient Anomaly cycling every 30 minutes
1300 // Sentient Anomaly + Xtra Cheese cycles
1301 1301 const halfHour = Math.trunc(timeMs / (unixTimesInMs.hour / 2));
1302 const hourInSeconds = 3600;
1303 const cheeseInterval = hourInSeconds * 8;
1304 const cheeseDuration = hourInSeconds * 2;
1305 const cheeseIndex = Math.trunc(timeSecs / cheeseInterval);
1302 1306 const tmp = {
1303 1307 cavabegin: "1690761600",
1304 1308 PurchasePlatformLockEnabled: true,
@@ -1323,6 +1327,11 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
1323 1327 },
1324 1328 ennnd: true,
1325 1329 mbrt: true,
1330 fbst: {
1331 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.
1332 e: cheeseIndex * cheeseInterval + cheeseDuration,
1333 n: (cheeseIndex + 1) * hourInSeconds * 8
1334 },
1326 1335 sfn: [550, 553, 554, 555][halfHour % 4]
1327 1336 };
1328 1337 worldState.Tmp = JSON.stringify(tmp);