2023-03-03 15:23:46 +00:00
|
|
|
import { inject, injectable } from "tsyringe";
|
|
|
|
|
2023-10-19 17:21:17 +00:00
|
|
|
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
|
|
|
{
|
2023-11-13 12:31:52 -05:00
|
|
|
constructor(@inject("ProfileCallbacks") protected profileCallbacks: ProfileCallbacks)
|
2023-03-03 15:23:46 +00:00
|
|
|
{
|
2023-11-13 12:31:52 -05:00
|
|
|
super([
|
|
|
|
new RouteAction(
|
|
|
|
"/client/game/profile/create",
|
|
|
|
(url: string, info: any, sessionID: string, output: string): any =>
|
|
|
|
{
|
|
|
|
return this.profileCallbacks.createProfile(url, info, sessionID);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
new RouteAction(
|
|
|
|
"/client/game/profile/list",
|
|
|
|
(url: string, info: any, sessionID: string, output: string): any =>
|
|
|
|
{
|
|
|
|
return this.profileCallbacks.getProfileData(url, info, sessionID);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
new RouteAction(
|
|
|
|
"/client/game/profile/savage/regenerate",
|
|
|
|
(url: string, info: any, sessionID: string, output: string): any =>
|
|
|
|
{
|
|
|
|
return this.profileCallbacks.regenerateScav(url, info, sessionID);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
new RouteAction(
|
|
|
|
"/client/game/profile/voice/change",
|
|
|
|
(url: string, info: any, sessionID: string, output: string): any =>
|
|
|
|
{
|
|
|
|
return this.profileCallbacks.changeVoice(url, info, sessionID);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
new RouteAction(
|
|
|
|
"/client/game/profile/nickname/change",
|
|
|
|
(url: string, info: any, sessionID: string, output: string): any =>
|
|
|
|
{
|
|
|
|
return this.profileCallbacks.changeNickname(url, info, sessionID);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
new RouteAction(
|
|
|
|
"/client/game/profile/nickname/validate",
|
|
|
|
(url: string, info: any, sessionID: string, output: string): any =>
|
|
|
|
{
|
|
|
|
return this.profileCallbacks.validateNickname(url, info, sessionID);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
new RouteAction(
|
|
|
|
"/client/game/profile/nickname/reserved",
|
|
|
|
(url: string, info: any, sessionID: string, output: string): any =>
|
|
|
|
{
|
|
|
|
return this.profileCallbacks.getReservedNickname(url, info, sessionID);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
new RouteAction(
|
|
|
|
"/client/profile/status",
|
|
|
|
(url: string, info: any, sessionID: string, output: string): any =>
|
|
|
|
{
|
|
|
|
return this.profileCallbacks.getProfileStatus(url, info, sessionID);
|
|
|
|
},
|
|
|
|
),
|
2023-12-27 15:05:07 +00:00
|
|
|
new RouteAction(
|
|
|
|
"/client/profile/view",
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
|
|
(url: string, info: any, sessionID: string, output: string): any =>
|
|
|
|
{
|
|
|
|
return this.profileCallbacks.getOtherProfile(url, info, sessionID);
|
|
|
|
},
|
|
|
|
),
|
2023-11-13 12:31:52 -05:00
|
|
|
new RouteAction(
|
|
|
|
"/client/profile/settings",
|
|
|
|
(url: string, info: any, sessionID: string, output: string): any =>
|
|
|
|
{
|
|
|
|
return this.profileCallbacks.getProfileSettings(url, info, sessionID);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
new RouteAction(
|
|
|
|
"/client/game/profile/search",
|
|
|
|
(url: string, info: any, sessionID: string, output: string): any =>
|
|
|
|
{
|
|
|
|
return this.profileCallbacks.searchFriend(url, info, sessionID);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
new RouteAction(
|
|
|
|
"/launcher/profile/info",
|
|
|
|
(url: string, info: any, sessionID: string, output: string): any =>
|
|
|
|
{
|
|
|
|
return this.profileCallbacks.getMiniProfile(url, info, sessionID);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
new RouteAction("/launcher/profiles", (url: string, info: any, sessionID: string, output: string): any =>
|
|
|
|
{
|
|
|
|
return this.profileCallbacks.getAllMiniProfiles(url, info, sessionID);
|
|
|
|
}),
|
|
|
|
]);
|
2023-03-03 15:23:46 +00:00
|
|
|
}
|
2023-11-13 11:12:17 -05:00
|
|
|
}
|