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/HealthStaticRouter.ts

33 lines
1.0 KiB
TypeScript
Raw Normal View History

2023-03-03 15:23:46 +00:00
import { inject, injectable } from "tsyringe";
import { HealthCallbacks } from "@spt-aki/callbacks/HealthCallbacks";
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 HealthStaticRouter extends StaticRouter
2023-03-03 15:23:46 +00:00
{
constructor(
2023-11-13 11:12:17 -05:00
@inject("HealthCallbacks") protected healthCallbacks: HealthCallbacks,
)
2023-03-03 15:23:46 +00:00
{
super(
[
new RouteAction(
"/player/health/sync",
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.healthCallbacks.syncHealth(url, info, sessionID);
2023-11-13 11:12:17 -05:00
},
2023-03-03 15:23:46 +00:00
),
new RouteAction(
"/client/hideout/workout",
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.healthCallbacks.handleWorkoutEffects(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
}