Formatting for routers.

This commit is contained in:
Refringe 2023-11-13 11:12:17 -05:00
parent d62ccce3ca
commit b90fb8c8b9
No known key found for this signature in database
GPG Key ID: 64E03E5F892C6F9E
53 changed files with 708 additions and 767 deletions

View File

@ -12,19 +12,19 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export class EventOutputHolder export class EventOutputHolder
{ {
/** What has client been informed of this game session */ /** What has client been informed of this game session */
protected clientActiveSessionStorage: Record<string, {clientInformed: boolean}> = {}; protected clientActiveSessionStorage: Record<string, {clientInformed: boolean;}> = {};
constructor( constructor(
@inject("JsonUtil") protected jsonUtil: JsonUtil, @inject("JsonUtil") protected jsonUtil: JsonUtil,
@inject("ProfileHelper") protected profileHelper: ProfileHelper, @inject("ProfileHelper") protected profileHelper: ProfileHelper,
@inject("TimeUtil") protected timeUtil: TimeUtil @inject("TimeUtil") protected timeUtil: TimeUtil,
) )
{} {}
// TODO REMEMBER TO CHANGE OUTPUT // TODO REMEMBER TO CHANGE OUTPUT
protected output: IItemEventRouterResponse = { protected output: IItemEventRouterResponse = {
warnings: [], warnings: [],
profileChanges: {} profileChanges: {},
}; };
public getOutput(sessionID: string): IItemEventRouterResponse public getOutput(sessionID: string): IItemEventRouterResponse
@ -57,20 +57,20 @@ export class EventOutputHolder
items: { items: {
new: [], new: [],
change: [], change: [],
del: [] del: [],
}, },
production: {}, production: {},
improvements: {}, improvements: {},
skills: { skills: {
Common: [], Common: [],
Mastering: [], Mastering: [],
Points: 0 Points: 0,
}, },
health: this.jsonUtil.clone(pmcData.Health), health: this.jsonUtil.clone(pmcData.Health),
traderRelations: {}, traderRelations: {},
//changedHideoutStashes: {}, // changedHideoutStashes: {},
recipeUnlocked: {}, recipeUnlocked: {},
questsStatus: [] questsStatus: [],
}; };
} }
@ -89,7 +89,9 @@ export class EventOutputHolder
profileChanges.skills.Mastering = this.jsonUtil.clone(pmcData.Skills.Mastering); profileChanges.skills.Mastering = this.jsonUtil.clone(pmcData.Skills.Mastering);
// Clone productions to ensure we preseve the profile jsons data // Clone productions to ensure we preseve the profile jsons data
profileChanges.production = this.getProductionsFromProfileAndFlagComplete(this.jsonUtil.clone(pmcData.Hideout.Production)); profileChanges.production = this.getProductionsFromProfileAndFlagComplete(
this.jsonUtil.clone(pmcData.Hideout.Production),
);
profileChanges.improvements = this.jsonUtil.clone(this.getImprovementsFromProfileAndFlagComplete(pmcData)); profileChanges.improvements = this.jsonUtil.clone(this.getImprovementsFromProfileAndFlagComplete(pmcData));
profileChanges.traderRelations = this.constructTraderRelations(pmcData.TradersInfo); profileChanges.traderRelations = this.constructTraderRelations(pmcData.TradersInfo);
} }
@ -111,13 +113,13 @@ export class EventOutputHolder
disabled: baseData.disabled, disabled: baseData.disabled,
loyalty: baseData.loyaltyLevel, loyalty: baseData.loyaltyLevel,
standing: baseData.standing, standing: baseData.standing,
unlocked: baseData.unlocked unlocked: baseData.unlocked,
}; };
} }
return result; return result;
} }
/** /**
* Return all hideout Improvements from player profile, adjust completed Improvements' completed property to be true * Return all hideout Improvements from player profile, adjust completed Improvements' completed property to be true
* @param pmcData Player profile * @param pmcData Player profile
@ -149,7 +151,9 @@ export class EventOutputHolder
* @param pmcData Player profile * @param pmcData Player profile
* @returns dictionary of hideout productions * @returns dictionary of hideout productions
*/ */
protected getProductionsFromProfileAndFlagComplete(productions: Record<string, Productive>): Record<string, Productive> protected getProductionsFromProfileAndFlagComplete(
productions: Record<string, Productive>,
): Record<string, Productive>
{ {
for (const productionKey in productions) for (const productionKey in productions)
{ {
@ -177,7 +181,7 @@ export class EventOutputHolder
// Flag started craft as having been seen by client // Flag started craft as having been seen by client
if (production.Progress > 0 && !this.clientActiveSessionStorage[productionKey]?.clientInformed) if (production.Progress > 0 && !this.clientActiveSessionStorage[productionKey]?.clientInformed)
{ {
this.clientActiveSessionStorage[productionKey] = { clientInformed: true }; this.clientActiveSessionStorage[productionKey] = {clientInformed: true};
} }
} }

View File

@ -8,11 +8,11 @@ export class HttpRouter
{ {
constructor( constructor(
@injectAll("StaticRoutes") protected staticRouters: StaticRouter[], @injectAll("StaticRoutes") protected staticRouters: StaticRouter[],
@injectAll("DynamicRoutes") protected dynamicRoutes: DynamicRouter[] @injectAll("DynamicRoutes") protected dynamicRoutes: DynamicRouter[],
) )
{ } {}
protected groupBy<T>(list: T[], keyGetter: (t:T) => string): Map<string, T[]> protected groupBy<T>(list: T[], keyGetter: (t: T) => string): Map<string, T[]>
{ {
const map: Map<string, T[]> = new Map(); const map: Map<string, T[]> = new Map();
for (const item of list) for (const item of list)
@ -56,7 +56,14 @@ export class HttpRouter
return wrapper.output; return wrapper.output;
} }
protected handleRoute(url: string, info: any, sessionID: string, wrapper: ResponseWrapper, routers: Router[], dynamic: boolean): boolean protected handleRoute(
url: string,
info: any,
sessionID: string,
wrapper: ResponseWrapper,
routers: Router[],
dynamic: boolean,
): boolean
{ {
let matched = false; let matched = false;
for (const route of routers) for (const route of routers)
@ -81,7 +88,7 @@ export class HttpRouter
class ResponseWrapper class ResponseWrapper
{ {
constructor( constructor(
public output: string public output: string,
) )
{} {}
} }

View File

@ -11,16 +11,15 @@ export class ImageRouter
constructor( constructor(
@inject("VFS") protected vfs: VFS, @inject("VFS") protected vfs: VFS,
@inject("ImageRouteService") protected imageRouteService: ImageRouteService, @inject("ImageRouteService") protected imageRouteService: ImageRouteService,
@inject("HttpFileUtil") protected httpFileUtil: HttpFileUtil @inject("HttpFileUtil") protected httpFileUtil: HttpFileUtil,
) )
{ } {}
public addRoute(key: string, valueToAdd: string): void public addRoute(key: string, valueToAdd: string): void
{ {
this.imageRouteService.addRoute(key, valueToAdd); this.imageRouteService.addRoute(key, valueToAdd);
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public sendImage(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void public sendImage(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void
{ {
// remove file extension // remove file extension
@ -37,4 +36,4 @@ export class ImageRouter
{ {
return "IMAGE"; return "IMAGE";
} }
} }

View File

@ -9,24 +9,23 @@ import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { LocalisationService } from "@spt-aki/services/LocalisationService";
@injectable() @injectable()
export class ItemEventRouter export class ItemEventRouter
{ {
constructor( constructor(
@inject("WinstonLogger") protected logger: ILogger, @inject("WinstonLogger") protected logger: ILogger,
@inject("ProfileHelper") protected profileHelper: ProfileHelper, @inject("ProfileHelper") protected profileHelper: ProfileHelper,
@injectAll("IERouters") protected itemEventRouters: ItemEventRouterDefinition[], @injectAll("IERouters") protected itemEventRouters: ItemEventRouterDefinition[],
@inject("LocalisationService") protected localisationService: LocalisationService, @inject("LocalisationService") protected localisationService: LocalisationService,
@inject("EventOutputHolder") protected eventOutputHolder: EventOutputHolder @inject("EventOutputHolder") protected eventOutputHolder: EventOutputHolder,
) )
{ } {}
/** /**
*
* @param info Event request * @param info Event request
* @param sessionID Session id * @param sessionID Session id
* @returns Item response * @returns Item response
*/ */
public handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse public handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse
{ {
this.eventOutputHolder.resetOutput(sessionID); this.eventOutputHolder.resetOutput(sessionID);
@ -36,13 +35,13 @@ export class ItemEventRouter
{ {
const pmcData = this.profileHelper.getPmcProfile(sessionID); const pmcData = this.profileHelper.getPmcProfile(sessionID);
const eventRouter = this.itemEventRouters.find(r => r.canHandle(body.Action)); const eventRouter = this.itemEventRouters.find((r) => r.canHandle(body.Action));
if (eventRouter) if (eventRouter)
{ {
this.logger.debug(`event: ${body.Action}`); this.logger.debug(`event: ${body.Action}`);
result = eventRouter.handleItemEvent(body.Action, pmcData, body, sessionID); result = eventRouter.handleItemEvent(body.Action, pmcData, body, sessionID);
} }
else else
{ {
this.logger.error(this.localisationService.getText("event-unhandled_event", body.Action)); this.logger.error(this.localisationService.getText("event-unhandled_event", body.Action));
this.logger.writeToLogFile(body); this.logger.writeToLogFile(body);

View File

@ -4,47 +4,43 @@ import { BotCallbacks } from "@spt-aki/callbacks/BotCallbacks";
import { DynamicRouter, RouteAction } from "@spt-aki/di/Router"; import { DynamicRouter, RouteAction } from "@spt-aki/di/Router";
@injectable() @injectable()
export class BotDynamicRouter extends DynamicRouter export class BotDynamicRouter extends DynamicRouter
{ {
constructor( constructor(
@inject("BotCallbacks") protected botCallbacks: BotCallbacks @inject("BotCallbacks") protected botCallbacks: BotCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/singleplayer/settings/bot/limit/", "/singleplayer/settings/bot/limit/",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any => (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.botCallbacks.getBotLimit(url, info, sessionID); return this.botCallbacks.getBotLimit(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/singleplayer/settings/bot/difficulty/", "/singleplayer/settings/bot/difficulty/",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any => (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.botCallbacks.getBotDifficulty(url, info, sessionID); return this.botCallbacks.getBotDifficulty(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/singleplayer/settings/bot/maxCap", "/singleplayer/settings/bot/maxCap",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any => (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.botCallbacks.getBotCap(); return this.botCallbacks.getBotCap();
} },
), ),
new RouteAction( new RouteAction(
"/singleplayer/settings/bot/getBotBehaviours/", "/singleplayer/settings/bot/getBotBehaviours/",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any => (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.botCallbacks.getBotBehaviours(); return this.botCallbacks.getBotBehaviours();
} },
) ),
] ],
); );
} }
} }

View File

@ -4,23 +4,22 @@ import { BundleCallbacks } from "@spt-aki/callbacks/BundleCallbacks";
import { DynamicRouter, RouteAction } from "@spt-aki/di/Router"; import { DynamicRouter, RouteAction } from "@spt-aki/di/Router";
@injectable() @injectable()
export class BundleDynamicRouter extends DynamicRouter export class BundleDynamicRouter extends DynamicRouter
{ {
constructor( constructor(
@inject("BundleCallbacks") protected bundleCallbacks: BundleCallbacks @inject("BundleCallbacks") protected bundleCallbacks: BundleCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
".bundle", ".bundle",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any => (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.bundleCallbacks.getBundle(url, info, sessionID); return this.bundleCallbacks.getBundle(url, info, sessionID);
} },
) ),
] ],
); );
} }
} }

View File

@ -4,24 +4,22 @@ import { CustomizationCallbacks } from "@spt-aki/callbacks/CustomizationCallback
import { DynamicRouter, RouteAction } from "@spt-aki/di/Router"; import { DynamicRouter, RouteAction } from "@spt-aki/di/Router";
@injectable() @injectable()
export class CustomizationDynamicRouter extends DynamicRouter export class CustomizationDynamicRouter extends DynamicRouter
{ {
constructor( constructor(
@inject("CustomizationCallbacks") protected customizationCallbacks: CustomizationCallbacks @inject("CustomizationCallbacks") protected customizationCallbacks: CustomizationCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/client/trading/customization/", "/client/trading/customization/",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any => (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.customizationCallbacks.getTraderSuits(url, info, sessionID); return this.customizationCallbacks.getTraderSuits(url, info, sessionID);
} },
) ),
],
]
); );
} }
} }

View File

@ -4,38 +4,36 @@ import { DataCallbacks } from "@spt-aki/callbacks/DataCallbacks";
import { DynamicRouter, RouteAction } from "@spt-aki/di/Router"; import { DynamicRouter, RouteAction } from "@spt-aki/di/Router";
@injectable() @injectable()
export class DataDynamicRouter extends DynamicRouter export class DataDynamicRouter extends DynamicRouter
{ {
constructor( constructor(
@inject("DataCallbacks") protected dataCallbacks: DataCallbacks @inject("DataCallbacks") protected dataCallbacks: DataCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/client/menu/locale/", "/client/menu/locale/",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any => (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dataCallbacks.getLocalesMenu(url, info, sessionID); return this.dataCallbacks.getLocalesMenu(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/locale/", "/client/locale/",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any => (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dataCallbacks.getLocalesGlobal(url, info, sessionID); return this.dataCallbacks.getLocalesGlobal(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/items/prices/", "/client/items/prices/",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dataCallbacks.getItemPrices(url, info, sessionID); return this.dataCallbacks.getItemPrices(url, info, sessionID);
}) },
] ),
],
); );
} }
} }

View File

@ -4,40 +4,36 @@ import { DynamicRouter, RouteAction } from "@spt-aki/di/Router";
import { ImageRouter } from "@spt-aki/routers/ImageRouter"; import { ImageRouter } from "@spt-aki/routers/ImageRouter";
@injectable() @injectable()
export class HttpDynamicRouter extends DynamicRouter export class HttpDynamicRouter extends DynamicRouter
{ {
constructor( constructor(
@inject("ImageRouter") protected imageRouter: ImageRouter @inject("ImageRouter") protected imageRouter: ImageRouter,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
".jpg", ".jpg",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any => (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.imageRouter.getImage(); return this.imageRouter.getImage();
} },
), ),
new RouteAction( new RouteAction(
".png", ".png",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any => (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.imageRouter.getImage(); return this.imageRouter.getImage();
} },
), ),
new RouteAction( new RouteAction(
".ico", ".ico",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any => (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.imageRouter.getImage(); return this.imageRouter.getImage();
} },
) ),
],
]
); );
} }
} }

View File

@ -4,28 +4,27 @@ import { InraidCallbacks } from "@spt-aki/callbacks/InraidCallbacks";
import { DynamicRouter, RouteAction } from "@spt-aki/di/Router"; import { DynamicRouter, RouteAction } from "@spt-aki/di/Router";
@injectable() @injectable()
export class InraidDynamicRouter extends DynamicRouter export class InraidDynamicRouter extends DynamicRouter
{ {
constructor( constructor(
@inject("InraidCallbacks") protected inraidCallbacks: InraidCallbacks @inject("InraidCallbacks") protected inraidCallbacks: InraidCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/client/location/getLocalloot", "/client/location/getLocalloot",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any => (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.inraidCallbacks.registerPlayer(url, info, sessionID); return this.inraidCallbacks.registerPlayer(url, info, sessionID);
} },
) ),
] ],
); );
} }
public override getTopLevelRoute(): string public override getTopLevelRoute(): string
{ {
return "aki-name"; return "aki-name";
} }
} }

View File

@ -4,28 +4,27 @@ import { LocationCallbacks } from "@spt-aki/callbacks/LocationCallbacks";
import { DynamicRouter, RouteAction } from "@spt-aki/di/Router"; import { DynamicRouter, RouteAction } from "@spt-aki/di/Router";
@injectable() @injectable()
export class LocationDynamicRouter extends DynamicRouter export class LocationDynamicRouter extends DynamicRouter
{ {
constructor( constructor(
@inject("LocationCallbacks") protected locationCallbacks: LocationCallbacks @inject("LocationCallbacks") protected locationCallbacks: LocationCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/client/location/getLocalloot", "/client/location/getLocalloot",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, _output: string): any => (url: string, info: any, sessionID: string, _output: string): any =>
{ {
return this.locationCallbacks.getLocation(url, info, sessionID); return this.locationCallbacks.getLocation(url, info, sessionID);
} },
) ),
] ],
); );
} }
public override getTopLevelRoute(): string public override getTopLevelRoute(): string
{ {
return "aki-loot"; return "aki-loot";
} }
} }

View File

@ -4,48 +4,43 @@ import { NotifierCallbacks } from "@spt-aki/callbacks/NotifierCallbacks";
import { DynamicRouter, RouteAction } from "@spt-aki/di/Router"; import { DynamicRouter, RouteAction } from "@spt-aki/di/Router";
@injectable() @injectable()
export class NotifierDynamicRouter extends DynamicRouter export class NotifierDynamicRouter extends DynamicRouter
{ {
constructor( constructor(
@inject("NotifierCallbacks") protected notifierCallbacks: NotifierCallbacks @inject("NotifierCallbacks") protected notifierCallbacks: NotifierCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/?last_id", "/?last_id",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any => (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.notifierCallbacks.notify(url, info, sessionID); return this.notifierCallbacks.notify(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/notifierServer", "/notifierServer",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any => (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.notifierCallbacks.notify(url, info, sessionID); return this.notifierCallbacks.notify(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/push/notifier/get/", "/push/notifier/get/",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any => (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.notifierCallbacks.getNotifier(url, info, sessionID); return this.notifierCallbacks.getNotifier(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/push/notifier/getwebsocket/", "/push/notifier/getwebsocket/",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any => (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.notifierCallbacks.getNotifier(url, info, sessionID); return this.notifierCallbacks.getNotifier(url, info, sessionID);
} },
) ),
] ],
); );
} }
} }

View File

@ -4,31 +4,29 @@ import { TraderCallbacks } from "@spt-aki/callbacks/TraderCallbacks";
import { DynamicRouter, RouteAction } from "@spt-aki/di/Router"; import { DynamicRouter, RouteAction } from "@spt-aki/di/Router";
@injectable() @injectable()
export class TraderDynamicRouter extends DynamicRouter export class TraderDynamicRouter extends DynamicRouter
{ {
constructor( constructor(
@inject("TraderCallbacks") protected traderCallbacks: TraderCallbacks @inject("TraderCallbacks") protected traderCallbacks: TraderCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/client/trading/api/getTrader/", "/client/trading/api/getTrader/",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any => (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.traderCallbacks.getTrader(url, info, sessionID); return this.traderCallbacks.getTrader(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/trading/api/getTraderAssort/", "/client/trading/api/getTraderAssort/",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any => (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.traderCallbacks.getAssort(url, info, sessionID); return this.traderCallbacks.getAssort(url, info, sessionID);
} },
) ),
] ],
); );
} }
} }

View File

@ -6,24 +6,29 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
@injectable() @injectable()
export class CustomizationItemEventRouter extends ItemEventRouterDefinition export class CustomizationItemEventRouter extends ItemEventRouterDefinition
{ {
constructor( constructor(
@inject("CustomizationCallbacks") protected customizationCallbacks: CustomizationCallbacks // TODO: delay required @inject("CustomizationCallbacks") protected customizationCallbacks: CustomizationCallbacks, // TODO: delay required
) )
{ {
super(); super();
} }
public override getHandledRoutes(): HandledRoute[] public override getHandledRoutes(): HandledRoute[]
{ {
return [ return [
new HandledRoute("CustomizationWear", false), new HandledRoute("CustomizationWear", false),
new HandledRoute("CustomizationBuy", false) new HandledRoute("CustomizationBuy", false),
]; ];
} }
public override handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse public override handleItemEvent(
url: string,
pmcData: IPmcData,
body: any,
sessionID: string,
): IItemEventRouterResponse
{ {
switch (url) switch (url)
{ {
@ -33,4 +38,4 @@ export class CustomizationItemEventRouter extends ItemEventRouterDefinition
return this.customizationCallbacks.buyClothing(pmcData, body, sessionID); return this.customizationCallbacks.buyClothing(pmcData, body, sessionID);
} }
} }
} }

View File

@ -6,25 +6,30 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
@injectable() @injectable()
export class HealthItemEventRouter extends ItemEventRouterDefinition export class HealthItemEventRouter extends ItemEventRouterDefinition
{ {
constructor( constructor(
@inject("HealthCallbacks") protected healthCallbacks: HealthCallbacks // TODO: delay required @inject("HealthCallbacks") protected healthCallbacks: HealthCallbacks, // TODO: delay required
) )
{ {
super(); super();
} }
public override getHandledRoutes(): HandledRoute[] public override getHandledRoutes(): HandledRoute[]
{ {
return [ return [
new HandledRoute("Eat", false), new HandledRoute("Eat", false),
new HandledRoute("Heal", false), new HandledRoute("Heal", false),
new HandledRoute("RestoreHealth", false) new HandledRoute("RestoreHealth", false),
]; ];
} }
public override handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse public override handleItemEvent(
url: string,
pmcData: IPmcData,
body: any,
sessionID: string,
): IItemEventRouterResponse
{ {
switch (url) switch (url)
{ {
@ -36,4 +41,4 @@ export class HealthItemEventRouter extends ItemEventRouterDefinition
return this.healthCallbacks.healthTreatment(pmcData, body, sessionID); return this.healthCallbacks.healthTreatment(pmcData, body, sessionID);
} }
} }
} }

View File

@ -7,16 +7,16 @@ import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEve
import { HideoutEventActions } from "@spt-aki/models/enums/HideoutEventActions"; import { HideoutEventActions } from "@spt-aki/models/enums/HideoutEventActions";
@injectable() @injectable()
export class HideoutItemEventRouter extends ItemEventRouterDefinition export class HideoutItemEventRouter extends ItemEventRouterDefinition
{ {
constructor( constructor(
@inject("HideoutCallbacks") protected hideoutCallbacks: HideoutCallbacks @inject("HideoutCallbacks") protected hideoutCallbacks: HideoutCallbacks,
) )
{ {
super(); super();
} }
public override getHandledRoutes(): HandledRoute[] public override getHandledRoutes(): HandledRoute[]
{ {
return [ return [
new HandledRoute(HideoutEventActions.HIDEOUT_UPGRADE, false), new HandledRoute(HideoutEventActions.HIDEOUT_UPGRADE, false),
@ -30,11 +30,16 @@ export class HideoutItemEventRouter extends ItemEventRouterDefinition
new HandledRoute(HideoutEventActions.HIDEOUT_TAKE_PRODUCTION, false), new HandledRoute(HideoutEventActions.HIDEOUT_TAKE_PRODUCTION, false),
new HandledRoute(HideoutEventActions.HIDEOUT_RECORD_SHOOTING_RANGE_POINTS, false), new HandledRoute(HideoutEventActions.HIDEOUT_RECORD_SHOOTING_RANGE_POINTS, false),
new HandledRoute(HideoutEventActions.HIDEOUT_IMPROVE_AREA, false), new HandledRoute(HideoutEventActions.HIDEOUT_IMPROVE_AREA, false),
new HandledRoute(HideoutEventActions.HIDEOUT_CANCEL_PRODUCTION_COMMAND, false) new HandledRoute(HideoutEventActions.HIDEOUT_CANCEL_PRODUCTION_COMMAND, false),
]; ];
} }
public override handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse public override handleItemEvent(
url: string,
pmcData: IPmcData,
body: any,
sessionID: string,
): IItemEventRouterResponse
{ {
switch (url) switch (url)
{ {
@ -64,4 +69,4 @@ export class HideoutItemEventRouter extends ItemEventRouterDefinition
return this.hideoutCallbacks.cancelProduction(pmcData, body, sessionID); return this.hideoutCallbacks.cancelProduction(pmcData, body, sessionID);
} }
} }
} }

View File

@ -6,29 +6,33 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
@injectable() @injectable()
export class InsuranceItemEventRouter extends ItemEventRouterDefinition export class InsuranceItemEventRouter extends ItemEventRouterDefinition
{ {
constructor( constructor(
@inject("InsuranceCallbacks") protected insuranceCallbacks: InsuranceCallbacks // TODO: delay required @inject("InsuranceCallbacks") protected insuranceCallbacks: InsuranceCallbacks, // TODO: delay required
) )
{ {
super(); super();
} }
public override getHandledRoutes(): HandledRoute[] public override getHandledRoutes(): HandledRoute[]
{ {
return [ return [
new HandledRoute("Insure", false) new HandledRoute("Insure", false),
]; ];
} }
public override handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse public override handleItemEvent(
url: string,
pmcData: IPmcData,
body: any,
sessionID: string,
): IItemEventRouterResponse
{ {
switch (url) switch (url)
{ {
case "Insure": case "Insure":
return this.insuranceCallbacks.insure(pmcData, body, sessionID); return this.insuranceCallbacks.insure(pmcData, body, sessionID);
} }
} }
} }

View File

@ -8,18 +8,17 @@ import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEve
import { ItemEventActions } from "@spt-aki/models/enums/ItemEventActions"; import { ItemEventActions } from "@spt-aki/models/enums/ItemEventActions";
@injectable() @injectable()
export class InventoryItemEventRouter extends ItemEventRouterDefinition export class InventoryItemEventRouter extends ItemEventRouterDefinition
{ {
constructor( constructor(
@inject("InventoryCallbacks") protected inventoryCallbacks: InventoryCallbacks, @inject("InventoryCallbacks") protected inventoryCallbacks: InventoryCallbacks,
@inject("HideoutCallbacks") protected hideoutCallbacks: HideoutCallbacks @inject("HideoutCallbacks") protected hideoutCallbacks: HideoutCallbacks,
)
)
{ {
super(); super();
} }
public override getHandledRoutes(): HandledRoute[] public override getHandledRoutes(): HandledRoute[]
{ {
return [ return [
new HandledRoute(ItemEventActions.MOVE, false), new HandledRoute(ItemEventActions.MOVE, false),
@ -39,11 +38,16 @@ export class InventoryItemEventRouter extends ItemEventRouterDefinition
new HandledRoute(ItemEventActions.DELETE_MAP_MARKER, false), new HandledRoute(ItemEventActions.DELETE_MAP_MARKER, false),
new HandledRoute(ItemEventActions.EDIT_MAP_MARKER, false), new HandledRoute(ItemEventActions.EDIT_MAP_MARKER, false),
new HandledRoute(ItemEventActions.OPEN_RANDOM_LOOT_CONTAINER, false), new HandledRoute(ItemEventActions.OPEN_RANDOM_LOOT_CONTAINER, false),
new HandledRoute(ItemEventActions.HIDEOUT_QTE_EVENT, false) new HandledRoute(ItemEventActions.HIDEOUT_QTE_EVENT, false),
]; ];
} }
public override handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse public override handleItemEvent(
url: string,
pmcData: IPmcData,
body: any,
sessionID: string,
): IItemEventRouterResponse
{ {
switch (url) switch (url)
{ {
@ -87,4 +91,4 @@ export class InventoryItemEventRouter extends ItemEventRouterDefinition
throw new Error(`Unhandled event ${url}`); throw new Error(`Unhandled event ${url}`);
} }
} }
} }

View File

@ -7,34 +7,39 @@ import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEve
import { INoteActionData } from "@spt-aki/models/eft/notes/INoteActionData"; import { INoteActionData } from "@spt-aki/models/eft/notes/INoteActionData";
@injectable() @injectable()
export class NoteItemEventRouter extends ItemEventRouterDefinition export class NoteItemEventRouter extends ItemEventRouterDefinition
{ {
constructor( constructor(
@inject("NoteCallbacks") protected noteCallbacks: NoteCallbacks // TODO: delay required @inject("NoteCallbacks") protected noteCallbacks: NoteCallbacks, // TODO: delay required
) )
{ {
super(); super();
} }
public override getHandledRoutes(): HandledRoute[] public override getHandledRoutes(): HandledRoute[]
{ {
return [ return [
new HandledRoute("AddNote", false), new HandledRoute("AddNote", false),
new HandledRoute("EditNote", false), new HandledRoute("EditNote", false),
new HandledRoute("DeleteNote", false) new HandledRoute("DeleteNote", false),
]; ];
} }
public override handleItemEvent(url: string, pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse public override handleItemEvent(
url: string,
pmcData: IPmcData,
body: INoteActionData,
sessionID: string,
): IItemEventRouterResponse
{ {
switch (url) switch (url)
{ {
case "AddNote": case "AddNote":
return this.noteCallbacks.addNote(pmcData, body, sessionID); return this.noteCallbacks.addNote(pmcData, body, sessionID);
case "EditNote": case "EditNote":
return this.noteCallbacks.editNote(pmcData, body, sessionID); return this.noteCallbacks.editNote(pmcData, body, sessionID);
case "DeleteNote": case "DeleteNote":
return this.noteCallbacks.deleteNote(pmcData, body, sessionID); return this.noteCallbacks.deleteNote(pmcData, body, sessionID);
} }
} }
} }

View File

@ -7,27 +7,32 @@ import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEve
import { ItemEventActions } from "@spt-aki/models/enums/ItemEventActions"; import { ItemEventActions } from "@spt-aki/models/enums/ItemEventActions";
@injectable() @injectable()
export class PresetBuildItemEventRouter extends ItemEventRouterDefinition export class PresetBuildItemEventRouter extends ItemEventRouterDefinition
{ {
constructor( constructor(
@inject("PresetBuildCallbacks") protected presetBuildCallbacks: PresetBuildCallbacks @inject("PresetBuildCallbacks") protected presetBuildCallbacks: PresetBuildCallbacks,
) )
{ {
super(); super();
} }
public override getHandledRoutes(): HandledRoute[] public override getHandledRoutes(): HandledRoute[]
{ {
return [ return [
new HandledRoute(ItemEventActions.SAVE_WEAPON_BUILD, false), new HandledRoute(ItemEventActions.SAVE_WEAPON_BUILD, false),
new HandledRoute(ItemEventActions.REMOVE_WEAPON_BUILD, false), new HandledRoute(ItemEventActions.REMOVE_WEAPON_BUILD, false),
new HandledRoute(ItemEventActions.SAVE_EQUIPMENT_BUILD, false), new HandledRoute(ItemEventActions.SAVE_EQUIPMENT_BUILD, false),
new HandledRoute(ItemEventActions.REMOVE_EQUIPMENT_BUILD, false), new HandledRoute(ItemEventActions.REMOVE_EQUIPMENT_BUILD, false),
new HandledRoute(ItemEventActions.REMOVE_BUILD, false) new HandledRoute(ItemEventActions.REMOVE_BUILD, false),
]; ];
} }
public override handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse public override handleItemEvent(
url: string,
pmcData: IPmcData,
body: any,
sessionID: string,
): IItemEventRouterResponse
{ {
switch (url) switch (url)
{ {
@ -43,4 +48,4 @@ export class PresetBuildItemEventRouter extends ItemEventRouterDefinition
return this.presetBuildCallbacks.removeEquipmentBuild(pmcData, body, sessionID); return this.presetBuildCallbacks.removeEquipmentBuild(pmcData, body, sessionID);
} }
} }
} }

View File

@ -7,27 +7,32 @@ import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEve
import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
@injectable() @injectable()
export class QuestItemEventRouter extends ItemEventRouterDefinition export class QuestItemEventRouter extends ItemEventRouterDefinition
{ {
constructor( constructor(
@inject("WinstonLogger") protected logger: ILogger, @inject("WinstonLogger") protected logger: ILogger,
@inject("QuestCallbacks") protected questCallbacks: QuestCallbacks @inject("QuestCallbacks") protected questCallbacks: QuestCallbacks,
) )
{ {
super(); super();
} }
public override getHandledRoutes(): HandledRoute[] public override getHandledRoutes(): HandledRoute[]
{ {
return [ return [
new HandledRoute("QuestAccept", false), new HandledRoute("QuestAccept", false),
new HandledRoute("QuestComplete", false), new HandledRoute("QuestComplete", false),
new HandledRoute("QuestHandover", false), new HandledRoute("QuestHandover", false),
new HandledRoute("RepeatableQuestChange", false) new HandledRoute("RepeatableQuestChange", false),
]; ];
} }
public override handleItemEvent(eventAction: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse public override handleItemEvent(
eventAction: string,
pmcData: IPmcData,
body: any,
sessionID: string,
): IItemEventRouterResponse
{ {
this.logger.debug(`${eventAction} ${body.qid}`); this.logger.debug(`${eventAction} ${body.qid}`);
switch (eventAction) switch (eventAction)
@ -35,11 +40,11 @@ export class QuestItemEventRouter extends ItemEventRouterDefinition
case "QuestAccept": case "QuestAccept":
return this.questCallbacks.acceptQuest(pmcData, body, sessionID); return this.questCallbacks.acceptQuest(pmcData, body, sessionID);
case "QuestComplete": case "QuestComplete":
return this.questCallbacks.completeQuest(pmcData, body, sessionID); return this.questCallbacks.completeQuest(pmcData, body, sessionID);
case "QuestHandover": case "QuestHandover":
return this.questCallbacks.handoverQuest(pmcData, body, sessionID); return this.questCallbacks.handoverQuest(pmcData, body, sessionID);
case "RepeatableQuestChange": case "RepeatableQuestChange":
return this.questCallbacks.changeRepeatableQuest(pmcData, body, sessionID); return this.questCallbacks.changeRepeatableQuest(pmcData, body, sessionID);
} }
} }
} }

View File

@ -6,25 +6,30 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
@injectable() @injectable()
export class RagfairItemEventRouter extends ItemEventRouterDefinition export class RagfairItemEventRouter extends ItemEventRouterDefinition
{ {
constructor( constructor(
@inject("RagfairCallbacks") protected ragfairCallbacks: RagfairCallbacks @inject("RagfairCallbacks") protected ragfairCallbacks: RagfairCallbacks,
) )
{ {
super(); super();
} }
public override getHandledRoutes(): HandledRoute[] public override getHandledRoutes(): HandledRoute[]
{ {
return [ return [
new HandledRoute("RagFairAddOffer", false), new HandledRoute("RagFairAddOffer", false),
new HandledRoute("RagFairRemoveOffer", false), new HandledRoute("RagFairRemoveOffer", false),
new HandledRoute("RagFairRenewOffer", false) new HandledRoute("RagFairRenewOffer", false),
]; ];
} }
public override handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse public override handleItemEvent(
url: string,
pmcData: IPmcData,
body: any,
sessionID: string,
): IItemEventRouterResponse
{ {
switch (url) switch (url)
{ {
@ -36,4 +41,4 @@ export class RagfairItemEventRouter extends ItemEventRouterDefinition
return this.ragfairCallbacks.extendOffer(pmcData, body, sessionID); return this.ragfairCallbacks.extendOffer(pmcData, body, sessionID);
} }
} }
} }

View File

@ -6,24 +6,29 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
@injectable() @injectable()
export class RepairItemEventRouter extends ItemEventRouterDefinition export class RepairItemEventRouter extends ItemEventRouterDefinition
{ {
constructor( constructor(
@inject("RepairCallbacks") protected repairCallbacks: RepairCallbacks @inject("RepairCallbacks") protected repairCallbacks: RepairCallbacks,
) )
{ {
super(); super();
} }
public override getHandledRoutes(): HandledRoute[] public override getHandledRoutes(): HandledRoute[]
{ {
return [ return [
new HandledRoute("Repair", false), new HandledRoute("Repair", false),
new HandledRoute("TraderRepair", false) new HandledRoute("TraderRepair", false),
]; ];
} }
public override handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse public override handleItemEvent(
url: string,
pmcData: IPmcData,
body: any,
sessionID: string,
): IItemEventRouterResponse
{ {
switch (url) switch (url)
{ {
@ -33,4 +38,4 @@ export class RepairItemEventRouter extends ItemEventRouterDefinition
return this.repairCallbacks.traderRepair(pmcData, body, sessionID); return this.repairCallbacks.traderRepair(pmcData, body, sessionID);
} }
} }
} }

View File

@ -6,25 +6,30 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
@injectable() @injectable()
export class TradeItemEventRouter extends ItemEventRouterDefinition export class TradeItemEventRouter extends ItemEventRouterDefinition
{ {
constructor( constructor(
@inject("TradeCallbacks") protected tradeCallbacks: TradeCallbacks @inject("TradeCallbacks") protected tradeCallbacks: TradeCallbacks,
) )
{ {
super(); super();
} }
public override getHandledRoutes(): HandledRoute[] public override getHandledRoutes(): HandledRoute[]
{ {
return [ return [
new HandledRoute("TradingConfirm", false), new HandledRoute("TradingConfirm", false),
new HandledRoute("RagFairBuyOffer", false), new HandledRoute("RagFairBuyOffer", false),
new HandledRoute("SellAllFromSavage", false) new HandledRoute("SellAllFromSavage", false),
]; ];
} }
public override handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse public override handleItemEvent(
url: string,
pmcData: IPmcData,
body: any,
sessionID: string,
): IItemEventRouterResponse
{ {
switch (url) switch (url)
{ {
@ -36,4 +41,4 @@ export class TradeItemEventRouter extends ItemEventRouterDefinition
return this.tradeCallbacks.sellAllFromSavage(pmcData, body, sessionID); return this.tradeCallbacks.sellAllFromSavage(pmcData, body, sessionID);
} }
} }
} }

View File

@ -6,24 +6,29 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
@injectable() @injectable()
export class WishlistItemEventRouter extends ItemEventRouterDefinition export class WishlistItemEventRouter extends ItemEventRouterDefinition
{ {
constructor( constructor(
@inject("WishlistCallbacks") protected wishlistCallbacks: WishlistCallbacks @inject("WishlistCallbacks") protected wishlistCallbacks: WishlistCallbacks,
) )
{ {
super(); super();
} }
public override getHandledRoutes(): HandledRoute[] public override getHandledRoutes(): HandledRoute[]
{ {
return [ return [
new HandledRoute("AddToWishList", false), new HandledRoute("AddToWishList", false),
new HandledRoute("RemoveFromWishList", false) new HandledRoute("RemoveFromWishList", false),
]; ];
} }
public override handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse public override handleItemEvent(
url: string,
pmcData: IPmcData,
body: any,
sessionID: string,
): IItemEventRouterResponse
{ {
switch (url) switch (url)
{ {
@ -33,4 +38,4 @@ export class WishlistItemEventRouter extends ItemEventRouterDefinition
return this.wishlistCallbacks.removeFromWishlist(pmcData, body, sessionID); return this.wishlistCallbacks.removeFromWishlist(pmcData, body, sessionID);
} }
} }
} }

View File

@ -4,22 +4,22 @@ import { HandledRoute, SaveLoadRouter } from "@spt-aki/di/Router";
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
@injectable() @injectable()
export class HealthSaveLoadRouter extends SaveLoadRouter export class HealthSaveLoadRouter extends SaveLoadRouter
{ {
public override getHandledRoutes(): HandledRoute[] public override getHandledRoutes(): HandledRoute[]
{ {
return [ return [
new HandledRoute("aki-health", false) new HandledRoute("aki-health", false),
]; ];
} }
public override handleLoad(profile: IAkiProfile): IAkiProfile public override handleLoad(profile: IAkiProfile): IAkiProfile
{ {
if (!profile.vitality) // Occurs on newly created profiles if (!profile.vitality)
{ { // Occurs on newly created profiles
profile.vitality = { profile.vitality = {
health: null, health: null,
effects: null effects: null,
}; };
} }
profile.vitality.health = { profile.vitality.health = {
@ -32,7 +32,7 @@ export class HealthSaveLoadRouter extends SaveLoadRouter
LeftArm: 0, LeftArm: 0,
RightArm: 0, RightArm: 0,
LeftLeg: 0, LeftLeg: 0,
RightLeg: 0 RightLeg: 0,
}; };
profile.vitality.effects = { profile.vitality.effects = {
@ -42,9 +42,9 @@ export class HealthSaveLoadRouter extends SaveLoadRouter
LeftArm: {}, LeftArm: {},
RightArm: {}, RightArm: {},
LeftLeg: {}, LeftLeg: {},
RightLeg: {} RightLeg: {},
}; };
return profile; return profile;
} }
} }

View File

@ -4,25 +4,25 @@ import { HandledRoute, SaveLoadRouter } from "@spt-aki/di/Router";
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
@injectable() @injectable()
export class InraidSaveLoadRouter extends SaveLoadRouter export class InraidSaveLoadRouter extends SaveLoadRouter
{ {
public override getHandledRoutes(): HandledRoute[] public override getHandledRoutes(): HandledRoute[]
{ {
return [ return [
new HandledRoute("aki-inraid", false) new HandledRoute("aki-inraid", false),
]; ];
} }
public override handleLoad(profile: IAkiProfile): IAkiProfile public override handleLoad(profile: IAkiProfile): IAkiProfile
{ {
if (profile.inraid === undefined) if (profile.inraid === undefined)
{ {
profile.inraid = { profile.inraid = {
location: "none", location: "none",
character: "none" character: "none",
}; };
} }
return profile; return profile;
} }
} }

View File

@ -4,16 +4,16 @@ import { HandledRoute, SaveLoadRouter } from "@spt-aki/di/Router";
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
@injectable() @injectable()
export class InsuranceSaveLoadRouter extends SaveLoadRouter export class InsuranceSaveLoadRouter extends SaveLoadRouter
{ {
public override getHandledRoutes(): HandledRoute[] public override getHandledRoutes(): HandledRoute[]
{ {
return [ return [
new HandledRoute("aki-insurance", false) new HandledRoute("aki-insurance", false),
]; ];
} }
public override handleLoad(profile: IAkiProfile): IAkiProfile public override handleLoad(profile: IAkiProfile): IAkiProfile
{ {
if (profile.insurance === undefined) if (profile.insurance === undefined)
{ {
@ -21,4 +21,4 @@ export class InsuranceSaveLoadRouter extends SaveLoadRouter
} }
return profile; return profile;
} }
} }

View File

@ -5,24 +5,24 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
@injectable() @injectable()
export class ProfileSaveLoadRouter extends SaveLoadRouter export class ProfileSaveLoadRouter extends SaveLoadRouter
{ {
public override getHandledRoutes(): HandledRoute[] public override getHandledRoutes(): HandledRoute[]
{ {
return [ return [
new HandledRoute("aki-profile", false) new HandledRoute("aki-profile", false),
]; ];
} }
public override handleLoad(profile: IAkiProfile): IAkiProfile public override handleLoad(profile: IAkiProfile): IAkiProfile
{ {
if (profile.characters === null) if (profile.characters === null)
{ {
profile.characters = { profile.characters = {
pmc: {} as IPmcData, pmc: {} as IPmcData,
scav: {} as IPmcData scav: {} as IPmcData,
}; };
} }
return profile; return profile;
} }
} }

View File

@ -9,17 +9,15 @@ import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil";
@injectable() @injectable()
export class BundleSerializer extends Serializer export class BundleSerializer extends Serializer
{ {
constructor( constructor(
@inject("WinstonLogger") protected logger: ILogger, @inject("WinstonLogger") protected logger: ILogger,
@inject("BundleLoader") protected bundleLoader: BundleLoader, @inject("BundleLoader") protected bundleLoader: BundleLoader,
@inject("HttpFileUtil") protected httpFileUtil: HttpFileUtil @inject("HttpFileUtil") protected httpFileUtil: HttpFileUtil,
) )
{ {
super(); super();
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public override serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void public override serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void
{ {
this.logger.info(`[BUNDLE]: ${req.url}`); this.logger.info(`[BUNDLE]: ${req.url}`);
@ -35,4 +33,4 @@ export class BundleSerializer extends Serializer
{ {
return route === "BUNDLE"; return route === "BUNDLE";
} }
} }

View File

@ -5,16 +5,16 @@ import { Serializer } from "@spt-aki/di/Serializer";
import { ImageRouter } from "@spt-aki/routers/ImageRouter"; import { ImageRouter } from "@spt-aki/routers/ImageRouter";
@injectable() @injectable()
export class ImageSerializer extends Serializer export class ImageSerializer extends Serializer
{ {
constructor( constructor(
@inject("ImageRouter") protected imageRouter: ImageRouter @inject("ImageRouter") protected imageRouter: ImageRouter,
) )
{ {
super(); super();
} }
public override serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void public override serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void
{ {
this.imageRouter.sendImage(sessionID, req, resp, body); this.imageRouter.sendImage(sessionID, req, resp, body);
} }
@ -23,4 +23,4 @@ export class ImageSerializer extends Serializer
{ {
return route === "IMAGE"; return route === "IMAGE";
} }
} }

View File

@ -9,17 +9,15 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil";
@injectable() @injectable()
export class NotifySerializer extends Serializer export class NotifySerializer extends Serializer
{ {
constructor( constructor(
@inject("NotifierController") protected notifierController: NotifierController, @inject("NotifierController") protected notifierController: NotifierController,
@inject("JsonUtil") protected jsonUtil: JsonUtil, @inject("JsonUtil") protected jsonUtil: JsonUtil,
@inject("HttpServerHelper") protected httpServerHelper: HttpServerHelper @inject("HttpServerHelper") protected httpServerHelper: HttpServerHelper,
) )
{ {
super(); super();
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public override serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void public override serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void
{ {
const splittedUrl = req.url.split("/"); const splittedUrl = req.url.split("/");
@ -38,4 +36,4 @@ export class NotifySerializer extends Serializer
{ {
return route.toUpperCase() === "NOTIFY"; return route.toUpperCase() === "NOTIFY";
} }
} }

View File

@ -4,23 +4,22 @@ import { BotCallbacks } from "@spt-aki/callbacks/BotCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router"; import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable() @injectable()
export class BotStaticRouter extends StaticRouter export class BotStaticRouter extends StaticRouter
{ {
constructor( constructor(
@inject("BotCallbacks") protected botCallbacks: BotCallbacks @inject("BotCallbacks") protected botCallbacks: BotCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/client/game/bot/generate", "/client/game/bot/generate",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.botCallbacks.generateBots(url, info, sessionID); return this.botCallbacks.generateBots(url, info, sessionID);
} },
) ),
] ],
); );
} }
} }

View File

@ -4,23 +4,22 @@ import { BundleCallbacks } from "@spt-aki/callbacks/BundleCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router"; import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable() @injectable()
export class BundleStaticRouter extends StaticRouter export class BundleStaticRouter extends StaticRouter
{ {
constructor( constructor(
@inject("BundleCallbacks") protected bundleCallbacks: BundleCallbacks @inject("BundleCallbacks") protected bundleCallbacks: BundleCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/singleplayer/bundles", "/singleplayer/bundles",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.bundleCallbacks.getBundles(url, info, sessionID); return this.bundleCallbacks.getBundles(url, info, sessionID);
} },
) ),
] ],
); );
} }
} }

View File

@ -7,20 +7,19 @@ import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
export class ClientLogStaticRouter extends StaticRouter export class ClientLogStaticRouter extends StaticRouter
{ {
constructor( constructor(
@inject("ClientLogCallbacks") protected clientLogCallbacks: ClientLogCallbacks @inject("ClientLogCallbacks") protected clientLogCallbacks: ClientLogCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/singleplayer/log", "/singleplayer/log",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any => (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.clientLogCallbacks.clientLog(url, info, sessionID); return this.clientLogCallbacks.clientLog(url, info, sessionID);
} },
) ),
] ],
); );
} }
} }

View File

@ -4,23 +4,22 @@ import { CustomizationCallbacks } from "@spt-aki/callbacks/CustomizationCallback
import { RouteAction, StaticRouter } from "@spt-aki/di/Router"; import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable() @injectable()
export class CustomizationStaticRouter extends StaticRouter export class CustomizationStaticRouter extends StaticRouter
{ {
constructor( constructor(
@inject("CustomizationCallbacks") protected customizationCallbacks: CustomizationCallbacks @inject("CustomizationCallbacks") protected customizationCallbacks: CustomizationCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/client/trading/customization/storage", "/client/trading/customization/storage",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.customizationCallbacks.getSuits(url, info, sessionID); return this.customizationCallbacks.getSuits(url, info, sessionID);
} },
) ),
] ],
); );
} }
} }

View File

@ -4,111 +4,99 @@ import { DataCallbacks } from "@spt-aki/callbacks/DataCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router"; import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable() @injectable()
export class DataStaticRouter extends StaticRouter export class DataStaticRouter extends StaticRouter
{ {
constructor( constructor(
@inject("DataCallbacks") protected dataCallbacks: DataCallbacks @inject("DataCallbacks") protected dataCallbacks: DataCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/client/settings", "/client/settings",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dataCallbacks.getSettings(url, info, sessionID); return this.dataCallbacks.getSettings(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/globals", "/client/globals",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dataCallbacks.getGlobals(url, info, sessionID); return this.dataCallbacks.getGlobals(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/items", "/client/items",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dataCallbacks.getTemplateItems(url, info, sessionID); return this.dataCallbacks.getTemplateItems(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/handbook/templates", "/client/handbook/templates",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dataCallbacks.getTemplateHandbook(url, info, sessionID); return this.dataCallbacks.getTemplateHandbook(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/customization", "/client/customization",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dataCallbacks.getTemplateSuits(url, info, sessionID); return this.dataCallbacks.getTemplateSuits(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/account/customization", "/client/account/customization",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dataCallbacks.getTemplateCharacter(url, info, sessionID); return this.dataCallbacks.getTemplateCharacter(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/hideout/production/recipes", "/client/hideout/production/recipes",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dataCallbacks.gethideoutProduction(url, info, sessionID); return this.dataCallbacks.gethideoutProduction(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/hideout/settings", "/client/hideout/settings",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dataCallbacks.getHideoutSettings(url, info, sessionID); return this.dataCallbacks.getHideoutSettings(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/hideout/areas", "/client/hideout/areas",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dataCallbacks.getHideoutAreas(url, info, sessionID); return this.dataCallbacks.getHideoutAreas(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/hideout/production/scavcase/recipes", "/client/hideout/production/scavcase/recipes",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dataCallbacks.getHideoutScavcase(url, info, sessionID); return this.dataCallbacks.getHideoutScavcase(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/languages", "/client/languages",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dataCallbacks.getLocalesLanguages(url, info, sessionID); return this.dataCallbacks.getLocalesLanguages(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/hideout/qte/list", "/client/hideout/qte/list",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dataCallbacks.getQteList(url, info, sessionID); return this.dataCallbacks.getQteList(url, info, sessionID);
} },
) ),
] ],
); );
} }
} }

View File

@ -4,183 +4,162 @@ import { DialogueCallbacks } from "@spt-aki/callbacks/DialogueCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router"; import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable() @injectable()
export class DialogStaticRouter extends StaticRouter export class DialogStaticRouter extends StaticRouter
{ {
constructor( constructor(
@inject("DialogueCallbacks") protected dialogueCallbacks: DialogueCallbacks @inject("DialogueCallbacks") protected dialogueCallbacks: DialogueCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/client/chatServer/list", "/client/chatServer/list",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dialogueCallbacks.getChatServerList(url, info, sessionID); return this.dialogueCallbacks.getChatServerList(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/mail/dialog/list", "/client/mail/dialog/list",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dialogueCallbacks.getMailDialogList(url, info, sessionID); return this.dialogueCallbacks.getMailDialogList(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/mail/dialog/view", "/client/mail/dialog/view",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dialogueCallbacks.getMailDialogView(url, info, sessionID); return this.dialogueCallbacks.getMailDialogView(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/mail/dialog/info", "/client/mail/dialog/info",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dialogueCallbacks.getMailDialogInfo(url, info, sessionID); return this.dialogueCallbacks.getMailDialogInfo(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/mail/dialog/remove", "/client/mail/dialog/remove",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dialogueCallbacks.removeDialog(url, info, sessionID); return this.dialogueCallbacks.removeDialog(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/mail/dialog/pin", "/client/mail/dialog/pin",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dialogueCallbacks.pinDialog(url, info, sessionID); return this.dialogueCallbacks.pinDialog(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/mail/dialog/unpin", "/client/mail/dialog/unpin",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dialogueCallbacks.unpinDialog(url, info, sessionID); return this.dialogueCallbacks.unpinDialog(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/mail/dialog/read", "/client/mail/dialog/read",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dialogueCallbacks.setRead(url, info, sessionID); return this.dialogueCallbacks.setRead(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/mail/dialog/remove", "/client/mail/dialog/remove",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dialogueCallbacks.removeMail(url, info, sessionID); return this.dialogueCallbacks.removeMail(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/mail/dialog/getAllAttachments", "/client/mail/dialog/getAllAttachments",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dialogueCallbacks.getAllAttachments(url, info, sessionID); return this.dialogueCallbacks.getAllAttachments(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/mail/msg/send", "/client/mail/msg/send",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dialogueCallbacks.sendMessage(url, info, sessionID); return this.dialogueCallbacks.sendMessage(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/mail/dialog/clear", "/client/mail/dialog/clear",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dialogueCallbacks.clearMail(url, info, sessionID); return this.dialogueCallbacks.clearMail(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/friend/list", "/client/friend/list",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dialogueCallbacks.getFriendList(url, info, sessionID); return this.dialogueCallbacks.getFriendList(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/friend/request/list/outbox", "/client/friend/request/list/outbox",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dialogueCallbacks.listOutbox(url, info, sessionID); return this.dialogueCallbacks.listOutbox(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/friend/request/list/inbox", "/client/friend/request/list/inbox",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dialogueCallbacks.listInbox(url, info, sessionID); return this.dialogueCallbacks.listInbox(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/friend/request/send", "/client/friend/request/send",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dialogueCallbacks.sendFriendRequest(url, info, sessionID); return this.dialogueCallbacks.sendFriendRequest(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/friend/request/accept", "/client/friend/request/accept",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dialogueCallbacks.acceptFriendRequest(url, info, sessionID); return this.dialogueCallbacks.acceptFriendRequest(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/friend/request/cancel", "/client/friend/request/cancel",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dialogueCallbacks.cancelFriendRequest(url, info, sessionID); return this.dialogueCallbacks.cancelFriendRequest(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/friend/delete", "/client/friend/delete",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dialogueCallbacks.deleteFriend(url, info, sessionID); return this.dialogueCallbacks.deleteFriend(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/friend/ignore/set", "/client/friend/ignore/set",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dialogueCallbacks.ignoreFriend(url, info, sessionID); return this.dialogueCallbacks.ignoreFriend(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/friend/ignore/remove", "/client/friend/ignore/remove",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.dialogueCallbacks.unIgnoreFriend(url, info, sessionID); return this.dialogueCallbacks.unIgnoreFriend(url, info, sessionID);
} },
) ),
] ],
); );
} }
} }

View File

@ -4,95 +4,85 @@ import { GameCallbacks } from "@spt-aki/callbacks/GameCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router"; import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable() @injectable()
export class GameStaticRouter extends StaticRouter export class GameStaticRouter extends StaticRouter
{ {
constructor( constructor(
@inject("GameCallbacks") protected gameCallbacks: GameCallbacks @inject("GameCallbacks") protected gameCallbacks: GameCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/client/game/config", "/client/game/config",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.gameCallbacks.getGameConfig(url, info, sessionID); return this.gameCallbacks.getGameConfig(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/server/list", "/client/server/list",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.gameCallbacks.getServer(url, info, sessionID); return this.gameCallbacks.getServer(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/match/group/current", "/client/match/group/current",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.gameCallbacks.getCurrentGroup(url, info, sessionID); return this.gameCallbacks.getCurrentGroup(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/game/version/validate", "/client/game/version/validate",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.gameCallbacks.versionValidate(url, info, sessionID); return this.gameCallbacks.versionValidate(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/game/start", "/client/game/start",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.gameCallbacks.gameStart(url, info, sessionID); return this.gameCallbacks.gameStart(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/game/logout", "/client/game/logout",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.gameCallbacks.gameLogout(url, info, sessionID); return this.gameCallbacks.gameLogout(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/checkVersion", "/client/checkVersion",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.gameCallbacks.validateGameVersion(url, info, sessionID); return this.gameCallbacks.validateGameVersion(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/game/keepalive", "/client/game/keepalive",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.gameCallbacks.gameKeepalive(url, info, sessionID); return this.gameCallbacks.gameKeepalive(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/singleplayer/settings/version", "/singleplayer/settings/version",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.gameCallbacks.getVersion(url, info, sessionID); return this.gameCallbacks.getVersion(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/reports/lobby/send", "/client/reports/lobby/send",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.gameCallbacks.reportNickname(url, info, sessionID); return this.gameCallbacks.reportNickname(url, info, sessionID);
} },
) ),
] ],
); );
} }
} }

View File

@ -4,31 +4,29 @@ import { HealthCallbacks } from "@spt-aki/callbacks/HealthCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router"; import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable() @injectable()
export class HealthStaticRouter extends StaticRouter export class HealthStaticRouter extends StaticRouter
{ {
constructor( constructor(
@inject("HealthCallbacks") protected healthCallbacks: HealthCallbacks @inject("HealthCallbacks") protected healthCallbacks: HealthCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/player/health/sync", "/player/health/sync",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.healthCallbacks.syncHealth(url, info, sessionID); return this.healthCallbacks.syncHealth(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/hideout/workout", "/client/hideout/workout",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.healthCallbacks.handleWorkoutEffects(url, info, sessionID); return this.healthCallbacks.handleWorkoutEffects(url, info, sessionID);
} },
) ),
] ],
); );
} }
} }

View File

@ -4,55 +4,50 @@ import { InraidCallbacks } from "@spt-aki/callbacks/InraidCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router"; import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable() @injectable()
export class InraidStaticRouter extends StaticRouter export class InraidStaticRouter extends StaticRouter
{ {
constructor( constructor(
@inject("InraidCallbacks") protected inraidCallbacks: InraidCallbacks @inject("InraidCallbacks") protected inraidCallbacks: InraidCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/raid/profile/save", "/raid/profile/save",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.inraidCallbacks.saveProgress(url, info, sessionID); return this.inraidCallbacks.saveProgress(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/singleplayer/settings/raid/endstate", "/singleplayer/settings/raid/endstate",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.inraidCallbacks.getRaidEndState(); return this.inraidCallbacks.getRaidEndState();
} },
), ),
new RouteAction( new RouteAction(
"/singleplayer/settings/weapon/durability", "/singleplayer/settings/weapon/durability",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.inraidCallbacks.getWeaponDurability(); return this.inraidCallbacks.getWeaponDurability();
} },
), ),
new RouteAction( new RouteAction(
"/singleplayer/settings/raid/menu", "/singleplayer/settings/raid/menu",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.inraidCallbacks.getRaidMenuSettings(); return this.inraidCallbacks.getRaidMenuSettings();
} },
), ),
new RouteAction( new RouteAction(
"/singleplayer/airdrop/config", "/singleplayer/airdrop/config",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.inraidCallbacks.getAirdropConfig(); return this.inraidCallbacks.getAirdropConfig();
} },
) ),
] ],
); );
} }
} }

View File

@ -4,23 +4,22 @@ import { InsuranceCallbacks } from "@spt-aki/callbacks/InsuranceCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router"; import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable() @injectable()
export class InsuranceStaticRouter extends StaticRouter export class InsuranceStaticRouter extends StaticRouter
{ {
constructor( constructor(
@inject("InsuranceCallbacks") protected insuranceCallbacks: InsuranceCallbacks @inject("InsuranceCallbacks") protected insuranceCallbacks: InsuranceCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/client/insurance/items/list/cost", "/client/insurance/items/list/cost",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.insuranceCallbacks.getInsuranceCost(url, info, sessionID); return this.insuranceCallbacks.getInsuranceCost(url, info, sessionID);
} },
) ),
] ],
); );
} }
} }

View File

@ -4,23 +4,22 @@ import { ItemEventCallbacks } from "@spt-aki/callbacks/ItemEventCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router"; import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable() @injectable()
export class ItemEventStaticRouter extends StaticRouter export class ItemEventStaticRouter extends StaticRouter
{ {
constructor( constructor(
@inject("ItemEventCallbacks") protected itemEventCallbacks: ItemEventCallbacks @inject("ItemEventCallbacks") protected itemEventCallbacks: ItemEventCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/client/game/profile/items/moving", "/client/game/profile/items/moving",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.itemEventCallbacks.handleEvents(url, info, sessionID); return this.itemEventCallbacks.handleEvents(url, info, sessionID);
} },
) ),
] ],
); );
} }
} }

View File

@ -4,119 +4,106 @@ import { LauncherCallbacks } from "@spt-aki/callbacks/LauncherCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router"; import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable() @injectable()
export class LauncherStaticRouter extends StaticRouter export class LauncherStaticRouter extends StaticRouter
{ {
constructor( constructor(
@inject("LauncherCallbacks") protected launcherCallbacks: LauncherCallbacks @inject("LauncherCallbacks") protected launcherCallbacks: LauncherCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/launcher/ping", "/launcher/ping",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.launcherCallbacks.ping(url, info, sessionID); return this.launcherCallbacks.ping(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/launcher/server/connect", "/launcher/server/connect",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.launcherCallbacks.connect(); return this.launcherCallbacks.connect();
} },
), ),
new RouteAction( new RouteAction(
"/launcher/profile/login", "/launcher/profile/login",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.launcherCallbacks.login(url, info,sessionID); return this.launcherCallbacks.login(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/launcher/profile/register", "/launcher/profile/register",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.launcherCallbacks.register(url, info, sessionID); return this.launcherCallbacks.register(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/launcher/profile/get", "/launcher/profile/get",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.launcherCallbacks.get(url, info, sessionID); return this.launcherCallbacks.get(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/launcher/profile/change/username", "/launcher/profile/change/username",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.launcherCallbacks.changeUsername(url, info, sessionID); return this.launcherCallbacks.changeUsername(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/launcher/profile/change/password", "/launcher/profile/change/password",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.launcherCallbacks.changePassword(url, info, sessionID); return this.launcherCallbacks.changePassword(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/launcher/profile/change/wipe", "/launcher/profile/change/wipe",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.launcherCallbacks.wipe(url, info, sessionID); return this.launcherCallbacks.wipe(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/launcher/profile/remove", "/launcher/profile/remove",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.launcherCallbacks.removeProfile(url, info, sessionID); return this.launcherCallbacks.removeProfile(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/launcher/profile/compatibleTarkovVersion", "/launcher/profile/compatibleTarkovVersion",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.launcherCallbacks.getCompatibleTarkovVersion(); return this.launcherCallbacks.getCompatibleTarkovVersion();
} },
), ),
new RouteAction( new RouteAction(
"/launcher/server/version", "/launcher/server/version",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.launcherCallbacks.getServerVersion(); return this.launcherCallbacks.getServerVersion();
} },
), ),
new RouteAction( new RouteAction(
"/launcher/server/loadedServerMods", "/launcher/server/loadedServerMods",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.launcherCallbacks.getLoadedServerMods(); return this.launcherCallbacks.getLoadedServerMods();
} },
), ),
new RouteAction( new RouteAction(
"/launcher/server/serverModsUsedByProfile", "/launcher/server/serverModsUsedByProfile",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.launcherCallbacks.getServerModsProfileUsed(url, info, sessionID); return this.launcherCallbacks.getServerModsProfileUsed(url, info, sessionID);
} },
) ),
] ],
); );
} }
} }

View File

@ -4,31 +4,29 @@ import { LocationCallbacks } from "@spt-aki/callbacks/LocationCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router"; import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable() @injectable()
export class LocationStaticRouter extends StaticRouter export class LocationStaticRouter extends StaticRouter
{ {
constructor( constructor(
@inject("LocationCallbacks") protected locationCallbacks: LocationCallbacks @inject("LocationCallbacks") protected locationCallbacks: LocationCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/client/locations", "/client/locations",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.locationCallbacks.getLocationData(url, info, sessionID); return this.locationCallbacks.getLocationData(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/location/getAirdropLoot", "/client/location/getAirdropLoot",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, _output: string): any => (url: string, info: any, sessionID: string, _output: string): any =>
{ {
return this.locationCallbacks.getAirdropLoot(url, info, sessionID); return this.locationCallbacks.getAirdropLoot(url, info, sessionID);
} },
) ),
] ],
); );
} }
} }

View File

@ -4,200 +4,176 @@ import { MatchCallbacks } from "@spt-aki/callbacks/MatchCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router"; import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable() @injectable()
export class MatchStaticRouter extends StaticRouter export class MatchStaticRouter extends StaticRouter
{ {
constructor( constructor(
@inject("MatchCallbacks") protected matchCallbacks: MatchCallbacks @inject("MatchCallbacks") protected matchCallbacks: MatchCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/raid/profile/list", "/raid/profile/list",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.matchCallbacks.getProfile(url, info, sessionID); return this.matchCallbacks.getProfile(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/match/available", "/client/match/available",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.matchCallbacks.serverAvailable(url, info, sessionID); return this.matchCallbacks.serverAvailable(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/match/updatePing", "/client/match/updatePing",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.matchCallbacks.updatePing(url, info, sessionID); return this.matchCallbacks.updatePing(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/match/join", "/client/match/join",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.matchCallbacks.joinMatch(url, info, sessionID); return this.matchCallbacks.joinMatch(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/match/exit", "/client/match/exit",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.matchCallbacks.exitMatch(url, info, sessionID); return this.matchCallbacks.exitMatch(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/match/group/create", "/client/match/group/create",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.matchCallbacks.createGroup(url, info, sessionID); return this.matchCallbacks.createGroup(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/match/group/delete", "/client/match/group/delete",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this. matchCallbacks.deleteGroup(url, info, sessionID); return this.matchCallbacks.deleteGroup(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/match/group/leave", "/client/match/group/leave",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this. matchCallbacks.leaveGroup(url, info, sessionID); return this.matchCallbacks.leaveGroup(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/match/group/status", "/client/match/group/status",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.matchCallbacks.getGroupStatus(url, info, sessionID); return this.matchCallbacks.getGroupStatus(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/match/group/start_game", "/client/match/group/start_game",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.matchCallbacks.joinMatch(url, info, sessionID); return this.matchCallbacks.joinMatch(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/match/group/exit_from_menu", "/client/match/group/exit_from_menu",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.matchCallbacks.exitToMenu(url, info, sessionID); return this.matchCallbacks.exitToMenu(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/match/group/looking/start", "/client/match/group/looking/start",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.matchCallbacks.startGroupSearch(url, info, sessionID); return this.matchCallbacks.startGroupSearch(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/match/group/looking/stop", "/client/match/group/looking/stop",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.matchCallbacks.stopGroupSearch(url, info, sessionID); return this.matchCallbacks.stopGroupSearch(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/match/group/invite/send", "/client/match/group/invite/send",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.matchCallbacks.sendGroupInvite(url, info, sessionID); return this.matchCallbacks.sendGroupInvite(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/match/group/invite/accept", "/client/match/group/invite/accept",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.matchCallbacks.acceptGroupInvite(url, info, sessionID); return this.matchCallbacks.acceptGroupInvite(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/match/group/invite/cancel", "/client/match/group/invite/cancel",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.matchCallbacks.cancelGroupInvite(url, info, sessionID); return this.matchCallbacks.cancelGroupInvite(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/match/group/invite/cancel-all", "/client/match/group/invite/cancel-all",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.matchCallbacks.cancelAllGroupInvite(url, info, sessionID); return this.matchCallbacks.cancelAllGroupInvite(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/match/group/transfer", "/client/match/group/transfer",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.matchCallbacks.transferGroup(url, info, sessionID); return this.matchCallbacks.transferGroup(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/match/offline/end", "/client/match/offline/end",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.matchCallbacks.endOfflineRaid(url, info, sessionID); return this.matchCallbacks.endOfflineRaid(url, info, sessionID);
},
}
), ),
new RouteAction( new RouteAction(
"/client/putMetrics", "/client/putMetrics",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.matchCallbacks.putMetrics(url, info, sessionID); return this.matchCallbacks.putMetrics(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/getMetricsConfig", "/client/getMetricsConfig",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.matchCallbacks.getMetrics(url, info, sessionID); return this.matchCallbacks.getMetrics(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/raid/configuration", "/client/raid/configuration",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.matchCallbacks.getRaidConfiguration(url, info, sessionID); return this.matchCallbacks.getRaidConfiguration(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/match/group/player/remove", "/client/match/group/player/remove",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.matchCallbacks.removePlayerFromGroup(url, info, sessionID); return this.matchCallbacks.removePlayerFromGroup(url, info, sessionID);
} },
) ),
] ],
); );
} }
} }

View File

@ -4,31 +4,29 @@ import { NotifierCallbacks } from "@spt-aki/callbacks/NotifierCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router"; import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable() @injectable()
export class NotifierStaticRouter extends StaticRouter export class NotifierStaticRouter extends StaticRouter
{ {
constructor( constructor(
@inject("NotifierCallbacks") protected notifierCallbacks: NotifierCallbacks @inject("NotifierCallbacks") protected notifierCallbacks: NotifierCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/client/notifier/channel/create", "/client/notifier/channel/create",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.notifierCallbacks.createNotifierChannel(url, info, sessionID); return this.notifierCallbacks.createNotifierChannel(url, info, sessionID);
} },
), ),
new RouteAction( new RouteAction(
"/client/game/profile/select", "/client/game/profile/select",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.notifierCallbacks.selectProfile(url, info, sessionID); return this.notifierCallbacks.selectProfile(url, info, sessionID);
} },
) ),
] ],
); );
} }
} }

View File

@ -4,23 +4,22 @@ import { PresetBuildCallbacks } from "@spt-aki/callbacks/PresetBuildCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router"; import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable() @injectable()
export class PresetStaticRouter extends StaticRouter export class PresetStaticRouter extends StaticRouter
{ {
constructor( constructor(
@inject("PresetBuildCallbacks") protected presetCallbacks: PresetBuildCallbacks @inject("PresetBuildCallbacks") protected presetCallbacks: PresetBuildCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/client/handbook/builds/my/list", "/client/handbook/builds/my/list",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.presetCallbacks.getHandbookUserlist(url, info, sessionID); return this.presetCallbacks.getHandbookUserlist(url, info, sessionID);
} },
) ),
] ],
); );
} }
} }

View File

@ -4,99 +4,99 @@ import { ProfileCallbacks } from "@spt-aki/callbacks/ProfileCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router"; import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable() @injectable()
export class ProfileStaticRouter extends StaticRouter export class ProfileStaticRouter extends StaticRouter
{ {
constructor( constructor(
@inject("ProfileCallbacks") protected profileCallbacks: ProfileCallbacks @inject("ProfileCallbacks") protected profileCallbacks: ProfileCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/client/game/profile/create", "/client/game/profile/create",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.profileCallbacks.createProfile(url, info, sessionID); return this.profileCallbacks.createProfile(url, info, sessionID);
}), },
),
new RouteAction( new RouteAction(
"/client/game/profile/list", "/client/game/profile/list",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.profileCallbacks.getProfileData(url, info, sessionID); return this.profileCallbacks.getProfileData(url, info, sessionID);
}), },
),
new RouteAction( new RouteAction(
"/client/game/profile/savage/regenerate", "/client/game/profile/savage/regenerate",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.profileCallbacks.regenerateScav(url, info, sessionID); return this.profileCallbacks.regenerateScav(url, info, sessionID);
}), },
),
new RouteAction( new RouteAction(
"/client/game/profile/voice/change", "/client/game/profile/voice/change",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.profileCallbacks.changeVoice(url, info, sessionID); return this.profileCallbacks.changeVoice(url, info, sessionID);
}), },
),
new RouteAction( new RouteAction(
"/client/game/profile/nickname/change", "/client/game/profile/nickname/change",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.profileCallbacks.changeNickname(url, info, sessionID); return this.profileCallbacks.changeNickname(url, info, sessionID);
}), },
),
new RouteAction( new RouteAction(
"/client/game/profile/nickname/validate", "/client/game/profile/nickname/validate",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.profileCallbacks.validateNickname(url, info, sessionID); return this.profileCallbacks.validateNickname(url, info, sessionID);
}), },
),
new RouteAction( new RouteAction(
"/client/game/profile/nickname/reserved", "/client/game/profile/nickname/reserved",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.profileCallbacks.getReservedNickname(url, info, sessionID); return this.profileCallbacks.getReservedNickname(url, info, sessionID);
}), },
),
new RouteAction( new RouteAction(
"/client/profile/status", "/client/profile/status",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.profileCallbacks.getProfileStatus(url, info, sessionID); return this.profileCallbacks.getProfileStatus(url, info, sessionID);
}), },
),
new RouteAction( new RouteAction(
"/client/profile/settings", "/client/profile/settings",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.profileCallbacks.getProfileSettings(url, info, sessionID); return this.profileCallbacks.getProfileSettings(url, info, sessionID);
}), },
),
new RouteAction( new RouteAction(
"/client/game/profile/search", "/client/game/profile/search",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.profileCallbacks.searchFriend(url, info, sessionID); return this.profileCallbacks.searchFriend(url, info, sessionID);
}), },
),
new RouteAction( new RouteAction(
"/launcher/profile/info", "/launcher/profile/info",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.profileCallbacks.getMiniProfile(url, info, sessionID); return this.profileCallbacks.getMiniProfile(url, info, sessionID);
}), },
),
new RouteAction( new RouteAction(
"/launcher/profiles", "/launcher/profiles",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.profileCallbacks.getAllMiniProfiles(url, info, sessionID); return this.profileCallbacks.getAllMiniProfiles(url, info, sessionID);
}) },
] ),
],
); );
} }
} }

View File

@ -4,29 +4,29 @@ import { QuestCallbacks } from "@spt-aki/callbacks/QuestCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router"; import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable() @injectable()
export class QuestStaticRouter extends StaticRouter export class QuestStaticRouter extends StaticRouter
{ {
constructor( constructor(
@inject("QuestCallbacks") protected questCallbacks: QuestCallbacks @inject("QuestCallbacks") protected questCallbacks: QuestCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/client/quest/list", "/client/quest/list",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.questCallbacks.listQuests(url, info, sessionID); return this.questCallbacks.listQuests(url, info, sessionID);
}), },
),
new RouteAction( new RouteAction(
"/client/repeatalbeQuests/activityPeriods", "/client/repeatalbeQuests/activityPeriods",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.questCallbacks.activityPeriods(url, info, sessionID); return this.questCallbacks.activityPeriods(url, info, sessionID);
}) },
] ),
],
); );
} }
} }

View File

@ -4,58 +4,57 @@ import { RagfairCallbacks } from "@spt-aki/callbacks/RagfairCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router"; import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable() @injectable()
export class RagfairStaticRouter extends StaticRouter export class RagfairStaticRouter extends StaticRouter
{ {
constructor( constructor(
@inject("RagfairCallbacks") protected ragfairCallbacks: RagfairCallbacks @inject("RagfairCallbacks") protected ragfairCallbacks: RagfairCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/client/ragfair/search", "/client/ragfair/search",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.ragfairCallbacks.search(url, info, sessionID); return this.ragfairCallbacks.search(url, info, sessionID);
}), },
),
new RouteAction( new RouteAction(
"/client/ragfair/find", "/client/ragfair/find",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.ragfairCallbacks.search(url, info, sessionID); return this.ragfairCallbacks.search(url, info, sessionID);
}), },
),
new RouteAction( new RouteAction(
"/client/ragfair/itemMarketPrice", "/client/ragfair/itemMarketPrice",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.ragfairCallbacks.getMarketPrice(url, info, sessionID); return this.ragfairCallbacks.getMarketPrice(url, info, sessionID);
}), },
),
new RouteAction( new RouteAction(
"/client/ragfair/offerfees", "/client/ragfair/offerfees",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.ragfairCallbacks.storePlayerOfferTaxAmount(url, info, sessionID); return this.ragfairCallbacks.storePlayerOfferTaxAmount(url, info, sessionID);
}), },
),
new RouteAction( new RouteAction(
"/client/reports/ragfair/send", "/client/reports/ragfair/send",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.ragfairCallbacks.sendReport(url, info, sessionID); return this.ragfairCallbacks.sendReport(url, info, sessionID);
}), },
),
new RouteAction( new RouteAction(
"/client/items/prices", "/client/items/prices",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.ragfairCallbacks.getFleaPrices(url, info, sessionID); return this.ragfairCallbacks.getFleaPrices(url, info, sessionID);
}) },
] ),
],
); );
} }
}
}

View File

@ -4,23 +4,22 @@ import { TraderCallbacks } from "@spt-aki/callbacks/TraderCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router"; import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable() @injectable()
export class TraderStaticRouter extends StaticRouter export class TraderStaticRouter extends StaticRouter
{ {
constructor( constructor(
@inject("TraderCallbacks") protected traderCallbacks: TraderCallbacks @inject("TraderCallbacks") protected traderCallbacks: TraderCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/client/trading/api/traderSettings", "/client/trading/api/traderSettings",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.traderCallbacks.getTraderSettings(url, info, sessionID); return this.traderCallbacks.getTraderSettings(url, info, sessionID);
} },
) ),
] ],
); );
} }
} }

View File

@ -4,22 +4,22 @@ import { WeatherCallbacks } from "@spt-aki/callbacks/WeatherCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router"; import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable() @injectable()
export class WeatherStaticRouter extends StaticRouter export class WeatherStaticRouter extends StaticRouter
{ {
constructor( constructor(
@inject("WeatherCallbacks") protected weatherCallbacks: WeatherCallbacks @inject("WeatherCallbacks") protected weatherCallbacks: WeatherCallbacks,
) )
{ {
super( super(
[ [
new RouteAction( new RouteAction(
"/client/weather", "/client/weather",
// eslint-disable-next-line @typescript-eslint/no-unused-vars (url: string, info: any, sessionID: string, output: string): any =>
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.weatherCallbacks.getWeather(url, info, sessionID); return this.weatherCallbacks.getWeather(url, info, sessionID);
}) },
] ),
],
); );
} }
} }