返回提交历史
Modified
src/controllers/api/claimCompletedRecipeController.ts
+2
-0
Modified
src/controllers/api/inventoryController.ts
+9
-0
Modified
src/services/purchaseService.ts
+8
-1
XFEstudio/XFESpaceNinjaServer
chore: convert kogake paths for pre-U25 clients (#4195)
Closes #4194 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/4195 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
77ccbee0
代码差异
3 个文件
+19
-1
@@ -25,6 +25,7 @@ import type { IEquipmentClient } from "../../types/equipmentTypes.ts";
25
25
import { eEquipmentFeatures, eStatus } from "../../types/equipmentTypes.ts";
26
26
import { pseudoRecipeToOwnedRecipeMap } from "../../services/foundryService.ts";
27
27
import gameToBuildVersion from "../../constants/gameToBuildVersion.ts";
28
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
28
29
29
30
interface IClaimCompletedRecipeRequest {
30
31
RecipeIds?: IOidWithLegacySupport[]; // U24.4 and beyond
@@ -114,6 +115,7 @@ export const claimCompletedRecipeController: RequestHandler = async (req, res) =
114
115
}
115
116
await inventory.save();
116
117
res.json(resp);
118
broadcastInventoryUpdate(req);
117
119
};
118
120
119
121
const claimCompletedRecipe = async (
@@ -684,6 +684,15 @@ export const getInventoryResponse = async (
684
684
delete mission.Tier;
685
685
}
686
686
687
if (version_compare(buildLabel, gameToBuildVersion["25.0.0"]) >= 0) {
688
return inventoryResponse;
689
}
690
for (const melee of inventoryResponse.Melee) {
691
if (melee.ItemType == "/Lotus/Weapons/Tenno/Melee/BrassKnuckles/BrassKnuckles") {
692
melee.ItemType = "/Lotus/Weapons/Tenno/Melee/Brass Knuckles/BrassKnuckles";
693
}
694
}
695
687
696
// Builds before U24.4.0 handle equipment features differently
688
697
if (version_compare(buildLabel, gameToBuildVersion["24.4.0"]) >= 0) {
689
698
return inventoryResponse;
@@ -111,6 +111,13 @@ export const handlePurchase = async (
111
111
): Promise<IPurchaseResponse> => {
112
112
logger.debug("purchase request", purchaseRequest);
113
113
114
// Fix this path for pre-U25
115
if (
116
purchaseRequest.PurchaseParams.StoreItem == "/Lotus/StoreItems/Weapons/Tenno/Melee/Brass Knuckles/BrassKnuckles"
117
) {
118
purchaseRequest.PurchaseParams.StoreItem = "/Lotus/StoreItems/Weapons/Tenno/Melee/BrassKnuckles/BrassKnuckles";
119
}
120
114
121
const prePurchaseInventoryChanges: IInventoryChanges = {};
115
122
let seed: bigint | undefined;
116
123
if (purchaseRequest.PurchaseParams.Source == ePurchaseSource.Vendor) {
@@ -492,7 +499,7 @@ export const handleStoreItemAcquisition = async (
492
499
seed?: bigint,
493
500
buildLabel: string = BL_LATEST
494
501
): Promise<IPurchaseResponse> => {
495
let purchaseResponse = {
502
let purchaseResponse: IPurchaseResponse = {
496
503
InventoryChanges: {}
497
504
};
498
505
logger.debug(`handling acquisition of ${storeItemName}`);