diff --git a/project/assets/database/templates/prestige.json b/project/assets/database/templates/prestige.json index 7c3d47a0..e2942701 100644 --- a/project/assets/database/templates/prestige.json +++ b/project/assets/database/templates/prestige.json @@ -29,21 +29,6 @@ "dispersion": 0, "conditionType": "Quest" }, - { - "id": "6761fe66b41bc1e8222b5b6e", - "index": 2, - "dynamicLocale": false, - "visibilityConditions": [], - "globalQuestCounterId": "", - "parentId": "", - "target": "6761f28a022f60bb320f3e95", - "status": [ - 4 - ], - "availableAfter": 0, - "dispersion": 0, - "conditionType": "Quest" - }, { "id": "675d723b026308c637193c83", "index": 3, diff --git a/project/src/callbacks/PrestigeCallbacks.ts b/project/src/callbacks/PrestigeCallbacks.ts index 5341440c..913b5c8b 100644 --- a/project/src/callbacks/PrestigeCallbacks.ts +++ b/project/src/callbacks/PrestigeCallbacks.ts @@ -3,6 +3,8 @@ import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; import type { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPrestige } from "@spt/models/eft/common/tables/IPrestige"; import type { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; +import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; +import { IObtainPrestigeRequest } from "@spt/models/eft/prestige/IObtainPrestigeRequest"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { inject, injectable } from "tsyringe"; @@ -20,7 +22,9 @@ export class PrestigeCallbacks { } /** Handle client/prestige/obtain */ - public obtainPrestige(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData { - return this.httpResponse.getBody(this.prestigeController.obtainPrestige(sessionID, info)); + public obtainPrestige(url: string, info: IObtainPrestigeRequest, sessionID: string): INullResponseData { + this.prestigeController.obtainPrestige(sessionID, info); + + return this.httpResponse.nullResponse(); } } diff --git a/project/src/controllers/PrestigeController.ts b/project/src/controllers/PrestigeController.ts index 0c8b0863..be57a1c1 100644 --- a/project/src/controllers/PrestigeController.ts +++ b/project/src/controllers/PrestigeController.ts @@ -5,6 +5,7 @@ import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPrestige } from "@spt/models/eft/common/tables/IPrestige"; +import { IObtainPrestigeRequest } from "@spt/models/eft/prestige/IObtainPrestigeRequest"; import type { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { SaveServer } from "@spt/servers/SaveServer"; @@ -51,7 +52,11 @@ export class PrestigeController { /** * Handle /client/prestige/obtain */ - public obtainPrestige(sessionID: string, info: IEmptyRequestData): any { - throw new Error("Method not implemented."); + public obtainPrestige(sessionID: string, request: IObtainPrestigeRequest): void { + // TODO + // Reset profile back to default from template + // Take items passed in from request and add to inventory + // Set prestige level in profile + // Update dogtags to prestige type } } diff --git a/project/src/models/eft/prestige/IObtainPrestigeRequest.ts b/project/src/models/eft/prestige/IObtainPrestigeRequest.ts new file mode 100644 index 00000000..6407cb68 --- /dev/null +++ b/project/src/models/eft/prestige/IObtainPrestigeRequest.ts @@ -0,0 +1,10 @@ +export interface IObtainPrestigeRequest { + id: string; + location: ILocation; +} + +export interface ILocation { + x: number; + y: number; + r: string; +} diff --git a/project/src/routers/static/PrestigeStaticRouter.ts b/project/src/routers/static/PrestigeStaticRouter.ts index 221e6c36..dd108761 100644 --- a/project/src/routers/static/PrestigeStaticRouter.ts +++ b/project/src/routers/static/PrestigeStaticRouter.ts @@ -1,6 +1,7 @@ import type { PrestigeCallbacks } from "@spt/callbacks/PrestigeCallbacks"; import { RouteAction, StaticRouter } from "@spt/di/Router"; import type { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; +import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; import { inject, injectable } from "tsyringe"; @injectable() @@ -21,12 +22,7 @@ export class PrestigeStaticRouter extends StaticRouter { new RouteAction( "/client/prestige/obtain", - async ( - url: string, - info: any, - sessionID: string, - _output: string, - ): Promise> => { + async (url: string, info: any, sessionID: string, _output: string): Promise => { return this.prestigeCallbacks.obtainPrestige(url, info, sessionID); }, ),