返回提交历史
Modified
config.json.example
+4
-0
Modified
src/controllers/api/getVendorInfoController.ts
+9
-0
Modified
src/services/configService.ts
+4
-1
XFEstudio/SpaceNinjaServer
feat: add dev.keepVendorsExpired config option (#2161)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2161 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
12d09531
代码差异
3 个文件
+17
-1
@@ -50,6 +50,7 @@
50
50
"noDojoResearchTime": false,
51
51
"fastClanAscension": false,
52
52
"spoofMasteryRank": -1,
53
"nightwaveStandingMultiplier": 1,
53
54
"worldState": {
54
55
"creditBoost": false,
55
56
"affinityBoost": false,
@@ -58,5 +59,8 @@
58
59
"eidolonOverride": "",
59
60
"vallisOverride": "",
60
61
"nightwaveOverride": ""
62
},
63
"dev": {
64
"keepVendorsExpired": false
61
65
}
62
66
}
@@ -2,6 +2,7 @@ import { RequestHandler } from "express";
2
2
import { applyStandingToVendorManifest, getVendorManifestByTypeName } from "@/src/services/serversideVendorsService";
3
3
import { getInventory } from "@/src/services/inventoryService";
4
4
import { getAccountIdForRequest } from "@/src/services/loginService";
5
import { config } from "@/src/services/configService";
5
6
6
7
export const getVendorInfoController: RequestHandler = async (req, res) => {
7
8
let manifest = getVendorManifestByTypeName(req.query.vendor as string);
@@ -14,6 +15,14 @@ export const getVendorInfoController: RequestHandler = async (req, res) => {
14
15
const accountId = await getAccountIdForRequest(req);
15
16
const inventory = await getInventory(accountId);
16
17
manifest = applyStandingToVendorManifest(inventory, manifest);
18
if (config.dev?.keepVendorsExpired) {
19
manifest = {
20
VendorInfo: {
21
...manifest.VendorInfo,
22
Expiry: { $date: { $numberLong: "0" } }
23
}
24
};
25
}
17
26
}
18
27
19
28
res.json(manifest);
@@ -56,6 +56,7 @@ interface IConfig {
56
56
noDojoResearchTime?: boolean;
57
57
fastClanAscension?: boolean;
58
58
spoofMasteryRank?: number;
59
nightwaveStandingMultiplier?: number;
59
60
worldState?: {
60
61
creditBoost?: boolean;
61
62
affinityBoost?: boolean;
@@ -65,7 +66,9 @@ interface IConfig {
65
66
vallisOverride?: string;
66
67
nightwaveOverride?: string;
67
68
};
68
nightwaveStandingMultiplier?: number;
69
dev?: {
70
keepVendorsExpired?: boolean;
71
};
69
72
}
70
73
71
74
export const configPath = path.join(repoDir, "config.json");