mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-13 09:50:43 -05:00
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
![]() |
import { inject, injectable } from "tsyringe";
|
||
|
|
||
|
import { RepairCallbacks } from "../../callbacks/RepairCallbacks";
|
||
|
import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router";
|
||
|
import { IPmcData } from "../../models/eft/common/IPmcData";
|
||
|
import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse";
|
||
|
|
||
|
@injectable()
|
||
|
export class RepairItemEventRouter extends ItemEventRouterDefinition
|
||
|
{
|
||
|
constructor(
|
||
|
@inject("RepairCallbacks") protected repairCallbacks: RepairCallbacks
|
||
|
)
|
||
|
{
|
||
|
super();
|
||
|
}
|
||
|
|
||
|
public override getHandledRoutes(): HandledRoute[]
|
||
|
{
|
||
|
return [
|
||
|
new HandledRoute("Repair", false),
|
||
|
new HandledRoute("TraderRepair", false)
|
||
|
];
|
||
|
}
|
||
|
|
||
|
public override handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse
|
||
|
{
|
||
|
switch (url)
|
||
|
{
|
||
|
case "Repair":
|
||
|
return this.repairCallbacks.repair(pmcData, body, sessionID);
|
||
|
case "TraderRepair":
|
||
|
return this.repairCallbacks.traderRepair(pmcData, body, sessionID);
|
||
|
}
|
||
|
}
|
||
|
}
|