311-update #5

Merged
chomp merged 2 commits from :311-update into master 2022-07-25 14:40:21 -04:00
Showing only changes of commit 0878d6ec19 - Show all commits

View File

@ -2,7 +2,7 @@ import { DependencyContainer } from "tsyringe";
// SPT types // SPT types
import { IPreAkiLoadMod } from "@spt-aki/models/external/IPreAkiLoadMod"; import { IPreAkiLoadMod } from "@spt-aki/models/external/IPreAkiLoadMod";
import { IPostAkiLoadMod } from "@spt-aki/models/external/IPostAkiLoadMod"; import { IPostDBLoadMod } from "@spt-aki/models/external/IPostDBLoadMod";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { PreAkiModLoader } from "@spt-aki/loaders/PreAkiModLoader"; import { PreAkiModLoader } from "@spt-aki/loaders/PreAkiModLoader";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
@ -18,13 +18,14 @@ import { ILocaleGlobalBase } from "@spt-aki/models/spt/server/ILocaleBase";
// The new trader config // The new trader config
import * as baseJson from "../db/base.json"; import * as baseJson from "../db/base.json";
class SampleTrader implements IPreAkiLoadMod, IPostAkiLoadMod { class SampleTrader implements IPreAkiLoadMod, IPostDBLoadMod {
mod: string mod: string
logger: ILogger logger: ILogger
constructor() { constructor() {
this.mod = "13AddTrader"; this.mod = "13AddTrader";
} }
public preAkiLoad(container: DependencyContainer): void { public preAkiLoad(container: DependencyContainer): void {
this.logger = container.resolve<ILogger>("WinstonLogger"); this.logger = container.resolve<ILogger>("WinstonLogger");
this.logger.debug(`[${this.mod}] Loading... `); this.logger.debug(`[${this.mod}] Loading... `);
@ -36,7 +37,7 @@ class SampleTrader implements IPreAkiLoadMod, IPostAkiLoadMod {
this.logger.debug(`[${this.mod}] Loaded`); this.logger.debug(`[${this.mod}] Loaded`);
} }
public postAkiLoad(container: DependencyContainer): void { public postDBLoad(container: DependencyContainer): void {
this.logger.debug(`[${this.mod}] Delayed Loading... `); this.logger.debug(`[${this.mod}] Delayed Loading... `);
const databaseServer = container.resolve<DatabaseServer>("DatabaseServer"); const databaseServer = container.resolve<DatabaseServer>("DatabaseServer");