0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-13 09:50:43 -05:00

Stub out get Prestige endpoint

This commit is contained in:
Chomp 2025-01-09 10:52:09 +00:00
parent 9c17464ae3
commit f5600fe215
5 changed files with 25 additions and 25 deletions

View File

@ -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,

View File

@ -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<any> {
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();
}
}

View File

@ -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
}
}

View File

@ -0,0 +1,10 @@
export interface IObtainPrestigeRequest {
id: string;
location: ILocation;
}
export interface ILocation {
x: number;
y: number;
r: string;
}

View File

@ -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<IGetBodyResponseData<any>> => {
async (url: string, info: any, sessionID: string, _output: string): Promise<INullResponseData> => {
return this.prestigeCallbacks.obtainPrestige(url, info, sessionID);
},
),