2023-03-03 15:23:46 +00:00
|
|
|
import { inject, injectable } from "tsyringe";
|
2024-05-21 17:59:04 +00:00
|
|
|
import { LocationCallbacks } from "@spt/callbacks/LocationCallbacks";
|
|
|
|
import { RouteAction, StaticRouter } from "@spt/di/Router";
|
|
|
|
import { ILocationsGenerateAllResponse } from "@spt/models/eft/common/ILocationsSourceDestinationBase";
|
|
|
|
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
|
2023-03-03 15:23:46 +00:00
|
|
|
|
|
|
|
@injectable()
|
2023-11-13 11:12:17 -05:00
|
|
|
export class LocationStaticRouter extends StaticRouter
|
2023-03-03 15:23:46 +00:00
|
|
|
{
|
2023-11-13 12:31:52 -05:00
|
|
|
constructor(@inject("LocationCallbacks") protected locationCallbacks: LocationCallbacks)
|
2023-03-03 15:23:46 +00:00
|
|
|
{
|
2023-11-13 12:31:52 -05:00
|
|
|
super([
|
2024-04-28 13:45:36 +00:00
|
|
|
new RouteAction(
|
|
|
|
"/client/locations",
|
|
|
|
async (
|
|
|
|
url: string,
|
|
|
|
info: any,
|
|
|
|
sessionID: string,
|
|
|
|
output: string,
|
|
|
|
): Promise<IGetBodyResponseData<ILocationsGenerateAllResponse>> =>
|
|
|
|
{
|
|
|
|
return this.locationCallbacks.getLocationData(url, info, sessionID);
|
|
|
|
},
|
|
|
|
),
|
2023-11-13 12:31:52 -05:00
|
|
|
new RouteAction(
|
|
|
|
"/client/location/getAirdropLoot",
|
2024-04-28 13:45:36 +00:00
|
|
|
async (url: string, info: any, sessionID: string, _output: string): Promise<string> =>
|
2023-11-13 12:31:52 -05:00
|
|
|
{
|
|
|
|
return this.locationCallbacks.getAirdropLoot(url, info, sessionID);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
]);
|
2023-03-03 15:23:46 +00:00
|
|
|
}
|
2023-11-13 11:12:17 -05:00
|
|
|
}
|