Add stub of gift service

This commit is contained in:
Dev 2023-07-20 21:07:47 +01:00
parent 67706f09fc
commit 4092ff7c9d
2 changed files with 49 additions and 17 deletions

View File

@ -67,11 +67,12 @@ import { BotWeaponGenerator } from "../generators/BotWeaponGenerator";
import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator"; import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator";
import { LocationGenerator } from "../generators/LocationGenerator"; import { LocationGenerator } from "../generators/LocationGenerator";
import { LootGenerator } from "../generators/LootGenerator"; import { LootGenerator } from "../generators/LootGenerator";
import { PlayerScavGenerator } from "../generators/PlayerScavGenerator";
import { PMCLootGenerator } from "../generators/PMCLootGenerator"; import { PMCLootGenerator } from "../generators/PMCLootGenerator";
import { PlayerScavGenerator } from "../generators/PlayerScavGenerator";
import { RagfairAssortGenerator } from "../generators/RagfairAssortGenerator"; import { RagfairAssortGenerator } from "../generators/RagfairAssortGenerator";
import { RagfairOfferGenerator } from "../generators/RagfairOfferGenerator"; import { RagfairOfferGenerator } from "../generators/RagfairOfferGenerator";
import { ScavCaseRewardGenerator } from "../generators/ScavCaseRewardGenerator"; import { ScavCaseRewardGenerator } from "../generators/ScavCaseRewardGenerator";
import { WeatherGenerator } from "../generators/WeatherGenerator";
import { import {
BarrelInventoryMagGen BarrelInventoryMagGen
} from "../generators/weapongen/implementations/BarrelInventoryMagGen"; } from "../generators/weapongen/implementations/BarrelInventoryMagGen";
@ -82,7 +83,6 @@ import {
InternalMagazineInventoryMagGen InternalMagazineInventoryMagGen
} from "../generators/weapongen/implementations/InternalMagazineInventoryMagGen"; } from "../generators/weapongen/implementations/InternalMagazineInventoryMagGen";
import { UbglExternalMagGen } from "../generators/weapongen/implementations/UbglExternalMagGen"; import { UbglExternalMagGen } from "../generators/weapongen/implementations/UbglExternalMagGen";
import { WeatherGenerator } from "../generators/WeatherGenerator";
import { AssortHelper } from "../helpers/AssortHelper"; import { AssortHelper } from "../helpers/AssortHelper";
import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper"; import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper";
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
@ -127,6 +127,10 @@ import { PostDBModLoader } from "../loaders/PostDBModLoader";
import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; import { PreAkiModLoader } from "../loaders/PreAkiModLoader";
import { IAsyncQueue } from "../models/spt/utils/IAsyncQueue"; import { IAsyncQueue } from "../models/spt/utils/IAsyncQueue";
import { IUUidGenerator } from "../models/spt/utils/IUuidGenerator"; import { IUUidGenerator } from "../models/spt/utils/IUuidGenerator";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { HttpRouter } from "../routers/HttpRouter";
import { ImageRouter } from "../routers/ImageRouter";
import { ItemEventRouter } from "../routers/ItemEventRouter";
import { BotDynamicRouter } from "../routers/dynamic/BotDynamicRouter"; import { BotDynamicRouter } from "../routers/dynamic/BotDynamicRouter";
import { BundleDynamicRouter } from "../routers/dynamic/BundleDynamicRouter"; import { BundleDynamicRouter } from "../routers/dynamic/BundleDynamicRouter";
import { CustomizationDynamicRouter } from "../routers/dynamic/CustomizationDynamicRouter"; import { CustomizationDynamicRouter } from "../routers/dynamic/CustomizationDynamicRouter";
@ -136,10 +140,6 @@ import { InraidDynamicRouter } from "../routers/dynamic/InraidDynamicRouter";
import { LocationDynamicRouter } from "../routers/dynamic/LocationDynamicRouter"; import { LocationDynamicRouter } from "../routers/dynamic/LocationDynamicRouter";
import { NotifierDynamicRouter } from "../routers/dynamic/NotifierDynamicRouter"; import { NotifierDynamicRouter } from "../routers/dynamic/NotifierDynamicRouter";
import { TraderDynamicRouter } from "../routers/dynamic/TraderDynamicRouter"; import { TraderDynamicRouter } from "../routers/dynamic/TraderDynamicRouter";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { HttpRouter } from "../routers/HttpRouter";
import { ImageRouter } from "../routers/ImageRouter";
import { ItemEventRouter } from "../routers/ItemEventRouter";
import { CustomizationItemEventRouter } from "../routers/item_events/CustomizationItemEventRouter"; import { CustomizationItemEventRouter } from "../routers/item_events/CustomizationItemEventRouter";
import { HealthItemEventRouter } from "../routers/item_events/HealthItemEventRouter"; import { HealthItemEventRouter } from "../routers/item_events/HealthItemEventRouter";
import { HideoutItemEventRouter } from "../routers/item_events/HideoutItemEventRouter"; import { HideoutItemEventRouter } from "../routers/item_events/HideoutItemEventRouter";
@ -181,12 +181,12 @@ import { TraderStaticRouter } from "../routers/static/TraderStaticRouter";
import { WeatherStaticRouter } from "../routers/static/WeatherStaticRouter"; import { WeatherStaticRouter } from "../routers/static/WeatherStaticRouter";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { AkiHttpListener } from "../servers/http/AkiHttpListener";
import { HttpBufferHandler } from "../servers/http/HttpBufferHandler";
import { HttpServer } from "../servers/HttpServer"; import { HttpServer } from "../servers/HttpServer";
import { RagfairServer } from "../servers/RagfairServer"; import { RagfairServer } from "../servers/RagfairServer";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { WebSocketServer } from "../servers/WebSocketServer"; import { WebSocketServer } from "../servers/WebSocketServer";
import { AkiHttpListener } from "../servers/http/AkiHttpListener";
import { HttpBufferHandler } from "../servers/http/HttpBufferHandler";
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService";
import { BotGenerationCacheService } from "../services/BotGenerationCacheService"; import { BotGenerationCacheService } from "../services/BotGenerationCacheService";
@ -194,6 +194,7 @@ import { BotLootCacheService } from "../services/BotLootCacheService";
import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService";
import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { CustomLocationWaveService } from "../services/CustomLocationWaveService";
import { FenceService } from "../services/FenceService"; import { FenceService } from "../services/FenceService";
import { GiftService } from "../services/GiftService";
import { HashCacheService } from "../services/HashCacheService"; import { HashCacheService } from "../services/HashCacheService";
import { InsuranceService } from "../services/InsuranceService"; import { InsuranceService } from "../services/InsuranceService";
import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { ItemBaseClassService } from "../services/ItemBaseClassService";
@ -202,13 +203,6 @@ import { LocaleService } from "../services/LocaleService";
import { LocalisationService } from "../services/LocalisationService"; import { LocalisationService } from "../services/LocalisationService";
import { MatchBotDetailsCacheService } from "../services/MatchBotDetailsCacheService"; import { MatchBotDetailsCacheService } from "../services/MatchBotDetailsCacheService";
import { MatchLocationService } from "../services/MatchLocationService"; import { MatchLocationService } from "../services/MatchLocationService";
import { CustomItemService } from "../services/mod/CustomItemService";
import { DynamicRouterModService } from "../services/mod/dynamicRouter/DynamicRouterModService";
import { HttpListenerModService } from "../services/mod/httpListener/HttpListenerModService";
import { ImageRouteService } from "../services/mod/image/ImageRouteService";
import { OnLoadModService } from "../services/mod/onLoad/OnLoadModService";
import { OnUpdateModService } from "../services/mod/onUpdate/OnUpdateModService";
import { StaticRouterModService } from "../services/mod/staticRouter/StaticRouterModService";
import { ModCompilerService } from "../services/ModCompilerService"; import { ModCompilerService } from "../services/ModCompilerService";
import { NotificationService } from "../services/NotificationService"; import { NotificationService } from "../services/NotificationService";
import { OpenZoneService } from "../services/OpenZoneService"; import { OpenZoneService } from "../services/OpenZoneService";
@ -226,6 +220,13 @@ import { RepairService } from "../services/RepairService";
import { SeasonalEventService } from "../services/SeasonalEventService"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { TraderAssortService } from "../services/TraderAssortService"; import { TraderAssortService } from "../services/TraderAssortService";
import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService";
import { CustomItemService } from "../services/mod/CustomItemService";
import { DynamicRouterModService } from "../services/mod/dynamicRouter/DynamicRouterModService";
import { HttpListenerModService } from "../services/mod/httpListener/HttpListenerModService";
import { ImageRouteService } from "../services/mod/image/ImageRouteService";
import { OnLoadModService } from "../services/mod/onLoad/OnLoadModService";
import { OnUpdateModService } from "../services/mod/onUpdate/OnUpdateModService";
import { StaticRouterModService } from "../services/mod/staticRouter/StaticRouterModService";
import { App } from "../utils/App"; import { App } from "../utils/App";
import { AsyncQueue } from "../utils/AsyncQueue"; import { AsyncQueue } from "../utils/AsyncQueue";
import { DatabaseImporter } from "../utils/DatabaseImporter"; import { DatabaseImporter } from "../utils/DatabaseImporter";
@ -235,8 +236,6 @@ import { HttpFileUtil } from "../utils/HttpFileUtil";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { ImporterUtil } from "../utils/ImporterUtil"; import { ImporterUtil } from "../utils/ImporterUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { WinstonMainLogger } from "../utils/logging/WinstonMainLogger";
import { WinstonRequestLogger } from "../utils/logging/WinstonRequestLogger";
import { MathUtil } from "../utils/MathUtil"; import { MathUtil } from "../utils/MathUtil";
import { ObjectId } from "../utils/ObjectId"; import { ObjectId } from "../utils/ObjectId";
import { RandomUtil } from "../utils/RandomUtil"; import { RandomUtil } from "../utils/RandomUtil";
@ -244,6 +243,8 @@ import { TimeUtil } from "../utils/TimeUtil";
import { UUidGenerator } from "../utils/UUidGenerator"; import { UUidGenerator } from "../utils/UUidGenerator";
import { VFS } from "../utils/VFS"; import { VFS } from "../utils/VFS";
import { Watermark, WatermarkLocale } from "../utils/Watermark"; import { Watermark, WatermarkLocale } from "../utils/Watermark";
import { WinstonMainLogger } from "../utils/logging/WinstonMainLogger";
import { WinstonRequestLogger } from "../utils/logging/WinstonRequestLogger";
/** /**
* Handle the registration of classes to be used by the Dependency Injection code * Handle the registration of classes to be used by the Dependency Injection code
@ -608,6 +609,7 @@ export class Container
depContainer.register<MatchBotDetailsCacheService>("MatchBotDetailsCacheService", MatchBotDetailsCacheService, { lifecycle: Lifecycle.Singleton }); depContainer.register<MatchBotDetailsCacheService>("MatchBotDetailsCacheService", MatchBotDetailsCacheService, { lifecycle: Lifecycle.Singleton });
depContainer.register<TraderPurchasePersisterService>("TraderPurchasePersisterService", TraderPurchasePersisterService); depContainer.register<TraderPurchasePersisterService>("TraderPurchasePersisterService", TraderPurchasePersisterService);
depContainer.register<PmcChatResponseService>("PmcChatResponseService", PmcChatResponseService); depContainer.register<PmcChatResponseService>("PmcChatResponseService", PmcChatResponseService);
depContainer.register<GiftService>("GiftService", GiftService);
} }
private static registerServers(depContainer: DependencyContainer): void private static registerServers(depContainer: DependencyContainer): void

View File

@ -0,0 +1,30 @@
import { inject, injectable } from "tsyringe";
import { DialogueHelper } from "../helpers/DialogueHelper";
import { ConfigTypes } from "../models/enums/ConfigTypes";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
@injectable()
export class GiftService
{
protected giftConfig: any;
constructor(
@inject("WinstonLogger") protected logger: ILogger,
@inject("DialogueHelper") protected dialogueHelper: DialogueHelper,
@inject("ConfigServer") protected configServer: ConfigServer
)
{
this.giftConfig = this.configServer.getConfig(ConfigTypes.QUEST);
}
/**
* Send a player a gift
* @param playerId Player to send gift to
* @param giftId Id of gift to send player
*/
public sendGiftToPlayer(playerId: string, giftId: string): void
{
return;
}
}