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

42 lines
1.5 KiB
TypeScript
Raw Normal View History

2023-03-03 15:23:46 +00:00
import { inject, injectable } from "tsyringe";
import { WeatherCallbacks } from "@spt/callbacks/WeatherCallbacks";
import { RouteAction, StaticRouter } from "@spt/di/Router";
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
import { IWeatherData } from "@spt/models/eft/weather/IWeatherData";
2024-07-05 14:21:30 +01:00
import { IGetLocalWeatherResponseData } from "@spt/models/spt/weather/IGetLocalWeatherResponseData";
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(@inject("WeatherCallbacks") protected weatherCallbacks: WeatherCallbacks)
2023-03-03 15:23:46 +00:00
{
super([
new RouteAction(
"/client/weather",
async (
url: string,
info: any,
sessionID: string,
output: string,
): Promise<IGetBodyResponseData<IWeatherData>> =>
{
return this.weatherCallbacks.getWeather(url, info, sessionID);
},
),
2024-07-05 14:21:30 +01:00
new RouteAction(
"/client/localGame/weather",
async (
url: string,
info: any,
sessionID: string,
_output: string
): Promise<IGetBodyResponseData<IGetLocalWeatherResponseData>> =>
{
return this.weatherCallbacks.getLocalWeather(url, info, sessionID);
},
),
]);
2023-03-03 15:23:46 +00:00
}
2023-11-13 11:12:17 -05:00
}