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

fix: transform baro data for older versions (#3557)

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

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

代码差异

2 个文件 +14 -7
Modified src/services/worldStateService.ts +11 -4
@@ -3771,7 +3771,11 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
3771 3771 const baroEnd = baroStart + unixTimesInMs.day * 14;
3772 3772 const baroRelayOverride = config.worldState?.baroRelayOverride;
3773 3773 const baroNodeIndex = baroRelayOverride && baroRelayOverride > 0 ? baroRelayOverride - 1 : baroIndex % 4;
3774 const baroNode = ["EarthHUB", "MercuryHUB", "SaturnHUB", "PlutoHUB"][baroNodeIndex];
3774 let baroNode = ["EarthHUB", "MercuryHUB", "SaturnHUB", "PlutoHUB"][baroNodeIndex];
3775 if (baroNode == "MercuryHUB" && buildLabel && version_compare(buildLabel, gameToBuildVersion["18.18.0"]) < 0) {
3776 // This Pre-Star Chart 3.0 client won't know Larunda Relay, so move Baro elsewhere.
3777 baroNode = "EarthHUB";
3778 }
3775 3779 const evilBaroStage =
3776 3780 buildLabel && version_compare(buildLabel, gameToBuildVersion["40.0.0"]) < 0
3777 3781 ? 0
@@ -3780,9 +3784,12 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
3780 3784 evilBaroStage
3781 3785 ];
3782 3786 const vt: IVoidTrader = {
3783 _id: { $oid: ((baroStart / 1000) & 0xffffffff).toString(16).padStart(8, "0") + "493c96d6067610bc" },
3784 Activation: { $date: { $numberLong: baroActualStart.toString() } },
3785 Expiry: { $date: { $numberLong: baroEnd.toString() } },
3787 _id: toOid2(
3788 ((baroStart / 1000) & 0xffffffff).toString(16).padStart(8, "0") + "493c96d6067610bc",
3789 buildLabel
3790 ),
3791 Activation: toMongoDate2(baroActualStart, buildLabel),
3792 Expiry: toMongoDate2(baroEnd, buildLabel),
3786 3793 Character: baroCharacter,
3787 3794 Node: baroNode,
3788 3795 Manifest: []
Modified src/types/worldStateTypes.ts +3 -3
@@ -294,9 +294,9 @@ export interface ILiteSortie {
294 294 }
295 295
296 296 export interface IVoidTrader {
297 _id: IOid;
298 Activation: IMongoDate;
299 Expiry: IMongoDate;
297 _id: IOidWithLegacySupport;
298 Activation: IMongoDateWithLegacySupport;
299 Expiry: IMongoDateWithLegacySupport;
300 300 Character: string;
301 301 Node: string;
302 302 Manifest: IVoidTraderOffer[];