Server/project/src/routers/static/LauncherStaticRouter.ts
Alex d13e86ba46 Rebranding to SPT (!345)
Rebranded src code and scripts to SPT

Co-authored-by: clodan <clodan@clodan.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/345
Co-authored-by: Alex <clodan@noreply.dev.sp-tarkov.com>
Co-committed-by: Alex <clodan@noreply.dev.sp-tarkov.com>
2024-05-21 17:59:04 +00:00

105 lines
4.3 KiB
TypeScript

import { inject, injectable } from "tsyringe";
import { LauncherCallbacks } from "@spt/callbacks/LauncherCallbacks";
import { RouteAction, StaticRouter } from "@spt/di/Router";
@injectable()
export class LauncherStaticRouter extends StaticRouter
{
constructor(@inject("LauncherCallbacks") protected launcherCallbacks: LauncherCallbacks)
{
super([
new RouteAction(
"/launcher/ping",
async (url: string, info: any, sessionID: string, output: string): Promise<string> =>
{
return this.launcherCallbacks.ping(url, info, sessionID);
},
),
new RouteAction(
"/launcher/server/connect",
async (url: string, info: any, sessionID: string, output: string): Promise<string> =>
{
return this.launcherCallbacks.connect();
},
),
new RouteAction(
"/launcher/profile/login",
async (url: string, info: any, sessionID: string, output: string): Promise<string> =>
{
return this.launcherCallbacks.login(url, info, sessionID);
},
),
new RouteAction(
"/launcher/profile/register",
async (url: string, info: any, sessionID: string, output: string): Promise<string> =>
{
return this.launcherCallbacks.register(url, info, sessionID);
},
),
new RouteAction(
"/launcher/profile/get",
async (url: string, info: any, sessionID: string, output: string): Promise<string> =>
{
return this.launcherCallbacks.get(url, info, sessionID);
},
),
new RouteAction(
"/launcher/profile/change/username",
async (url: string, info: any, sessionID: string, output: string): Promise<string> =>
{
return this.launcherCallbacks.changeUsername(url, info, sessionID);
},
),
new RouteAction(
"/launcher/profile/change/password",
async (url: string, info: any, sessionID: string, output: string): Promise<string> =>
{
return this.launcherCallbacks.changePassword(url, info, sessionID);
},
),
new RouteAction(
"/launcher/profile/change/wipe",
async (url: string, info: any, sessionID: string, output: string): Promise<string> =>
{
return this.launcherCallbacks.wipe(url, info, sessionID);
},
),
new RouteAction(
"/launcher/profile/remove",
async (url: string, info: any, sessionID: string, output: string): Promise<string> =>
{
return this.launcherCallbacks.removeProfile(url, info, sessionID);
},
),
new RouteAction(
"/launcher/profile/compatibleTarkovVersion",
async (url: string, info: any, sessionID: string, output: string): Promise<string> =>
{
return this.launcherCallbacks.getCompatibleTarkovVersion();
},
),
new RouteAction(
"/launcher/server/version",
async (url: string, info: any, sessionID: string, output: string): Promise<string> =>
{
return this.launcherCallbacks.getServerVersion();
},
),
new RouteAction(
"/launcher/server/loadedServerMods",
async (url: string, info: any, sessionID: string, output: string): Promise<string> =>
{
return this.launcherCallbacks.getLoadedServerMods();
},
),
new RouteAction(
"/launcher/server/serverModsUsedByProfile",
async (url: string, info: any, sessionID: string, output: string): Promise<string> =>
{
return this.launcherCallbacks.getServerModsProfileUsed(url, info, sessionID);
},
),
]);
}
}