返回提交历史
Modified
src/controllers/api/inventoryController.ts
+3
-3
Modified
src/types/inventoryTypes/inventoryTypes.ts
+8
-2
XFEstudio/XFESpaceNinjaServer
fix: convert NextRefill for pre-U19.5 clients (#3673)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3673 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
3d7df4c8
代码差异
2 个文件
+11
-5
@@ -42,6 +42,7 @@ import {
42
42
fromOid,
43
43
modernToU5Recipes,
44
44
toLegacyOid,
45
toMongoDate2,
45
46
toOid,
46
47
toOid2,
47
48
U5Recipes,
@@ -614,18 +615,17 @@ export const getInventoryResponse = async (
614
615
}
615
616
}
616
617
}
617
618
618
for (const item of inventoryResponse.WeaponSkins) {
619
619
toLegacyOid(item.ItemId);
620
620
}
621
622
621
for (const ship of inventoryResponse.Ships) {
623
622
toLegacyOid(ship.ItemId);
624
623
}
625
626
624
for (const item of inventoryResponse.RawUpgrades) {
627
625
if (item.LastAdded) toLegacyOid(item.LastAdded);
628
626
}
627
// as well as a different date format
628
inventoryResponse.NextRefill = toMongoDate2(inventory.NextRefill!, buildLabel);
629
629
630
630
if (version_compare(buildLabel, "2014.02.05.00.00") < 0) {
631
631
// Pre-U12 builds store mods in an array called Cards, and have no concept of RawUpgrades
@@ -1,5 +1,11 @@
1
1
import type { Types } from "mongoose";
2
import type { IOid, IMongoDate, IOidWithLegacySupport, ITypeCount } from "../commonTypes.ts";
2
import type {
3
IOid,
4
IMongoDate,
5
IOidWithLegacySupport,
6
ITypeCount,
7
IMongoDateWithLegacySupport
8
} from "../commonTypes.ts";
3
9
import type {
4
10
IColor,
5
11
IItemConfig,
@@ -458,7 +464,7 @@ export interface IInventoryClient
458
464
OperatorCustomizationSlotPurchases?: number;
459
465
NemesisAbandonedRewards: string[];
460
466
LastInventorySync?: IOid;
461
NextRefill?: IMongoDate;
467
NextRefill?: IMongoDateWithLegacySupport;
462
468
FoundToday?: IMiscItem[]; // for Argon Crystals
463
469
CustomMarkers?: ICustomMarkers[];
464
470
//ActiveLandscapeTraps: any[];