mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-13 04:30:44 -05:00
Added new client/customization/storage
endpoint
This commit is contained in:
parent
089cf2f2b0
commit
cbe69db50b
@ -10,6 +10,7 @@ import type { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEv
|
||||
import { SaveServer } from "@spt/servers/SaveServer";
|
||||
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||
import { inject, injectable } from "tsyringe";
|
||||
import type { ICustomisationStorage } from "../models/eft/common/tables/ICustomisationStorage";
|
||||
|
||||
@injectable()
|
||||
export class CustomizationCallbacks {
|
||||
@ -58,6 +59,10 @@ export class CustomizationCallbacks {
|
||||
}
|
||||
|
||||
public getHideoutCustomisation(url: string, info: any, sessionID: string): IGetBodyResponseData<any> {
|
||||
return this.customizationController.getHideoutCustomisation(sessionID, info);
|
||||
return this.httpResponse.getBody(this.customizationController.getHideoutCustomisation(sessionID, info));
|
||||
}
|
||||
|
||||
getStorage(url: string, info: any, sessionID: string): IGetBodyResponseData<ICustomisationStorage> {
|
||||
return this.httpResponse.getBody(this.customizationController.getCustomisationStoage(sessionID, info));
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,8 @@ import { SaveServer } from "@spt/servers/SaveServer";
|
||||
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||
import { inject, injectable } from "tsyringe";
|
||||
import type { ICustomisationStorage } from "../models/eft/common/tables/ICustomisationStorage";
|
||||
import type { IHideoutCustomisation } from "../models/eft/hideout/IHideoutCustomisation";
|
||||
|
||||
@injectable()
|
||||
export class CustomizationController {
|
||||
@ -239,7 +241,11 @@ export class CustomizationController {
|
||||
return result;
|
||||
}
|
||||
|
||||
public getHideoutCustomisation(sessionID: string, info: any) {
|
||||
public getHideoutCustomisation(sessionID: string, info: any): IHideoutCustomisation {
|
||||
return this.databaseService.getHideout().customisation;
|
||||
}
|
||||
|
||||
public getCustomisationStoage(sessionID: string, info: any): ICustomisationStorage[] {
|
||||
return this.databaseService.getTemplates().customisationStoage;
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import type { IAchievement } from "@spt/models/eft/common/tables/IAchievement";
|
||||
import type { ICustomisationStorage } from "@spt/models/eft/common/tables/ICustomisationStorage";
|
||||
import type { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem";
|
||||
import type { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase";
|
||||
import type { ILocationServices } from "@spt/models/eft/common/tables/ILocationServices";
|
||||
@ -11,6 +12,7 @@ import type { IDefaultEquipmentPreset } from "@spt/models/eft/profile/ISptProfil
|
||||
|
||||
export interface ITemplates {
|
||||
character: string[];
|
||||
customisationStoage: ICustomisationStorage[];
|
||||
items: Record<string, ITemplateItem>;
|
||||
prestige: IPrestige;
|
||||
quests: Record<string, IQuest>;
|
||||
|
@ -30,6 +30,17 @@ export class CustomizationStaticRouter extends StaticRouter {
|
||||
return this.customizationCallbacks.getHideoutCustomisation(url, info, sessionID);
|
||||
},
|
||||
),
|
||||
new RouteAction(
|
||||
"/client/customization/storage",
|
||||
async (
|
||||
url: string,
|
||||
info: any,
|
||||
sessionID: string,
|
||||
output: string,
|
||||
): Promise<IGetBodyResponseData<IGetSuitsResponse>> => {
|
||||
return this.customizationCallbacks.getStorage(url, info, sessionID);
|
||||
},
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user