返回提交历史
Modified
src/controllers/api/getVendorInfoController.ts
+12
-1
XFEstudio/SpaceNinjaServer
fix: omit bubonico from coda weapons shop for clients that don't know it (#3958)
Closes #3967 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3958 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
117b7a69
代码差异
1 个文件
+12
-1
@@ -3,6 +3,8 @@ import { applyStandingToVendorManifest, getVendorManifestByTypeName } from "../.
3
3
import { getInventory } from "../../services/inventoryService.ts";
4
4
import { getAccountForRequest } from "../../services/loginService.ts";
5
5
import { config } from "../../services/configService.ts";
6
import { toMongoDate, version_compare } from "../../helpers/inventoryHelpers.ts";
7
import gameToBuildVersion from "../../constants/gameToBuildVersion.ts";
6
8
7
9
export const getVendorInfoController: RequestHandler = async (req, res) => {
8
10
let buildLabel: string | undefined;
@@ -27,10 +29,19 @@ export const getVendorInfoController: RequestHandler = async (req, res) => {
27
29
manifest = {
28
30
VendorInfo: {
29
31
...manifest.VendorInfo,
30
Expiry: { $date: { $numberLong: "0" } }
32
Expiry: toMongoDate(new Date(Date.now() + 5000)) // Giving 5 seconds because tenet/coda shop boots you with "Shopping session expired" at expiry
31
33
}
32
34
};
33
35
}
36
37
if (buildLabel && version_compare(buildLabel, gameToBuildVersion["42.0.0"]) < 0) {
38
// Coda shop breaks if an item is unknown.
39
manifest.VendorInfo.ItemManifest = manifest.VendorInfo.ItemManifest.filter(
40
item =>
41
item.StoreItem !=
42
"/Lotus/StoreItems/Weapons/Infested/InfestedLich/LongGuns/CodaBubonico/CodaBubonicoCannon"
43
);
44
}
34
45
}
35
46
36
47
res.json(manifest);