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
{
/** What has client been informed of this game session */
protected clientActiveSessionStorage: Record<string, {clientInformed: boolean}> = {};
protected clientActiveSessionStorage: Record<string, {clientInformed: boolean;}> = {};
constructor(
@inject("JsonUtil") protected jsonUtil: JsonUtil,
@inject("ProfileHelper") protected profileHelper: ProfileHelper,
@inject("TimeUtil") protected timeUtil: TimeUtil
@inject("TimeUtil") protected timeUtil: TimeUtil,
)
{}
// TODO REMEMBER TO CHANGE OUTPUT
protected output: IItemEventRouterResponse = {
warnings: [],
profileChanges: {}
profileChanges: {},
};
public getOutput(sessionID: string): IItemEventRouterResponse
@ -57,20 +57,20 @@ export class EventOutputHolder
items: {
new: [],
change: [],
del: []
del: [],
},
production: {},
improvements: {},
skills: {
Common: [],
Mastering: [],
Points: 0
Points: 0,
},
health: this.jsonUtil.clone(pmcData.Health),
traderRelations: {},
//changedHideoutStashes: {},
// changedHideoutStashes: {},
recipeUnlocked: {},
questsStatus: []
questsStatus: [],
};
}
@ -89,7 +89,9 @@ export class EventOutputHolder
profileChanges.skills.Mastering = this.jsonUtil.clone(pmcData.Skills.Mastering);
// 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.traderRelations = this.constructTraderRelations(pmcData.TradersInfo);
}
@ -111,13 +113,13 @@ export class EventOutputHolder
disabled: baseData.disabled,
loyalty: baseData.loyaltyLevel,
standing: baseData.standing,
unlocked: baseData.unlocked
unlocked: baseData.unlocked,
};
}
return result;
}
/**
* Return all hideout Improvements from player profile, adjust completed Improvements' completed property to be true
* @param pmcData Player profile
@ -149,7 +151,9 @@ export class EventOutputHolder
* @param pmcData Player profile
* @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)
{
@ -177,7 +181,7 @@ export class EventOutputHolder
// Flag started craft as having been seen by client
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(
@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();
for (const item of list)
@ -56,7 +56,14 @@ export class HttpRouter
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;
for (const route of routers)
@ -81,7 +88,7 @@ export class HttpRouter
class ResponseWrapper
{
constructor(
public output: string
public output: string,
)
{}
}
}

View File

@ -11,16 +11,15 @@ export class ImageRouter
constructor(
@inject("VFS") protected vfs: VFS,
@inject("ImageRouteService") protected imageRouteService: ImageRouteService,
@inject("HttpFileUtil") protected httpFileUtil: HttpFileUtil
@inject("HttpFileUtil") protected httpFileUtil: HttpFileUtil,
)
{ }
{}
public addRoute(key: string, valueToAdd: string): void
{
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
{
// remove file extension
@ -37,4 +36,4 @@ export class ImageRouter
{
return "IMAGE";
}
}
}

View File

@ -9,24 +9,23 @@ import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
@injectable()
export class ItemEventRouter
export class ItemEventRouter
{
constructor(
@inject("WinstonLogger") protected logger: ILogger,
@inject("ProfileHelper") protected profileHelper: ProfileHelper,
@injectAll("IERouters") protected itemEventRouters: ItemEventRouterDefinition[],
@inject("LocalisationService") protected localisationService: LocalisationService,
@inject("EventOutputHolder") protected eventOutputHolder: EventOutputHolder
)
{ }
@inject("EventOutputHolder") protected eventOutputHolder: EventOutputHolder,
)
{}
/**
*
* @param info Event request
* @param sessionID Session id
* @returns Item response
*/
public handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse
public handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse
{
this.eventOutputHolder.resetOutput(sessionID);
@ -36,13 +35,13 @@ export class ItemEventRouter
{
const pmcData = this.profileHelper.getPmcProfile(sessionID);
const eventRouter = this.itemEventRouters.find(r => r.canHandle(body.Action));
if (eventRouter)
const eventRouter = this.itemEventRouters.find((r) => r.canHandle(body.Action));
if (eventRouter)
{
this.logger.debug(`event: ${body.Action}`);
result = eventRouter.handleItemEvent(body.Action, pmcData, body, sessionID);
}
else
else
{
this.logger.error(this.localisationService.getText("event-unhandled_event", body.Action));
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";
@injectable()
export class BotDynamicRouter extends DynamicRouter
export class BotDynamicRouter extends DynamicRouter
{
constructor(
@inject("BotCallbacks") protected botCallbacks: BotCallbacks
)
@inject("BotCallbacks") protected botCallbacks: BotCallbacks,
)
{
super(
[
new RouteAction(
"/singleplayer/settings/bot/limit/",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.botCallbacks.getBotLimit(url, info, sessionID);
}
},
),
new RouteAction(
"/singleplayer/settings/bot/difficulty/",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.botCallbacks.getBotDifficulty(url, info, sessionID);
}
},
),
new RouteAction(
"/singleplayer/settings/bot/maxCap",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.botCallbacks.getBotCap();
}
},
),
new RouteAction(
"/singleplayer/settings/bot/getBotBehaviours/",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
{
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";
@injectable()
export class BundleDynamicRouter extends DynamicRouter
export class BundleDynamicRouter extends DynamicRouter
{
constructor(
@inject("BundleCallbacks") protected bundleCallbacks: BundleCallbacks
)
@inject("BundleCallbacks") protected bundleCallbacks: BundleCallbacks,
)
{
super(
[
new RouteAction(
".bundle",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
{
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";
@injectable()
export class CustomizationDynamicRouter extends DynamicRouter
export class CustomizationDynamicRouter extends DynamicRouter
{
constructor(
@inject("CustomizationCallbacks") protected customizationCallbacks: CustomizationCallbacks
)
@inject("CustomizationCallbacks") protected customizationCallbacks: CustomizationCallbacks,
)
{
super(
[
new RouteAction(
"/client/trading/customization/",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
{
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";
@injectable()
export class DataDynamicRouter extends DynamicRouter
export class DataDynamicRouter extends DynamicRouter
{
constructor(
@inject("DataCallbacks") protected dataCallbacks: DataCallbacks
)
@inject("DataCallbacks") protected dataCallbacks: DataCallbacks,
)
{
super(
[
new RouteAction(
"/client/menu/locale/",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.dataCallbacks.getLocalesMenu(url, info, sessionID);
}
},
),
new RouteAction(
"/client/locale/",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.dataCallbacks.getLocalesGlobal(url, info, sessionID);
}
},
),
new RouteAction(
"/client/items/prices/",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/items/prices/",
(url: string, info: any, sessionID: string, output: string): any =>
{
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";
@injectable()
export class HttpDynamicRouter extends DynamicRouter
export class HttpDynamicRouter extends DynamicRouter
{
constructor(
@inject("ImageRouter") protected imageRouter: ImageRouter
)
@inject("ImageRouter") protected imageRouter: ImageRouter,
)
{
super(
[
new RouteAction(
".jpg",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.imageRouter.getImage();
}
},
),
new RouteAction(
".png",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.imageRouter.getImage();
}
},
),
new RouteAction(
".ico",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
{
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";
@injectable()
export class InraidDynamicRouter extends DynamicRouter
export class InraidDynamicRouter extends DynamicRouter
{
constructor(
@inject("InraidCallbacks") protected inraidCallbacks: InraidCallbacks
)
@inject("InraidCallbacks") protected inraidCallbacks: InraidCallbacks,
)
{
super(
[
new RouteAction(
"/client/location/getLocalloot",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.inraidCallbacks.registerPlayer(url, info, sessionID);
}
)
]
},
),
],
);
}
public override getTopLevelRoute(): string
public override getTopLevelRoute(): string
{
return "aki-name";
}
}
}

View File

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

View File

@ -4,48 +4,43 @@ import { NotifierCallbacks } from "@spt-aki/callbacks/NotifierCallbacks";
import { DynamicRouter, RouteAction } from "@spt-aki/di/Router";
@injectable()
export class NotifierDynamicRouter extends DynamicRouter
export class NotifierDynamicRouter extends DynamicRouter
{
constructor(
@inject("NotifierCallbacks") protected notifierCallbacks: NotifierCallbacks
)
@inject("NotifierCallbacks") protected notifierCallbacks: NotifierCallbacks,
)
{
super(
[
new RouteAction(
"/?last_id",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.notifierCallbacks.notify(url, info, sessionID);
}
},
),
new RouteAction(
"/notifierServer",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.notifierCallbacks.notify(url, info, sessionID);
}
},
),
new RouteAction(
"/push/notifier/get/",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.notifierCallbacks.getNotifier(url, info, sessionID);
}
},
),
new RouteAction(
"/push/notifier/getwebsocket/",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
{
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";
@injectable()
export class TraderDynamicRouter extends DynamicRouter
export class TraderDynamicRouter extends DynamicRouter
{
constructor(
@inject("TraderCallbacks") protected traderCallbacks: TraderCallbacks
)
@inject("TraderCallbacks") protected traderCallbacks: TraderCallbacks,
)
{
super(
[
new RouteAction(
"/client/trading/api/getTrader/",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.traderCallbacks.getTrader(url, info, sessionID);
}
},
),
new RouteAction(
"/client/trading/api/getTraderAssort/",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
{
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";
@injectable()
export class CustomizationItemEventRouter extends ItemEventRouterDefinition
export class CustomizationItemEventRouter extends ItemEventRouterDefinition
{
constructor(
@inject("CustomizationCallbacks") protected customizationCallbacks: CustomizationCallbacks // TODO: delay required
)
@inject("CustomizationCallbacks") protected customizationCallbacks: CustomizationCallbacks, // TODO: delay required
)
{
super();
}
public override getHandledRoutes(): HandledRoute[]
public override getHandledRoutes(): HandledRoute[]
{
return [
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)
{
@ -33,4 +38,4 @@ export class CustomizationItemEventRouter extends ItemEventRouterDefinition
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";
@injectable()
export class HealthItemEventRouter extends ItemEventRouterDefinition
export class HealthItemEventRouter extends ItemEventRouterDefinition
{
constructor(
@inject("HealthCallbacks") protected healthCallbacks: HealthCallbacks // TODO: delay required
)
@inject("HealthCallbacks") protected healthCallbacks: HealthCallbacks, // TODO: delay required
)
{
super();
}
public override getHandledRoutes(): HandledRoute[]
public override getHandledRoutes(): HandledRoute[]
{
return [
new HandledRoute("Eat", 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)
{
@ -36,4 +41,4 @@ export class HealthItemEventRouter extends ItemEventRouterDefinition
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";
@injectable()
export class HideoutItemEventRouter extends ItemEventRouterDefinition
export class HideoutItemEventRouter extends ItemEventRouterDefinition
{
constructor(
@inject("HideoutCallbacks") protected hideoutCallbacks: HideoutCallbacks
)
@inject("HideoutCallbacks") protected hideoutCallbacks: HideoutCallbacks,
)
{
super();
}
public override getHandledRoutes(): HandledRoute[]
public override getHandledRoutes(): HandledRoute[]
{
return [
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_RECORD_SHOOTING_RANGE_POINTS, 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)
{
@ -64,4 +69,4 @@ export class HideoutItemEventRouter extends ItemEventRouterDefinition
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";
@injectable()
export class InsuranceItemEventRouter extends ItemEventRouterDefinition
export class InsuranceItemEventRouter extends ItemEventRouterDefinition
{
constructor(
@inject("InsuranceCallbacks") protected insuranceCallbacks: InsuranceCallbacks // TODO: delay required
)
@inject("InsuranceCallbacks") protected insuranceCallbacks: InsuranceCallbacks, // TODO: delay required
)
{
super();
}
public override getHandledRoutes(): HandledRoute[]
public override getHandledRoutes(): HandledRoute[]
{
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)
{
case "Insure":
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";
@injectable()
export class InventoryItemEventRouter extends ItemEventRouterDefinition
export class InventoryItemEventRouter extends ItemEventRouterDefinition
{
constructor(
@inject("InventoryCallbacks") protected inventoryCallbacks: InventoryCallbacks,
@inject("HideoutCallbacks") protected hideoutCallbacks: HideoutCallbacks
)
@inject("HideoutCallbacks") protected hideoutCallbacks: HideoutCallbacks,
)
{
super();
}
public override getHandledRoutes(): HandledRoute[]
public override getHandledRoutes(): HandledRoute[]
{
return [
new HandledRoute(ItemEventActions.MOVE, false),
@ -39,11 +38,16 @@ export class InventoryItemEventRouter extends ItemEventRouterDefinition
new HandledRoute(ItemEventActions.DELETE_MAP_MARKER, false),
new HandledRoute(ItemEventActions.EDIT_MAP_MARKER, 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)
{
@ -87,4 +91,4 @@ export class InventoryItemEventRouter extends ItemEventRouterDefinition
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";
@injectable()
export class NoteItemEventRouter extends ItemEventRouterDefinition
export class NoteItemEventRouter extends ItemEventRouterDefinition
{
constructor(
@inject("NoteCallbacks") protected noteCallbacks: NoteCallbacks // TODO: delay required
)
@inject("NoteCallbacks") protected noteCallbacks: NoteCallbacks, // TODO: delay required
)
{
super();
}
public override getHandledRoutes(): HandledRoute[]
public override getHandledRoutes(): HandledRoute[]
{
return [
new HandledRoute("AddNote", 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)
{
case "AddNote":
return this.noteCallbacks.addNote(pmcData, body, sessionID);
case "EditNote":
return this.noteCallbacks.editNote(pmcData, body, sessionID);
return this.noteCallbacks.editNote(pmcData, body, sessionID);
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";
@injectable()
export class PresetBuildItemEventRouter extends ItemEventRouterDefinition
export class PresetBuildItemEventRouter extends ItemEventRouterDefinition
{
constructor(
@inject("PresetBuildCallbacks") protected presetBuildCallbacks: PresetBuildCallbacks
)
@inject("PresetBuildCallbacks") protected presetBuildCallbacks: PresetBuildCallbacks,
)
{
super();
}
public override getHandledRoutes(): HandledRoute[]
public override getHandledRoutes(): HandledRoute[]
{
return [
new HandledRoute(ItemEventActions.SAVE_WEAPON_BUILD, false),
new HandledRoute(ItemEventActions.REMOVE_WEAPON_BUILD, false),
new HandledRoute(ItemEventActions.SAVE_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)
{
@ -43,4 +48,4 @@ export class PresetBuildItemEventRouter extends ItemEventRouterDefinition
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";
@injectable()
export class QuestItemEventRouter extends ItemEventRouterDefinition
export class QuestItemEventRouter extends ItemEventRouterDefinition
{
constructor(
@inject("WinstonLogger") protected logger: ILogger,
@inject("QuestCallbacks") protected questCallbacks: QuestCallbacks
)
@inject("QuestCallbacks") protected questCallbacks: QuestCallbacks,
)
{
super();
}
public override getHandledRoutes(): HandledRoute[]
public override getHandledRoutes(): HandledRoute[]
{
return [
new HandledRoute("QuestAccept", false),
new HandledRoute("QuestComplete", 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}`);
switch (eventAction)
@ -35,11 +40,11 @@ export class QuestItemEventRouter extends ItemEventRouterDefinition
case "QuestAccept":
return this.questCallbacks.acceptQuest(pmcData, body, sessionID);
case "QuestComplete":
return this.questCallbacks.completeQuest(pmcData, body, sessionID);
return this.questCallbacks.completeQuest(pmcData, body, sessionID);
case "QuestHandover":
return this.questCallbacks.handoverQuest(pmcData, body, sessionID);
return this.questCallbacks.handoverQuest(pmcData, body, sessionID);
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";
@injectable()
export class RagfairItemEventRouter extends ItemEventRouterDefinition
export class RagfairItemEventRouter extends ItemEventRouterDefinition
{
constructor(
@inject("RagfairCallbacks") protected ragfairCallbacks: RagfairCallbacks
)
@inject("RagfairCallbacks") protected ragfairCallbacks: RagfairCallbacks,
)
{
super();
}
public override getHandledRoutes(): HandledRoute[]
public override getHandledRoutes(): HandledRoute[]
{
return [
new HandledRoute("RagFairAddOffer", 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)
{
@ -36,4 +41,4 @@ export class RagfairItemEventRouter extends ItemEventRouterDefinition
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";
@injectable()
export class RepairItemEventRouter extends ItemEventRouterDefinition
export class RepairItemEventRouter extends ItemEventRouterDefinition
{
constructor(
@inject("RepairCallbacks") protected repairCallbacks: RepairCallbacks
)
@inject("RepairCallbacks") protected repairCallbacks: RepairCallbacks,
)
{
super();
}
public override getHandledRoutes(): HandledRoute[]
public override getHandledRoutes(): HandledRoute[]
{
return [
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)
{
@ -33,4 +38,4 @@ export class RepairItemEventRouter extends ItemEventRouterDefinition
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";
@injectable()
export class TradeItemEventRouter extends ItemEventRouterDefinition
export class TradeItemEventRouter extends ItemEventRouterDefinition
{
constructor(
@inject("TradeCallbacks") protected tradeCallbacks: TradeCallbacks
)
@inject("TradeCallbacks") protected tradeCallbacks: TradeCallbacks,
)
{
super();
}
public override getHandledRoutes(): HandledRoute[]
public override getHandledRoutes(): HandledRoute[]
{
return [
new HandledRoute("TradingConfirm", 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)
{
@ -36,4 +41,4 @@ export class TradeItemEventRouter extends ItemEventRouterDefinition
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";
@injectable()
export class WishlistItemEventRouter extends ItemEventRouterDefinition
export class WishlistItemEventRouter extends ItemEventRouterDefinition
{
constructor(
@inject("WishlistCallbacks") protected wishlistCallbacks: WishlistCallbacks
)
@inject("WishlistCallbacks") protected wishlistCallbacks: WishlistCallbacks,
)
{
super();
}
public override getHandledRoutes(): HandledRoute[]
public override getHandledRoutes(): HandledRoute[]
{
return [
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)
{
@ -33,4 +38,4 @@ export class WishlistItemEventRouter extends ItemEventRouterDefinition
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";
@injectable()
export class HealthSaveLoadRouter extends SaveLoadRouter
export class HealthSaveLoadRouter extends SaveLoadRouter
{
public override getHandledRoutes(): HandledRoute[]
public override getHandledRoutes(): HandledRoute[]
{
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 = {
health: null,
effects: null
effects: null,
};
}
profile.vitality.health = {
@ -32,7 +32,7 @@ export class HealthSaveLoadRouter extends SaveLoadRouter
LeftArm: 0,
RightArm: 0,
LeftLeg: 0,
RightLeg: 0
RightLeg: 0,
};
profile.vitality.effects = {
@ -42,9 +42,9 @@ export class HealthSaveLoadRouter extends SaveLoadRouter
LeftArm: {},
RightArm: {},
LeftLeg: {},
RightLeg: {}
RightLeg: {},
};
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";
@injectable()
export class InraidSaveLoadRouter extends SaveLoadRouter
export class InraidSaveLoadRouter extends SaveLoadRouter
{
public override getHandledRoutes(): HandledRoute[]
public override getHandledRoutes(): HandledRoute[]
{
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)
{
profile.inraid = {
location: "none",
character: "none"
character: "none",
};
}
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";
@injectable()
export class InsuranceSaveLoadRouter extends SaveLoadRouter
export class InsuranceSaveLoadRouter extends SaveLoadRouter
{
public override getHandledRoutes(): HandledRoute[]
public override getHandledRoutes(): HandledRoute[]
{
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)
{
@ -21,4 +21,4 @@ export class InsuranceSaveLoadRouter extends SaveLoadRouter
}
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";
@injectable()
export class ProfileSaveLoadRouter extends SaveLoadRouter
export class ProfileSaveLoadRouter extends SaveLoadRouter
{
public override getHandledRoutes(): HandledRoute[]
public override getHandledRoutes(): HandledRoute[]
{
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)
{
profile.characters = {
pmc: {} as IPmcData,
scav: {} as IPmcData
scav: {} as IPmcData,
};
}
return profile;
}
}
}

View File

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

View File

@ -5,16 +5,16 @@ import { Serializer } from "@spt-aki/di/Serializer";
import { ImageRouter } from "@spt-aki/routers/ImageRouter";
@injectable()
export class ImageSerializer extends Serializer
export class ImageSerializer extends Serializer
{
constructor(
@inject("ImageRouter") protected imageRouter: ImageRouter
@inject("ImageRouter") protected imageRouter: ImageRouter,
)
{
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);
}
@ -23,4 +23,4 @@ export class ImageSerializer extends Serializer
{
return route === "IMAGE";
}
}
}

View File

@ -9,17 +9,15 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil";
@injectable()
export class NotifySerializer extends Serializer
{
constructor(
@inject("NotifierController") protected notifierController: NotifierController,
@inject("JsonUtil") protected jsonUtil: JsonUtil,
@inject("HttpServerHelper") protected httpServerHelper: HttpServerHelper
@inject("HttpServerHelper") protected httpServerHelper: HttpServerHelper,
)
{
super();
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public override serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void
{
const splittedUrl = req.url.split("/");
@ -38,4 +36,4 @@ export class NotifySerializer extends Serializer
{
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";
@injectable()
export class BotStaticRouter extends StaticRouter
export class BotStaticRouter extends StaticRouter
{
constructor(
@inject("BotCallbacks") protected botCallbacks: BotCallbacks
)
@inject("BotCallbacks") protected botCallbacks: BotCallbacks,
)
{
super(
[
new RouteAction(
"/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);
}
)
]
},
),
],
);
}
}
}

View File

@ -4,23 +4,22 @@ import { BundleCallbacks } from "@spt-aki/callbacks/BundleCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable()
export class BundleStaticRouter extends StaticRouter
export class BundleStaticRouter extends StaticRouter
{
constructor(
@inject("BundleCallbacks") protected bundleCallbacks: BundleCallbacks
)
@inject("BundleCallbacks") protected bundleCallbacks: BundleCallbacks,
)
{
super(
[
new RouteAction(
"/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);
}
)
]
},
),
],
);
}
}
}

View File

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

View File

@ -4,111 +4,99 @@ import { DataCallbacks } from "@spt-aki/callbacks/DataCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable()
export class DataStaticRouter extends StaticRouter
export class DataStaticRouter extends StaticRouter
{
constructor(
@inject("DataCallbacks") protected dataCallbacks: DataCallbacks
)
@inject("DataCallbacks") protected dataCallbacks: DataCallbacks,
)
{
super(
[
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
)
]
},
),
],
);
}
}
}

View File

@ -4,183 +4,162 @@ import { DialogueCallbacks } from "@spt-aki/callbacks/DialogueCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable()
export class DialogStaticRouter extends StaticRouter
export class DialogStaticRouter extends StaticRouter
{
constructor(
@inject("DialogueCallbacks") protected dialogueCallbacks: DialogueCallbacks
)
@inject("DialogueCallbacks") protected dialogueCallbacks: DialogueCallbacks,
)
{
super(
[
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
)
]
},
),
],
);
}
}
}

View File

@ -4,95 +4,85 @@ import { GameCallbacks } from "@spt-aki/callbacks/GameCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable()
export class GameStaticRouter extends StaticRouter
export class GameStaticRouter extends StaticRouter
{
constructor(
@inject("GameCallbacks") protected gameCallbacks: GameCallbacks
)
@inject("GameCallbacks") protected gameCallbacks: GameCallbacks,
)
{
super(
[
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
)
]
},
),
],
);
}
}
}

View File

@ -4,31 +4,29 @@ import { HealthCallbacks } from "@spt-aki/callbacks/HealthCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable()
export class HealthStaticRouter extends StaticRouter
export class HealthStaticRouter extends StaticRouter
{
constructor(
@inject("HealthCallbacks") protected healthCallbacks: HealthCallbacks
)
@inject("HealthCallbacks") protected healthCallbacks: HealthCallbacks,
)
{
super(
[
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
)
]
},
),
],
);
}
}
}

View File

@ -4,55 +4,50 @@ import { InraidCallbacks } from "@spt-aki/callbacks/InraidCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable()
export class InraidStaticRouter extends StaticRouter
export class InraidStaticRouter extends StaticRouter
{
constructor(
@inject("InraidCallbacks") protected inraidCallbacks: InraidCallbacks
)
@inject("InraidCallbacks") protected inraidCallbacks: InraidCallbacks,
)
{
super(
[
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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();
}
},
),
new RouteAction(
"/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();
}
},
),
new RouteAction(
"/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();
}
},
),
new RouteAction(
"/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();
}
)
]
},
),
],
);
}
}
}

View File

@ -4,23 +4,22 @@ import { InsuranceCallbacks } from "@spt-aki/callbacks/InsuranceCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable()
export class InsuranceStaticRouter extends StaticRouter
export class InsuranceStaticRouter extends StaticRouter
{
constructor(
@inject("InsuranceCallbacks") protected insuranceCallbacks: InsuranceCallbacks
)
@inject("InsuranceCallbacks") protected insuranceCallbacks: InsuranceCallbacks,
)
{
super(
[
new RouteAction(
"/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);
}
)
]
},
),
],
);
}
}
}

View File

@ -4,23 +4,22 @@ import { ItemEventCallbacks } from "@spt-aki/callbacks/ItemEventCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable()
export class ItemEventStaticRouter extends StaticRouter
export class ItemEventStaticRouter extends StaticRouter
{
constructor(
@inject("ItemEventCallbacks") protected itemEventCallbacks: ItemEventCallbacks
)
@inject("ItemEventCallbacks") protected itemEventCallbacks: ItemEventCallbacks,
)
{
super(
[
new RouteAction(
"/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);
}
)
]
},
),
],
);
}
}
}

View File

@ -4,119 +4,106 @@ import { LauncherCallbacks } from "@spt-aki/callbacks/LauncherCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable()
export class LauncherStaticRouter extends StaticRouter
export class LauncherStaticRouter extends StaticRouter
{
constructor(
@inject("LauncherCallbacks") protected launcherCallbacks: LauncherCallbacks
)
@inject("LauncherCallbacks") protected launcherCallbacks: LauncherCallbacks,
)
{
super(
[
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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();
}
},
),
new RouteAction(
"/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(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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();
}
},
),
new RouteAction(
"/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();
}
},
),
new RouteAction(
"/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();
}
},
),
new RouteAction(
"/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);
}
)
]
},
),
],
);
}
}
}

View File

@ -4,31 +4,29 @@ import { LocationCallbacks } from "@spt-aki/callbacks/LocationCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable()
export class LocationStaticRouter extends StaticRouter
export class LocationStaticRouter extends StaticRouter
{
constructor(
@inject("LocationCallbacks") protected locationCallbacks: LocationCallbacks
)
@inject("LocationCallbacks") protected locationCallbacks: LocationCallbacks,
)
{
super(
[
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/client/location/getAirdropLoot",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, _output: string): any =>
{
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";
@injectable()
export class MatchStaticRouter extends StaticRouter
export class MatchStaticRouter extends StaticRouter
{
constructor(
@inject("MatchCallbacks") protected matchCallbacks: MatchCallbacks
)
@inject("MatchCallbacks") protected matchCallbacks: MatchCallbacks,
)
{
super(
[
new RouteAction(
"/raid/profile/list",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/raid/profile/list",
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.matchCallbacks.getProfile(url, info, sessionID);
}
},
),
new RouteAction(
"/client/match/available",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/match/available",
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.matchCallbacks.serverAvailable(url, info, sessionID);
}
},
),
new RouteAction(
"/client/match/updatePing",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/match/updatePing",
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.matchCallbacks.updatePing(url, info, sessionID);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/client/match/exit",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/match/exit",
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.matchCallbacks.exitMatch(url, info, sessionID);
}
},
),
new RouteAction(
"/client/match/group/create",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/match/group/create",
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.matchCallbacks.createGroup(url, info, sessionID);
}
},
),
new RouteAction(
"/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(
"/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(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
},
),
new RouteAction(
"/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);
}
)
]
},
),
],
);
}
}
}

View File

@ -4,31 +4,29 @@ import { NotifierCallbacks } from "@spt-aki/callbacks/NotifierCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable()
export class NotifierStaticRouter extends StaticRouter
export class NotifierStaticRouter extends StaticRouter
{
constructor(
@inject("NotifierCallbacks") protected notifierCallbacks: NotifierCallbacks
)
@inject("NotifierCallbacks") protected notifierCallbacks: NotifierCallbacks,
)
{
super(
[
new RouteAction(
"/client/notifier/channel/create",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/notifier/channel/create",
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.notifierCallbacks.createNotifierChannel(url, info, sessionID);
}
},
),
new RouteAction(
"/client/game/profile/select",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/game/profile/select",
(url: string, info: any, sessionID: string, output: string): any =>
{
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";
@injectable()
export class PresetStaticRouter extends StaticRouter
export class PresetStaticRouter extends StaticRouter
{
constructor(
@inject("PresetBuildCallbacks") protected presetCallbacks: PresetBuildCallbacks
)
@inject("PresetBuildCallbacks") protected presetCallbacks: PresetBuildCallbacks,
)
{
super(
[
new RouteAction(
"/client/handbook/builds/my/list",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/handbook/builds/my/list",
(url: string, info: any, sessionID: string, output: string): any =>
{
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";
@injectable()
export class ProfileStaticRouter extends StaticRouter
export class ProfileStaticRouter extends StaticRouter
{
constructor(
@inject("ProfileCallbacks") protected profileCallbacks: ProfileCallbacks
)
@inject("ProfileCallbacks") protected profileCallbacks: ProfileCallbacks,
)
{
super(
[
new RouteAction(
"/client/game/profile/create",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/game/profile/create",
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.profileCallbacks.createProfile(url, info, sessionID);
}),
},
),
new RouteAction(
"/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);
}),
},
),
new RouteAction(
"/client/game/profile/savage/regenerate",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/game/profile/savage/regenerate",
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.profileCallbacks.regenerateScav(url, info, sessionID);
}),
},
),
new RouteAction(
"/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);
}),
},
),
new RouteAction(
"/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);
}),
},
),
new RouteAction(
"/client/game/profile/nickname/validate",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/game/profile/nickname/validate",
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.profileCallbacks.validateNickname(url, info, sessionID);
}),
},
),
new RouteAction(
"/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);
}),
},
),
new RouteAction(
"/client/profile/status",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/profile/status",
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.profileCallbacks.getProfileStatus(url, info, sessionID);
}),
},
),
new RouteAction(
"/client/profile/settings",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/profile/settings",
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.profileCallbacks.getProfileSettings(url, info, sessionID);
}),
},
),
new RouteAction(
"/client/game/profile/search",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/game/profile/search",
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.profileCallbacks.searchFriend(url, info, sessionID);
}),
},
),
new RouteAction(
"/launcher/profile/info",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/launcher/profile/info",
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.profileCallbacks.getMiniProfile(url, info, sessionID);
}),
},
),
new RouteAction(
"/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);
})
]
},
),
],
);
}
}
}

View File

@ -4,29 +4,29 @@ import { QuestCallbacks } from "@spt-aki/callbacks/QuestCallbacks";
import { RouteAction, StaticRouter } from "@spt-aki/di/Router";
@injectable()
export class QuestStaticRouter extends StaticRouter
export class QuestStaticRouter extends StaticRouter
{
constructor(
@inject("QuestCallbacks") protected questCallbacks: QuestCallbacks
)
@inject("QuestCallbacks") protected questCallbacks: QuestCallbacks,
)
{
super(
[
new RouteAction(
"/client/quest/list",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/quest/list",
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.questCallbacks.listQuests(url, info, sessionID);
}),
},
),
new RouteAction(
"/client/repeatalbeQuests/activityPeriods",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/repeatalbeQuests/activityPeriods",
(url: string, info: any, sessionID: string, output: string): any =>
{
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";
@injectable()
export class RagfairStaticRouter extends StaticRouter
export class RagfairStaticRouter extends StaticRouter
{
constructor(
@inject("RagfairCallbacks") protected ragfairCallbacks: RagfairCallbacks
)
@inject("RagfairCallbacks") protected ragfairCallbacks: RagfairCallbacks,
)
{
super(
[
new RouteAction(
"/client/ragfair/search",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/ragfair/search",
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.ragfairCallbacks.search(url, info, sessionID);
}),
},
),
new RouteAction(
"/client/ragfair/find",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/ragfair/find",
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.ragfairCallbacks.search(url, info, sessionID);
}),
},
),
new RouteAction(
"/client/ragfair/itemMarketPrice",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/ragfair/itemMarketPrice",
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.ragfairCallbacks.getMarketPrice(url, info, sessionID);
}),
},
),
new RouteAction(
"/client/ragfair/offerfees",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/ragfair/offerfees",
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.ragfairCallbacks.storePlayerOfferTaxAmount(url, info, sessionID);
}),
},
),
new RouteAction(
"/client/reports/ragfair/send",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/reports/ragfair/send",
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.ragfairCallbacks.sendReport(url, info, sessionID);
}),
},
),
new RouteAction(
"/client/items/prices",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/items/prices",
(url: string, info: any, sessionID: string, output: string): any =>
{
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";
@injectable()
export class TraderStaticRouter extends StaticRouter
export class TraderStaticRouter extends StaticRouter
{
constructor(
@inject("TraderCallbacks") protected traderCallbacks: TraderCallbacks
)
@inject("TraderCallbacks") protected traderCallbacks: TraderCallbacks,
)
{
super(
[
new RouteAction(
"/client/trading/api/traderSettings",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/trading/api/traderSettings",
(url: string, info: any, sessionID: string, output: string): any =>
{
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";
@injectable()
export class WeatherStaticRouter extends StaticRouter
export class WeatherStaticRouter extends StaticRouter
{
constructor(
@inject("WeatherCallbacks") protected weatherCallbacks: WeatherCallbacks
)
@inject("WeatherCallbacks") protected weatherCallbacks: WeatherCallbacks,
)
{
super(
[
new RouteAction(
"/client/weather",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
"/client/weather",
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.weatherCallbacks.getWeather(url, info, sessionID);
})
]
},
),
],
);
}
}
}