2023-03-03 15:23:46 +00:00
|
|
|
import { inject, injectable } from "tsyringe";
|
|
|
|
|
2023-10-19 17:21:17 +00:00
|
|
|
import { GameCallbacks } from "@spt-aki/callbacks/GameCallbacks";
|
|
|
|
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 GameStaticRouter extends StaticRouter
|
2023-03-03 15:23:46 +00:00
|
|
|
{
|
|
|
|
constructor(
|
2023-11-13 11:12:17 -05:00
|
|
|
@inject("GameCallbacks") protected gameCallbacks: GameCallbacks,
|
|
|
|
)
|
2023-03-03 15:23:46 +00:00
|
|
|
{
|
|
|
|
super(
|
|
|
|
[
|
|
|
|
new RouteAction(
|
|
|
|
"/client/game/config",
|
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.gameCallbacks.getGameConfig(url, info, sessionID);
|
2023-11-13 11:12:17 -05:00
|
|
|
},
|
2023-03-03 15:23:46 +00:00
|
|
|
),
|
|
|
|
new RouteAction(
|
|
|
|
"/client/server/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.gameCallbacks.getServer(url, info, sessionID);
|
2023-11-13 11:12:17 -05:00
|
|
|
},
|
2023-03-03 15:23:46 +00:00
|
|
|
),
|
|
|
|
new RouteAction(
|
|
|
|
"/client/match/group/current",
|
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.gameCallbacks.getCurrentGroup(url, info, sessionID);
|
2023-11-13 11:12:17 -05:00
|
|
|
},
|
2023-03-03 15:23:46 +00:00
|
|
|
),
|
|
|
|
new RouteAction(
|
|
|
|
"/client/game/version/validate",
|
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.gameCallbacks.versionValidate(url, info, sessionID);
|
2023-11-13 11:12:17 -05:00
|
|
|
},
|
2023-03-03 15:23:46 +00:00
|
|
|
),
|
|
|
|
new RouteAction(
|
|
|
|
"/client/game/start",
|
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.gameCallbacks.gameStart(url, info, sessionID);
|
2023-11-13 11:12:17 -05:00
|
|
|
},
|
2023-03-03 15:23:46 +00:00
|
|
|
),
|
|
|
|
new RouteAction(
|
|
|
|
"/client/game/logout",
|
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.gameCallbacks.gameLogout(url, info, sessionID);
|
2023-11-13 11:12:17 -05:00
|
|
|
},
|
2023-03-03 15:23:46 +00:00
|
|
|
),
|
|
|
|
new RouteAction(
|
|
|
|
"/client/checkVersion",
|
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.gameCallbacks.validateGameVersion(url, info, sessionID);
|
2023-11-13 11:12:17 -05:00
|
|
|
},
|
2023-03-03 15:23:46 +00:00
|
|
|
),
|
|
|
|
new RouteAction(
|
|
|
|
"/client/game/keepalive",
|
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.gameCallbacks.gameKeepalive(url, info, sessionID);
|
2023-11-13 11:12:17 -05:00
|
|
|
},
|
2023-03-03 15:23:46 +00:00
|
|
|
),
|
|
|
|
new RouteAction(
|
|
|
|
"/singleplayer/settings/version",
|
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.gameCallbacks.getVersion(url, info, sessionID);
|
2023-11-13 11:12:17 -05:00
|
|
|
},
|
2023-03-03 15:23:46 +00:00
|
|
|
),
|
|
|
|
new RouteAction(
|
|
|
|
"/client/reports/lobby/send",
|
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.gameCallbacks.reportNickname(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
|
|
|
}
|