0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-13 09:50:43 -05:00
server/project/src/routers/static/WeatherStaticRouter.ts

26 lines
740 B
TypeScript
Raw Normal View History

2023-03-03 15:23:46 +00:00
import { inject, injectable } from "tsyringe";
import { WeatherCallbacks } from "@spt-aki/callbacks/WeatherCallbacks";
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 WeatherStaticRouter extends StaticRouter
2023-03-03 15:23:46 +00:00
{
constructor(
2023-11-13 11:12:17 -05:00
@inject("WeatherCallbacks") protected weatherCallbacks: WeatherCallbacks,
)
2023-03-03 15:23:46 +00:00
{
super(
[
new RouteAction(
2023-11-13 11:12:17 -05:00
"/client/weather",
(url: string, info: any, sessionID: string, output: string): any =>
2023-03-03 15:23:46 +00:00
{
return this.weatherCallbacks.getWeather(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
}