Server/project/src/routers/static/ProfileStaticRouter.ts

103 lines
4.3 KiB
TypeScript
Raw Normal View History

2023-03-03 15:23:46 +00:00
import { inject, injectable } from "tsyringe";
import { ProfileCallbacks } from "@spt-aki/callbacks/ProfileCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
2023-03-03 15:23:46 +00:00
@injectable()
2023-11-13 11:12:17 -05:00
export class ProfileStaticRouter extends StaticRouter
2023-03-03 15:23:46 +00:00
{
constructor(
2023-11-13 11:12:17 -05:00
@inject("ProfileCallbacks") protected profileCallbacks: ProfileCallbacks,
)
2023-03-03 15:23:46 +00:00
{
super(
[
new RouteAction(
2023-11-13 11:12:17 -05:00
"/client/game/profile/create",
(url: string, info: any, sessionID: string, output: string): any =>
2023-03-03 15:23:46 +00:00
{
return this.profileCallbacks.createProfile(url, info, sessionID);
2023-11-13 11:12:17 -05:00
},
),
2023-03-03 15:23:46 +00:00
new RouteAction(
"/client/game/profile/list",
2023-11-13 11:12:17 -05:00
(url: string, info: any, sessionID: string, output: string): any =>
2023-03-03 15:23:46 +00:00
{
return this.profileCallbacks.getProfileData(url, info, sessionID);
2023-11-13 11:12:17 -05:00
},
),
2023-03-03 15:23:46 +00:00
new RouteAction(
2023-11-13 11:12:17 -05:00
"/client/game/profile/savage/regenerate",
(url: string, info: any, sessionID: string, output: string): any =>
2023-03-03 15:23:46 +00:00
{
return this.profileCallbacks.regenerateScav(url, info, sessionID);
2023-11-13 11:12:17 -05:00
},
),
2023-03-03 15:23:46 +00:00
new RouteAction(
"/client/game/profile/voice/change",
2023-11-13 11:12:17 -05:00
(url: string, info: any, sessionID: string, output: string): any =>
2023-03-03 15:23:46 +00:00
{
return this.profileCallbacks.changeVoice(url, info, sessionID);
2023-11-13 11:12:17 -05:00
},
),
2023-03-03 15:23:46 +00:00
new RouteAction(
"/client/game/profile/nickname/change",
2023-11-13 11:12:17 -05:00
(url: string, info: any, sessionID: string, output: string): any =>
2023-03-03 15:23:46 +00:00
{
return this.profileCallbacks.changeNickname(url, info, sessionID);
2023-11-13 11:12:17 -05:00
},
),
2023-03-03 15:23:46 +00:00
new RouteAction(
2023-11-13 11:12:17 -05:00
"/client/game/profile/nickname/validate",
(url: string, info: any, sessionID: string, output: string): any =>
2023-03-03 15:23:46 +00:00
{
return this.profileCallbacks.validateNickname(url, info, sessionID);
2023-11-13 11:12:17 -05:00
},
),
2023-03-03 15:23:46 +00:00
new RouteAction(
"/client/game/profile/nickname/reserved",
2023-11-13 11:12:17 -05:00
(url: string, info: any, sessionID: string, output: string): any =>
2023-03-03 15:23:46 +00:00
{
return this.profileCallbacks.getReservedNickname(url, info, sessionID);
2023-11-13 11:12:17 -05:00
},
),
2023-03-03 15:23:46 +00:00
new RouteAction(
2023-11-13 11:12:17 -05:00
"/client/profile/status",
(url: string, info: any, sessionID: string, output: string): any =>
2023-03-03 15:23:46 +00:00
{
return this.profileCallbacks.getProfileStatus(url, info, sessionID);
2023-11-13 11:12:17 -05:00
},
),
2023-03-03 15:23:46 +00:00
new RouteAction(
2023-11-13 11:12:17 -05:00
"/client/profile/settings",
(url: string, info: any, sessionID: string, output: string): any =>
2023-03-03 15:23:46 +00:00
{
return this.profileCallbacks.getProfileSettings(url, info, sessionID);
2023-11-13 11:12:17 -05:00
},
),
2023-03-03 15:23:46 +00:00
new RouteAction(
2023-11-13 11:12:17 -05:00
"/client/game/profile/search",
(url: string, info: any, sessionID: string, output: string): any =>
2023-03-03 15:23:46 +00:00
{
return this.profileCallbacks.searchFriend(url, info, sessionID);
2023-11-13 11:12:17 -05:00
},
),
2023-03-03 15:23:46 +00:00
new RouteAction(
2023-11-13 11:12:17 -05:00
"/launcher/profile/info",
(url: string, info: any, sessionID: string, output: string): any =>
2023-03-03 15:23:46 +00:00
{
return this.profileCallbacks.getMiniProfile(url, info, sessionID);
2023-11-13 11:12:17 -05:00
},
),
2023-03-03 15:23:46 +00:00
new RouteAction(
"/launcher/profiles",
2023-11-13 11:12:17 -05:00
(url: string, info: any, sessionID: string, output: string): any =>
2023-03-03 15:23:46 +00:00
{
return this.profileCallbacks.getAllMiniProfiles(url, info, sessionID);
2023-11-13 11:12:17 -05:00
},
),
],
2023-03-03 15:23:46 +00:00
);
}
2023-11-13 11:12:17 -05:00
}