Updating server types

This commit is contained in:
Tyfon
2024-07-06 21:19:15 -07:00
parent b999528dde
commit 531d8fce06
524 changed files with 8788 additions and 3835 deletions

View File

@@ -1,7 +1,8 @@
import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper";
import { BundleHashCacheService } from "@spt-aki/services/cache/BundleHashCacheService";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { VFS } from "@spt-aki/utils/VFS";
import { HttpServerHelper } from "@spt/helpers/HttpServerHelper";
import { BundleHashCacheService } from "@spt/services/cache/BundleHashCacheService";
import { ICloner } from "@spt/utils/cloners/ICloner";
import { JsonUtil } from "@spt/utils/JsonUtil";
import { VFS } from "@spt/utils/VFS";
export declare class BundleInfo {
modpath: string;
filename: string;
@@ -14,8 +15,9 @@ export declare class BundleLoader {
protected vfs: VFS;
protected jsonUtil: JsonUtil;
protected bundleHashCacheService: BundleHashCacheService;
protected cloner: ICloner;
protected bundles: Record<string, BundleInfo>;
constructor(httpServerHelper: HttpServerHelper, vfs: VFS, jsonUtil: JsonUtil, bundleHashCacheService: BundleHashCacheService);
constructor(httpServerHelper: HttpServerHelper, vfs: VFS, jsonUtil: JsonUtil, bundleHashCacheService: BundleHashCacheService, cloner: ICloner);
/**
* Handle singleplayer/bundles
*/

View File

@@ -1,6 +1,6 @@
import { IPackageJsonData } from "@spt-aki/models/spt/mod/IPackageJsonData";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData";
import { ILogger } from "@spt/models/spt/utils/ILogger";
import { LocalisationService } from "@spt/services/LocalisationService";
export declare class ModLoadOrder {
protected logger: ILogger;
protected localisationService: LocalisationService;

View File

@@ -1,40 +1,40 @@
import { IPostAkiLoadMod } from "@spt-aki/models/external/IPostAkiLoadMod";
import { IPostAkiLoadModAsync } from "@spt-aki/models/external/IPostAkiLoadModAsync";
import { IPostDBLoadMod } from "@spt-aki/models/external/IPostDBLoadMod";
import { IPostDBLoadModAsync } from "@spt-aki/models/external/IPostDBLoadModAsync";
import { IPreAkiLoadMod } from "@spt-aki/models/external/IPreAkiLoadMod";
import { IPreAkiLoadModAsync } from "@spt-aki/models/external/IPreAkiLoadModAsync";
import { IPostDBLoadMod } from "@spt/models/external/IPostDBLoadMod";
import { IPostDBLoadModAsync } from "@spt/models/external/IPostDBLoadModAsync";
import { IPostSptLoadMod } from "@spt/models/external/IPostSptLoadMod";
import { IPostSptLoadModAsync } from "@spt/models/external/IPostSptLoadModAsync";
import { IPreSptLoadMod } from "@spt/models/external/IPreSptLoadMod";
import { IPreSptLoadModAsync } from "@spt/models/external/IPreSptLoadModAsync";
export declare class ModTypeCheck {
/**
* Use defined safe guard to check if the mod is a IPreAkiLoadMod
* Use defined safe guard to check if the mod is a IPreSptLoadMod
* @returns boolean
*/
isPreAkiLoad(mod: any): mod is IPreAkiLoadMod;
isPreSptLoad(mod: any): mod is IPreSptLoadMod;
/**
* Use defined safe guard to check if the mod is a IPostAkiLoadMod
* Use defined safe guard to check if the mod is a IPostSptLoadMod
* @returns boolean
*/
isPostAkiLoad(mod: any): mod is IPostAkiLoadMod;
isPostSptLoad(mod: any): mod is IPostSptLoadMod;
/**
* Use defined safe guard to check if the mod is a IPostDBLoadMod
* @returns boolean
*/
isPostDBAkiLoad(mod: any): mod is IPostDBLoadMod;
isPostDBLoad(mod: any): mod is IPostDBLoadMod;
/**
* Use defined safe guard to check if the mod is a IPreAkiLoadModAsync
* Use defined safe guard to check if the mod is a IPreSptLoadModAsync
* @returns boolean
*/
isPreAkiLoadAsync(mod: any): mod is IPreAkiLoadModAsync;
isPreSptLoadAsync(mod: any): mod is IPreSptLoadModAsync;
/**
* Use defined safe guard to check if the mod is a IPostAkiLoadModAsync
* Use defined safe guard to check if the mod is a IPostSptLoadModAsync
* @returns boolean
*/
isPostAkiLoadAsync(mod: any): mod is IPostAkiLoadModAsync;
isPostSptLoadAsync(mod: any): mod is IPostSptLoadModAsync;
/**
* Use defined safe guard to check if the mod is a IPostDBLoadModAsync
* @returns boolean
*/
isPostDBAkiLoadAsync(mod: any): mod is IPostDBLoadModAsync;
isPostDBLoadAsync(mod: any): mod is IPostDBLoadModAsync;
/**
* Checks for mod to be compatible with 3.X+
* @returns boolean

View File

@@ -1,17 +0,0 @@
import { DependencyContainer } from "tsyringe";
import { ModTypeCheck } from "@spt-aki/loaders/ModTypeCheck";
import { PreAkiModLoader } from "@spt-aki/loaders/PreAkiModLoader";
import { IModLoader } from "@spt-aki/models/spt/mod/IModLoader";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
export declare class PostAkiModLoader implements IModLoader {
protected logger: ILogger;
protected preAkiModLoader: PreAkiModLoader;
protected localisationService: LocalisationService;
protected modTypeCheck: ModTypeCheck;
protected container: DependencyContainer;
constructor(logger: ILogger, preAkiModLoader: PreAkiModLoader, localisationService: LocalisationService, modTypeCheck: ModTypeCheck);
getModPath(mod: string): string;
load(): Promise<void>;
protected executeModsAsync(): Promise<void>;
}

View File

@@ -1,18 +1,18 @@
import { DependencyContainer } from "tsyringe";
import { OnLoad } from "@spt-aki/di/OnLoad";
import { BundleLoader } from "@spt-aki/loaders/BundleLoader";
import { ModTypeCheck } from "@spt-aki/loaders/ModTypeCheck";
import { PreAkiModLoader } from "@spt-aki/loaders/PreAkiModLoader";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { OnLoad } from "@spt/di/OnLoad";
import { BundleLoader } from "@spt/loaders/BundleLoader";
import { ModTypeCheck } from "@spt/loaders/ModTypeCheck";
import { PreSptModLoader } from "@spt/loaders/PreSptModLoader";
import { ILogger } from "@spt/models/spt/utils/ILogger";
import { LocalisationService } from "@spt/services/LocalisationService";
export declare class PostDBModLoader implements OnLoad {
protected logger: ILogger;
protected bundleLoader: BundleLoader;
protected preAkiModLoader: PreAkiModLoader;
protected preSptModLoader: PreSptModLoader;
protected localisationService: LocalisationService;
protected modTypeCheck: ModTypeCheck;
protected container: DependencyContainer;
constructor(logger: ILogger, bundleLoader: BundleLoader, preAkiModLoader: PreAkiModLoader, localisationService: LocalisationService, modTypeCheck: ModTypeCheck);
constructor(logger: ILogger, bundleLoader: BundleLoader, preSptModLoader: PreSptModLoader, localisationService: LocalisationService, modTypeCheck: ModTypeCheck);
onLoad(): Promise<void>;
getRoute(): string;
getModPath(mod: string): string;

View File

@@ -0,0 +1,17 @@
import { DependencyContainer } from "tsyringe";
import { ModTypeCheck } from "@spt/loaders/ModTypeCheck";
import { PreSptModLoader } from "@spt/loaders/PreSptModLoader";
import { IModLoader } from "@spt/models/spt/mod/IModLoader";
import { ILogger } from "@spt/models/spt/utils/ILogger";
import { LocalisationService } from "@spt/services/LocalisationService";
export declare class PostSptModLoader implements IModLoader {
protected logger: ILogger;
protected preSptModLoader: PreSptModLoader;
protected localisationService: LocalisationService;
protected modTypeCheck: ModTypeCheck;
protected container: DependencyContainer;
constructor(logger: ILogger, preSptModLoader: PreSptModLoader, localisationService: LocalisationService, modTypeCheck: ModTypeCheck);
getModPath(mod: string): string;
load(): Promise<void>;
protected executeModsAsync(): Promise<void>;
}

View File

@@ -1,17 +1,17 @@
import { DependencyContainer } from "tsyringe";
import { ModLoadOrder } from "@spt-aki/loaders/ModLoadOrder";
import { ModTypeCheck } from "@spt-aki/loaders/ModTypeCheck";
import { ModDetails } from "@spt-aki/models/eft/profile/IAkiProfile";
import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig";
import { IModLoader } from "@spt-aki/models/spt/mod/IModLoader";
import { IPackageJsonData } from "@spt-aki/models/spt/mod/IPackageJsonData";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { ModCompilerService } from "@spt-aki/services/ModCompilerService";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { VFS } from "@spt-aki/utils/VFS";
export declare class PreAkiModLoader implements IModLoader {
import { ModLoadOrder } from "@spt/loaders/ModLoadOrder";
import { ModTypeCheck } from "@spt/loaders/ModTypeCheck";
import { ModDetails } from "@spt/models/eft/profile/ISptProfile";
import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig";
import { IModLoader } from "@spt/models/spt/mod/IModLoader";
import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData";
import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer";
import { LocalisationService } from "@spt/services/LocalisationService";
import { ModCompilerService } from "@spt/services/ModCompilerService";
import { JsonUtil } from "@spt/utils/JsonUtil";
import { VFS } from "@spt/utils/VFS";
export declare class PreSptModLoader implements IModLoader {
protected logger: ILogger;
protected vfs: VFS;
protected jsonUtil: JsonUtil;
@@ -25,7 +25,7 @@ export declare class PreAkiModLoader implements IModLoader {
protected readonly modOrderPath = "user/mods/order.json";
protected order: Record<string, number>;
protected imported: Record<string, IPackageJsonData>;
protected akiConfig: ICoreConfig;
protected sptConfig: ICoreConfig;
protected serverDependencies: Record<string, string>;
protected skippedMods: Set<string>;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck);
@@ -60,10 +60,10 @@ export declare class PreAkiModLoader implements IModLoader {
protected getModsPackageData(mods: string[]): Map<string, IPackageJsonData>;
/**
* Is the passed in mod compatible with the running server version
* @param mod Mod to check compatibiltiy with AKI
* @param mod Mod to check compatibiltiy with SPT
* @returns True if compatible
*/
protected isModCombatibleWithAki(mod: IPackageJsonData): boolean;
protected isModCombatibleWithSpt(mod: IPackageJsonData): boolean;
/**
* Execute each mod found in this.imported
* @returns void promise