From 2d996a9e9fc282771cbd9941c573dca8acb59ca9 Mon Sep 17 00:00:00 2001 From: Craig Date: Wed, 19 Oct 2022 17:27:45 +0100 Subject: [PATCH] bump, debugTool needs fixing for 3.2.5, added WIP Halloween event and prepatcher --- .../{Plugin.cs => BushWhacker.cs} | 6 +- .../{Patch.cs => BushWhackerPatch.cs} | 4 +- .../bepInEx/plugins/CWX-BushWhacker.dll | Bin 6144 -> 0 bytes .../bepInEx/plugins/CWX-BushWhacker.dll | Bin 0 -> 6144 bytes .../mods/CWX-BushWhacker 1.2.5}/LICENSE.txt | 0 .../mods/CWX-BushWhacker 1.2.5}/package.json | 4 +- .../mods/CWX-BushWhacker 1.2.5}/src/mod.ts | 0 Live/CWX_BushWhacker/CWX_BushWhacker.csproj | 22 +- .../bepInEx/plugins/CWX-DeSharpener.dll | Bin 5120 -> 0 bytes .../bepInEx/plugins/CWX-DeSharpener.dll | Bin 0 -> 5120 bytes .../mods/CWX-DeSharpener 1.4.5}/LICENSE.txt | 0 .../mods/CWX-DeSharpener 1.4.5}/package.json | 4 +- .../mods/CWX-DeSharpener 1.4.5}/src/mod.ts | 0 Live/CWX_DeSharpener/CWX_DeSharpener.csproj | 19 +- .../{Program.cs => DeSharpener.cs} | 9 +- .../{SharpenPatch.cs => DeSharpenerPatch.cs} | 6 +- Live/CWX_DebugTool/config/config.json | 7 + Live/CWX_DebugTool/dist/config/config.json | 7 + Live/CWX_DebugTool/dist/models/IConfig.ts | 31 +- Live/CWX_DebugTool/dist/src/airdropConfig.ts | 70 +++ Live/CWX_DebugTool/dist/src/configHandler.ts | 8 +- Live/CWX_DebugTool/dist/src/globalsConfig.ts | 25 +- Live/CWX_DebugTool/dist/src/inraidConfig.ts | 14 +- Live/CWX_DebugTool/dist/src/itemsConfig.ts | 18 +- Live/CWX_DebugTool/dist/src/locationConfig.ts | 14 +- Live/CWX_DebugTool/dist/src/logging.ts | 81 ++- Live/CWX_DebugTool/dist/src/mod.ts | 45 +- Live/CWX_DebugTool/dist/src/ragfairConfig.ts | 22 +- .../dist/types/ErrorHandler.d.ts | 6 + Live/CWX_DebugTool/dist/types/Program.d.ts | 1 + .../dist/types/callbacks/BundleCallbacks.d.ts | 6 +- .../dist/types/callbacks/HttpCallbacks.d.ts | 6 +- .../dist/types/callbacks/ModCallbacks.d.ts | 6 +- .../types/controllers/DialogueController.d.ts | 67 ++- .../types/controllers/MatchController.d.ts | 7 + .../types/controllers/RagfairController.d.ts | 30 ++ .../dist/types/di/Container.d.ts | 1 + .../dist/types/di/Serializer.d.ts | 5 +- .../dist/types/generators/LootGenerator.d.ts | 3 +- .../generators/RagfairOfferGenerator.d.ts | 7 + .../dist/types/helpers/BotHelper.d.ts | 6 + .../dist/types/helpers/DialogueHelper.d.ts | 3 +- .../types/helpers/NotificationSendHelper.d.ts | 6 +- .../types/helpers/RagfairOfferHelper.d.ts | 6 + .../dist/types/helpers/RagfairSortHelper.d.ts | 16 +- .../dist/types/loaders/PreAkiModLoader.d.ts | 25 +- .../models/eft/common/tables/IBotBase.d.ts | 3 + .../models/eft/ragfair/IRagfairOffer.d.ts | 1 + .../eft/ragfair/ISearchRequestData.d.ts | 3 +- .../dist/types/models/enums/RagfairSort.d.ts | 7 + .../types/models/external/HttpFramework.d.ts | 33 ++ .../types/models/spt/config/IHttpConfig.d.ts | 1 + .../dist/types/routers/ImageRouter.d.ts | 7 +- .../routers/serializers/BundleSerializer.d.ts | 9 +- .../routers/serializers/ImageSerializer.d.ts | 5 +- .../routers/serializers/NotifySerializer.d.ts | 5 +- .../dist/types/servers/HttpServer.d.ts | 33 +- .../types/servers/http/AkiHttpListener.d.ts | 26 + .../types/servers/http/HttpBufferHandler.d.ts | 6 + .../dist/types/servers/http/HttpMethods.d.ts | 8 + .../types/servers/http/IHttpListener.d.ts | 6 + .../services/BotGenerationCacheService.d.ts | 6 +- .../types/services/ProfileFixerService.d.ts | 24 +- .../mod/httpListener/HttpListenerMod.d.ts | 10 + .../httpListener/HttpListenerModService.d.ts | 8 + .../dist/types/utils/HttpFileUtil.d.ts | 8 + Live/CWX_DebugTool/models/IConfig.ts | 31 +- Live/CWX_DebugTool/src/airdropConfig.ts | 70 +++ Live/CWX_DebugTool/src/configHandler.ts | 8 +- Live/CWX_DebugTool/src/globalsConfig.ts | 25 +- Live/CWX_DebugTool/src/inraidConfig.ts | 14 +- Live/CWX_DebugTool/src/itemsConfig.ts | 18 +- Live/CWX_DebugTool/src/locationConfig.ts | 14 +- Live/CWX_DebugTool/src/logging.ts | 81 ++- Live/CWX_DebugTool/src/mod.ts | 45 +- Live/CWX_DebugTool/src/ragfairConfig.ts | 22 +- Live/CWX_DebugTool/types/ErrorHandler.d.ts | 6 + Live/CWX_DebugTool/types/Program.d.ts | 1 + .../types/callbacks/BundleCallbacks.d.ts | 6 +- .../types/callbacks/HttpCallbacks.d.ts | 6 +- .../types/callbacks/ModCallbacks.d.ts | 6 +- .../types/controllers/DialogueController.d.ts | 67 ++- .../types/controllers/MatchController.d.ts | 7 + .../types/controllers/RagfairController.d.ts | 30 ++ Live/CWX_DebugTool/types/di/Container.d.ts | 1 + Live/CWX_DebugTool/types/di/Serializer.d.ts | 5 +- .../types/generators/LootGenerator.d.ts | 3 +- .../generators/RagfairOfferGenerator.d.ts | 7 + .../types/helpers/BotHelper.d.ts | 6 + .../types/helpers/DialogueHelper.d.ts | 3 +- .../types/helpers/NotificationSendHelper.d.ts | 6 +- .../types/helpers/RagfairOfferHelper.d.ts | 6 + .../types/helpers/RagfairSortHelper.d.ts | 16 +- .../types/loaders/PreAkiModLoader.d.ts | 25 +- .../models/eft/common/tables/IBotBase.d.ts | 3 + .../models/eft/ragfair/IRagfairOffer.d.ts | 1 + .../eft/ragfair/ISearchRequestData.d.ts | 3 +- .../types/models/enums/RagfairSort.d.ts | 7 + .../types/models/external/HttpFramework.d.ts | 33 ++ .../types/models/spt/config/IHttpConfig.d.ts | 1 + .../types/routers/ImageRouter.d.ts | 7 +- .../routers/serializers/BundleSerializer.d.ts | 9 +- .../routers/serializers/ImageSerializer.d.ts | 5 +- .../routers/serializers/NotifySerializer.d.ts | 5 +- .../types/servers/HttpServer.d.ts | 33 +- .../types/servers/http/AkiHttpListener.d.ts | 26 + .../types/servers/http/HttpBufferHandler.d.ts | 6 + .../types/servers/http/HttpMethods.d.ts | 8 + .../types/servers/http/IHttpListener.d.ts | 6 + .../services/BotGenerationCacheService.d.ts | 6 +- .../types/services/ProfileFixerService.d.ts | 24 +- .../mod/httpListener/HttpListenerMod.d.ts | 10 + .../httpListener/HttpListenerModService.d.ts | 8 + .../types/utils/HttpFileUtil.d.ts | 8 + .../bepInEx/plugins/CWX-MasterKey.dll | Bin 7680 -> 0 bytes .../bepInEx/plugins/CWX-MasterKey.dll | Bin 0 -> 8704 bytes .../mods/CWX-MasterKey 1.3.7}/LICENSE.txt | 0 .../mods/CWX-MasterKey 1.3.7}/package.json | 6 +- .../mods/CWX-MasterKey 1.3.7}/src/config.json | 0 .../user/mods/CWX-MasterKey 1.3.7}/src/mod.ts | 0 Live/CWX_MasterKey/CWX_MasterKey.csproj | 19 +- Live/CWX_MasterKey/MasterKey.cs | 93 +--- ...ConfigClass.cs => MasterKeyConfigClass.cs} | 2 +- .../{Patch.cs => MasterKeyPatch.cs} | 4 +- Live/CWX_MasterKey/MasterKeyScript.cs | 113 +++++ Live/CWX_MasterKey/program.cs | 13 - Live/CWX_Mods.sln | 2 +- Live/CWX_VoiceAdder/CWX_VoiceAdder.csproj | 16 +- Live/CWX_WeatherPatcher/CWX_JsonConverter.cs | 11 - .../CWX_WeatherPatch.csproj | 45 -- .../BepInEx/plugins/CWX-WeatherPatcher.dll | Bin 7168 -> 0 bytes .../BepInEx/plugins/CWX-WeatherPatcher.dll | Bin 0 -> 6144 bytes .../CWX-WeatherPatcher 2.4.5}/LICENSE.txt | 0 .../CWX-WeatherPatcher 2.4.5}/package.json | 4 +- .../mods/CWX-WeatherPatcher 2.4.5}/src/mod.ts | 0 .../CWX_WeatherPatcher.csproj | 30 ++ Live/CWX_WeatherPatcher/GClassPatch.cs | 3 +- Live/CWX_WeatherPatcher/GameWorldPatch.cs | 5 +- Live/CWX_WeatherPatcher/LevelSettingsPatch.cs | 2 +- ...atteringPatch.cs => TodScatteringPatch.cs} | 2 +- .../{Program.cs => WeatherPatcher.cs} | 7 +- .../CWX_HalloweenEvent.csproj | 36 ++ WIP/CWX-HalloweenEvent/CWX_HalloweenEvent.sln | 25 + .../Changes/EventWeather.cs | 80 +++ WIP/CWX-HalloweenEvent/HalloweenEvent.cs | 37 ++ .../Patches/LevelSettingPatch.cs | 20 + .../Patches/RaidStartPatch.cs | 22 + .../CWX_NewAiType/CWX_NewAiType.csproj | 39 ++ .../CWX_NewAiType/Constants/Constants.cs | 16 + WIP/CWX-PrePatcher/CWX_NewAiType/NewAiType.cs | 15 + .../Patches/PlayerStatTrackerOnKillPatch.cs | 191 +++++++ .../CWX_NewAiType/Patches/StaticPatches.cs | 47 ++ .../CWX_NewAiType/Utils/ClassResolver.cs | 465 ++++++++++++++++++ .../CWX_NewAiType/Utils/EnumResolver.cs | 11 + .../CWX_PREPATCHER/CWX_PREPATCHER.sln | 31 ++ .../CWX_PREPATCHER.sln.DotSettings.user | 4 + .../CWX_PREPATCHER/CWX_PrePatcher.csproj | 39 ++ .../CWX_PREPATCHER/PrePatcher.cs | 30 ++ 158 files changed, 2482 insertions(+), 579 deletions(-) rename Live/CWX_BushWhacker/{Plugin.cs => BushWhacker.cs} (93%) rename Live/CWX_BushWhacker/{Patch.cs => BushWhackerPatch.cs} (84%) delete mode 100644 Live/CWX_BushWhacker/CWX-BushWhacker 1.2.4/bepInEx/plugins/CWX-BushWhacker.dll create mode 100644 Live/CWX_BushWhacker/CWX-BushWhacker 1.2.5/bepInEx/plugins/CWX-BushWhacker.dll rename Live/CWX_BushWhacker/{CWX-BushWhacker 1.2.4/user/mods/CWX-BushWhacker 1.2.4 => CWX-BushWhacker 1.2.5/user/mods/CWX-BushWhacker 1.2.5}/LICENSE.txt (100%) rename Live/CWX_BushWhacker/{CWX-BushWhacker 1.2.4/user/mods/CWX-BushWhacker 1.2.4 => CWX-BushWhacker 1.2.5/user/mods/CWX-BushWhacker 1.2.5}/package.json (95%) rename Live/CWX_BushWhacker/{CWX-BushWhacker 1.2.4/user/mods/CWX-BushWhacker 1.2.4 => CWX-BushWhacker 1.2.5/user/mods/CWX-BushWhacker 1.2.5}/src/mod.ts (100%) delete mode 100644 Live/CWX_DeSharpener/CWX-DeSharpener 1.4.4/bepInEx/plugins/CWX-DeSharpener.dll create mode 100644 Live/CWX_DeSharpener/CWX-DeSharpener 1.4.5/bepInEx/plugins/CWX-DeSharpener.dll rename Live/CWX_DeSharpener/{CWX-DeSharpener 1.4.4/user/mods/CWX-DeSharpener 1.4.4 => CWX-DeSharpener 1.4.5/user/mods/CWX-DeSharpener 1.4.5}/LICENSE.txt (100%) rename Live/CWX_DeSharpener/{CWX-DeSharpener 1.4.4/user/mods/CWX-DeSharpener 1.4.4 => CWX-DeSharpener 1.4.5/user/mods/CWX-DeSharpener 1.4.5}/package.json (95%) rename Live/CWX_DeSharpener/{CWX-DeSharpener 1.4.4/user/mods/CWX-DeSharpener 1.4.4 => CWX-DeSharpener 1.4.5/user/mods/CWX-DeSharpener 1.4.5}/src/mod.ts (100%) rename Live/CWX_DeSharpener/{Program.cs => DeSharpener.cs} (51%) rename Live/CWX_DeSharpener/{SharpenPatch.cs => DeSharpenerPatch.cs} (86%) create mode 100644 Live/CWX_DebugTool/dist/src/airdropConfig.ts create mode 100644 Live/CWX_DebugTool/dist/types/ErrorHandler.d.ts create mode 100644 Live/CWX_DebugTool/dist/types/models/enums/RagfairSort.d.ts create mode 100644 Live/CWX_DebugTool/dist/types/models/external/HttpFramework.d.ts create mode 100644 Live/CWX_DebugTool/dist/types/servers/http/AkiHttpListener.d.ts create mode 100644 Live/CWX_DebugTool/dist/types/servers/http/HttpBufferHandler.d.ts create mode 100644 Live/CWX_DebugTool/dist/types/servers/http/HttpMethods.d.ts create mode 100644 Live/CWX_DebugTool/dist/types/servers/http/IHttpListener.d.ts create mode 100644 Live/CWX_DebugTool/dist/types/services/mod/httpListener/HttpListenerMod.d.ts create mode 100644 Live/CWX_DebugTool/dist/types/services/mod/httpListener/HttpListenerModService.d.ts create mode 100644 Live/CWX_DebugTool/dist/types/utils/HttpFileUtil.d.ts create mode 100644 Live/CWX_DebugTool/src/airdropConfig.ts create mode 100644 Live/CWX_DebugTool/types/ErrorHandler.d.ts create mode 100644 Live/CWX_DebugTool/types/models/enums/RagfairSort.d.ts create mode 100644 Live/CWX_DebugTool/types/models/external/HttpFramework.d.ts create mode 100644 Live/CWX_DebugTool/types/servers/http/AkiHttpListener.d.ts create mode 100644 Live/CWX_DebugTool/types/servers/http/HttpBufferHandler.d.ts create mode 100644 Live/CWX_DebugTool/types/servers/http/HttpMethods.d.ts create mode 100644 Live/CWX_DebugTool/types/servers/http/IHttpListener.d.ts create mode 100644 Live/CWX_DebugTool/types/services/mod/httpListener/HttpListenerMod.d.ts create mode 100644 Live/CWX_DebugTool/types/services/mod/httpListener/HttpListenerModService.d.ts create mode 100644 Live/CWX_DebugTool/types/utils/HttpFileUtil.d.ts delete mode 100644 Live/CWX_MasterKey/CWX_MasterKey 1.3.6/bepInEx/plugins/CWX-MasterKey.dll create mode 100644 Live/CWX_MasterKey/CWX_MasterKey 1.3.7/bepInEx/plugins/CWX-MasterKey.dll rename Live/CWX_MasterKey/{CWX_MasterKey 1.3.6/user/mods/CWX-MasterKey 1.3.6 => CWX_MasterKey 1.3.7/user/mods/CWX-MasterKey 1.3.7}/LICENSE.txt (100%) rename Live/CWX_MasterKey/{CWX_MasterKey 1.3.6/user/mods/CWX-MasterKey 1.3.6 => CWX_MasterKey 1.3.7/user/mods/CWX-MasterKey 1.3.7}/package.json (94%) rename Live/CWX_MasterKey/{CWX_MasterKey 1.3.6/user/mods/CWX-MasterKey 1.3.6 => CWX_MasterKey 1.3.7/user/mods/CWX-MasterKey 1.3.7}/src/config.json (100%) rename Live/CWX_MasterKey/{CWX_MasterKey 1.3.6/user/mods/CWX-MasterKey 1.3.6 => CWX_MasterKey 1.3.7/user/mods/CWX-MasterKey 1.3.7}/src/mod.ts (100%) rename Live/CWX_MasterKey/{ConfigClass.cs => MasterKeyConfigClass.cs} (69%) rename Live/CWX_MasterKey/{Patch.cs => MasterKeyPatch.cs} (81%) create mode 100644 Live/CWX_MasterKey/MasterKeyScript.cs delete mode 100644 Live/CWX_MasterKey/program.cs delete mode 100644 Live/CWX_WeatherPatcher/CWX_JsonConverter.cs delete mode 100644 Live/CWX_WeatherPatcher/CWX_WeatherPatch.csproj delete mode 100644 Live/CWX_WeatherPatcher/CWX_WeatherPatcher 2.4.4/BepInEx/plugins/CWX-WeatherPatcher.dll create mode 100644 Live/CWX_WeatherPatcher/CWX_WeatherPatcher 2.4.5/BepInEx/plugins/CWX-WeatherPatcher.dll rename Live/CWX_WeatherPatcher/{CWX_WeatherPatcher 2.4.4/user/mods/CWX-WeatherPatcher 2.4.4 => CWX_WeatherPatcher 2.4.5/user/mods/CWX-WeatherPatcher 2.4.5}/LICENSE.txt (100%) rename Live/CWX_WeatherPatcher/{CWX_WeatherPatcher 2.4.4/user/mods/CWX-WeatherPatcher 2.4.4 => CWX_WeatherPatcher 2.4.5/user/mods/CWX-WeatherPatcher 2.4.5}/package.json (95%) rename Live/CWX_WeatherPatcher/{CWX_WeatherPatcher 2.4.4/user/mods/CWX-WeatherPatcher 2.4.4 => CWX_WeatherPatcher 2.4.5/user/mods/CWX-WeatherPatcher 2.4.5}/src/mod.ts (100%) create mode 100644 Live/CWX_WeatherPatcher/CWX_WeatherPatcher.csproj rename Live/CWX_WeatherPatcher/{TOD_ScatteringPatch.cs => TodScatteringPatch.cs} (84%) rename Live/CWX_WeatherPatcher/{Program.cs => WeatherPatcher.cs} (88%) create mode 100644 WIP/CWX-HalloweenEvent/CWX_HalloweenEvent.csproj create mode 100644 WIP/CWX-HalloweenEvent/CWX_HalloweenEvent.sln create mode 100644 WIP/CWX-HalloweenEvent/Changes/EventWeather.cs create mode 100644 WIP/CWX-HalloweenEvent/HalloweenEvent.cs create mode 100644 WIP/CWX-HalloweenEvent/Patches/LevelSettingPatch.cs create mode 100644 WIP/CWX-HalloweenEvent/Patches/RaidStartPatch.cs create mode 100644 WIP/CWX-PrePatcher/CWX_NewAiType/CWX_NewAiType.csproj create mode 100644 WIP/CWX-PrePatcher/CWX_NewAiType/Constants/Constants.cs create mode 100644 WIP/CWX-PrePatcher/CWX_NewAiType/NewAiType.cs create mode 100644 WIP/CWX-PrePatcher/CWX_NewAiType/Patches/PlayerStatTrackerOnKillPatch.cs create mode 100644 WIP/CWX-PrePatcher/CWX_NewAiType/Patches/StaticPatches.cs create mode 100644 WIP/CWX-PrePatcher/CWX_NewAiType/Utils/ClassResolver.cs create mode 100644 WIP/CWX-PrePatcher/CWX_NewAiType/Utils/EnumResolver.cs create mode 100644 WIP/CWX-PrePatcher/CWX_PREPATCHER/CWX_PREPATCHER.sln create mode 100644 WIP/CWX-PrePatcher/CWX_PREPATCHER/CWX_PREPATCHER.sln.DotSettings.user create mode 100644 WIP/CWX-PrePatcher/CWX_PREPATCHER/CWX_PrePatcher.csproj create mode 100644 WIP/CWX-PrePatcher/CWX_PREPATCHER/PrePatcher.cs diff --git a/Live/CWX_BushWhacker/Plugin.cs b/Live/CWX_BushWhacker/BushWhacker.cs similarity index 93% rename from Live/CWX_BushWhacker/Plugin.cs rename to Live/CWX_BushWhacker/BushWhacker.cs index 4a1f644..566cc66 100644 --- a/Live/CWX_BushWhacker/Plugin.cs +++ b/Live/CWX_BushWhacker/BushWhacker.cs @@ -3,14 +3,14 @@ using EFT.Interactive; using System.Linq; using UnityEngine; -namespace BushWhacker +namespace CWX_BushWhacker { - [BepInPlugin("com.cwx.bushwhacker", "cwx-bushwhacker", "1.2.4")] + [BepInPlugin("com.cwx.bushwhacker", "cwx-bushwhacker", "1.2.5")] public class BushWhacker : BaseUnityPlugin { public void Start() { - new Patch().Enable(); + new BushWhackerPatch().Enable(); } public static void DisableBushes() diff --git a/Live/CWX_BushWhacker/Patch.cs b/Live/CWX_BushWhacker/BushWhackerPatch.cs similarity index 84% rename from Live/CWX_BushWhacker/Patch.cs rename to Live/CWX_BushWhacker/BushWhackerPatch.cs index ccc93e0..16b439c 100644 --- a/Live/CWX_BushWhacker/Patch.cs +++ b/Live/CWX_BushWhacker/BushWhackerPatch.cs @@ -2,9 +2,9 @@ using EFT; using System.Reflection; -namespace BushWhacker +namespace CWX_BushWhacker { - public class Patch : ModulePatch + public class BushWhackerPatch : ModulePatch { protected override MethodBase GetTargetMethod() { diff --git a/Live/CWX_BushWhacker/CWX-BushWhacker 1.2.4/bepInEx/plugins/CWX-BushWhacker.dll b/Live/CWX_BushWhacker/CWX-BushWhacker 1.2.4/bepInEx/plugins/CWX-BushWhacker.dll deleted file mode 100644 index f89386f401a9a29d088a6c823ede7a46bc07db87..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6144 zcmeHLYiu0V6+U-%y|y>;I=glf@*tVS2`q6uwex@kDD`U{Z}AK7=0WS$8L!9oklC4K zW;U@=TLnr&(@GVh4;3L*z>f&26{=9BLSI4%(f$Y&p{OkqpcGXI)JmvSLT!bde&^2Y zBTfNTswyFISNF_4k9*F!=bro8(Jwqm5h9ABUcOB9G`?JVCH!b`8tlZ@pC{<2%`a|y zT8zB7Ex%xTYRPrxUA?FlblY}(b;eNLvaOo7IyjzFi_WZ}wY0={gsLYpL?a?X-+KSz zuPfFr(ROu}=q6eNN-Uthq~WWg_M$RJ1ylmRnGlK*oeti zw*aE_trrcRs1#~l>4o>2Ygi5h*;hJ_%DUE})|FnO{yJ1PpX9irux|=A(9_$Ao{bX; zN&W9ZTX%#uqZ|4s>18+|(k(=B7kFuFdm5vS$2%#uYdfVIc-D4pSJJH@(yklHL;PcD zOcJn7-3q;eP8dd#(r9$1(d>+;A=8;g5IR>;qtgc2)txt_lyo~g5Wi1b-naPYf4#O2aTJY4a|CtV$MeH&~Tt1#!?OGO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~p{il;o6X z8auFqTZly_I0j^>bq;NdW+aBYe+%PP44d5>(TvjHw`uGZ&12Xlcq~541DI<|IyBk-pO=UzXE8*zc#3$0C+0hu@&3pC;J!aCY07U+zsIGf;CqJb180VqVO z2wVx|vw>K)LE36iDRugcgy%2&jfGxS$5Ph2mxhvpw1#4Hr#ZLP3`ZPEhtm6Vz64idx~+qBesZ zJ{2tRR^VNAc%@Hpw9P#~{8tjA6AI7=P%q$(d7*OI1jbpYEY9BHzCHVIq|g(; z;t57;-HS;E7Y(?V zcS6g`uw1S3Q_6=#fbZ-?cp{&^Qh*mE;Wl|So#lp6kM$CLz=<4|4-`D`=m>VmX}}C# z9XZP4pO!J;S-_#-Ul;mS^xb97bVXW-R==MM^+fTlQ!A;1fC5^1=N*!JssWug-WHDJ z?~u3JJh(cj9`;-vJG2R|E%`)0iB3VOko&g_j!pCbLDK;#(~WTlzkS%P5d-Q)lmu?x z4$gp*w6TN{1t$U<7@(tcjJoh=OBvP|fGvPqpcBD4fOv8Lisyr%df>7jr7QgWI6d9i zFKc>^NbO$TID2rP--EgjmHi&ZJ4MJy@pGIDh#? zd1e2VQLDv_=zxrGA7;mcpGC~Rg;A==JdR#1(zQN8oH3+NPEmvZEMC6tljHKIp8oG5 F@NZEe+^qlr diff --git a/Live/CWX_BushWhacker/CWX-BushWhacker 1.2.5/bepInEx/plugins/CWX-BushWhacker.dll b/Live/CWX_BushWhacker/CWX-BushWhacker 1.2.5/bepInEx/plugins/CWX-BushWhacker.dll new file mode 100644 index 0000000000000000000000000000000000000000..41030e4a5ff949a04e3af9a5f99188c58902d2d6 GIT binary patch literal 6144 zcmeHLYiu0V6+Scjuy>QJv+GA7FK^-iOPn2?Ckd^oU+YI3Kge!gV9A+XkL@9|Gt10u zV$(uhsX*aJi&R7lq7@HOT8T;}MTNGs6{r%b3bdg9p`s}jRi8gv0Y3mCyWhDp`>+FP zD^-<{xb{7B&$;KGd+s^so_p_(UVk?Qh$x7YVzUYYz(P1e-g@*(8 z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thEU58(3u$k;m4nS-LjHv$F_-j|xb7zgN6|?MFr7kM;at GTHs&o;p094 literal 0 HcmV?d00001 diff --git a/Live/CWX_BushWhacker/CWX-BushWhacker 1.2.4/user/mods/CWX-BushWhacker 1.2.4/LICENSE.txt b/Live/CWX_BushWhacker/CWX-BushWhacker 1.2.5/user/mods/CWX-BushWhacker 1.2.5/LICENSE.txt similarity index 100% rename from Live/CWX_BushWhacker/CWX-BushWhacker 1.2.4/user/mods/CWX-BushWhacker 1.2.4/LICENSE.txt rename to Live/CWX_BushWhacker/CWX-BushWhacker 1.2.5/user/mods/CWX-BushWhacker 1.2.5/LICENSE.txt diff --git a/Live/CWX_BushWhacker/CWX-BushWhacker 1.2.4/user/mods/CWX-BushWhacker 1.2.4/package.json b/Live/CWX_BushWhacker/CWX-BushWhacker 1.2.5/user/mods/CWX-BushWhacker 1.2.5/package.json similarity index 95% rename from Live/CWX_BushWhacker/CWX-BushWhacker 1.2.4/user/mods/CWX-BushWhacker 1.2.4/package.json rename to Live/CWX_BushWhacker/CWX-BushWhacker 1.2.5/user/mods/CWX-BushWhacker 1.2.5/package.json index 51136cc..a86c439 100644 --- a/Live/CWX_BushWhacker/CWX-BushWhacker 1.2.4/user/mods/CWX-BushWhacker 1.2.4/package.json +++ b/Live/CWX_BushWhacker/CWX-BushWhacker 1.2.5/user/mods/CWX-BushWhacker 1.2.5/package.json @@ -1,10 +1,10 @@ { "name": "BushWhacker", "author": "CWX", - "version": "1.2.4", + "version": "1.2.5", "license": "NCSA", "main": "src/mod.js", - "akiVersion": "3.2.3", + "akiVersion": "3.2.4", "scripts": { "setup:environment": "npm i", "build:unzipped": "copyfiles -e \"./node_modules/**/*.*\" -e \"./dist/**/*.*\" -e \"./package-lock.json\" -e \"./tsconfig.json\" -e \"./README.txt\" -e \"./mod.code-workspace\" ./**/*.* ./dist", diff --git a/Live/CWX_BushWhacker/CWX-BushWhacker 1.2.4/user/mods/CWX-BushWhacker 1.2.4/src/mod.ts b/Live/CWX_BushWhacker/CWX-BushWhacker 1.2.5/user/mods/CWX-BushWhacker 1.2.5/src/mod.ts similarity index 100% rename from Live/CWX_BushWhacker/CWX-BushWhacker 1.2.4/user/mods/CWX-BushWhacker 1.2.4/src/mod.ts rename to Live/CWX_BushWhacker/CWX-BushWhacker 1.2.5/user/mods/CWX-BushWhacker 1.2.5/src/mod.ts diff --git a/Live/CWX_BushWhacker/CWX_BushWhacker.csproj b/Live/CWX_BushWhacker/CWX_BushWhacker.csproj index 3d095f3..5c74da9 100644 --- a/Live/CWX_BushWhacker/CWX_BushWhacker.csproj +++ b/Live/CWX_BushWhacker/CWX_BushWhacker.csproj @@ -3,39 +3,39 @@ net472 CWX-BushWhacker - 1.2.4 + 1.2.5 - ..\Shared\AKI\Aki.Common.dll + ..\..\..\Shared\Aki\Aki.Common.dll - ..\Shared\AKI\Aki.Reflection.dll + ..\..\..\Shared\Aki\Aki.Reflection.dll - ..\Shared\EFT\Assembly-CSharp.dll + ..\..\..\Shared\EFT\Assembly-CSharp.dll - ..\Shared\BepInEx\BepInEx.dll + ..\..\..\Shared\BepInEx\BepInEx.dll - ..\Shared\EFT\Comfort.dll + ..\..\..\Shared\EFT\Comfort.dll - ..\Shared\EFT\Newtonsoft.Json.dll + ..\..\..\Shared\EFT\Newtonsoft.Json.dll - ..\Shared\EFT\UnityEngine.dll + ..\..\..\Shared\EFT\UnityEngine.dll - ..\Shared\EFT\UnityEngine.AssetBundleModule.dll + ..\..\..\Shared\EFT\UnityEngine.AssetBundleModule.dll - ..\Shared\EFT\UnityEngine.CoreModule.dll + ..\..\..\Shared\EFT\UnityEngine.CoreModule.dll - ..\..\..\AKI-All\Modules\project\Shared\Managed\UnityEngine.PhysicsModule.dll + ..\..\..\Shared\EFT\UnityEngine.PhysicsModule.dll diff --git a/Live/CWX_DeSharpener/CWX-DeSharpener 1.4.4/bepInEx/plugins/CWX-DeSharpener.dll b/Live/CWX_DeSharpener/CWX-DeSharpener 1.4.4/bepInEx/plugins/CWX-DeSharpener.dll deleted file mode 100644 index da29c58b4c0fadffd33c142e37552e09dcd9f80b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5120 zcmeHKU2Ggz6+U;?UOOAIjyHCQleC${ZQ~}*$d29S*I;|sNf!LGcpcj5>r%Csep>ADyaky6%UmVK}da|5>iVm3P>RFQXwQBc!)$_5Ij`;sPI4v4d1yl z>s{NBf`o)B_3qwt@A); z_rEU2-rhgGV)=T-b4#9C){Ca&xPe}fx>t2{%h5BFdA;l|Nn_i#!~>D)+$hnQh*8&@ z@4i;s?HxLxZxy{np8zEuQk_E>b@U;0qU~y~g?2L`5+k|}1axjOTKqDL^1nVtD3j23 zL+>O{hKS}k5F6WKXvVIGiKaL5?uF|_tquHE;O81}Baqhu;6VZaJmqU-H!#(7qD8~= zy&^DW+YlyvP)YQLHU#SpPuea7Ib^hm&bm_Q4Q+^Mqybga363io+on-7(SD*`FkC3= ze-9obA5o0=Y$Hn0p#xeEY{le7t*4DA)Pu7~XdlGkM%-`5yaziSz7EiIXh*L`N3bQ3 zc8YlzD(()5bo6upKC&a`?O9JcEOsUiQ=DDkwVfE@b~`=I>gwz3GJ;xa`lFR2`Ol1q z$Xkxxl>wvI=gL3zlb<}Ta>{)uHavZ=P5P6s^HH+NzjP)P%J?c zfJsVfx3TI5or2^oaFcXH+!jgN9(x~@HbvhTJEf)QB7F@MK|R>(OIjIw61#)O5fzBV ztoD-j=o+>g*a=`U9MN;MLOGpfpP>s_FX%~yeP!1zrL(jSdtPDB&=+wYf_|>BpVBya zi08WsyGcguDn}RmuhSN~h3K>c#;FT1K@S6Nr#=NwC^)QOR>99H__%^5U?=S3wU?;~ z+pK8Ll$-PiZ7)vcmUf7~OI7NnRZ7zs{eVu!rpTbJ^c3I@dKPdGeG9OgUI9EzcL4jT zO&D~Fb_1sAAmC>eJr9_s&(ksSW9)cToTDe`05x4_Z<^GZ!!fjPz(KwNwYEU})U+8? zzWrf)h%XXWHnu0#>8xM-k`j0jJELV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sHgYzu&+G=*6fUs@Buvw&y9uP*vw(;q(ws~mn3xYh~BPqPvq> zDq03ms4VG0kA+-`8UlH98M&6*18UVYszc7UKKPuCEpQ#hM`hkL52XS&1(32pFZ~Nm z$CXSkYP|3_Kn2W*h7cuzs>wxmuc$p%;gJc9Gd7-Qnx#2>$#9NepV=jL<9PA>e((JZywz;{ z@C}C(5vX}3qQ)9H5*5_J>_G`{GQ8_lvdF3ZCL=mWnWbxfGZsedKixNsdk*?s*iuEz zf(Gk9Jnp^fJ7fL&jZv$|jOe(E?=WKO!`CuS--eeuZr=Jx*Vh>8e!%^YPSeA0%*x4+ Nj>#We`oD|7KLO$_@Du<5 diff --git a/Live/CWX_DeSharpener/CWX-DeSharpener 1.4.5/bepInEx/plugins/CWX-DeSharpener.dll b/Live/CWX_DeSharpener/CWX-DeSharpener 1.4.5/bepInEx/plugins/CWX-DeSharpener.dll new file mode 100644 index 0000000000000000000000000000000000000000..bff3a9d63ba4829b4e4ffc021d8bdc21d904166b GIT binary patch literal 5120 zcmeHKU2Ggz6+U;?UOOAIj@NNW+BBWSsp9;N9NVdrfE)j;9lON#;`LvPgFU;xUQaSR zvzeKVZ9tVP3Th>&QvMzaZwLekA&@GyM1cBG5HFFC`WjW0cm?GFc!{9lJ9lQiyAGrv zA)!jWyZ6lbyXT&B?!9O3Ogw*!Vnoz{{@?-8TX=FCQ1H=U3*zLHx0Ce7t~*EG5?AgV znOU=Zz2vzC&n)VB({bED&q>`YJG$lQ>8Y$E}~C>6A!u9PU5Mf51qN~p@@CLuHM9}PjR15h0RWkbHS!yjYC6%f;rU)3l=5u= z2rpC;y`~Mod&85q3q?*DEu*uo6nae?AR4M675Xga6^(t1t&qH+QnFcrU8?b)b3)` zExH8FA3~a>TjH)r(y>@eEKV(o-xIr}rRW;H3LQb6nCr{h4a|x2!~i`0?WLb-Khe%@ zQ;&hV04jzhdWF^~qqFXdbQR+TeO^&tJ#bsuEYwk7Q`C#}C9H>_-z(}JnjjDP{F9~uvm%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X-DeSharpener 1.4.4/user/mods/CWX-DeSharpener 1.4.4/LICENSE.txt rename to Live/CWX_DeSharpener/CWX-DeSharpener 1.4.5/user/mods/CWX-DeSharpener 1.4.5/LICENSE.txt diff --git a/Live/CWX_DeSharpener/CWX-DeSharpener 1.4.4/user/mods/CWX-DeSharpener 1.4.4/package.json b/Live/CWX_DeSharpener/CWX-DeSharpener 1.4.5/user/mods/CWX-DeSharpener 1.4.5/package.json similarity index 95% rename from Live/CWX_DeSharpener/CWX-DeSharpener 1.4.4/user/mods/CWX-DeSharpener 1.4.4/package.json rename to Live/CWX_DeSharpener/CWX-DeSharpener 1.4.5/user/mods/CWX-DeSharpener 1.4.5/package.json index 79e57da..476a947 100644 --- a/Live/CWX_DeSharpener/CWX-DeSharpener 1.4.4/user/mods/CWX-DeSharpener 1.4.4/package.json +++ b/Live/CWX_DeSharpener/CWX-DeSharpener 1.4.5/user/mods/CWX-DeSharpener 1.4.5/package.json @@ -1,10 +1,10 @@ { "name": "DeSharpener", "author": "CWX", - "version": "1.4.4", + "version": "1.4.5", "license": "NCSA", "main": "src/mod.js", - "akiVersion": "3.2.3", + "akiVersion": "3.2.4", "scripts": { "setup:environment": "npm i", "build:unzipped": "copyfiles -e \"./node_modules/**/*.*\" -e \"./dist/**/*.*\" -e \"./package-lock.json\" -e \"./tsconfig.json\" -e \"./README.txt\" -e \"./mod.code-workspace\" ./**/*.* ./dist", diff --git a/Live/CWX_DeSharpener/CWX-DeSharpener 1.4.4/user/mods/CWX-DeSharpener 1.4.4/src/mod.ts b/Live/CWX_DeSharpener/CWX-DeSharpener 1.4.5/user/mods/CWX-DeSharpener 1.4.5/src/mod.ts similarity index 100% rename from Live/CWX_DeSharpener/CWX-DeSharpener 1.4.4/user/mods/CWX-DeSharpener 1.4.4/src/mod.ts rename to Live/CWX_DeSharpener/CWX-DeSharpener 1.4.5/user/mods/CWX-DeSharpener 1.4.5/src/mod.ts diff --git a/Live/CWX_DeSharpener/CWX_DeSharpener.csproj b/Live/CWX_DeSharpener/CWX_DeSharpener.csproj index 3184092..37c0087 100644 --- a/Live/CWX_DeSharpener/CWX_DeSharpener.csproj +++ b/Live/CWX_DeSharpener/CWX_DeSharpener.csproj @@ -2,31 +2,28 @@ net472 - 1.4.4 - CWX-DeSharpener + 1.4.5 + CWX-DeSharpener - ..\Shared\AKI\Aki.Common.dll + ..\..\..\Shared\Aki\Aki.Common.dll - ..\Shared\AKI\Aki.Reflection.dll + ..\..\..\Shared\Aki\Aki.Reflection.dll - ..\Shared\EFT\Assembly-CSharp.dll + ..\..\..\Shared\EFT\Assembly-CSharp.dll - ..\Shared\BepInEx\BepInEx.dll - - - ..\Shared\BepInEx\ConfigurationManager.dll + ..\..\..\Shared\BepInEx\BepInEx.dll - ..\Shared\EFT\UnityEngine.dll + ..\..\..\Shared\EFT\UnityEngine.dll - ..\Shared\EFT\UnityEngine.CoreModule.dll + ..\..\..\Shared\EFT\UnityEngine.CoreModule.dll diff --git a/Live/CWX_DeSharpener/Program.cs b/Live/CWX_DeSharpener/DeSharpener.cs similarity index 51% rename from Live/CWX_DeSharpener/Program.cs rename to Live/CWX_DeSharpener/DeSharpener.cs index 6f8b64a..ab7ec51 100644 --- a/Live/CWX_DeSharpener/Program.cs +++ b/Live/CWX_DeSharpener/DeSharpener.cs @@ -1,14 +1,13 @@ using BepInEx; -using BepInEx.Configuration; -namespace DeSharpener +namespace CWX_DeSharpener { - [BepInPlugin("com.CWX.DeSharpener", "CWX-DeSharpener", "1.4.4")] - public class Plugin : BaseUnityPlugin + [BepInPlugin("com.CWX.DeSharpener", "CWX-DeSharpener", "1.4.5")] + public class DeSharpener : BaseUnityPlugin { private void Awake() { - new SharpenPatch().Enable(); + new DeSharpenerPatch().Enable(); } } } diff --git a/Live/CWX_DeSharpener/SharpenPatch.cs b/Live/CWX_DeSharpener/DeSharpenerPatch.cs similarity index 86% rename from Live/CWX_DeSharpener/SharpenPatch.cs rename to Live/CWX_DeSharpener/DeSharpenerPatch.cs index a973125..61f6752 100644 --- a/Live/CWX_DeSharpener/SharpenPatch.cs +++ b/Live/CWX_DeSharpener/DeSharpenerPatch.cs @@ -4,13 +4,13 @@ using Aki.Reflection.Patching; using Aki.Reflection.Utils; using System.Linq; -namespace DeSharpener +namespace CWX_DeSharpener { - public class SharpenPatch : ModulePatch + public class DeSharpenerPatch : ModulePatch { private static Type _targetType; - public SharpenPatch() + public DeSharpenerPatch() { _targetType = PatchConstants.EftTypes.Single(IsTargetType); } diff --git a/Live/CWX_DebugTool/config/config.json b/Live/CWX_DebugTool/config/config.json index d4ad390..ececeea 100644 --- a/Live/CWX_DebugTool/config/config.json +++ b/Live/CWX_DebugTool/config/config.json @@ -20,5 +20,12 @@ "changeShrapProps": true, "changeMaxAmmoForKS23": true, "removeDevFromBlacklist": true + }, + "airdropConfig": { + "enableAllTheTime": true, + "changeFlightHeight": true, + "changeStartTime": true, + "changePlaneVolume": true + } } \ No newline at end of file diff --git a/Live/CWX_DebugTool/dist/config/config.json b/Live/CWX_DebugTool/dist/config/config.json index d4ad390..ececeea 100644 --- a/Live/CWX_DebugTool/dist/config/config.json +++ b/Live/CWX_DebugTool/dist/config/config.json @@ -20,5 +20,12 @@ "changeShrapProps": true, "changeMaxAmmoForKS23": true, "removeDevFromBlacklist": true + }, + "airdropConfig": { + "enableAllTheTime": true, + "changeFlightHeight": true, + "changeStartTime": true, + "changePlaneVolume": true + } } \ No newline at end of file diff --git a/Live/CWX_DebugTool/dist/models/IConfig.ts b/Live/CWX_DebugTool/dist/models/IConfig.ts index 29dda5d..2cb6a28 100644 --- a/Live/CWX_DebugTool/dist/models/IConfig.ts +++ b/Live/CWX_DebugTool/dist/models/IConfig.ts @@ -1,40 +1,49 @@ -export interface IConfig +export interface ICwxConfig { showLogs: boolean - globalsConfig: globalsConfig - ragfairConfig: ragfairConfig - locationConfig: locationConfig - inraidConfig: inraidConfig - itemsConfig: itemsConfig + globalsConfig: GlobalsConfig + ragfairConfig: RagfairConfig + locationConfig: LocationConfig + inraidConfig: InraidConfig + itemsConfig: ItemsConfig + airdropConfig: AirdropConfig } -export interface globalsConfig +export interface GlobalsConfig { noFallDamage: boolean openFlea: boolean quickScav: boolean } -export interface ragfairConfig +export interface RagfairConfig { staticTrader: boolean roublesOnly: boolean disableBSGBlacklist: boolean } -export interface locationConfig +export interface LocationConfig { turnLootOff: boolean } -export interface inraidConfig +export interface InraidConfig { turnPVEOff: boolean } -export interface itemsConfig +export interface ItemsConfig { changeShrapProps: boolean changeMaxAmmoForKS23: boolean removeDevFromBlacklist: boolean +} + +export interface AirdropConfig +{ + enableAllTheTime: boolean + changeFlightHeight: boolean + changeStartTime: boolean + changePlaneVolume: boolean } \ No newline at end of file diff --git a/Live/CWX_DebugTool/dist/src/airdropConfig.ts b/Live/CWX_DebugTool/dist/src/airdropConfig.ts new file mode 100644 index 0000000..af7e225 --- /dev/null +++ b/Live/CWX_DebugTool/dist/src/airdropConfig.ts @@ -0,0 +1,70 @@ +import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; + +import{ IAirdropConfig } from "@spt-aki/models/spt/config/IAirdropConfig" + +import { AirdropConfig } from "models/IConfig"; + +import { inject, injectable } from "tsyringe"; +import { CwxConfigHandler } from "./configHandler"; + +@injectable() +export class CwxAirdropConfig +{ + private tables: IAirdropConfig; + private config: AirdropConfig; + + constructor( + @inject("ConfigServer") private configServer: ConfigServer, + @inject("CwxConfigHandler") private configHandler: CwxConfigHandler + ) + {} + + public applyChanges(): void + { + this.config = this.configHandler.getConfig().airdropConfig; + this.tables = this.configServer.getConfig(ConfigTypes.AIRDROP); + + this.enableAllTheTime(); + this.changeFlightHeight(); + this.changeStartTime(); + this.changePlaneVolume(); + } + + private enableAllTheTime(): void + { + if (this.config.enableAllTheTime) + { + for (const i in this.tables.airdropChancePercent) + { + this.tables.airdropChancePercent[i] = 100; + } + } + } + + private changeFlightHeight(): void + { + if (this.config.changeFlightHeight) + { + this.tables.planeMinFlyHeight = 100; + this.tables.planeMaxFlyHeight = 110; + } + } + + private changeStartTime(): void + { + if (this.config.changeStartTime) + { + this.tables.airdropMinStartTimeSeconds = 10; + this.tables.airdropMaxStartTimeSeconds = 20; + } + } + + private changePlaneVolume(): void + { + if (this.config.changePlaneVolume) + { + this.tables.planeVolume = 0.1; + } + } +} \ No newline at end of file diff --git a/Live/CWX_DebugTool/dist/src/configHandler.ts b/Live/CWX_DebugTool/dist/src/configHandler.ts index 08492fe..76311d4 100644 --- a/Live/CWX_DebugTool/dist/src/configHandler.ts +++ b/Live/CWX_DebugTool/dist/src/configHandler.ts @@ -1,17 +1,17 @@ import { injectable } from "tsyringe"; -import { IConfig } from "../models/IConfig"; +import { ICwxConfig } from "../models/IConfig"; @injectable() -export class CWX_ConfigHandler +export class CwxConfigHandler { - private config: IConfig; + private config: ICwxConfig; constructor() { this.config = require("../config/config.json"); } - public getConfig(): IConfig + public getConfig(): ICwxConfig { return this.config; } diff --git a/Live/CWX_DebugTool/dist/src/globalsConfig.ts b/Live/CWX_DebugTool/dist/src/globalsConfig.ts index ab4f3ee..d2c4cd8 100644 --- a/Live/CWX_DebugTool/dist/src/globalsConfig.ts +++ b/Live/CWX_DebugTool/dist/src/globalsConfig.ts @@ -1,18 +1,19 @@ +import { IGlobals } from "@spt-aki/models/eft/common/IGlobals"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { globalsConfig } from "models/IConfig"; +import { GlobalsConfig } from "models/IConfig"; import { inject, injectable } from "tsyringe"; -import { CWX_ConfigHandler } from "./configHandler"; +import { CwxConfigHandler } from "./configHandler"; @injectable() -export class CWX_GlobalsConfig +export class CwxGlobalsConfig { - private tables; - private config: globalsConfig; + private tables: IGlobals; + private config: GlobalsConfig; constructor( @inject("DatabaseServer") private databaseServer: DatabaseServer, - @inject("CWX_ConfigHandler") private configHandler: CWX_ConfigHandler + @inject("CwxConfigHandler") private configHandler: CwxConfigHandler ) {} @@ -21,12 +22,12 @@ export class CWX_GlobalsConfig this.config = this.configHandler.getConfig().globalsConfig; this.tables = this.databaseServer.getTables().globals; - this.NoFallDamage(); - this.OpenFlea(); - this.QuickScav(); + this.noFallDamage(); + this.openFlea(); + this.quickScav(); } - private NoFallDamage(): void + private noFallDamage(): void { if (this.config.noFallDamage) { @@ -35,7 +36,7 @@ export class CWX_GlobalsConfig } } - private OpenFlea(): void + private openFlea(): void { if (this.config.openFlea) { @@ -43,7 +44,7 @@ export class CWX_GlobalsConfig } } - private QuickScav(): void + private quickScav(): void { if (this.config.quickScav) { diff --git a/Live/CWX_DebugTool/dist/src/inraidConfig.ts b/Live/CWX_DebugTool/dist/src/inraidConfig.ts index 903c387..c32960a 100644 --- a/Live/CWX_DebugTool/dist/src/inraidConfig.ts +++ b/Live/CWX_DebugTool/dist/src/inraidConfig.ts @@ -4,18 +4,18 @@ import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { IInRaidConfig } from "@spt-aki/models/spt/config/IInRaidConfig"; -import { CWX_ConfigHandler } from "./configHandler"; -import { inraidConfig } from "models/IConfig"; +import { CwxConfigHandler } from "./configHandler"; +import { InraidConfig } from "models/IConfig"; @injectable() -export class CWX_InraidConfig +export class CwxInraidConfig { private tables: IInRaidConfig; - private config: inraidConfig; + private config: InraidConfig; constructor( @inject("ConfigServer") private configServer: ConfigServer, - @inject("CWX_ConfigHandler") private configHandler: CWX_ConfigHandler + @inject("CwxConfigHandler") private configHandler: CwxConfigHandler ) {} @@ -24,10 +24,10 @@ export class CWX_InraidConfig this.config = this.configHandler.getConfig().inraidConfig; this.tables = this.configServer.getConfig(ConfigTypes.IN_RAID); - this.TurnPVEOff(); + this.turnPVEOff(); } - private TurnPVEOff(): void + private turnPVEOff(): void { if (this.config.turnPVEOff) { diff --git a/Live/CWX_DebugTool/dist/src/itemsConfig.ts b/Live/CWX_DebugTool/dist/src/itemsConfig.ts index 5762e0d..812dc21 100644 --- a/Live/CWX_DebugTool/dist/src/itemsConfig.ts +++ b/Live/CWX_DebugTool/dist/src/itemsConfig.ts @@ -1,24 +1,24 @@ import { inject, injectable } from "tsyringe"; -import { CWX_ConfigHandler } from "./configHandler"; +import { CwxConfigHandler } from "./configHandler"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IItemConfig } from "@spt-aki/models/spt/config/IItemConfig" -import { IConfig } from "models/IConfig"; +import { ItemsConfig } from "models/IConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes"; @injectable() -export class CWX_ItemsConfig +export class CwxItemsConfig { private tables: Record; - private config: IConfig; + private config: ItemsConfig; private itemConfig: IItemConfig; constructor( @inject("DatabaseServer") private databaseServer: DatabaseServer, @inject("ConfigServer") private configServer: ConfigServer, - @inject("CWX_ConfigHandler") private configHandler: CWX_ConfigHandler + @inject("CwxConfigHandler") private configHandler: CwxConfigHandler ) {} @@ -26,7 +26,7 @@ export class CWX_ItemsConfig { this.tables = this.databaseServer.getTables().templates.items; this.itemConfig = this.configServer.getConfig(ConfigTypes.ITEM); - this.config = this.configHandler.getConfig(); + this.config = this.configHandler.getConfig().itemsConfig; this.changeShrapProps(); this.changeMaxAmmoForKS23(); @@ -38,7 +38,7 @@ export class CWX_ItemsConfig { const shrap = this.tables["5e85a9a6eacf8c039e4e2ac1"]; - if (this.config.itemsConfig.changeShrapProps) + if (this.config.changeShrapProps) { shrap._props.Damage = 200; shrap._props.InitialSpeed = 1000; @@ -49,7 +49,7 @@ export class CWX_ItemsConfig { const ks23 = this.tables["5f647d9f8499b57dc40ddb93"]; - if (this.config.itemsConfig.changeMaxAmmoForKS23) + if (this.config.changeMaxAmmoForKS23) { ks23._props.Cartridges[0]._max_count = 30; } @@ -57,7 +57,7 @@ export class CWX_ItemsConfig private removeDevFromBlacklist(): void { - if (this.config.itemsConfig.removeDevFromBlacklist) + if (this.config.removeDevFromBlacklist) { this.itemConfig.blacklist.splice(this.itemConfig.blacklist.indexOf("58ac60eb86f77401897560ff")); } diff --git a/Live/CWX_DebugTool/dist/src/locationConfig.ts b/Live/CWX_DebugTool/dist/src/locationConfig.ts index dbfcaa6..a2932af 100644 --- a/Live/CWX_DebugTool/dist/src/locationConfig.ts +++ b/Live/CWX_DebugTool/dist/src/locationConfig.ts @@ -4,18 +4,18 @@ import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig"; -import { CWX_ConfigHandler } from "./configHandler"; -import { locationConfig } from "models/IConfig"; +import { CwxConfigHandler } from "./configHandler"; +import { LocationConfig } from "models/IConfig"; @injectable() -export class CWX_LocationConfig +export class CwxLocationConfig { private tables: ILocationConfig; - private config: locationConfig; + private config: LocationConfig; constructor( @inject("ConfigServer") private configServer: ConfigServer, - @inject("CWX_ConfigHandler") private configHandler: CWX_ConfigHandler + @inject("CwxConfigHandler") private configHandler: CwxConfigHandler ) {} @@ -24,10 +24,10 @@ export class CWX_LocationConfig this.config = this.configHandler.getConfig().locationConfig; this.tables = this.configServer.getConfig(ConfigTypes.LOCATION); - this.TurnLootOff(); + this.turnLootOff(); } - private TurnLootOff(): void + private turnLootOff(): void { if (this.config.turnLootOff) { diff --git a/Live/CWX_DebugTool/dist/src/logging.ts b/Live/CWX_DebugTool/dist/src/logging.ts index 441fae2..1e93ba9 100644 --- a/Live/CWX_DebugTool/dist/src/logging.ts +++ b/Live/CWX_DebugTool/dist/src/logging.ts @@ -1,47 +1,53 @@ import { SptLogger } from "@spt-aki/models/spt/logging/SptLogger"; -import { IConfig } from "models/IConfig"; +import { ICwxConfig } from "models/IConfig"; import { inject, injectable } from "tsyringe"; -import { CWX_ConfigHandler } from "./configHandler"; +import { CwxConfigHandler } from "./configHandler"; @injectable() -export class CWX_Logging +export class CwxLogging { - private config: IConfig; + private config: ICwxConfig; constructor( @inject("WinstonLogger") private logger: SptLogger, - @inject("CWX_ConfigHandler") private configHandler: CWX_ConfigHandler + @inject("CwxConfigHandler") private configHandler: CwxConfigHandler ) {} - public SendLogging(): void + public sendLogging(): void { this.config = this.configHandler.getConfig(); // globals - this.NoFallDamage(); - this.OpenFlea(); - this.QuickScav(); + this.noFallDamage(); + this.openFlea(); + this.quickScav(); // ragfair - this.StaticTrader(); - this.RoublesOnly(); - this.DisableBSGBlacklist(); + this.staticTrader(); + this.roublesOnly(); + this.disableBSGBlacklist(); // location - this.TurnLootOff(); + this.turnLootOff(); // inraid - this.TurnPVEOff(); + this.turnPVEOff(); // items this.changeShrapProps(); this.changeMaxAmmoForKS23(); this.removeDevFromBlacklist(); + // airdrops + this.enableAllTheTime(); + this.changeFlightHeight(); + this.changeStartTime(); + this.changePlaneVolume(); + } - private NoFallDamage(): void + private noFallDamage(): void { if (this.config.globalsConfig.noFallDamage) { @@ -49,7 +55,7 @@ export class CWX_Logging } } - private OpenFlea(): void + private openFlea(): void { if (this.config.globalsConfig.openFlea) { @@ -57,7 +63,7 @@ export class CWX_Logging } } - private QuickScav(): void + private quickScav(): void { if (this.config.globalsConfig.quickScav) { @@ -65,7 +71,7 @@ export class CWX_Logging } } - private StaticTrader(): void + private staticTrader(): void { if (this.config.ragfairConfig.staticTrader) { @@ -73,7 +79,7 @@ export class CWX_Logging } } - private RoublesOnly(): void + private roublesOnly(): void { if (this.config.ragfairConfig.roublesOnly) { @@ -81,7 +87,7 @@ export class CWX_Logging } } - private DisableBSGBlacklist(): void + private disableBSGBlacklist(): void { if (this.config.ragfairConfig.disableBSGBlacklist) { @@ -89,7 +95,7 @@ export class CWX_Logging } } - private TurnLootOff(): void + private turnLootOff(): void { if (this.config.locationConfig.turnLootOff) { @@ -97,7 +103,7 @@ export class CWX_Logging } } - private TurnPVEOff(): void + private turnPVEOff(): void { if (this.config.inraidConfig.turnPVEOff) { @@ -129,4 +135,35 @@ export class CWX_Logging } } + private enableAllTheTime(): void + { + if (this.config.airdropConfig.enableAllTheTime) + { + this.logger.info("Enable Airdrops All The Time Activated"); + } + } + + private changeFlightHeight(): void + { + if (this.config.airdropConfig.changeFlightHeight) + { + this.logger.info("Change Flight Height Activated"); + } + } + + private changeStartTime(): void + { + if (this.config.airdropConfig.changeStartTime) + { + this.logger.info("Change Start Time Activated"); + } + } + + private changePlaneVolume(): void + { + if (this.config.airdropConfig.changePlaneVolume) + { + this.logger.info("Change Plane Volume Activated"); + } + } } \ No newline at end of file diff --git a/Live/CWX_DebugTool/dist/src/mod.ts b/Live/CWX_DebugTool/dist/src/mod.ts index 774a88a..a565b22 100644 --- a/Live/CWX_DebugTool/dist/src/mod.ts +++ b/Live/CWX_DebugTool/dist/src/mod.ts @@ -1,37 +1,40 @@ import { DependencyContainer, Lifecycle } from "tsyringe"; import { IPostDBLoadMod } from "@spt-aki/models/external/IPostDBLoadMod"; -import { CWX_ConfigHandler } from "./configHandler"; -import { CWX_GlobalsConfig } from "./globalsConfig"; -import { CWX_Logging } from "./logging"; -import { CWX_RagfairConfig } from "./ragfairConfig"; -import { CWX_LocationConfig } from "./locationConfig"; -import { CWX_InraidConfig } from "./inraidConfig"; -import { CWX_ItemsConfig } from "./itemsConfig"; +import { CwxLogging } from "./logging"; +import { CwxConfigHandler } from "./configHandler"; +import { CwxGlobalsConfig } from "./globalsConfig"; +import { CwxRagfairConfig } from "./ragfairConfig"; +import { CwxLocationConfig } from "./locationConfig"; +import { CwxInraidConfig } from "./inraidConfig"; +import { CwxItemsConfig } from "./itemsConfig"; +import { CwxAirdropConfig } from "./airdropConfig"; class CWX_DebugTool implements IPostDBLoadMod { public postDBLoad(container: DependencyContainer): void { - container.register("CWX_ConfigHandler", CWX_ConfigHandler, {lifecycle:Lifecycle.Singleton}) - container.register("CWX_GlobalsConfig", CWX_GlobalsConfig); - container.register("CWX_RagfairConfig", CWX_RagfairConfig); - container.register("CWX_LocationConfig", CWX_LocationConfig); - container.register("CWX_InraidConfig", CWX_InraidConfig); - container.register("CWX_ItemsConfig", CWX_ItemsConfig); - container.register("CWX_Logging", CWX_Logging); + container.register("CwxConfigHandler", CwxConfigHandler, {lifecycle:Lifecycle.Singleton}) + container.register("CwxGlobalsConfig", CwxGlobalsConfig); + container.register("CwxRagfairConfig", CwxRagfairConfig); + container.register("CwxLocationConfig", CwxLocationConfig); + container.register("CwxInraidConfig", CwxInraidConfig); + container.register("CwxItemsConfig", CwxItemsConfig); + container.register("CwxAirdropConfig", CwxAirdropConfig); + container.register("CwxLogging", CwxLogging); - container.resolve("CWX_GlobalsConfig").applyChanges(); - container.resolve("CWX_RagfairConfig").applyChanges(); - container.resolve("CWX_LocationConfig").applyChanges(); - container.resolve("CWX_InraidConfig").applyChanges(); - container.resolve("CWX_ItemsConfig").applyChanges(); + container.resolve("CwxGlobalsConfig").applyChanges(); + container.resolve("CwxRagfairConfig").applyChanges(); + container.resolve("CwxLocationConfig").applyChanges(); + container.resolve("CwxInraidConfig").applyChanges(); + container.resolve("CwxItemsConfig").applyChanges(); + container.resolve("CwxAirdropConfig").applyChanges(); - if (container.resolve("CWX_ConfigHandler").getConfig().showLogs) + if (container.resolve("CwxConfigHandler").getConfig().showLogs) { - container.resolve("CWX_Logging").SendLogging(); + container.resolve("CwxLogging").sendLogging(); } } } diff --git a/Live/CWX_DebugTool/dist/src/ragfairConfig.ts b/Live/CWX_DebugTool/dist/src/ragfairConfig.ts index 819ecfb..a02a627 100644 --- a/Live/CWX_DebugTool/dist/src/ragfairConfig.ts +++ b/Live/CWX_DebugTool/dist/src/ragfairConfig.ts @@ -4,18 +4,18 @@ import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; -import { CWX_ConfigHandler } from "./configHandler"; -import { ragfairConfig } from "models/IConfig"; +import { CwxConfigHandler } from "./configHandler"; +import { RagfairConfig } from "models/IConfig"; @injectable() -export class CWX_RagfairConfig +export class CwxRagfairConfig { private tables: IRagfairConfig; - private config: ragfairConfig; + private config: RagfairConfig; constructor( @inject("ConfigServer") private configServer: ConfigServer, - @inject("CWX_ConfigHandler") private configHandler: CWX_ConfigHandler + @inject("CwxConfigHandler") private configHandler: CwxConfigHandler ) {} @@ -24,12 +24,12 @@ export class CWX_RagfairConfig this.config = this.configHandler.getConfig().ragfairConfig; this.tables = this.configServer.getConfig(ConfigTypes.RAGFAIR); - this.StaticTrader(); - this.RoublesOnly(); - this.DisableBSGBlacklist(); + this.staticTrader(); + this.roublesOnly(); + this.disableBSGBlacklist(); } - private StaticTrader(): void + private staticTrader(): void { if (this.config.staticTrader) { @@ -37,7 +37,7 @@ export class CWX_RagfairConfig } } - private RoublesOnly(): void + private roublesOnly(): void { if (this.config.roublesOnly) { @@ -47,7 +47,7 @@ export class CWX_RagfairConfig } } - private DisableBSGBlacklist(): void + private disableBSGBlacklist(): void { if (this.config.disableBSGBlacklist) { diff --git a/Live/CWX_DebugTool/dist/types/ErrorHandler.d.ts b/Live/CWX_DebugTool/dist/types/ErrorHandler.d.ts new file mode 100644 index 0000000..69b0bcd --- /dev/null +++ b/Live/CWX_DebugTool/dist/types/ErrorHandler.d.ts @@ -0,0 +1,6 @@ +export declare class ErrorHandler { + private logger; + private readLine; + constructor(); + handleCriticalError(err: any): void; +} diff --git a/Live/CWX_DebugTool/dist/types/Program.d.ts b/Live/CWX_DebugTool/dist/types/Program.d.ts index d4b71b9..afe5216 100644 --- a/Live/CWX_DebugTool/dist/types/Program.d.ts +++ b/Live/CWX_DebugTool/dist/types/Program.d.ts @@ -1,4 +1,5 @@ export declare class Program { + private errorHandler; constructor(); start(): void; } diff --git a/Live/CWX_DebugTool/dist/types/callbacks/BundleCallbacks.d.ts b/Live/CWX_DebugTool/dist/types/callbacks/BundleCallbacks.d.ts index b28abe1..b7e1703 100644 --- a/Live/CWX_DebugTool/dist/types/callbacks/BundleCallbacks.d.ts +++ b/Live/CWX_DebugTool/dist/types/callbacks/BundleCallbacks.d.ts @@ -1,17 +1,17 @@ import { BundleLoader } from "../loaders/BundleLoader"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; -import { IHttpServer } from "../models/spt/server/IHttpServer"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { HttpFileUtil } from "../utils/HttpFileUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class BundleCallbacks { protected logger: ILogger; protected httpResponse: HttpResponseUtil; - protected httpServer: IHttpServer; + protected httpFileUtil: HttpFileUtil; protected bundleLoader: BundleLoader; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; - constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpServer: IHttpServer, bundleLoader: BundleLoader, configServer: ConfigServer); + constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); sendBundle(sessionID: string, req: any, resp: any, body: any): any; getBundles(url: string, info: any, sessionID: string): string; getBundle(url: string, info: any, sessionID: string): string; diff --git a/Live/CWX_DebugTool/dist/types/callbacks/HttpCallbacks.d.ts b/Live/CWX_DebugTool/dist/types/callbacks/HttpCallbacks.d.ts index 94c97bd..43928a1 100644 --- a/Live/CWX_DebugTool/dist/types/callbacks/HttpCallbacks.d.ts +++ b/Live/CWX_DebugTool/dist/types/callbacks/HttpCallbacks.d.ts @@ -1,8 +1,8 @@ import { OnLoad } from "../di/OnLoad"; -import { IHttpServer } from "../models/spt/server/IHttpServer"; +import { HttpServer } from "../servers/HttpServer"; export declare class HttpCallbacks extends OnLoad { - protected httpServer: IHttpServer; - constructor(httpServer: IHttpServer); + protected httpServer: HttpServer; + constructor(httpServer: HttpServer); onLoad(): void; getRoute(): string; getImage(): string; diff --git a/Live/CWX_DebugTool/dist/types/callbacks/ModCallbacks.d.ts b/Live/CWX_DebugTool/dist/types/callbacks/ModCallbacks.d.ts index 58342dc..aec2f59 100644 --- a/Live/CWX_DebugTool/dist/types/callbacks/ModCallbacks.d.ts +++ b/Live/CWX_DebugTool/dist/types/callbacks/ModCallbacks.d.ts @@ -1,18 +1,18 @@ import { OnLoad } from "../di/OnLoad"; import { PostAkiModLoader } from "../loaders/PostAkiModLoader"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; -import { IHttpServer } from "../models/spt/server/IHttpServer"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { HttpFileUtil } from "../utils/HttpFileUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; declare class ModCallbacks extends OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; - protected httpServer: IHttpServer; + protected httpFileUtil: HttpFileUtil; protected postAkiModLoader: PostAkiModLoader; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; - constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpServer: IHttpServer, postAkiModLoader: PostAkiModLoader, configServer: ConfigServer); + constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, postAkiModLoader: PostAkiModLoader, configServer: ConfigServer); onLoad(): void; getRoute(): string; sendBundle(sessionID: string, req: any, resp: any, body: any): void; diff --git a/Live/CWX_DebugTool/dist/types/controllers/DialogueController.d.ts b/Live/CWX_DebugTool/dist/types/controllers/DialogueController.d.ts index b15c4b6..1b72522 100644 --- a/Live/CWX_DebugTool/dist/types/controllers/DialogueController.d.ts +++ b/Live/CWX_DebugTool/dist/types/controllers/DialogueController.d.ts @@ -2,24 +2,77 @@ import { DialogueHelper } from "../helpers/DialogueHelper"; import { IGetAllAttachmentsResponse } from "../models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetFriendListDataResponse } from "../models/eft/dialog/IGetFriendListDataResponse"; import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDialogViewResponseData"; -import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { DialogueInfo, Message } from "../models/eft/profile/IAkiProfile"; import { SaveServer } from "../servers/SaveServer"; -import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { TimeUtil } from "../utils/TimeUtil"; export declare class DialogueController { - protected httpResponse: HttpResponseUtil; protected saveServer: SaveServer; + protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - constructor(httpResponse: HttpResponseUtil, saveServer: SaveServer, dialogueHelper: DialogueHelper); + constructor(saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper); + update(): void; getFriendList(sessionID: string): IGetFriendListDataResponse; - generateDialogueList(sessionID: string): IGetBodyResponseData; + /** + * Create array holding trader dialogs and mail interactions with player + * Set the content of the dialogue on the list tab. + * @param sessionID Session Id + * @returns array of dialogs + */ + generateDialogueList(sessionID: string): DialogueInfo[]; + /** + * Get the content of a dialogue + * @param dialogueID Dialog id + * @param sessionID Session Id + * @returns + */ getDialogueInfo(dialogueID: string, sessionID: string): DialogueInfo; + /** + * Set the content of the dialogue on the details panel, showing all the messages + * for the specified dialogue. + * @param dialogueID Dialog id + * @param sessionID Session id + * @returns IGetMailDialogViewResponseData object + */ generateDialogueView(dialogueID: string, sessionID: string): IGetMailDialogViewResponseData; + /** + * Get a count of messages with attachments from a particular dialog + * @param sessionID Session id + * @param dialogueID Dialog id + * @returns Count of messages with attachments + */ + protected getUnreadMessagesWithAttachmentsCount(sessionID: string, dialogueID: string): number; + /** + * Does array have messages with uncollected rewards (includes expired rewards) + * @param messages Messages to check + * @returns true if uncollected rewards found + */ + protected messagesHaveUncollectedRewards(messages: Message[]): boolean; removeDialogue(dialogueID: string, sessionID: string): void; setDialoguePin(dialogueID: string, shouldPin: boolean, sessionID: string): void; setRead(dialogueIDs: string[], sessionID: string): void; + /** + * Get all uncollected items attached to mail in a particular dialog + * @param dialogueID Dialog to get mail attachments from + * @param sessionID Session id + * @returns + */ getAllAttachments(dialogueID: string, sessionID: string): IGetAllAttachmentsResponse; - protected messagesHaveUncollectedRewards(messages: Message[]): boolean; + /** + * Get messages from a specific dialog that have items not expired + * @param sessionId Session id + * @param dialogueId Dialog to get mail attachments from + * @returns Message array + */ + protected getActiveMessagesFromDialog(sessionId: string, dialogueId: string): Message[]; + /** + * Return array of messages with uncollected items (includes expired) + * @param messages Messages to parse + * @returns messages with items to collect + */ + protected getMessagesWithAttachments(messages: Message[]): Message[]; + /** + * Delete expired items. triggers when updating traders. + * @param sessionID Session id + */ protected removeExpiredItems(sessionID: string): void; - update(): void; } diff --git a/Live/CWX_DebugTool/dist/types/controllers/MatchController.d.ts b/Live/CWX_DebugTool/dist/types/controllers/MatchController.d.ts index 07f6a89..dac6a3f 100644 --- a/Live/CWX_DebugTool/dist/types/controllers/MatchController.d.ts +++ b/Live/CWX_DebugTool/dist/types/controllers/MatchController.d.ts @@ -9,6 +9,7 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; +import { BotDifficulty } from "../models/enums/BotDifficulty"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; @@ -44,5 +45,11 @@ export declare class MatchController { protected getMatch(location: string): any; getGroupStatus(info: IGetGroupStatusRequestData): any; startOfflineRaid(info: IStartOfflineRaidRequestData, sessionID: string): void; + /** + * Convert a difficulty value from pre-raid screen to a bot difficulty + * @param botDifficulty dropdown difficulty + * @returns bot difficulty + */ + protected convertDifficultyDropdownIntoBotDifficulty(botDifficulty: BotDifficulty): string; endOfflineRaid(info: IEndOfflineRaidRequestData, sessionID: string): void; } diff --git a/Live/CWX_DebugTool/dist/types/controllers/RagfairController.d.ts b/Live/CWX_DebugTool/dist/types/controllers/RagfairController.d.ts index 06af740..fe1f472 100644 --- a/Live/CWX_DebugTool/dist/types/controllers/RagfairController.d.ts +++ b/Live/CWX_DebugTool/dist/types/controllers/RagfairController.d.ts @@ -12,6 +12,7 @@ import { RagfairTaxHelper } from "../helpers/RagfairTaxHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Item } from "../models/eft/common/tables/IItem"; +import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { IAddOfferRequestData, Requirement } from "../models/eft/ragfair/IAddOfferRequestData"; @@ -65,6 +66,35 @@ export declare class RagfairController { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult; + /** + * Get offers for the client based on type of search being performed + * @param searchRequest Client search request data + * @param itemsToAdd + * @param assorts + * @param pmcProfile Player profile + * @returns array of offers + */ + protected getOffersForSearchType(searchRequest: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Get categories for the type of search being performed, linked/required/all + * @param searchRequest Client search request data + * @param offers ragfair offers to get categories for + * @returns record with tpls + counts + */ + protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; + /** + * Add Required offers to offers result + * @param searchRequest Client search request data + * @param assorts + * @param pmcProfile Player profile + * @param result Result object being sent back to client + */ + protected addRequiredOffersToResult(searchRequest: ISearchRequestData, assorts: Record, pmcProfile: IPmcData, result: IGetOffersResult): void; + /** + * Add index to all offers passed in (0-indexed) + * @param offers Offers to add index value to + */ + protected addIndexValueToOffers(offers: IRagfairOffer[]): void; /** * Update a trader flea offer with buy restrictions stored in the traders assort * @param offer flea offer to update diff --git a/Live/CWX_DebugTool/dist/types/di/Container.d.ts b/Live/CWX_DebugTool/dist/types/di/Container.d.ts index 98d1fa1..e339a3b 100644 --- a/Live/CWX_DebugTool/dist/types/di/Container.d.ts +++ b/Live/CWX_DebugTool/dist/types/di/Container.d.ts @@ -3,6 +3,7 @@ import { DependencyContainer } from "tsyringe"; * Handle the registration of classes to be used by the Dependency Injection code */ export declare class Container { + static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; diff --git a/Live/CWX_DebugTool/dist/types/di/Serializer.d.ts b/Live/CWX_DebugTool/dist/types/di/Serializer.d.ts index 70aa7c5..2617007 100644 --- a/Live/CWX_DebugTool/dist/types/di/Serializer.d.ts +++ b/Live/CWX_DebugTool/dist/types/di/Serializer.d.ts @@ -1,5 +1,6 @@ -import { IHttpServer } from "../models/spt/server/IHttpServer"; +/// +import { IncomingMessage, ServerResponse } from "http"; export declare class Serializer { - serialize(sessionID: string, req: any, resp: any, body: any, httpServer: IHttpServer): void; + serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void; canHandle(something: string): boolean; } diff --git a/Live/CWX_DebugTool/dist/types/generators/LootGenerator.d.ts b/Live/CWX_DebugTool/dist/types/generators/LootGenerator.d.ts index bbc1915..66056c2 100644 --- a/Live/CWX_DebugTool/dist/types/generators/LootGenerator.d.ts +++ b/Live/CWX_DebugTool/dist/types/generators/LootGenerator.d.ts @@ -48,11 +48,12 @@ export declare class LootGenerator { * Find a random item in items.json and add to result array * @param globalDefaultPresets presets to choose from * @param itemTypeCounts item limit counts + * @param itemBlacklist items to skip * @param result array to add found preset to * @returns true if preset was valid and added to pool */ protected findAndAddRandomPresetToLoot(globalDefaultPresets: [string, Preset][], itemTypeCounts: Record, result: LootItem[]): boolean; + }>, itemBlacklist: string[], result: LootItem[]): boolean; } diff --git a/Live/CWX_DebugTool/dist/types/generators/RagfairOfferGenerator.d.ts b/Live/CWX_DebugTool/dist/types/generators/RagfairOfferGenerator.d.ts index 317cd6b..0dc2d61 100644 --- a/Live/CWX_DebugTool/dist/types/generators/RagfairOfferGenerator.d.ts +++ b/Live/CWX_DebugTool/dist/types/generators/RagfairOfferGenerator.d.ts @@ -39,6 +39,13 @@ export declare class RagfairOfferGenerator { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; + /** + * Convert a count of currency into roubles + * @param currencyCount amount of currency to convert into roubles + * @param currencyType Type of currency (euro/dollar/rouble) + * @returns count of roubles + */ + protected calculateRoublePrice(currencyCount: number, currencyType: string): number; protected getTraderId(userID: string): string; protected getRating(userID: string): number; /** diff --git a/Live/CWX_DebugTool/dist/types/helpers/BotHelper.d.ts b/Live/CWX_DebugTool/dist/types/helpers/BotHelper.d.ts index 18738e5..67a6384 100644 --- a/Live/CWX_DebugTool/dist/types/helpers/BotHelper.d.ts +++ b/Live/CWX_DebugTool/dist/types/helpers/BotHelper.d.ts @@ -33,6 +33,12 @@ export declare class BotHelper { * @returns Difficulty object */ getPmcDifficultySettings(type: string, difficulty: string): Difficulty; + /** + * Translate chosen value from pre-raid difficulty dropdown into bot difficulty value + * @param dropDownDifficulty Dropdown difficulty value to convert + * @returns bot difficulty + */ + convertBotDifficultyDropdownToBotDifficulty(dropDownDifficulty: string): string; /** * Choose a random difficulty from - easy/normal/hard/impossible * @returns random difficulty diff --git a/Live/CWX_DebugTool/dist/types/helpers/DialogueHelper.d.ts b/Live/CWX_DebugTool/dist/types/helpers/DialogueHelper.d.ts index e3e2bda..d2be04d 100644 --- a/Live/CWX_DebugTool/dist/types/helpers/DialogueHelper.d.ts +++ b/Live/CWX_DebugTool/dist/types/helpers/DialogueHelper.d.ts @@ -34,7 +34,8 @@ export declare class DialogueHelper { * Get the item contents for a particular message. * @param messageID * @param sessionID + * @param itemId Item being moved to inventory * @returns */ - getMessageItemContents(messageID: string, sessionID: string): Item[]; + getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[]; } diff --git a/Live/CWX_DebugTool/dist/types/helpers/NotificationSendHelper.d.ts b/Live/CWX_DebugTool/dist/types/helpers/NotificationSendHelper.d.ts index 34e62d9..6c56006 100644 --- a/Live/CWX_DebugTool/dist/types/helpers/NotificationSendHelper.d.ts +++ b/Live/CWX_DebugTool/dist/types/helpers/NotificationSendHelper.d.ts @@ -1,10 +1,10 @@ import { INotification } from "../models/eft/notifier/INotifier"; -import { IHttpServer } from "../models/spt/server/IHttpServer"; +import { HttpServer } from "../servers/HttpServer"; import { NotificationService } from "../services/NotificationService"; export declare class NotificationSendHelper { - protected httpServer: IHttpServer; + protected httpServer: HttpServer; protected notificationService: NotificationService; - constructor(httpServer: IHttpServer, notificationService: NotificationService); + constructor(httpServer: HttpServer, notificationService: NotificationService); /** * Send notification message to the appropiate channel */ diff --git a/Live/CWX_DebugTool/dist/types/helpers/RagfairOfferHelper.d.ts b/Live/CWX_DebugTool/dist/types/helpers/RagfairOfferHelper.d.ts index e9d72ca..ea13aae 100644 --- a/Live/CWX_DebugTool/dist/types/helpers/RagfairOfferHelper.d.ts +++ b/Live/CWX_DebugTool/dist/types/helpers/RagfairOfferHelper.d.ts @@ -48,6 +48,12 @@ export declare class RagfairOfferHelper { constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Get an array of flea offers that are inaccessible to player due to their inadequate loyalty level + * @param offers Offers to check + * @param pmcProfile Players profile with trader loyalty levels + */ + protected getLoyaltyLockedOffers(offers: IRagfairOffer[], pmcProfile: IPmcData): string[]; processOffersOnProfile(sessionID: string): boolean; protected getProfileOffers(sessionID: string): IRagfairOffer[]; protected deleteOfferByOfferId(sessionID: string, offerId: string): void; diff --git a/Live/CWX_DebugTool/dist/types/helpers/RagfairSortHelper.d.ts b/Live/CWX_DebugTool/dist/types/helpers/RagfairSortHelper.d.ts index d20e10c..28d1d38 100644 --- a/Live/CWX_DebugTool/dist/types/helpers/RagfairSortHelper.d.ts +++ b/Live/CWX_DebugTool/dist/types/helpers/RagfairSortHelper.d.ts @@ -1,14 +1,28 @@ import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; +import { RagfairSort } from "../models/enums/RagfairSort"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; export declare class RagfairSortHelper { protected databaseServer: DatabaseServer; protected localeService: LocaleService; constructor(databaseServer: DatabaseServer, localeService: LocaleService); - sortOffers(offers: IRagfairOffer[], type: number, direction?: number): IRagfairOffer[]; + /** + * Sort a list of ragfair offers by something (id/rating/offer name/price/expirty time) + * @param offers Offers to sort + * @param type How to sort it + * @param direction Ascending/descending + * @returns Sorted offers + */ + sortOffers(offers: IRagfairOffer[], type: RagfairSort, direction?: number): IRagfairOffer[]; protected sortOffersByID(a: IRagfairOffer, b: IRagfairOffer): number; protected sortOffersByRating(a: IRagfairOffer, b: IRagfairOffer): number; protected sortOffersByName(a: IRagfairOffer, b: IRagfairOffer): number; + /** + * Order two offers by price value + * @param a Offer a + * @param b Offer b + * @returns + */ protected sortOffersByPrice(a: IRagfairOffer, b: IRagfairOffer): number; protected sortOffersByExpiry(a: IRagfairOffer, b: IRagfairOffer): number; } diff --git a/Live/CWX_DebugTool/dist/types/loaders/PreAkiModLoader.d.ts b/Live/CWX_DebugTool/dist/types/loaders/PreAkiModLoader.d.ts index 4ab1689..7a687a5 100644 --- a/Live/CWX_DebugTool/dist/types/loaders/PreAkiModLoader.d.ts +++ b/Live/CWX_DebugTool/dist/types/loaders/PreAkiModLoader.d.ts @@ -9,6 +9,9 @@ import { ModCompilerService } from "../services/ModCompilerService"; import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; import { BundleLoader } from "./BundleLoader"; +import { IPostAkiLoadMod } from "../models/external/IPostAkiLoadMod"; +import { IPreAkiLoadMod } from "../models/external/IPreAkiLoadMod"; +import { IPostDBLoadMod } from "../models/external/IPostDBLoadMod"; export declare class PreAkiModLoader implements IModLoader { protected logger: ILogger; protected vfs: VFS; @@ -56,12 +59,26 @@ export declare class PreAkiModLoader implements IModLoader { */ protected getModsPackageData(mods: string[]): Record; /** - * Does mod have "delayedLoad(" string in its entry class - * @param modFolderName folder name - * @param modToValidate package.json details + * Use defined safe guard to check if the mod is a IPreAkiLoadMod * @returns boolean */ - protected isModSpt3XXCompatible(modFolderName: string, modToValidate: IPackageJsonData): boolean; + protected isPreAkiLoad(mod: any): mod is IPreAkiLoadMod; + /** + * Use defined safe guard to check if the mod is a IPostAkiLoadMod + * @returns boolean + */ + protected isPostAkiLoad(mod: any): mod is IPostAkiLoadMod; + /** + * Use defined safe guard to check if the mod is a IPostDBLoadMod + * @returns boolean + */ + protected isPostDBAkiLoad(mod: any): mod is IPostDBLoadMod; + /** + * Check that the mod is compatible with SPT 3.X.X + * @param mod the mod to check + * @returns boolean + */ + protected isModSpt3XXCompatible(mod: any): boolean; protected isModCombatibleWithAki(mod: IPackageJsonData): boolean; protected executeMods(container: DependencyContainer): void; sortModsLoadOrder(): string[]; diff --git a/Live/CWX_DebugTool/dist/types/models/eft/common/tables/IBotBase.d.ts b/Live/CWX_DebugTool/dist/types/models/eft/common/tables/IBotBase.d.ts index 25cb861..1c28ae0 100644 --- a/Live/CWX_DebugTool/dist/types/models/eft/common/tables/IBotBase.d.ts +++ b/Live/CWX_DebugTool/dist/types/models/eft/common/tables/IBotBase.d.ts @@ -341,6 +341,7 @@ export interface RagfairInfo { offers: IRagfairOffer[]; } export interface Bonus { + id?: string; type: string; templateId?: string; passive?: boolean; @@ -348,6 +349,8 @@ export interface Bonus { visible?: boolean; value?: number; icon?: string; + filter?: string[]; + skillType?: string; } export interface Note { Time: number; diff --git a/Live/CWX_DebugTool/dist/types/models/eft/ragfair/IRagfairOffer.d.ts b/Live/CWX_DebugTool/dist/types/models/eft/ragfair/IRagfairOffer.d.ts index 141b605..3251a37 100644 --- a/Live/CWX_DebugTool/dist/types/models/eft/ragfair/IRagfairOffer.d.ts +++ b/Live/CWX_DebugTool/dist/types/models/eft/ragfair/IRagfairOffer.d.ts @@ -9,6 +9,7 @@ export interface IRagfairOffer { intId: number; itemsCost: number; requirementsCost: number; + sptRequirementsCostRouble: number; startTime: number; endTime: number; sellInOnePiece: boolean; diff --git a/Live/CWX_DebugTool/dist/types/models/eft/ragfair/ISearchRequestData.d.ts b/Live/CWX_DebugTool/dist/types/models/eft/ragfair/ISearchRequestData.d.ts index 08e7fd3..56d093b 100644 --- a/Live/CWX_DebugTool/dist/types/models/eft/ragfair/ISearchRequestData.d.ts +++ b/Live/CWX_DebugTool/dist/types/models/eft/ragfair/ISearchRequestData.d.ts @@ -1,7 +1,8 @@ +import { RagfairSort } from "../../enums/RagfairSort"; export interface ISearchRequestData { page: number; limit: number; - sortType: number; + sortType: RagfairSort; sortDirection: number; currency: number; priceFrom: number; diff --git a/Live/CWX_DebugTool/dist/types/models/enums/RagfairSort.d.ts b/Live/CWX_DebugTool/dist/types/models/enums/RagfairSort.d.ts new file mode 100644 index 0000000..798a5e7 --- /dev/null +++ b/Live/CWX_DebugTool/dist/types/models/enums/RagfairSort.d.ts @@ -0,0 +1,7 @@ +export declare enum RagfairSort { + ID = 0, + RATING = 3, + OFFER_TITLE = 4, + PRICE = 5, + EXPIRY = 6 +} diff --git a/Live/CWX_DebugTool/dist/types/models/external/HttpFramework.d.ts b/Live/CWX_DebugTool/dist/types/models/external/HttpFramework.d.ts new file mode 100644 index 0000000..3b4a56a --- /dev/null +++ b/Live/CWX_DebugTool/dist/types/models/external/HttpFramework.d.ts @@ -0,0 +1,33 @@ +/// +import { IncomingMessage, ServerResponse } from "http"; +export declare type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) => void; +/** + * Associates handlers, HTTP methods and a base url to a listener using a proxy + * @param basePath The base path + * @returns The decorator that create the listener proxy + */ +export declare const Listen: (basePath: string) => any>(Base: T) => T; +/** + * HTTP DELETE decorator + */ +export declare const Delete: (path?: string) => (target: any, propertyKey: string) => void; +/** + * HTTP GET decorator + */ +export declare const Get: (path?: string) => (target: any, propertyKey: string) => void; +/** + * HTTP OPTIONS decorator + */ +export declare const Options: (path?: string) => (target: any, propertyKey: string) => void; +/** + * HTTP PATCH decorator + */ +export declare const Patch: (path?: string) => (target: any, propertyKey: string) => void; +/** + * HTTP POST decorator + */ +export declare const Post: (path?: string) => (target: any, propertyKey: string) => void; +/** + * HTTP PUT decorator + */ +export declare const Put: (path?: string) => (target: any, propertyKey: string) => void; diff --git a/Live/CWX_DebugTool/dist/types/models/spt/config/IHttpConfig.d.ts b/Live/CWX_DebugTool/dist/types/models/spt/config/IHttpConfig.d.ts index c41d035..3fe4787 100644 --- a/Live/CWX_DebugTool/dist/types/models/spt/config/IHttpConfig.d.ts +++ b/Live/CWX_DebugTool/dist/types/models/spt/config/IHttpConfig.d.ts @@ -1,5 +1,6 @@ import { IBaseConfig } from "./IBaseConfig"; export interface IHttpConfig extends IBaseConfig { + webSocketPingDelayMs: number; kind: "aki-http"; ip: string; port: number; diff --git a/Live/CWX_DebugTool/dist/types/routers/ImageRouter.d.ts b/Live/CWX_DebugTool/dist/types/routers/ImageRouter.d.ts index ab03977..675441c 100644 --- a/Live/CWX_DebugTool/dist/types/routers/ImageRouter.d.ts +++ b/Live/CWX_DebugTool/dist/types/routers/ImageRouter.d.ts @@ -1,13 +1,14 @@ /// import { IncomingMessage, ServerResponse } from "http"; -import { IHttpServer } from "../models/spt/server/IHttpServer"; import { ImageRouteService } from "../services/mod/image/ImageRouteService"; +import { HttpFileUtil } from "../utils/HttpFileUtil"; import { VFS } from "../utils/VFS"; export declare class ImageRouter { protected vfs: VFS; protected imageRouteService: ImageRouteService; - constructor(vfs: VFS, imageRouteService: ImageRouteService); + protected httpFileUtil: HttpFileUtil; + constructor(vfs: VFS, imageRouteService: ImageRouteService, httpFileUtil: HttpFileUtil); addRoute(key: string, valueToAdd: string): void; - sendImage(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any, httpServer: IHttpServer): void; + sendImage(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void; getImage(): string; } diff --git a/Live/CWX_DebugTool/dist/types/routers/serializers/BundleSerializer.d.ts b/Live/CWX_DebugTool/dist/types/routers/serializers/BundleSerializer.d.ts index 912db83..ca4d8b6 100644 --- a/Live/CWX_DebugTool/dist/types/routers/serializers/BundleSerializer.d.ts +++ b/Live/CWX_DebugTool/dist/types/routers/serializers/BundleSerializer.d.ts @@ -1,11 +1,14 @@ +/// +import { IncomingMessage, ServerResponse } from "http"; import { Serializer } from "../../di/Serializer"; import { BundleLoader } from "../../loaders/BundleLoader"; -import { IHttpServer } from "../../models/spt/server/IHttpServer"; import { ILogger } from "../../models/spt/utils/ILogger"; +import { HttpFileUtil } from "../../utils/HttpFileUtil"; export declare class BundleSerializer extends Serializer { protected logger: ILogger; protected bundleLoader: BundleLoader; - constructor(logger: ILogger, bundleLoader: BundleLoader); - serialize(sessionID: string, req: any, resp: any, body: any, httpServer: IHttpServer): void; + protected httpFileUtil: HttpFileUtil; + constructor(logger: ILogger, bundleLoader: BundleLoader, httpFileUtil: HttpFileUtil); + serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void; canHandle(route: string): boolean; } diff --git a/Live/CWX_DebugTool/dist/types/routers/serializers/ImageSerializer.d.ts b/Live/CWX_DebugTool/dist/types/routers/serializers/ImageSerializer.d.ts index 0e040d4..7f15bcf 100644 --- a/Live/CWX_DebugTool/dist/types/routers/serializers/ImageSerializer.d.ts +++ b/Live/CWX_DebugTool/dist/types/routers/serializers/ImageSerializer.d.ts @@ -1,9 +1,10 @@ -import { IHttpServer } from "../../models/spt/server/IHttpServer"; +/// import { Serializer } from "../../di/Serializer"; import { ImageRouter } from "../ImageRouter"; +import { IncomingMessage, ServerResponse } from "http"; export declare class ImageSerializer extends Serializer { protected imageRouter: ImageRouter; constructor(imageRouter: ImageRouter); - serialize(sessionID: string, req: any, resp: any, body: any, httpServer: IHttpServer): void; + serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void; canHandle(route: string): boolean; } diff --git a/Live/CWX_DebugTool/dist/types/routers/serializers/NotifySerializer.d.ts b/Live/CWX_DebugTool/dist/types/routers/serializers/NotifySerializer.d.ts index 1779ac9..0d8cc89 100644 --- a/Live/CWX_DebugTool/dist/types/routers/serializers/NotifySerializer.d.ts +++ b/Live/CWX_DebugTool/dist/types/routers/serializers/NotifySerializer.d.ts @@ -1,11 +1,12 @@ +/// +import { IncomingMessage, ServerResponse } from "http"; import { NotifierController } from "../../controllers/NotifierController"; import { Serializer } from "../../di/Serializer"; import { HttpServerHelper } from "../../helpers/HttpServerHelper"; -import { IHttpServer } from "../../models/spt/server/IHttpServer"; export declare class NotifySerializer extends Serializer { protected notifierController: NotifierController; protected httpServerHelper: HttpServerHelper; constructor(notifierController: NotifierController, httpServerHelper: HttpServerHelper); - serialize(_sessionID: string, req: any, resp: any, body: any, httpServer: IHttpServer): void; + serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void; canHandle(route: string): boolean; } diff --git a/Live/CWX_DebugTool/dist/types/servers/HttpServer.d.ts b/Live/CWX_DebugTool/dist/types/servers/HttpServer.d.ts index 44d802b..f572a8f 100644 --- a/Live/CWX_DebugTool/dist/types/servers/HttpServer.d.ts +++ b/Live/CWX_DebugTool/dist/types/servers/HttpServer.d.ts @@ -1,51 +1,34 @@ /// -/// -import http, { ServerResponse } from "http"; +import http, { IncomingMessage, ServerResponse } from "http"; +import WebSocket from "ws"; import { ApplicationContext } from "../context/ApplicationContext"; -import { Serializer } from "../di/Serializer"; import { HttpServerHelper } from "../helpers/HttpServerHelper"; import { NotifierHelper } from "../helpers/NotifierHelper"; import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; -import { IHttpServer } from "../models/spt/server/IHttpServer"; import { ILogger } from "../models/spt/utils/ILogger"; -import { HttpRouter } from "../routers/HttpRouter"; -import { HttpResponseUtil } from "../utils/HttpResponseUtil"; -import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; import { DatabaseServer } from "./DatabaseServer"; -export declare class HttpServer implements IHttpServer { - protected httpRouter: HttpRouter; +import { IHttpListener } from "./http/IHttpListener"; +export declare class HttpServer { protected logger: ILogger; protected randomUtil: RandomUtil; - protected jsonUtil: JsonUtil; - protected httpResponse: HttpResponseUtil; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; protected httpServerHelper: HttpServerHelper; - protected serializers: Serializer[]; + protected httpListeners: IHttpListener[]; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; - constructor(httpRouter: HttpRouter, // TODO: delay required - logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, httpServerHelper: HttpServerHelper, serializers: Serializer[], configServer: ConfigServer, applicationContext: ApplicationContext); - protected buffers: {}; - protected onReceive: {}; - protected onRespond: {}; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext); protected httpConfig: IHttpConfig; protected webSockets: {}; protected websocketPingHandler: any; getCookies(req: http.IncomingMessage): any; - resetBuffer(sessionID: string): void; - putInBuffer(sessionID: any, data: any, bufLength: number): boolean; - getFromBuffer(sessionID: string): any; - sendZlibJson(resp: any, output: any, sessionID: string): void; sendMessage(sessionID: string, output: INotification): void; - sendFile(resp: ServerResponse, file: any): void; isConnectionWebSocket(sessionID: string): boolean; - sendResponse(sessionID: string, req: any, resp: any, body: Buffer): void; - handleRequest(req: http.IncomingMessage, resp: http.ServerResponse): void; + handleRequest(req: IncomingMessage, resp: ServerResponse): void; load(): void; protected getRandomisedMessage(): string; - wsOnConnection(ws: any, req: any): void; + protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; } diff --git a/Live/CWX_DebugTool/dist/types/servers/http/AkiHttpListener.d.ts b/Live/CWX_DebugTool/dist/types/servers/http/AkiHttpListener.d.ts new file mode 100644 index 0000000..6f78939 --- /dev/null +++ b/Live/CWX_DebugTool/dist/types/servers/http/AkiHttpListener.d.ts @@ -0,0 +1,26 @@ +/// +/// +import { IncomingMessage, ServerResponse } from "http"; +import { IHttpListener } from "./IHttpListener"; +import { Serializer } from "../../di/Serializer"; +import { ILogger } from "../../models/spt/utils/ILogger"; +import { HttpRouter } from "../../routers/HttpRouter"; +import { HttpResponseUtil } from "../../utils/HttpResponseUtil"; +import { JsonUtil } from "../../utils/JsonUtil"; +import { HttpBufferHandler } from "./HttpBufferHandler"; +export declare class AkiHttpListener implements IHttpListener { + protected httpRouter: HttpRouter; + protected serializers: Serializer[]; + protected logger: ILogger; + protected jsonUtil: JsonUtil; + protected httpResponse: HttpResponseUtil; + protected httpBufferHandler: HttpBufferHandler; + constructor(httpRouter: HttpRouter, // TODO: delay required + serializers: Serializer[], logger: ILogger, jsonUtil: JsonUtil, httpResponse: HttpResponseUtil, httpBufferHandler: HttpBufferHandler); + canHandle(_: string, req: IncomingMessage): boolean; + handle(sessionId: string, req: IncomingMessage, resp: ServerResponse): void; + sendResponse(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: Buffer, output: string): void; + getResponse(sessionID: string, req: IncomingMessage, body: Buffer): string; + protected getBodyInfo(body: Buffer): string; + sendZlibJson(resp: ServerResponse, output: any, sessionID: string): void; +} diff --git a/Live/CWX_DebugTool/dist/types/servers/http/HttpBufferHandler.d.ts b/Live/CWX_DebugTool/dist/types/servers/http/HttpBufferHandler.d.ts new file mode 100644 index 0000000..fec4936 --- /dev/null +++ b/Live/CWX_DebugTool/dist/types/servers/http/HttpBufferHandler.d.ts @@ -0,0 +1,6 @@ +export declare class HttpBufferHandler { + protected buffers: {}; + resetBuffer(sessionID: string): void; + putInBuffer(sessionID: any, data: any, bufLength: number): boolean; + getFromBuffer(sessionID: string): any; +} diff --git a/Live/CWX_DebugTool/dist/types/servers/http/HttpMethods.d.ts b/Live/CWX_DebugTool/dist/types/servers/http/HttpMethods.d.ts new file mode 100644 index 0000000..96031e2 --- /dev/null +++ b/Live/CWX_DebugTool/dist/types/servers/http/HttpMethods.d.ts @@ -0,0 +1,8 @@ +export declare enum HttpMethods { + OPTIONS = "OPTIONS", + GET = "GET", + POST = "POST", + PUT = "PUT", + PATCH = "PATCH", + DELETE = "DELETE" +} diff --git a/Live/CWX_DebugTool/dist/types/servers/http/IHttpListener.d.ts b/Live/CWX_DebugTool/dist/types/servers/http/IHttpListener.d.ts new file mode 100644 index 0000000..758bb5a --- /dev/null +++ b/Live/CWX_DebugTool/dist/types/servers/http/IHttpListener.d.ts @@ -0,0 +1,6 @@ +/// +import { IncomingMessage, ServerResponse } from "http"; +export interface IHttpListener { + canHandle(sessionId: string, req: IncomingMessage): boolean; + handle(sessionId: string, req: IncomingMessage, resp: ServerResponse): void; +} diff --git a/Live/CWX_DebugTool/dist/types/services/BotGenerationCacheService.d.ts b/Live/CWX_DebugTool/dist/types/services/BotGenerationCacheService.d.ts index 670c583..ba53fec 100644 --- a/Live/CWX_DebugTool/dist/types/services/BotGenerationCacheService.d.ts +++ b/Live/CWX_DebugTool/dist/types/services/BotGenerationCacheService.d.ts @@ -35,9 +35,9 @@ export declare class BotGenerationCacheService { protected removeBotFromCache(indexOfBotToReturn: number): void; /** * Get index of bot profile that matches criteria - * @param role role of bot we want - * @param getPmc is requested bot a pmc - * @returns index of found bot + * @param role Role of bot wanted + * @param getPmc Requested bot a pmc + * @returns index of found bot, -1 if not found */ protected getIndexOfBotToReturn(role: string, getPmc: boolean): number; /** diff --git a/Live/CWX_DebugTool/dist/types/services/ProfileFixerService.d.ts b/Live/CWX_DebugTool/dist/types/services/ProfileFixerService.d.ts index 9cb5a38..e772919 100644 --- a/Live/CWX_DebugTool/dist/types/services/ProfileFixerService.d.ts +++ b/Live/CWX_DebugTool/dist/types/services/ProfileFixerService.d.ts @@ -1,6 +1,8 @@ +import { HideoutHelper } from "../helpers/HideoutHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { HideoutSlot } from "../models/eft/common/tables/IBotBase"; +import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; +import { StageBonus } from "../models/eft/hideout/IHideoutArea"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { HideoutAreas } from "../models/enums/HideoutAreas"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -9,8 +11,9 @@ import { Watermark } from "../utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected hideoutHelper: HideoutHelper; protected databaseServer: DatabaseServer; - constructor(logger: ILogger, watermark: Watermark, databaseServer: DatabaseServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, databaseServer: DatabaseServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -63,4 +66,21 @@ export declare class ProfileFixerService { */ protected updateProfilePocketsToNewId(pmcProfile: IPmcData): void; addMissingArmorRepairSkill(pmcProfile: IPmcData): void; + /** + * Iterate over players hideout areas and find what's build, look for missing bonuses those areas give and add them if missing + * @param pmcProfile Profile to update + */ + addMissingHideoutBonusesToProfile(pmcProfile: IPmcData): void; + /** + * + * @param profileBonuses bonuses from profile + * @param bonus bonus to find + * @returns matching bonus + */ + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + /** + * Checks profile inventiory for items that do not exist inside the items db + * @param pmcProfile Profile to check inventory of + */ + checkForOrphanedModdedItems(pmcProfile: IPmcData): void; } diff --git a/Live/CWX_DebugTool/dist/types/services/mod/httpListener/HttpListenerMod.d.ts b/Live/CWX_DebugTool/dist/types/services/mod/httpListener/HttpListenerMod.d.ts new file mode 100644 index 0000000..2cdfbda --- /dev/null +++ b/Live/CWX_DebugTool/dist/types/services/mod/httpListener/HttpListenerMod.d.ts @@ -0,0 +1,10 @@ +/// +import { IncomingMessage, ServerResponse } from "http"; +import { IHttpListener } from "../../../servers/http/IHttpListener"; +export declare class HttpListenerMod implements IHttpListener { + private canHandleOverride; + private handleOverride; + constructor(canHandleOverride: (sessionId: string, req: IncomingMessage) => boolean, handleOverride: (sessionId: string, req: IncomingMessage, resp: ServerResponse) => void); + canHandle(sessionId: string, req: IncomingMessage): boolean; + handle(sessionId: string, req: IncomingMessage, resp: ServerResponse): void; +} diff --git a/Live/CWX_DebugTool/dist/types/services/mod/httpListener/HttpListenerModService.d.ts b/Live/CWX_DebugTool/dist/types/services/mod/httpListener/HttpListenerModService.d.ts new file mode 100644 index 0000000..9dd3473 --- /dev/null +++ b/Live/CWX_DebugTool/dist/types/services/mod/httpListener/HttpListenerModService.d.ts @@ -0,0 +1,8 @@ +/// +import { IncomingMessage, ServerResponse } from "http"; +import { DependencyContainer } from "tsyringe"; +export declare class HttpListenerModService { + protected container: DependencyContainer; + constructor(container: DependencyContainer); + registerHttpListener(name: string, canHandleOverride: (sessionId: string, req: IncomingMessage) => boolean, handleOverride: (sessionId: string, req: IncomingMessage, resp: ServerResponse) => void): void; +} diff --git a/Live/CWX_DebugTool/dist/types/utils/HttpFileUtil.d.ts b/Live/CWX_DebugTool/dist/types/utils/HttpFileUtil.d.ts new file mode 100644 index 0000000..afc8409 --- /dev/null +++ b/Live/CWX_DebugTool/dist/types/utils/HttpFileUtil.d.ts @@ -0,0 +1,8 @@ +/// +import { ServerResponse } from "http"; +import { HttpServerHelper } from "../helpers/HttpServerHelper"; +export declare class HttpFileUtil { + protected httpServerHelper: HttpServerHelper; + constructor(httpServerHelper: HttpServerHelper); + sendFile(resp: ServerResponse, file: any): void; +} diff --git a/Live/CWX_DebugTool/models/IConfig.ts b/Live/CWX_DebugTool/models/IConfig.ts index 29dda5d..2cb6a28 100644 --- a/Live/CWX_DebugTool/models/IConfig.ts +++ b/Live/CWX_DebugTool/models/IConfig.ts @@ -1,40 +1,49 @@ -export interface IConfig +export interface ICwxConfig { showLogs: boolean - globalsConfig: globalsConfig - ragfairConfig: ragfairConfig - locationConfig: locationConfig - inraidConfig: inraidConfig - itemsConfig: itemsConfig + globalsConfig: GlobalsConfig + ragfairConfig: RagfairConfig + locationConfig: LocationConfig + inraidConfig: InraidConfig + itemsConfig: ItemsConfig + airdropConfig: AirdropConfig } -export interface globalsConfig +export interface GlobalsConfig { noFallDamage: boolean openFlea: boolean quickScav: boolean } -export interface ragfairConfig +export interface RagfairConfig { staticTrader: boolean roublesOnly: boolean disableBSGBlacklist: boolean } -export interface locationConfig +export interface LocationConfig { turnLootOff: boolean } -export interface inraidConfig +export interface InraidConfig { turnPVEOff: boolean } -export interface itemsConfig +export interface ItemsConfig { changeShrapProps: boolean changeMaxAmmoForKS23: boolean removeDevFromBlacklist: boolean +} + +export interface AirdropConfig +{ + enableAllTheTime: boolean + changeFlightHeight: boolean + changeStartTime: boolean + changePlaneVolume: boolean } \ No newline at end of file diff --git a/Live/CWX_DebugTool/src/airdropConfig.ts b/Live/CWX_DebugTool/src/airdropConfig.ts new file mode 100644 index 0000000..af7e225 --- /dev/null +++ b/Live/CWX_DebugTool/src/airdropConfig.ts @@ -0,0 +1,70 @@ +import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; + +import{ IAirdropConfig } from "@spt-aki/models/spt/config/IAirdropConfig" + +import { AirdropConfig } from "models/IConfig"; + +import { inject, injectable } from "tsyringe"; +import { CwxConfigHandler } from "./configHandler"; + +@injectable() +export class CwxAirdropConfig +{ + private tables: IAirdropConfig; + private config: AirdropConfig; + + constructor( + @inject("ConfigServer") private configServer: ConfigServer, + @inject("CwxConfigHandler") private configHandler: CwxConfigHandler + ) + {} + + public applyChanges(): void + { + this.config = this.configHandler.getConfig().airdropConfig; + this.tables = this.configServer.getConfig(ConfigTypes.AIRDROP); + + this.enableAllTheTime(); + this.changeFlightHeight(); + this.changeStartTime(); + this.changePlaneVolume(); + } + + private enableAllTheTime(): void + { + if (this.config.enableAllTheTime) + { + for (const i in this.tables.airdropChancePercent) + { + this.tables.airdropChancePercent[i] = 100; + } + } + } + + private changeFlightHeight(): void + { + if (this.config.changeFlightHeight) + { + this.tables.planeMinFlyHeight = 100; + this.tables.planeMaxFlyHeight = 110; + } + } + + private changeStartTime(): void + { + if (this.config.changeStartTime) + { + this.tables.airdropMinStartTimeSeconds = 10; + this.tables.airdropMaxStartTimeSeconds = 20; + } + } + + private changePlaneVolume(): void + { + if (this.config.changePlaneVolume) + { + this.tables.planeVolume = 0.1; + } + } +} \ No newline at end of file diff --git a/Live/CWX_DebugTool/src/configHandler.ts b/Live/CWX_DebugTool/src/configHandler.ts index 08492fe..76311d4 100644 --- a/Live/CWX_DebugTool/src/configHandler.ts +++ b/Live/CWX_DebugTool/src/configHandler.ts @@ -1,17 +1,17 @@ import { injectable } from "tsyringe"; -import { IConfig } from "../models/IConfig"; +import { ICwxConfig } from "../models/IConfig"; @injectable() -export class CWX_ConfigHandler +export class CwxConfigHandler { - private config: IConfig; + private config: ICwxConfig; constructor() { this.config = require("../config/config.json"); } - public getConfig(): IConfig + public getConfig(): ICwxConfig { return this.config; } diff --git a/Live/CWX_DebugTool/src/globalsConfig.ts b/Live/CWX_DebugTool/src/globalsConfig.ts index ab4f3ee..d2c4cd8 100644 --- a/Live/CWX_DebugTool/src/globalsConfig.ts +++ b/Live/CWX_DebugTool/src/globalsConfig.ts @@ -1,18 +1,19 @@ +import { IGlobals } from "@spt-aki/models/eft/common/IGlobals"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { globalsConfig } from "models/IConfig"; +import { GlobalsConfig } from "models/IConfig"; import { inject, injectable } from "tsyringe"; -import { CWX_ConfigHandler } from "./configHandler"; +import { CwxConfigHandler } from "./configHandler"; @injectable() -export class CWX_GlobalsConfig +export class CwxGlobalsConfig { - private tables; - private config: globalsConfig; + private tables: IGlobals; + private config: GlobalsConfig; constructor( @inject("DatabaseServer") private databaseServer: DatabaseServer, - @inject("CWX_ConfigHandler") private configHandler: CWX_ConfigHandler + @inject("CwxConfigHandler") private configHandler: CwxConfigHandler ) {} @@ -21,12 +22,12 @@ export class CWX_GlobalsConfig this.config = this.configHandler.getConfig().globalsConfig; this.tables = this.databaseServer.getTables().globals; - this.NoFallDamage(); - this.OpenFlea(); - this.QuickScav(); + this.noFallDamage(); + this.openFlea(); + this.quickScav(); } - private NoFallDamage(): void + private noFallDamage(): void { if (this.config.noFallDamage) { @@ -35,7 +36,7 @@ export class CWX_GlobalsConfig } } - private OpenFlea(): void + private openFlea(): void { if (this.config.openFlea) { @@ -43,7 +44,7 @@ export class CWX_GlobalsConfig } } - private QuickScav(): void + private quickScav(): void { if (this.config.quickScav) { diff --git a/Live/CWX_DebugTool/src/inraidConfig.ts b/Live/CWX_DebugTool/src/inraidConfig.ts index 903c387..c32960a 100644 --- a/Live/CWX_DebugTool/src/inraidConfig.ts +++ b/Live/CWX_DebugTool/src/inraidConfig.ts @@ -4,18 +4,18 @@ import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { IInRaidConfig } from "@spt-aki/models/spt/config/IInRaidConfig"; -import { CWX_ConfigHandler } from "./configHandler"; -import { inraidConfig } from "models/IConfig"; +import { CwxConfigHandler } from "./configHandler"; +import { InraidConfig } from "models/IConfig"; @injectable() -export class CWX_InraidConfig +export class CwxInraidConfig { private tables: IInRaidConfig; - private config: inraidConfig; + private config: InraidConfig; constructor( @inject("ConfigServer") private configServer: ConfigServer, - @inject("CWX_ConfigHandler") private configHandler: CWX_ConfigHandler + @inject("CwxConfigHandler") private configHandler: CwxConfigHandler ) {} @@ -24,10 +24,10 @@ export class CWX_InraidConfig this.config = this.configHandler.getConfig().inraidConfig; this.tables = this.configServer.getConfig(ConfigTypes.IN_RAID); - this.TurnPVEOff(); + this.turnPVEOff(); } - private TurnPVEOff(): void + private turnPVEOff(): void { if (this.config.turnPVEOff) { diff --git a/Live/CWX_DebugTool/src/itemsConfig.ts b/Live/CWX_DebugTool/src/itemsConfig.ts index 5762e0d..812dc21 100644 --- a/Live/CWX_DebugTool/src/itemsConfig.ts +++ b/Live/CWX_DebugTool/src/itemsConfig.ts @@ -1,24 +1,24 @@ import { inject, injectable } from "tsyringe"; -import { CWX_ConfigHandler } from "./configHandler"; +import { CwxConfigHandler } from "./configHandler"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IItemConfig } from "@spt-aki/models/spt/config/IItemConfig" -import { IConfig } from "models/IConfig"; +import { ItemsConfig } from "models/IConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes"; @injectable() -export class CWX_ItemsConfig +export class CwxItemsConfig { private tables: Record; - private config: IConfig; + private config: ItemsConfig; private itemConfig: IItemConfig; constructor( @inject("DatabaseServer") private databaseServer: DatabaseServer, @inject("ConfigServer") private configServer: ConfigServer, - @inject("CWX_ConfigHandler") private configHandler: CWX_ConfigHandler + @inject("CwxConfigHandler") private configHandler: CwxConfigHandler ) {} @@ -26,7 +26,7 @@ export class CWX_ItemsConfig { this.tables = this.databaseServer.getTables().templates.items; this.itemConfig = this.configServer.getConfig(ConfigTypes.ITEM); - this.config = this.configHandler.getConfig(); + this.config = this.configHandler.getConfig().itemsConfig; this.changeShrapProps(); this.changeMaxAmmoForKS23(); @@ -38,7 +38,7 @@ export class CWX_ItemsConfig { const shrap = this.tables["5e85a9a6eacf8c039e4e2ac1"]; - if (this.config.itemsConfig.changeShrapProps) + if (this.config.changeShrapProps) { shrap._props.Damage = 200; shrap._props.InitialSpeed = 1000; @@ -49,7 +49,7 @@ export class CWX_ItemsConfig { const ks23 = this.tables["5f647d9f8499b57dc40ddb93"]; - if (this.config.itemsConfig.changeMaxAmmoForKS23) + if (this.config.changeMaxAmmoForKS23) { ks23._props.Cartridges[0]._max_count = 30; } @@ -57,7 +57,7 @@ export class CWX_ItemsConfig private removeDevFromBlacklist(): void { - if (this.config.itemsConfig.removeDevFromBlacklist) + if (this.config.removeDevFromBlacklist) { this.itemConfig.blacklist.splice(this.itemConfig.blacklist.indexOf("58ac60eb86f77401897560ff")); } diff --git a/Live/CWX_DebugTool/src/locationConfig.ts b/Live/CWX_DebugTool/src/locationConfig.ts index dbfcaa6..a2932af 100644 --- a/Live/CWX_DebugTool/src/locationConfig.ts +++ b/Live/CWX_DebugTool/src/locationConfig.ts @@ -4,18 +4,18 @@ import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig"; -import { CWX_ConfigHandler } from "./configHandler"; -import { locationConfig } from "models/IConfig"; +import { CwxConfigHandler } from "./configHandler"; +import { LocationConfig } from "models/IConfig"; @injectable() -export class CWX_LocationConfig +export class CwxLocationConfig { private tables: ILocationConfig; - private config: locationConfig; + private config: LocationConfig; constructor( @inject("ConfigServer") private configServer: ConfigServer, - @inject("CWX_ConfigHandler") private configHandler: CWX_ConfigHandler + @inject("CwxConfigHandler") private configHandler: CwxConfigHandler ) {} @@ -24,10 +24,10 @@ export class CWX_LocationConfig this.config = this.configHandler.getConfig().locationConfig; this.tables = this.configServer.getConfig(ConfigTypes.LOCATION); - this.TurnLootOff(); + this.turnLootOff(); } - private TurnLootOff(): void + private turnLootOff(): void { if (this.config.turnLootOff) { diff --git a/Live/CWX_DebugTool/src/logging.ts b/Live/CWX_DebugTool/src/logging.ts index 441fae2..1e93ba9 100644 --- a/Live/CWX_DebugTool/src/logging.ts +++ b/Live/CWX_DebugTool/src/logging.ts @@ -1,47 +1,53 @@ import { SptLogger } from "@spt-aki/models/spt/logging/SptLogger"; -import { IConfig } from "models/IConfig"; +import { ICwxConfig } from "models/IConfig"; import { inject, injectable } from "tsyringe"; -import { CWX_ConfigHandler } from "./configHandler"; +import { CwxConfigHandler } from "./configHandler"; @injectable() -export class CWX_Logging +export class CwxLogging { - private config: IConfig; + private config: ICwxConfig; constructor( @inject("WinstonLogger") private logger: SptLogger, - @inject("CWX_ConfigHandler") private configHandler: CWX_ConfigHandler + @inject("CwxConfigHandler") private configHandler: CwxConfigHandler ) {} - public SendLogging(): void + public sendLogging(): void { this.config = this.configHandler.getConfig(); // globals - this.NoFallDamage(); - this.OpenFlea(); - this.QuickScav(); + this.noFallDamage(); + this.openFlea(); + this.quickScav(); // ragfair - this.StaticTrader(); - this.RoublesOnly(); - this.DisableBSGBlacklist(); + this.staticTrader(); + this.roublesOnly(); + this.disableBSGBlacklist(); // location - this.TurnLootOff(); + this.turnLootOff(); // inraid - this.TurnPVEOff(); + this.turnPVEOff(); // items this.changeShrapProps(); this.changeMaxAmmoForKS23(); this.removeDevFromBlacklist(); + // airdrops + this.enableAllTheTime(); + this.changeFlightHeight(); + this.changeStartTime(); + this.changePlaneVolume(); + } - private NoFallDamage(): void + private noFallDamage(): void { if (this.config.globalsConfig.noFallDamage) { @@ -49,7 +55,7 @@ export class CWX_Logging } } - private OpenFlea(): void + private openFlea(): void { if (this.config.globalsConfig.openFlea) { @@ -57,7 +63,7 @@ export class CWX_Logging } } - private QuickScav(): void + private quickScav(): void { if (this.config.globalsConfig.quickScav) { @@ -65,7 +71,7 @@ export class CWX_Logging } } - private StaticTrader(): void + private staticTrader(): void { if (this.config.ragfairConfig.staticTrader) { @@ -73,7 +79,7 @@ export class CWX_Logging } } - private RoublesOnly(): void + private roublesOnly(): void { if (this.config.ragfairConfig.roublesOnly) { @@ -81,7 +87,7 @@ export class CWX_Logging } } - private DisableBSGBlacklist(): void + private disableBSGBlacklist(): void { if (this.config.ragfairConfig.disableBSGBlacklist) { @@ -89,7 +95,7 @@ export class CWX_Logging } } - private TurnLootOff(): void + private turnLootOff(): void { if (this.config.locationConfig.turnLootOff) { @@ -97,7 +103,7 @@ export class CWX_Logging } } - private TurnPVEOff(): void + private turnPVEOff(): void { if (this.config.inraidConfig.turnPVEOff) { @@ -129,4 +135,35 @@ export class CWX_Logging } } + private enableAllTheTime(): void + { + if (this.config.airdropConfig.enableAllTheTime) + { + this.logger.info("Enable Airdrops All The Time Activated"); + } + } + + private changeFlightHeight(): void + { + if (this.config.airdropConfig.changeFlightHeight) + { + this.logger.info("Change Flight Height Activated"); + } + } + + private changeStartTime(): void + { + if (this.config.airdropConfig.changeStartTime) + { + this.logger.info("Change Start Time Activated"); + } + } + + private changePlaneVolume(): void + { + if (this.config.airdropConfig.changePlaneVolume) + { + this.logger.info("Change Plane Volume Activated"); + } + } } \ No newline at end of file diff --git a/Live/CWX_DebugTool/src/mod.ts b/Live/CWX_DebugTool/src/mod.ts index 774a88a..a565b22 100644 --- a/Live/CWX_DebugTool/src/mod.ts +++ b/Live/CWX_DebugTool/src/mod.ts @@ -1,37 +1,40 @@ import { DependencyContainer, Lifecycle } from "tsyringe"; import { IPostDBLoadMod } from "@spt-aki/models/external/IPostDBLoadMod"; -import { CWX_ConfigHandler } from "./configHandler"; -import { CWX_GlobalsConfig } from "./globalsConfig"; -import { CWX_Logging } from "./logging"; -import { CWX_RagfairConfig } from "./ragfairConfig"; -import { CWX_LocationConfig } from "./locationConfig"; -import { CWX_InraidConfig } from "./inraidConfig"; -import { CWX_ItemsConfig } from "./itemsConfig"; +import { CwxLogging } from "./logging"; +import { CwxConfigHandler } from "./configHandler"; +import { CwxGlobalsConfig } from "./globalsConfig"; +import { CwxRagfairConfig } from "./ragfairConfig"; +import { CwxLocationConfig } from "./locationConfig"; +import { CwxInraidConfig } from "./inraidConfig"; +import { CwxItemsConfig } from "./itemsConfig"; +import { CwxAirdropConfig } from "./airdropConfig"; class CWX_DebugTool implements IPostDBLoadMod { public postDBLoad(container: DependencyContainer): void { - container.register("CWX_ConfigHandler", CWX_ConfigHandler, {lifecycle:Lifecycle.Singleton}) - container.register("CWX_GlobalsConfig", CWX_GlobalsConfig); - container.register("CWX_RagfairConfig", CWX_RagfairConfig); - container.register("CWX_LocationConfig", CWX_LocationConfig); - container.register("CWX_InraidConfig", CWX_InraidConfig); - container.register("CWX_ItemsConfig", CWX_ItemsConfig); - container.register("CWX_Logging", CWX_Logging); + container.register("CwxConfigHandler", CwxConfigHandler, {lifecycle:Lifecycle.Singleton}) + container.register("CwxGlobalsConfig", CwxGlobalsConfig); + container.register("CwxRagfairConfig", CwxRagfairConfig); + container.register("CwxLocationConfig", CwxLocationConfig); + container.register("CwxInraidConfig", CwxInraidConfig); + container.register("CwxItemsConfig", CwxItemsConfig); + container.register("CwxAirdropConfig", CwxAirdropConfig); + container.register("CwxLogging", CwxLogging); - container.resolve("CWX_GlobalsConfig").applyChanges(); - container.resolve("CWX_RagfairConfig").applyChanges(); - container.resolve("CWX_LocationConfig").applyChanges(); - container.resolve("CWX_InraidConfig").applyChanges(); - container.resolve("CWX_ItemsConfig").applyChanges(); + container.resolve("CwxGlobalsConfig").applyChanges(); + container.resolve("CwxRagfairConfig").applyChanges(); + container.resolve("CwxLocationConfig").applyChanges(); + container.resolve("CwxInraidConfig").applyChanges(); + container.resolve("CwxItemsConfig").applyChanges(); + container.resolve("CwxAirdropConfig").applyChanges(); - if (container.resolve("CWX_ConfigHandler").getConfig().showLogs) + if (container.resolve("CwxConfigHandler").getConfig().showLogs) { - container.resolve("CWX_Logging").SendLogging(); + container.resolve("CwxLogging").sendLogging(); } } } diff --git a/Live/CWX_DebugTool/src/ragfairConfig.ts b/Live/CWX_DebugTool/src/ragfairConfig.ts index 819ecfb..a02a627 100644 --- a/Live/CWX_DebugTool/src/ragfairConfig.ts +++ b/Live/CWX_DebugTool/src/ragfairConfig.ts @@ -4,18 +4,18 @@ import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; -import { CWX_ConfigHandler } from "./configHandler"; -import { ragfairConfig } from "models/IConfig"; +import { CwxConfigHandler } from "./configHandler"; +import { RagfairConfig } from "models/IConfig"; @injectable() -export class CWX_RagfairConfig +export class CwxRagfairConfig { private tables: IRagfairConfig; - private config: ragfairConfig; + private config: RagfairConfig; constructor( @inject("ConfigServer") private configServer: ConfigServer, - @inject("CWX_ConfigHandler") private configHandler: CWX_ConfigHandler + @inject("CwxConfigHandler") private configHandler: CwxConfigHandler ) {} @@ -24,12 +24,12 @@ export class CWX_RagfairConfig this.config = this.configHandler.getConfig().ragfairConfig; this.tables = this.configServer.getConfig(ConfigTypes.RAGFAIR); - this.StaticTrader(); - this.RoublesOnly(); - this.DisableBSGBlacklist(); + this.staticTrader(); + this.roublesOnly(); + this.disableBSGBlacklist(); } - private StaticTrader(): void + private staticTrader(): void { if (this.config.staticTrader) { @@ -37,7 +37,7 @@ export class CWX_RagfairConfig } } - private RoublesOnly(): void + private roublesOnly(): void { if (this.config.roublesOnly) { @@ -47,7 +47,7 @@ export class CWX_RagfairConfig } } - private DisableBSGBlacklist(): void + private disableBSGBlacklist(): void { if (this.config.disableBSGBlacklist) { diff --git a/Live/CWX_DebugTool/types/ErrorHandler.d.ts b/Live/CWX_DebugTool/types/ErrorHandler.d.ts new file mode 100644 index 0000000..69b0bcd --- /dev/null +++ b/Live/CWX_DebugTool/types/ErrorHandler.d.ts @@ -0,0 +1,6 @@ +export declare class ErrorHandler { + private logger; + private readLine; + constructor(); + handleCriticalError(err: any): void; +} diff --git a/Live/CWX_DebugTool/types/Program.d.ts b/Live/CWX_DebugTool/types/Program.d.ts index d4b71b9..afe5216 100644 --- a/Live/CWX_DebugTool/types/Program.d.ts +++ b/Live/CWX_DebugTool/types/Program.d.ts @@ -1,4 +1,5 @@ export declare class Program { + private errorHandler; constructor(); start(): void; } diff --git a/Live/CWX_DebugTool/types/callbacks/BundleCallbacks.d.ts b/Live/CWX_DebugTool/types/callbacks/BundleCallbacks.d.ts index b28abe1..b7e1703 100644 --- a/Live/CWX_DebugTool/types/callbacks/BundleCallbacks.d.ts +++ b/Live/CWX_DebugTool/types/callbacks/BundleCallbacks.d.ts @@ -1,17 +1,17 @@ import { BundleLoader } from "../loaders/BundleLoader"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; -import { IHttpServer } from "../models/spt/server/IHttpServer"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { HttpFileUtil } from "../utils/HttpFileUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class BundleCallbacks { protected logger: ILogger; protected httpResponse: HttpResponseUtil; - protected httpServer: IHttpServer; + protected httpFileUtil: HttpFileUtil; protected bundleLoader: BundleLoader; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; - constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpServer: IHttpServer, bundleLoader: BundleLoader, configServer: ConfigServer); + constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); sendBundle(sessionID: string, req: any, resp: any, body: any): any; getBundles(url: string, info: any, sessionID: string): string; getBundle(url: string, info: any, sessionID: string): string; diff --git a/Live/CWX_DebugTool/types/callbacks/HttpCallbacks.d.ts b/Live/CWX_DebugTool/types/callbacks/HttpCallbacks.d.ts index 94c97bd..43928a1 100644 --- a/Live/CWX_DebugTool/types/callbacks/HttpCallbacks.d.ts +++ b/Live/CWX_DebugTool/types/callbacks/HttpCallbacks.d.ts @@ -1,8 +1,8 @@ import { OnLoad } from "../di/OnLoad"; -import { IHttpServer } from "../models/spt/server/IHttpServer"; +import { HttpServer } from "../servers/HttpServer"; export declare class HttpCallbacks extends OnLoad { - protected httpServer: IHttpServer; - constructor(httpServer: IHttpServer); + protected httpServer: HttpServer; + constructor(httpServer: HttpServer); onLoad(): void; getRoute(): string; getImage(): string; diff --git a/Live/CWX_DebugTool/types/callbacks/ModCallbacks.d.ts b/Live/CWX_DebugTool/types/callbacks/ModCallbacks.d.ts index 58342dc..aec2f59 100644 --- a/Live/CWX_DebugTool/types/callbacks/ModCallbacks.d.ts +++ b/Live/CWX_DebugTool/types/callbacks/ModCallbacks.d.ts @@ -1,18 +1,18 @@ import { OnLoad } from "../di/OnLoad"; import { PostAkiModLoader } from "../loaders/PostAkiModLoader"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; -import { IHttpServer } from "../models/spt/server/IHttpServer"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { HttpFileUtil } from "../utils/HttpFileUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; declare class ModCallbacks extends OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; - protected httpServer: IHttpServer; + protected httpFileUtil: HttpFileUtil; protected postAkiModLoader: PostAkiModLoader; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; - constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpServer: IHttpServer, postAkiModLoader: PostAkiModLoader, configServer: ConfigServer); + constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, postAkiModLoader: PostAkiModLoader, configServer: ConfigServer); onLoad(): void; getRoute(): string; sendBundle(sessionID: string, req: any, resp: any, body: any): void; diff --git a/Live/CWX_DebugTool/types/controllers/DialogueController.d.ts b/Live/CWX_DebugTool/types/controllers/DialogueController.d.ts index b15c4b6..1b72522 100644 --- a/Live/CWX_DebugTool/types/controllers/DialogueController.d.ts +++ b/Live/CWX_DebugTool/types/controllers/DialogueController.d.ts @@ -2,24 +2,77 @@ import { DialogueHelper } from "../helpers/DialogueHelper"; import { IGetAllAttachmentsResponse } from "../models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetFriendListDataResponse } from "../models/eft/dialog/IGetFriendListDataResponse"; import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDialogViewResponseData"; -import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { DialogueInfo, Message } from "../models/eft/profile/IAkiProfile"; import { SaveServer } from "../servers/SaveServer"; -import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { TimeUtil } from "../utils/TimeUtil"; export declare class DialogueController { - protected httpResponse: HttpResponseUtil; protected saveServer: SaveServer; + protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - constructor(httpResponse: HttpResponseUtil, saveServer: SaveServer, dialogueHelper: DialogueHelper); + constructor(saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper); + update(): void; getFriendList(sessionID: string): IGetFriendListDataResponse; - generateDialogueList(sessionID: string): IGetBodyResponseData; + /** + * Create array holding trader dialogs and mail interactions with player + * Set the content of the dialogue on the list tab. + * @param sessionID Session Id + * @returns array of dialogs + */ + generateDialogueList(sessionID: string): DialogueInfo[]; + /** + * Get the content of a dialogue + * @param dialogueID Dialog id + * @param sessionID Session Id + * @returns + */ getDialogueInfo(dialogueID: string, sessionID: string): DialogueInfo; + /** + * Set the content of the dialogue on the details panel, showing all the messages + * for the specified dialogue. + * @param dialogueID Dialog id + * @param sessionID Session id + * @returns IGetMailDialogViewResponseData object + */ generateDialogueView(dialogueID: string, sessionID: string): IGetMailDialogViewResponseData; + /** + * Get a count of messages with attachments from a particular dialog + * @param sessionID Session id + * @param dialogueID Dialog id + * @returns Count of messages with attachments + */ + protected getUnreadMessagesWithAttachmentsCount(sessionID: string, dialogueID: string): number; + /** + * Does array have messages with uncollected rewards (includes expired rewards) + * @param messages Messages to check + * @returns true if uncollected rewards found + */ + protected messagesHaveUncollectedRewards(messages: Message[]): boolean; removeDialogue(dialogueID: string, sessionID: string): void; setDialoguePin(dialogueID: string, shouldPin: boolean, sessionID: string): void; setRead(dialogueIDs: string[], sessionID: string): void; + /** + * Get all uncollected items attached to mail in a particular dialog + * @param dialogueID Dialog to get mail attachments from + * @param sessionID Session id + * @returns + */ getAllAttachments(dialogueID: string, sessionID: string): IGetAllAttachmentsResponse; - protected messagesHaveUncollectedRewards(messages: Message[]): boolean; + /** + * Get messages from a specific dialog that have items not expired + * @param sessionId Session id + * @param dialogueId Dialog to get mail attachments from + * @returns Message array + */ + protected getActiveMessagesFromDialog(sessionId: string, dialogueId: string): Message[]; + /** + * Return array of messages with uncollected items (includes expired) + * @param messages Messages to parse + * @returns messages with items to collect + */ + protected getMessagesWithAttachments(messages: Message[]): Message[]; + /** + * Delete expired items. triggers when updating traders. + * @param sessionID Session id + */ protected removeExpiredItems(sessionID: string): void; - update(): void; } diff --git a/Live/CWX_DebugTool/types/controllers/MatchController.d.ts b/Live/CWX_DebugTool/types/controllers/MatchController.d.ts index 07f6a89..dac6a3f 100644 --- a/Live/CWX_DebugTool/types/controllers/MatchController.d.ts +++ b/Live/CWX_DebugTool/types/controllers/MatchController.d.ts @@ -9,6 +9,7 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; +import { BotDifficulty } from "../models/enums/BotDifficulty"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; @@ -44,5 +45,11 @@ export declare class MatchController { protected getMatch(location: string): any; getGroupStatus(info: IGetGroupStatusRequestData): any; startOfflineRaid(info: IStartOfflineRaidRequestData, sessionID: string): void; + /** + * Convert a difficulty value from pre-raid screen to a bot difficulty + * @param botDifficulty dropdown difficulty + * @returns bot difficulty + */ + protected convertDifficultyDropdownIntoBotDifficulty(botDifficulty: BotDifficulty): string; endOfflineRaid(info: IEndOfflineRaidRequestData, sessionID: string): void; } diff --git a/Live/CWX_DebugTool/types/controllers/RagfairController.d.ts b/Live/CWX_DebugTool/types/controllers/RagfairController.d.ts index 06af740..fe1f472 100644 --- a/Live/CWX_DebugTool/types/controllers/RagfairController.d.ts +++ b/Live/CWX_DebugTool/types/controllers/RagfairController.d.ts @@ -12,6 +12,7 @@ import { RagfairTaxHelper } from "../helpers/RagfairTaxHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Item } from "../models/eft/common/tables/IItem"; +import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { IAddOfferRequestData, Requirement } from "../models/eft/ragfair/IAddOfferRequestData"; @@ -65,6 +66,35 @@ export declare class RagfairController { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult; + /** + * Get offers for the client based on type of search being performed + * @param searchRequest Client search request data + * @param itemsToAdd + * @param assorts + * @param pmcProfile Player profile + * @returns array of offers + */ + protected getOffersForSearchType(searchRequest: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Get categories for the type of search being performed, linked/required/all + * @param searchRequest Client search request data + * @param offers ragfair offers to get categories for + * @returns record with tpls + counts + */ + protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; + /** + * Add Required offers to offers result + * @param searchRequest Client search request data + * @param assorts + * @param pmcProfile Player profile + * @param result Result object being sent back to client + */ + protected addRequiredOffersToResult(searchRequest: ISearchRequestData, assorts: Record, pmcProfile: IPmcData, result: IGetOffersResult): void; + /** + * Add index to all offers passed in (0-indexed) + * @param offers Offers to add index value to + */ + protected addIndexValueToOffers(offers: IRagfairOffer[]): void; /** * Update a trader flea offer with buy restrictions stored in the traders assort * @param offer flea offer to update diff --git a/Live/CWX_DebugTool/types/di/Container.d.ts b/Live/CWX_DebugTool/types/di/Container.d.ts index 98d1fa1..e339a3b 100644 --- a/Live/CWX_DebugTool/types/di/Container.d.ts +++ b/Live/CWX_DebugTool/types/di/Container.d.ts @@ -3,6 +3,7 @@ import { DependencyContainer } from "tsyringe"; * Handle the registration of classes to be used by the Dependency Injection code */ export declare class Container { + static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void; private static registerUtils; diff --git a/Live/CWX_DebugTool/types/di/Serializer.d.ts b/Live/CWX_DebugTool/types/di/Serializer.d.ts index 70aa7c5..2617007 100644 --- a/Live/CWX_DebugTool/types/di/Serializer.d.ts +++ b/Live/CWX_DebugTool/types/di/Serializer.d.ts @@ -1,5 +1,6 @@ -import { IHttpServer } from "../models/spt/server/IHttpServer"; +/// +import { IncomingMessage, ServerResponse } from "http"; export declare class Serializer { - serialize(sessionID: string, req: any, resp: any, body: any, httpServer: IHttpServer): void; + serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void; canHandle(something: string): boolean; } diff --git a/Live/CWX_DebugTool/types/generators/LootGenerator.d.ts b/Live/CWX_DebugTool/types/generators/LootGenerator.d.ts index bbc1915..66056c2 100644 --- a/Live/CWX_DebugTool/types/generators/LootGenerator.d.ts +++ b/Live/CWX_DebugTool/types/generators/LootGenerator.d.ts @@ -48,11 +48,12 @@ export declare class LootGenerator { * Find a random item in items.json and add to result array * @param globalDefaultPresets presets to choose from * @param itemTypeCounts item limit counts + * @param itemBlacklist items to skip * @param result array to add found preset to * @returns true if preset was valid and added to pool */ protected findAndAddRandomPresetToLoot(globalDefaultPresets: [string, Preset][], itemTypeCounts: Record, result: LootItem[]): boolean; + }>, itemBlacklist: string[], result: LootItem[]): boolean; } diff --git a/Live/CWX_DebugTool/types/generators/RagfairOfferGenerator.d.ts b/Live/CWX_DebugTool/types/generators/RagfairOfferGenerator.d.ts index 317cd6b..0dc2d61 100644 --- a/Live/CWX_DebugTool/types/generators/RagfairOfferGenerator.d.ts +++ b/Live/CWX_DebugTool/types/generators/RagfairOfferGenerator.d.ts @@ -39,6 +39,13 @@ export declare class RagfairOfferGenerator { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; + /** + * Convert a count of currency into roubles + * @param currencyCount amount of currency to convert into roubles + * @param currencyType Type of currency (euro/dollar/rouble) + * @returns count of roubles + */ + protected calculateRoublePrice(currencyCount: number, currencyType: string): number; protected getTraderId(userID: string): string; protected getRating(userID: string): number; /** diff --git a/Live/CWX_DebugTool/types/helpers/BotHelper.d.ts b/Live/CWX_DebugTool/types/helpers/BotHelper.d.ts index 18738e5..67a6384 100644 --- a/Live/CWX_DebugTool/types/helpers/BotHelper.d.ts +++ b/Live/CWX_DebugTool/types/helpers/BotHelper.d.ts @@ -33,6 +33,12 @@ export declare class BotHelper { * @returns Difficulty object */ getPmcDifficultySettings(type: string, difficulty: string): Difficulty; + /** + * Translate chosen value from pre-raid difficulty dropdown into bot difficulty value + * @param dropDownDifficulty Dropdown difficulty value to convert + * @returns bot difficulty + */ + convertBotDifficultyDropdownToBotDifficulty(dropDownDifficulty: string): string; /** * Choose a random difficulty from - easy/normal/hard/impossible * @returns random difficulty diff --git a/Live/CWX_DebugTool/types/helpers/DialogueHelper.d.ts b/Live/CWX_DebugTool/types/helpers/DialogueHelper.d.ts index e3e2bda..d2be04d 100644 --- a/Live/CWX_DebugTool/types/helpers/DialogueHelper.d.ts +++ b/Live/CWX_DebugTool/types/helpers/DialogueHelper.d.ts @@ -34,7 +34,8 @@ export declare class DialogueHelper { * Get the item contents for a particular message. * @param messageID * @param sessionID + * @param itemId Item being moved to inventory * @returns */ - getMessageItemContents(messageID: string, sessionID: string): Item[]; + getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[]; } diff --git a/Live/CWX_DebugTool/types/helpers/NotificationSendHelper.d.ts b/Live/CWX_DebugTool/types/helpers/NotificationSendHelper.d.ts index 34e62d9..6c56006 100644 --- a/Live/CWX_DebugTool/types/helpers/NotificationSendHelper.d.ts +++ b/Live/CWX_DebugTool/types/helpers/NotificationSendHelper.d.ts @@ -1,10 +1,10 @@ import { INotification } from "../models/eft/notifier/INotifier"; -import { IHttpServer } from "../models/spt/server/IHttpServer"; +import { HttpServer } from "../servers/HttpServer"; import { NotificationService } from "../services/NotificationService"; export declare class NotificationSendHelper { - protected httpServer: IHttpServer; + protected httpServer: HttpServer; protected notificationService: NotificationService; - constructor(httpServer: IHttpServer, notificationService: NotificationService); + constructor(httpServer: HttpServer, notificationService: NotificationService); /** * Send notification message to the appropiate channel */ diff --git a/Live/CWX_DebugTool/types/helpers/RagfairOfferHelper.d.ts b/Live/CWX_DebugTool/types/helpers/RagfairOfferHelper.d.ts index e9d72ca..ea13aae 100644 --- a/Live/CWX_DebugTool/types/helpers/RagfairOfferHelper.d.ts +++ b/Live/CWX_DebugTool/types/helpers/RagfairOfferHelper.d.ts @@ -48,6 +48,12 @@ export declare class RagfairOfferHelper { constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Get an array of flea offers that are inaccessible to player due to their inadequate loyalty level + * @param offers Offers to check + * @param pmcProfile Players profile with trader loyalty levels + */ + protected getLoyaltyLockedOffers(offers: IRagfairOffer[], pmcProfile: IPmcData): string[]; processOffersOnProfile(sessionID: string): boolean; protected getProfileOffers(sessionID: string): IRagfairOffer[]; protected deleteOfferByOfferId(sessionID: string, offerId: string): void; diff --git a/Live/CWX_DebugTool/types/helpers/RagfairSortHelper.d.ts b/Live/CWX_DebugTool/types/helpers/RagfairSortHelper.d.ts index d20e10c..28d1d38 100644 --- a/Live/CWX_DebugTool/types/helpers/RagfairSortHelper.d.ts +++ b/Live/CWX_DebugTool/types/helpers/RagfairSortHelper.d.ts @@ -1,14 +1,28 @@ import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; +import { RagfairSort } from "../models/enums/RagfairSort"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; export declare class RagfairSortHelper { protected databaseServer: DatabaseServer; protected localeService: LocaleService; constructor(databaseServer: DatabaseServer, localeService: LocaleService); - sortOffers(offers: IRagfairOffer[], type: number, direction?: number): IRagfairOffer[]; + /** + * Sort a list of ragfair offers by something (id/rating/offer name/price/expirty time) + * @param offers Offers to sort + * @param type How to sort it + * @param direction Ascending/descending + * @returns Sorted offers + */ + sortOffers(offers: IRagfairOffer[], type: RagfairSort, direction?: number): IRagfairOffer[]; protected sortOffersByID(a: IRagfairOffer, b: IRagfairOffer): number; protected sortOffersByRating(a: IRagfairOffer, b: IRagfairOffer): number; protected sortOffersByName(a: IRagfairOffer, b: IRagfairOffer): number; + /** + * Order two offers by price value + * @param a Offer a + * @param b Offer b + * @returns + */ protected sortOffersByPrice(a: IRagfairOffer, b: IRagfairOffer): number; protected sortOffersByExpiry(a: IRagfairOffer, b: IRagfairOffer): number; } diff --git a/Live/CWX_DebugTool/types/loaders/PreAkiModLoader.d.ts b/Live/CWX_DebugTool/types/loaders/PreAkiModLoader.d.ts index 4ab1689..7a687a5 100644 --- a/Live/CWX_DebugTool/types/loaders/PreAkiModLoader.d.ts +++ b/Live/CWX_DebugTool/types/loaders/PreAkiModLoader.d.ts @@ -9,6 +9,9 @@ import { ModCompilerService } from "../services/ModCompilerService"; import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; import { BundleLoader } from "./BundleLoader"; +import { IPostAkiLoadMod } from "../models/external/IPostAkiLoadMod"; +import { IPreAkiLoadMod } from "../models/external/IPreAkiLoadMod"; +import { IPostDBLoadMod } from "../models/external/IPostDBLoadMod"; export declare class PreAkiModLoader implements IModLoader { protected logger: ILogger; protected vfs: VFS; @@ -56,12 +59,26 @@ export declare class PreAkiModLoader implements IModLoader { */ protected getModsPackageData(mods: string[]): Record; /** - * Does mod have "delayedLoad(" string in its entry class - * @param modFolderName folder name - * @param modToValidate package.json details + * Use defined safe guard to check if the mod is a IPreAkiLoadMod * @returns boolean */ - protected isModSpt3XXCompatible(modFolderName: string, modToValidate: IPackageJsonData): boolean; + protected isPreAkiLoad(mod: any): mod is IPreAkiLoadMod; + /** + * Use defined safe guard to check if the mod is a IPostAkiLoadMod + * @returns boolean + */ + protected isPostAkiLoad(mod: any): mod is IPostAkiLoadMod; + /** + * Use defined safe guard to check if the mod is a IPostDBLoadMod + * @returns boolean + */ + protected isPostDBAkiLoad(mod: any): mod is IPostDBLoadMod; + /** + * Check that the mod is compatible with SPT 3.X.X + * @param mod the mod to check + * @returns boolean + */ + protected isModSpt3XXCompatible(mod: any): boolean; protected isModCombatibleWithAki(mod: IPackageJsonData): boolean; protected executeMods(container: DependencyContainer): void; sortModsLoadOrder(): string[]; diff --git a/Live/CWX_DebugTool/types/models/eft/common/tables/IBotBase.d.ts b/Live/CWX_DebugTool/types/models/eft/common/tables/IBotBase.d.ts index 25cb861..1c28ae0 100644 --- a/Live/CWX_DebugTool/types/models/eft/common/tables/IBotBase.d.ts +++ b/Live/CWX_DebugTool/types/models/eft/common/tables/IBotBase.d.ts @@ -341,6 +341,7 @@ export interface RagfairInfo { offers: IRagfairOffer[]; } export interface Bonus { + id?: string; type: string; templateId?: string; passive?: boolean; @@ -348,6 +349,8 @@ export interface Bonus { visible?: boolean; value?: number; icon?: string; + filter?: string[]; + skillType?: string; } export interface Note { Time: number; diff --git a/Live/CWX_DebugTool/types/models/eft/ragfair/IRagfairOffer.d.ts b/Live/CWX_DebugTool/types/models/eft/ragfair/IRagfairOffer.d.ts index 141b605..3251a37 100644 --- a/Live/CWX_DebugTool/types/models/eft/ragfair/IRagfairOffer.d.ts +++ b/Live/CWX_DebugTool/types/models/eft/ragfair/IRagfairOffer.d.ts @@ -9,6 +9,7 @@ export interface IRagfairOffer { intId: number; itemsCost: number; requirementsCost: number; + sptRequirementsCostRouble: number; startTime: number; endTime: number; sellInOnePiece: boolean; diff --git a/Live/CWX_DebugTool/types/models/eft/ragfair/ISearchRequestData.d.ts b/Live/CWX_DebugTool/types/models/eft/ragfair/ISearchRequestData.d.ts index 08e7fd3..56d093b 100644 --- a/Live/CWX_DebugTool/types/models/eft/ragfair/ISearchRequestData.d.ts +++ b/Live/CWX_DebugTool/types/models/eft/ragfair/ISearchRequestData.d.ts @@ -1,7 +1,8 @@ +import { RagfairSort } from "../../enums/RagfairSort"; export interface ISearchRequestData { page: number; limit: number; - sortType: number; + sortType: RagfairSort; sortDirection: number; currency: number; priceFrom: number; diff --git a/Live/CWX_DebugTool/types/models/enums/RagfairSort.d.ts b/Live/CWX_DebugTool/types/models/enums/RagfairSort.d.ts new file mode 100644 index 0000000..798a5e7 --- /dev/null +++ b/Live/CWX_DebugTool/types/models/enums/RagfairSort.d.ts @@ -0,0 +1,7 @@ +export declare enum RagfairSort { + ID = 0, + RATING = 3, + OFFER_TITLE = 4, + PRICE = 5, + EXPIRY = 6 +} diff --git a/Live/CWX_DebugTool/types/models/external/HttpFramework.d.ts b/Live/CWX_DebugTool/types/models/external/HttpFramework.d.ts new file mode 100644 index 0000000..3b4a56a --- /dev/null +++ b/Live/CWX_DebugTool/types/models/external/HttpFramework.d.ts @@ -0,0 +1,33 @@ +/// +import { IncomingMessage, ServerResponse } from "http"; +export declare type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) => void; +/** + * Associates handlers, HTTP methods and a base url to a listener using a proxy + * @param basePath The base path + * @returns The decorator that create the listener proxy + */ +export declare const Listen: (basePath: string) => any>(Base: T) => T; +/** + * HTTP DELETE decorator + */ +export declare const Delete: (path?: string) => (target: any, propertyKey: string) => void; +/** + * HTTP GET decorator + */ +export declare const Get: (path?: string) => (target: any, propertyKey: string) => void; +/** + * HTTP OPTIONS decorator + */ +export declare const Options: (path?: string) => (target: any, propertyKey: string) => void; +/** + * HTTP PATCH decorator + */ +export declare const Patch: (path?: string) => (target: any, propertyKey: string) => void; +/** + * HTTP POST decorator + */ +export declare const Post: (path?: string) => (target: any, propertyKey: string) => void; +/** + * HTTP PUT decorator + */ +export declare const Put: (path?: string) => (target: any, propertyKey: string) => void; diff --git a/Live/CWX_DebugTool/types/models/spt/config/IHttpConfig.d.ts b/Live/CWX_DebugTool/types/models/spt/config/IHttpConfig.d.ts index c41d035..3fe4787 100644 --- a/Live/CWX_DebugTool/types/models/spt/config/IHttpConfig.d.ts +++ b/Live/CWX_DebugTool/types/models/spt/config/IHttpConfig.d.ts @@ -1,5 +1,6 @@ import { IBaseConfig } from "./IBaseConfig"; export interface IHttpConfig extends IBaseConfig { + webSocketPingDelayMs: number; kind: "aki-http"; ip: string; port: number; diff --git a/Live/CWX_DebugTool/types/routers/ImageRouter.d.ts b/Live/CWX_DebugTool/types/routers/ImageRouter.d.ts index ab03977..675441c 100644 --- a/Live/CWX_DebugTool/types/routers/ImageRouter.d.ts +++ b/Live/CWX_DebugTool/types/routers/ImageRouter.d.ts @@ -1,13 +1,14 @@ /// import { IncomingMessage, ServerResponse } from "http"; -import { IHttpServer } from "../models/spt/server/IHttpServer"; import { ImageRouteService } from "../services/mod/image/ImageRouteService"; +import { HttpFileUtil } from "../utils/HttpFileUtil"; import { VFS } from "../utils/VFS"; export declare class ImageRouter { protected vfs: VFS; protected imageRouteService: ImageRouteService; - constructor(vfs: VFS, imageRouteService: ImageRouteService); + protected httpFileUtil: HttpFileUtil; + constructor(vfs: VFS, imageRouteService: ImageRouteService, httpFileUtil: HttpFileUtil); addRoute(key: string, valueToAdd: string): void; - sendImage(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any, httpServer: IHttpServer): void; + sendImage(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void; getImage(): string; } diff --git a/Live/CWX_DebugTool/types/routers/serializers/BundleSerializer.d.ts b/Live/CWX_DebugTool/types/routers/serializers/BundleSerializer.d.ts index 912db83..ca4d8b6 100644 --- a/Live/CWX_DebugTool/types/routers/serializers/BundleSerializer.d.ts +++ b/Live/CWX_DebugTool/types/routers/serializers/BundleSerializer.d.ts @@ -1,11 +1,14 @@ +/// +import { IncomingMessage, ServerResponse } from "http"; import { Serializer } from "../../di/Serializer"; import { BundleLoader } from "../../loaders/BundleLoader"; -import { IHttpServer } from "../../models/spt/server/IHttpServer"; import { ILogger } from "../../models/spt/utils/ILogger"; +import { HttpFileUtil } from "../../utils/HttpFileUtil"; export declare class BundleSerializer extends Serializer { protected logger: ILogger; protected bundleLoader: BundleLoader; - constructor(logger: ILogger, bundleLoader: BundleLoader); - serialize(sessionID: string, req: any, resp: any, body: any, httpServer: IHttpServer): void; + protected httpFileUtil: HttpFileUtil; + constructor(logger: ILogger, bundleLoader: BundleLoader, httpFileUtil: HttpFileUtil); + serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void; canHandle(route: string): boolean; } diff --git a/Live/CWX_DebugTool/types/routers/serializers/ImageSerializer.d.ts b/Live/CWX_DebugTool/types/routers/serializers/ImageSerializer.d.ts index 0e040d4..7f15bcf 100644 --- a/Live/CWX_DebugTool/types/routers/serializers/ImageSerializer.d.ts +++ b/Live/CWX_DebugTool/types/routers/serializers/ImageSerializer.d.ts @@ -1,9 +1,10 @@ -import { IHttpServer } from "../../models/spt/server/IHttpServer"; +/// import { Serializer } from "../../di/Serializer"; import { ImageRouter } from "../ImageRouter"; +import { IncomingMessage, ServerResponse } from "http"; export declare class ImageSerializer extends Serializer { protected imageRouter: ImageRouter; constructor(imageRouter: ImageRouter); - serialize(sessionID: string, req: any, resp: any, body: any, httpServer: IHttpServer): void; + serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void; canHandle(route: string): boolean; } diff --git a/Live/CWX_DebugTool/types/routers/serializers/NotifySerializer.d.ts b/Live/CWX_DebugTool/types/routers/serializers/NotifySerializer.d.ts index 1779ac9..0d8cc89 100644 --- a/Live/CWX_DebugTool/types/routers/serializers/NotifySerializer.d.ts +++ b/Live/CWX_DebugTool/types/routers/serializers/NotifySerializer.d.ts @@ -1,11 +1,12 @@ +/// +import { IncomingMessage, ServerResponse } from "http"; import { NotifierController } from "../../controllers/NotifierController"; import { Serializer } from "../../di/Serializer"; import { HttpServerHelper } from "../../helpers/HttpServerHelper"; -import { IHttpServer } from "../../models/spt/server/IHttpServer"; export declare class NotifySerializer extends Serializer { protected notifierController: NotifierController; protected httpServerHelper: HttpServerHelper; constructor(notifierController: NotifierController, httpServerHelper: HttpServerHelper); - serialize(_sessionID: string, req: any, resp: any, body: any, httpServer: IHttpServer): void; + serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void; canHandle(route: string): boolean; } diff --git a/Live/CWX_DebugTool/types/servers/HttpServer.d.ts b/Live/CWX_DebugTool/types/servers/HttpServer.d.ts index 44d802b..f572a8f 100644 --- a/Live/CWX_DebugTool/types/servers/HttpServer.d.ts +++ b/Live/CWX_DebugTool/types/servers/HttpServer.d.ts @@ -1,51 +1,34 @@ /// -/// -import http, { ServerResponse } from "http"; +import http, { IncomingMessage, ServerResponse } from "http"; +import WebSocket from "ws"; import { ApplicationContext } from "../context/ApplicationContext"; -import { Serializer } from "../di/Serializer"; import { HttpServerHelper } from "../helpers/HttpServerHelper"; import { NotifierHelper } from "../helpers/NotifierHelper"; import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; -import { IHttpServer } from "../models/spt/server/IHttpServer"; import { ILogger } from "../models/spt/utils/ILogger"; -import { HttpRouter } from "../routers/HttpRouter"; -import { HttpResponseUtil } from "../utils/HttpResponseUtil"; -import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; import { DatabaseServer } from "./DatabaseServer"; -export declare class HttpServer implements IHttpServer { - protected httpRouter: HttpRouter; +import { IHttpListener } from "./http/IHttpListener"; +export declare class HttpServer { protected logger: ILogger; protected randomUtil: RandomUtil; - protected jsonUtil: JsonUtil; - protected httpResponse: HttpResponseUtil; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; protected httpServerHelper: HttpServerHelper; - protected serializers: Serializer[]; + protected httpListeners: IHttpListener[]; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; - constructor(httpRouter: HttpRouter, // TODO: delay required - logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, httpServerHelper: HttpServerHelper, serializers: Serializer[], configServer: ConfigServer, applicationContext: ApplicationContext); - protected buffers: {}; - protected onReceive: {}; - protected onRespond: {}; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext); protected httpConfig: IHttpConfig; protected webSockets: {}; protected websocketPingHandler: any; getCookies(req: http.IncomingMessage): any; - resetBuffer(sessionID: string): void; - putInBuffer(sessionID: any, data: any, bufLength: number): boolean; - getFromBuffer(sessionID: string): any; - sendZlibJson(resp: any, output: any, sessionID: string): void; sendMessage(sessionID: string, output: INotification): void; - sendFile(resp: ServerResponse, file: any): void; isConnectionWebSocket(sessionID: string): boolean; - sendResponse(sessionID: string, req: any, resp: any, body: Buffer): void; - handleRequest(req: http.IncomingMessage, resp: http.ServerResponse): void; + handleRequest(req: IncomingMessage, resp: ServerResponse): void; load(): void; protected getRandomisedMessage(): string; - wsOnConnection(ws: any, req: any): void; + protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; } diff --git a/Live/CWX_DebugTool/types/servers/http/AkiHttpListener.d.ts b/Live/CWX_DebugTool/types/servers/http/AkiHttpListener.d.ts new file mode 100644 index 0000000..6f78939 --- /dev/null +++ b/Live/CWX_DebugTool/types/servers/http/AkiHttpListener.d.ts @@ -0,0 +1,26 @@ +/// +/// +import { IncomingMessage, ServerResponse } from "http"; +import { IHttpListener } from "./IHttpListener"; +import { Serializer } from "../../di/Serializer"; +import { ILogger } from "../../models/spt/utils/ILogger"; +import { HttpRouter } from "../../routers/HttpRouter"; +import { HttpResponseUtil } from "../../utils/HttpResponseUtil"; +import { JsonUtil } from "../../utils/JsonUtil"; +import { HttpBufferHandler } from "./HttpBufferHandler"; +export declare class AkiHttpListener implements IHttpListener { + protected httpRouter: HttpRouter; + protected serializers: Serializer[]; + protected logger: ILogger; + protected jsonUtil: JsonUtil; + protected httpResponse: HttpResponseUtil; + protected httpBufferHandler: HttpBufferHandler; + constructor(httpRouter: HttpRouter, // TODO: delay required + serializers: Serializer[], logger: ILogger, jsonUtil: JsonUtil, httpResponse: HttpResponseUtil, httpBufferHandler: HttpBufferHandler); + canHandle(_: string, req: IncomingMessage): boolean; + handle(sessionId: string, req: IncomingMessage, resp: ServerResponse): void; + sendResponse(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: Buffer, output: string): void; + getResponse(sessionID: string, req: IncomingMessage, body: Buffer): string; + protected getBodyInfo(body: Buffer): string; + sendZlibJson(resp: ServerResponse, output: any, sessionID: string): void; +} diff --git a/Live/CWX_DebugTool/types/servers/http/HttpBufferHandler.d.ts b/Live/CWX_DebugTool/types/servers/http/HttpBufferHandler.d.ts new file mode 100644 index 0000000..fec4936 --- /dev/null +++ b/Live/CWX_DebugTool/types/servers/http/HttpBufferHandler.d.ts @@ -0,0 +1,6 @@ +export declare class HttpBufferHandler { + protected buffers: {}; + resetBuffer(sessionID: string): void; + putInBuffer(sessionID: any, data: any, bufLength: number): boolean; + getFromBuffer(sessionID: string): any; +} diff --git a/Live/CWX_DebugTool/types/servers/http/HttpMethods.d.ts b/Live/CWX_DebugTool/types/servers/http/HttpMethods.d.ts new file mode 100644 index 0000000..96031e2 --- /dev/null +++ b/Live/CWX_DebugTool/types/servers/http/HttpMethods.d.ts @@ -0,0 +1,8 @@ +export declare enum HttpMethods { + OPTIONS = "OPTIONS", + GET = "GET", + POST = "POST", + PUT = "PUT", + PATCH = "PATCH", + DELETE = "DELETE" +} diff --git a/Live/CWX_DebugTool/types/servers/http/IHttpListener.d.ts b/Live/CWX_DebugTool/types/servers/http/IHttpListener.d.ts new file mode 100644 index 0000000..758bb5a --- /dev/null +++ b/Live/CWX_DebugTool/types/servers/http/IHttpListener.d.ts @@ -0,0 +1,6 @@ +/// +import { IncomingMessage, ServerResponse } from "http"; +export interface IHttpListener { + canHandle(sessionId: string, req: IncomingMessage): boolean; + handle(sessionId: string, req: IncomingMessage, resp: ServerResponse): void; +} diff --git a/Live/CWX_DebugTool/types/services/BotGenerationCacheService.d.ts b/Live/CWX_DebugTool/types/services/BotGenerationCacheService.d.ts index 670c583..ba53fec 100644 --- a/Live/CWX_DebugTool/types/services/BotGenerationCacheService.d.ts +++ b/Live/CWX_DebugTool/types/services/BotGenerationCacheService.d.ts @@ -35,9 +35,9 @@ export declare class BotGenerationCacheService { protected removeBotFromCache(indexOfBotToReturn: number): void; /** * Get index of bot profile that matches criteria - * @param role role of bot we want - * @param getPmc is requested bot a pmc - * @returns index of found bot + * @param role Role of bot wanted + * @param getPmc Requested bot a pmc + * @returns index of found bot, -1 if not found */ protected getIndexOfBotToReturn(role: string, getPmc: boolean): number; /** diff --git a/Live/CWX_DebugTool/types/services/ProfileFixerService.d.ts b/Live/CWX_DebugTool/types/services/ProfileFixerService.d.ts index 9cb5a38..e772919 100644 --- a/Live/CWX_DebugTool/types/services/ProfileFixerService.d.ts +++ b/Live/CWX_DebugTool/types/services/ProfileFixerService.d.ts @@ -1,6 +1,8 @@ +import { HideoutHelper } from "../helpers/HideoutHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { HideoutSlot } from "../models/eft/common/tables/IBotBase"; +import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; +import { StageBonus } from "../models/eft/hideout/IHideoutArea"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { HideoutAreas } from "../models/enums/HideoutAreas"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -9,8 +11,9 @@ import { Watermark } from "../utils/Watermark"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; + protected hideoutHelper: HideoutHelper; protected databaseServer: DatabaseServer; - constructor(logger: ILogger, watermark: Watermark, databaseServer: DatabaseServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, databaseServer: DatabaseServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -63,4 +66,21 @@ export declare class ProfileFixerService { */ protected updateProfilePocketsToNewId(pmcProfile: IPmcData): void; addMissingArmorRepairSkill(pmcProfile: IPmcData): void; + /** + * Iterate over players hideout areas and find what's build, look for missing bonuses those areas give and add them if missing + * @param pmcProfile Profile to update + */ + addMissingHideoutBonusesToProfile(pmcProfile: IPmcData): void; + /** + * + * @param profileBonuses bonuses from profile + * @param bonus bonus to find + * @returns matching bonus + */ + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus; + /** + * Checks profile inventiory for items that do not exist inside the items db + * @param pmcProfile Profile to check inventory of + */ + checkForOrphanedModdedItems(pmcProfile: IPmcData): void; } diff --git a/Live/CWX_DebugTool/types/services/mod/httpListener/HttpListenerMod.d.ts b/Live/CWX_DebugTool/types/services/mod/httpListener/HttpListenerMod.d.ts new file mode 100644 index 0000000..2cdfbda --- /dev/null +++ b/Live/CWX_DebugTool/types/services/mod/httpListener/HttpListenerMod.d.ts @@ -0,0 +1,10 @@ +/// +import { IncomingMessage, ServerResponse } from "http"; +import { IHttpListener } from "../../../servers/http/IHttpListener"; +export declare class HttpListenerMod implements IHttpListener { + private canHandleOverride; + private handleOverride; + constructor(canHandleOverride: (sessionId: string, req: IncomingMessage) => boolean, handleOverride: (sessionId: string, req: IncomingMessage, resp: ServerResponse) => void); + canHandle(sessionId: string, req: IncomingMessage): boolean; + handle(sessionId: string, req: IncomingMessage, resp: ServerResponse): void; +} diff --git a/Live/CWX_DebugTool/types/services/mod/httpListener/HttpListenerModService.d.ts b/Live/CWX_DebugTool/types/services/mod/httpListener/HttpListenerModService.d.ts new file mode 100644 index 0000000..9dd3473 --- /dev/null +++ b/Live/CWX_DebugTool/types/services/mod/httpListener/HttpListenerModService.d.ts @@ -0,0 +1,8 @@ +/// +import { IncomingMessage, ServerResponse } from "http"; +import { DependencyContainer } from "tsyringe"; +export declare class HttpListenerModService { + protected container: DependencyContainer; + constructor(container: DependencyContainer); + registerHttpListener(name: string, canHandleOverride: (sessionId: string, req: IncomingMessage) => boolean, handleOverride: (sessionId: string, req: IncomingMessage, resp: ServerResponse) => void): void; +} diff --git a/Live/CWX_DebugTool/types/utils/HttpFileUtil.d.ts b/Live/CWX_DebugTool/types/utils/HttpFileUtil.d.ts new file mode 100644 index 0000000..afc8409 --- /dev/null +++ b/Live/CWX_DebugTool/types/utils/HttpFileUtil.d.ts @@ -0,0 +1,8 @@ +/// +import { ServerResponse } from "http"; +import { HttpServerHelper } from "../helpers/HttpServerHelper"; +export declare class HttpFileUtil { + protected httpServerHelper: HttpServerHelper; + constructor(httpServerHelper: HttpServerHelper); + sendFile(resp: ServerResponse, file: any): void; +} diff --git a/Live/CWX_MasterKey/CWX_MasterKey 1.3.6/bepInEx/plugins/CWX-MasterKey.dll b/Live/CWX_MasterKey/CWX_MasterKey 1.3.6/bepInEx/plugins/CWX-MasterKey.dll deleted file mode 100644 index 052c745ba13b28166449c6bca7b2c0fb8a7eee17..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7680 zcmeHLdu&_hbwA&|Bt=mYEmF4pQWRRYJKB_4$+E22@mxJfSxhABY0GV#%2(8td@Yif zx%bi*lh{?@HfVvq(seCR6lt3l1=6{Dv|bk%ZHgj6(RN7JBHgeIftL;)nhizQVd#c- znX}*d?xjfDjfefY$4B1topZkPo!9rgcj8?iC6$PLc;0-I=sDC}1|_^ZSVwdC-mi!0 zdgDvGo)hCQ?V3Ap*s-Ezu2@<=memRc(}^wWF{@OF8HHGCayFJXm-J*yOK6X$dMZsc zE>vni+V;bWwb!UC)+Bm}+QA99+#UU>V|WJf5VcBNas6h7Cq}dm0(>qioqHdP^1oVp zB(qSybBJh?kwKyqC*t;Uj;I;D@AeVR-QIRLIz|+%X%B)PtD%#QzUF|AZDD|iWA*$7 zCQFRyT+*_wEGX&QAP^p?ZFp+RAiPgndd`F(`%35Vu&xd~HD!=!xQ3MIZxBBh_Dvx_ z{d_mktDA^~SYg!LtTjW6YcC#=@|S1KVrktK!^giiuy8w^0hZv zXec(*6^QtvB92jmK-^yupqs64BMakDj7PYMZqm)I)X>%tY3Ocod&Q%&fnL1=wZ6cu zKnptCZD7WsJJA-51iQl&c#Q3t-~^f}4r_@x#1k!XuoG-A(dLU|LM7r2jQisl$V9x6 z@c=cNTcNJ4F>!yiF^+)-)fw=p8Uvdno7q6y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s-#^`Q-|yIhA8$=={SHqLzi-v3mE07dfL7j&N9EC{Lnj|{rflCM-_qvL zs)1|cXw>9^$OoZY{@6DLr9y7$mUmR%scDat=|SA?k56ypfR0fZeMjU$T9h`*h{!!8 zSigIiAE-ObAH<=-_k)z|Td|b_*T!+jJ{0SGyqk_5Y;9sA^3%{^L5m>|dbZz-uW5aF z`th*8DT+d#Gvr<@3h*^oV zq{rt=2-~W}%M>4_cgs=Lrkm#}=rZ9)33+mAyuO% diff --git a/Live/CWX_MasterKey/CWX_MasterKey 1.3.7/bepInEx/plugins/CWX-MasterKey.dll b/Live/CWX_MasterKey/CWX_MasterKey 1.3.7/bepInEx/plugins/CWX-MasterKey.dll new file mode 100644 index 0000000000000000000000000000000000000000..89d126f4d2e118a6b00a1e8b85454d68e6e47e4e GIT binary patch literal 8704 zcmeHMeQZ?Ml|T2*%o}@bk3Da|Kmap*X2RGLe*gxSQj9;q)W!}rI5ei_dHigqo|!ki z_Xco~StpxBqEWh`YNdXpyOgd}A#JKOO1Bhks%?{Ov)!OJinbfI2+>`wHeGGEQPpg^ zX_oBo-1o*a11YQiS*h24=bo>7&bjA)zBhv(f0}$mD2Sis;bJ-)|-N6FH;Wbyo z^g{KuwO7QzwY8%s(snFwnKPE2jivNl&U9jvM$9VYV(DD0XJ{mrHK&YZU0rB{XL`7o zXh8UA)3E73jRs4n*>+fm2x?7>6SAaTWwn;D)O(EyKj^hwLem{8@A5(E+Y z5jrR0h#+Kv&aYV#j{*-RNZlN56$HE7wFuehsTxwvY94!bv_zU)30u=pz)(hPcu+&6 z+5yz_LHKX1A>}Njeoe%evc9UsLq#FoXxK#7YB-HIvW#xfjpY=Ksu8t0?6r$8lM=eF zoP`I!dP_y5s*OPm#Sv~I8jJ*+qok;3*_{a;bsi(;Cna73yz!QZRz<3sRoebC)Z+*x z5rr`#72NJD? zliD~YLnvBDk-7>e9#!Tf90{|Nx=JUt@r^|%wYM74w?!urzqyG`*TYMF{9Z;IDAG{j z#iPo+L?R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NrR7zmr5|jBmD{^sY3`5IZ5iP2V#FV= z7b*qrmsCvZJNT@}za2fehv+Sypk8@P!FOdkg422eu$K-2>&Gu`2SN7(_PM{h(To0H z-r^bTek}+t*8Js;3$`QqEmRU7=s_)Dm2Uxk^6)lblaFarYHX0LMj_R~wQ;!X@<`{S z+%3=f_ajyz?-G`G*xzYsgVbroG3Ea8VT~NnE`0kFxODJUATNE)p-1lRgzdZ6k(Lj+ zj$n<+wnbk(IFfA~*c?N?BF4MfXvG#N7JGg~UP5eGDE6<7_-jrQM{82X+k@|+LS~5X zOct`BBPXSZf48qB4(1I0@KY5=LC^r&&&bx?`#i2U9Qh2cQ2bkF49|e{HRSR68pXbf z{bh>paCgg5$)}s=Vc0SeM*(?q%A&rT4MM;9YiecN+cQ7x literal 0 HcmV?d00001 diff --git a/Live/CWX_MasterKey/CWX_MasterKey 1.3.6/user/mods/CWX-MasterKey 1.3.6/LICENSE.txt b/Live/CWX_MasterKey/CWX_MasterKey 1.3.7/user/mods/CWX-MasterKey 1.3.7/LICENSE.txt similarity index 100% rename from Live/CWX_MasterKey/CWX_MasterKey 1.3.6/user/mods/CWX-MasterKey 1.3.6/LICENSE.txt rename to Live/CWX_MasterKey/CWX_MasterKey 1.3.7/user/mods/CWX-MasterKey 1.3.7/LICENSE.txt diff --git a/Live/CWX_MasterKey/CWX_MasterKey 1.3.6/user/mods/CWX-MasterKey 1.3.6/package.json b/Live/CWX_MasterKey/CWX_MasterKey 1.3.7/user/mods/CWX-MasterKey 1.3.7/package.json similarity index 94% rename from Live/CWX_MasterKey/CWX_MasterKey 1.3.6/user/mods/CWX-MasterKey 1.3.6/package.json rename to Live/CWX_MasterKey/CWX_MasterKey 1.3.7/user/mods/CWX-MasterKey 1.3.7/package.json index 4ef5e2a..2b70942 100644 --- a/Live/CWX_MasterKey/CWX_MasterKey 1.3.6/user/mods/CWX-MasterKey 1.3.6/package.json +++ b/Live/CWX_MasterKey/CWX_MasterKey 1.3.7/user/mods/CWX-MasterKey 1.3.7/package.json @@ -1,10 +1,10 @@ { "name": "MasterKey", "author": "CWX", - "version": "1.3.6", + "version": "1.3.7", "license": "NCSA", "main": "src/mod.js", - "akiVersion": "3.2.3", + "akiVersion": "3.2.4", "scripts": { "setup:environment": "npm i", "build:unzipped": "copyfiles -e \"./node_modules/**/*.*\" -e \"./dist/**/*.*\" -e \"./package-lock.json\" -e \"./tsconfig.json\" -e \"./README.txt\" -e \"./mod.code-workspace\" ./**/*.* ./dist", @@ -22,4 +22,4 @@ "typescript": "4.6.4", "bestzip": "2.2.1" } -} +} \ No newline at end of file diff --git a/Live/CWX_MasterKey/CWX_MasterKey 1.3.6/user/mods/CWX-MasterKey 1.3.6/src/config.json b/Live/CWX_MasterKey/CWX_MasterKey 1.3.7/user/mods/CWX-MasterKey 1.3.7/src/config.json similarity index 100% rename from Live/CWX_MasterKey/CWX_MasterKey 1.3.6/user/mods/CWX-MasterKey 1.3.6/src/config.json rename to Live/CWX_MasterKey/CWX_MasterKey 1.3.7/user/mods/CWX-MasterKey 1.3.7/src/config.json diff --git a/Live/CWX_MasterKey/CWX_MasterKey 1.3.6/user/mods/CWX-MasterKey 1.3.6/src/mod.ts b/Live/CWX_MasterKey/CWX_MasterKey 1.3.7/user/mods/CWX-MasterKey 1.3.7/src/mod.ts similarity index 100% rename from Live/CWX_MasterKey/CWX_MasterKey 1.3.6/user/mods/CWX-MasterKey 1.3.6/src/mod.ts rename to Live/CWX_MasterKey/CWX_MasterKey 1.3.7/user/mods/CWX-MasterKey 1.3.7/src/mod.ts diff --git a/Live/CWX_MasterKey/CWX_MasterKey.csproj b/Live/CWX_MasterKey/CWX_MasterKey.csproj index 9de0a60..ac17f7b 100644 --- a/Live/CWX_MasterKey/CWX_MasterKey.csproj +++ b/Live/CWX_MasterKey/CWX_MasterKey.csproj @@ -2,35 +2,34 @@ net472 - CWX_MasterKey CWX-MasterKey - 1.3.5 + 1.3.7 - ..\Shared\AKI\Aki.Common.dll + ..\..\..\Shared\Aki\Aki.Common.dll - ..\Shared\AKI\Aki.Reflection.dll + ..\..\..\Shared\Aki\Aki.Reflection.dll - ..\..\..\ALT-Mods\Shared\EFT\Assembly-CSharp.dll + ..\..\..\Shared\EFT\Assembly-CSharp.dll - ..\Shared\BepInEx\BepInEx.dll + ..\..\..\Shared\BepInEx\BepInEx.dll - ..\Shared\EFT\Comfort.dll + ..\..\..\Shared\EFT\Comfort.dll - ..\Shared\EFT\Newtonsoft.Json.dll + ..\..\..\Shared\EFT\Newtonsoft.Json.dll - ..\Shared\EFT\UnityEngine.dll + ..\..\..\Shared\EFT\UnityEngine.dll - ..\Shared\EFT\UnityEngine.CoreModule.dll + ..\..\..\Shared\EFT\UnityEngine.CoreModule.dll diff --git a/Live/CWX_MasterKey/MasterKey.cs b/Live/CWX_MasterKey/MasterKey.cs index cf5b727..b4d71cc 100644 --- a/Live/CWX_MasterKey/MasterKey.cs +++ b/Live/CWX_MasterKey/MasterKey.cs @@ -1,96 +1,13 @@ using BepInEx; -using EFT.Interactive; -using System.Linq; -using UnityEngine; -using System.Net; -using System.Threading; -using System.Collections.Generic; -using Aki.Common.Http; -using Aki.Common.Utils; namespace CWX_MasterKey { - public static class MasterKey + [BepInPlugin("com.CWX.MasterKey", "CWX-MasterKey", "1.3.7")] + public class MasterKey : BaseUnityPlugin { - static object lockObject = new object(); - - // Black, Blue, Green, Red, Yellow, Violet - static string[] keys = new string[] { "5c1d0f4986f7744bb01837fa", "5c1d0c5f86f7744bb2683cf0", "5c1d0dc586f7744baf2e7b79", "5c1d0efb86f7744baf2e7b7b", "5c1d0d6d86f7744bb2683e1f", "5c1e495a86f7743109743dfb" }; - - public static void Start() + private void Awake() { - ConfigClass config = new ConfigClass(); - bool lockWasTaken = false; - - string keyToUse = "5c1d0d6d86f7744bb2683e1f"; - - try - { - Monitor.Enter(lockObject, ref lockWasTaken); - - config = GetConfig(); - } - catch (WebException) - { - Debug.LogError("[CWX_Masterkey] Issue happened whilst getting config from server"); - } - finally - { - if (lockWasTaken) - { - Monitor.Exit(lockObject); - } - } - - if (keys.Any(x => x == config.keyId)) - { - keyToUse = config.keyId; - } - - List allDoors = GameObject.FindObjectsOfType().ToList(); // mechanical doors - List allKeyCardDoors = GameObject.FindObjectsOfType().ToList(); // keycard doors - List allKeyContainers = GameObject.FindObjectsOfType().ToList(); // locked loot containers - List allTrunks = GameObject.FindObjectsOfType().ToList(); // locked car trunks - - foreach (Door door in allDoors) // mechanical doors - { - if (!door.KeyId.IsNullOrWhiteSpace() || !door.KeyId.IsNullOrEmpty()) - { - door.KeyId = keyToUse; - } - } - - foreach (KeycardDoor door in allKeyCardDoors) // keycard doors - { - if (!door.KeyId.IsNullOrWhiteSpace() || !door.KeyId.IsNullOrEmpty()) - { - door.KeyId = keyToUse; - } - } - - foreach (LootableContainer door in allKeyContainers) // locked loot containers - { - if (!door.KeyId.IsNullOrWhiteSpace() || !door.KeyId.IsNullOrEmpty()) - { - door.KeyId = keyToUse; - } - } - - foreach (Trunk door in allTrunks) // locked car trunks - { - if (!door.KeyId.IsNullOrWhiteSpace() || !door.KeyId.IsNullOrEmpty()) - { - door.KeyId = keyToUse; - } - } - } - - public static ConfigClass GetConfig() - { - var json = RequestHandler.GetJson($"/cwx/masterkey"); - var jsonClass = Json.Deserialize(json); - - return jsonClass; + new MasterKeyPatch().Enable(); } } -} \ No newline at end of file +} diff --git a/Live/CWX_MasterKey/ConfigClass.cs b/Live/CWX_MasterKey/MasterKeyConfigClass.cs similarity index 69% rename from Live/CWX_MasterKey/ConfigClass.cs rename to Live/CWX_MasterKey/MasterKeyConfigClass.cs index f98e0db..6b9c913 100644 --- a/Live/CWX_MasterKey/ConfigClass.cs +++ b/Live/CWX_MasterKey/MasterKeyConfigClass.cs @@ -1,6 +1,6 @@ namespace CWX_MasterKey { - public class ConfigClass + public class MasterKeyConfigClass { public string keyId { get; set; } } diff --git a/Live/CWX_MasterKey/Patch.cs b/Live/CWX_MasterKey/MasterKeyPatch.cs similarity index 81% rename from Live/CWX_MasterKey/Patch.cs rename to Live/CWX_MasterKey/MasterKeyPatch.cs index 00c10bf..a802da3 100644 --- a/Live/CWX_MasterKey/Patch.cs +++ b/Live/CWX_MasterKey/MasterKeyPatch.cs @@ -14,7 +14,9 @@ namespace CWX_MasterKey [PatchPostfix] private static void PatchPostFix() { - MasterKey.Start(); + MasterKeyScript masterKey = new MasterKeyScript(); + + masterKey.Start(); } } } \ No newline at end of file diff --git a/Live/CWX_MasterKey/MasterKeyScript.cs b/Live/CWX_MasterKey/MasterKeyScript.cs new file mode 100644 index 0000000..539e873 --- /dev/null +++ b/Live/CWX_MasterKey/MasterKeyScript.cs @@ -0,0 +1,113 @@ +using Aki.Common.Http; +using Aki.Common.Utils; +using BepInEx; +using Comfort.Common; +using EFT; +using EFT.Interactive; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Threading; +using UnityEngine; + +namespace CWX_MasterKey +{ + public class MasterKeyScript + { + private object _lockObject = new object(); + + // Black, Blue, Green, Red, Yellow, Violet + private readonly string[] _keys = { "5c1d0f4986f7744bb01837fa", "5c1d0c5f86f7744bb2683cf0", "5c1d0dc586f7744baf2e7b79", "5c1d0efb86f7744baf2e7b7b", "5c1d0d6d86f7744bb2683e1f", "5c1e495a86f7743109743dfb" }; + private string _keyToUse = "5c1d0d6d86f7744bb2683e1f"; + + public void Start() + { + MasterKeyConfigClass config = new MasterKeyConfigClass(); + bool lockWasTaken = false; + + try + { + Monitor.Enter(_lockObject, ref lockWasTaken); + + config = GetConfig(); + } + catch (WebException) + { + Debug.LogError("[CWX_MasterKey] Issue happened whilst getting config from server"); + } + finally + { + if (lockWasTaken) + { + Monitor.Exit(_lockObject); + } + } + + if (_keys.Any(x => x == config.keyId)) + { + _keyToUse = config.keyId; + } + + if (!CheckPlayer()) + { + return; + } + + List allDoors = GameObject.FindObjectsOfType().ToList(); // mechanical doors + List allKeyCardDoors = GameObject.FindObjectsOfType().ToList(); // keycard doors + List allKeyContainers = GameObject.FindObjectsOfType().ToList(); // locked loot containers + List allTrunks = GameObject.FindObjectsOfType().ToList(); // locked car trunks + + foreach (Door door in allDoors) // mechanical doors + { + if (!door.KeyId.IsNullOrWhiteSpace() || !door.KeyId.IsNullOrEmpty()) + { + door.KeyId = _keyToUse; + } + } + + foreach (KeycardDoor door in allKeyCardDoors) // keycard doors + { + if (!door.KeyId.IsNullOrWhiteSpace() || !door.KeyId.IsNullOrEmpty()) + { + door.KeyId = _keyToUse; + } + } + + foreach (LootableContainer door in allKeyContainers) // locked loot containers + { + if (!door.KeyId.IsNullOrWhiteSpace() || !door.KeyId.IsNullOrEmpty()) + { + door.KeyId = _keyToUse; + } + } + + foreach (Trunk door in allTrunks) // locked car trunks + { + if (!door.KeyId.IsNullOrWhiteSpace() || !door.KeyId.IsNullOrEmpty()) + { + door.KeyId = _keyToUse; + } + } + } + + public MasterKeyConfigClass GetConfig() + { + var json = RequestHandler.GetJson($"/cwx/masterkey"); + var jsonClass = Json.Deserialize(json); + + return jsonClass; + } + + public bool CheckPlayer() + { + GameWorld gameWorld = Singleton.Instance; + + Player player= gameWorld.RegisteredPlayers.Find(p => p.IsYourPlayer); + + var items = player.Profile.Inventory.Equipment.GetAllItems(); + + return items.Any(item => item.TemplateId == _keyToUse); + } + } +} \ No newline at end of file diff --git a/Live/CWX_MasterKey/program.cs b/Live/CWX_MasterKey/program.cs deleted file mode 100644 index ab73b19..0000000 --- a/Live/CWX_MasterKey/program.cs +++ /dev/null @@ -1,13 +0,0 @@ -using BepInEx; - -namespace CWX_MasterKey -{ - [BepInPlugin("com.CWX.MasterKey", "CWX-MasterKey", "1.3.5")] - public class Plugin : BaseUnityPlugin - { - private void Awake() - { - new MasterKeyPatch().Enable(); - } - } -} diff --git a/Live/CWX_Mods.sln b/Live/CWX_Mods.sln index 265998e..c0922f6 100644 --- a/Live/CWX_Mods.sln +++ b/Live/CWX_Mods.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.1.32407.343 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CWX_WeatherPatch", "CWX_WeatherPatcher\CWX_WeatherPatch.csproj", "{0E6813D8-8989-4643-9D11-138F21CE4963}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CWX_WeatherPatcher", "CWX_WeatherPatcher\CWX_WeatherPatcher.csproj", "{0E6813D8-8989-4643-9D11-138F21CE4963}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CWX_BushWhacker", "CWX_BushWhacker\CWX_BushWhacker.csproj", "{FBA1D35B-1115-4333-8A6F-6F5884BD47D9}" EndProject diff --git a/Live/CWX_VoiceAdder/CWX_VoiceAdder.csproj b/Live/CWX_VoiceAdder/CWX_VoiceAdder.csproj index 78c5d6a..5549b18 100644 --- a/Live/CWX_VoiceAdder/CWX_VoiceAdder.csproj +++ b/Live/CWX_VoiceAdder/CWX_VoiceAdder.csproj @@ -7,28 +7,28 @@ - ..\Shared\BepInEx\0Harmony.dll + ..\..\..\Shared\BepInEx\0Harmony.dll - ..\Shared\AKI\Aki.Common.dll + ..\..\..\Shared\Aki\Aki.Common.dll - ..\Shared\AKI\Aki.Reflection.dll + ..\..\..\Shared\Aki\Aki.Reflection.dll - ..\Shared\EFT\Assembly-CSharp.dll + ..\..\..\Shared\EFT\Assembly-CSharp.dll - ..\Shared\BepInEx\BepInEx.dll + ..\..\..\Shared\BepInEx\BepInEx.dll - ..\Shared\EFT\Newtonsoft.Json.dll + ..\..\..\Shared\EFT\Newtonsoft.Json.dll - ..\Shared\EFT\UnityEngine.dll + ..\..\..\Shared\EFT\UnityEngine.dll - ..\Shared\EFT\UnityEngine.CoreModule.dll + ..\..\..\Shared\EFT\UnityEngine.CoreModule.dll diff --git a/Live/CWX_WeatherPatcher/CWX_JsonConverter.cs b/Live/CWX_WeatherPatcher/CWX_JsonConverter.cs deleted file mode 100644 index f42f19c..0000000 --- a/Live/CWX_WeatherPatcher/CWX_JsonConverter.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace CWX_WeatherPatch -{ - public class JSONClass - { - public float Cloudness { get; set; } - public int WindDirection { get; set; } - public float Wind { get; set; } - public float Rain { get; set; } - public float RainRandomness { get; set; } - } -} diff --git a/Live/CWX_WeatherPatcher/CWX_WeatherPatch.csproj b/Live/CWX_WeatherPatcher/CWX_WeatherPatch.csproj deleted file mode 100644 index b7c60fd..0000000 --- a/Live/CWX_WeatherPatcher/CWX_WeatherPatch.csproj +++ /dev/null @@ -1,45 +0,0 @@ - - - - net472 - 2.4.4 - CWX-WeatherPatcher - - - - - ..\Shared\AKI\Aki.Common.dll - - - ..\Shared\AKI\Aki.Reflection.dll - - - ..\..\..\ALT-Mods\Shared\EFT\Assembly-CSharp.dll - - - ..\Shared\BepInEx\BepInEx.dll - - - ..\Shared\EFT\UnityEngine.dll - - - ..\Shared\EFT\UnityEngine.CoreModule.dll - - - - - - True - True - Settings.settings - - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - diff --git a/Live/CWX_WeatherPatcher/CWX_WeatherPatcher 2.4.4/BepInEx/plugins/CWX-WeatherPatcher.dll b/Live/CWX_WeatherPatcher/CWX_WeatherPatcher 2.4.4/BepInEx/plugins/CWX-WeatherPatcher.dll deleted file mode 100644 index 4e5b76b6f941df70586a3a0b446ec2d4dfcd7ddc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7168 zcmeHLeQX@n5ud%?J71jSh%Zh;2u&_=027j{lbApt5PzOy;xBx598!a`clT^>vUhvg z-3xJOB1hq)UsOdUEmVk-0%}n|poO-Ssz4E{5(yAdTeSlINIZGBjp5je=VJ8CoL5&q ztMt6Oa%j?U5=GmZu=RW*s}~BEo5+ZST`DAuLZYKToyc1`k(@ujcD1j1pp&RaQK|jm z5AP3FJ58$+bCo8ddT=5h_qC0#O$`4XdZa(2BM+aW1mDPh@w^FQPA6}=%gzSxS)Tx5CCIxufE-&WJ?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zqE?&uace}R6zYMl38{%aRD^GMM-$k$3z-D^4!Lf>&*zHH>jr*citiN{=Ev&w zy|@fOFW*5*@TFU|n+wy2Wf5akYs9Ns&unj2e2H&+((kSO{t3JD$P&I|C9qHSY9#`d eIZ2sEyw<1QkO=&3?DeWz^r_qQe*^w!9{3NA5c0GD diff --git a/Live/CWX_WeatherPatcher/CWX_WeatherPatcher 2.4.5/BepInEx/plugins/CWX-WeatherPatcher.dll b/Live/CWX_WeatherPatcher/CWX_WeatherPatcher 2.4.5/BepInEx/plugins/CWX-WeatherPatcher.dll new file mode 100644 index 0000000000000000000000000000000000000000..a8758690740c5a89c67dcf2751ac6edf8a93dde0 GIT binary patch literal 6144 zcmeHLeQX@n5ue>XpUpYBBzAB}lafmu8WWPkNgTdE?AUjXi@)$)zNo?8yL&z_?CoB5 z_Y%7yC_$wtQl&x*h?Z7rrJ}S_s}g|X{`+Z(&>0n&&lhUdc%iJrlmTfc;#3{Idsx#8I)J$2E` z8=p}|U*4FXH{4X!vCEELNfmX=vb|J6q@0?SGOX0lL@rgaOCr5|d17;*dNM;as%Z4i zwr@TcT6>K)rP`HVqLtvpeeN4q;+?|NkB56wfU55|GXgQ96F#4L8qMA(m9QRGCg1fJ zGwEBj%OM)qy9{`r&=r5vC16_LXMwu&ypVk=9SNCqhc}6^<(!`=(M0{bCc* zU)qTj$^Gv^XRk);ef7g*xZu@p16YITdyN^5~hfbLng6xliGvD zNzm5j@$2g2p`^NDbz}S{>RH9B-WW;LJQn%_+n4j$p2pbDUX|_$rzYJv@w4O5mQW`z zJ&xGo?Yq_)!B{rn9BGRLa-q09-5;!-14t~^E($nfg+79sew~|f; zR7_HT2&h&`oeQXhq`ntW%O&-w_K;FzfvW4E4)JZyp^=+YRHnF`&=qK>Ah0aRKx6V1DP*uXOVf{k9ifnsb zQ&4a`@3nvlx*TvN?U3+V2?rz`k?>Xt4@r0!Fizh9yqJDU-=~d$H&G9&__0_o>9Y4E z6@Z_lgW4{@Yl-nLjiD*|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!dePS|0C3fBl)1*_|MT-Ng12Og_df} z;O|#_PKAw?^LdNU2CAX27U^Rdd=)mesoYTRADVdnVE_8jZ};pvdHUg(-eMg?*G+HV zzJ2e+SSB@)Chm#0ArK0*a@A*1u_kJF1a&)y z%I3CNj>@A~2iHZvE-Tvx<+mqdUxHFa?h#H<^XF@tl`_4UxBu&-0>=P0J27?;)+*RN z*v2AeUI!t}u`VuMW< z>lM|rG@6ZA5?v$XK7iG8;dcdD!Y4`!^W>FotUzOoAAh#>skfB>pW$0!!F}ou{ojHA HWd!~MEo> + + + net472 + CWX-WeatherPatcher + 2.4.5 + + + + + ..\..\..\Shared\Aki\Aki.Common.dll + + + ..\..\..\Shared\Aki\Aki.Reflection.dll + + + ..\..\..\Shared\EFT\Assembly-CSharp.dll + + + ..\..\..\Shared\BepInEx\BepInEx.dll + + + ..\..\..\Shared\EFT\UnityEngine.dll + + + ..\..\..\Shared\EFT\UnityEngine.CoreModule.dll + + + + diff --git a/Live/CWX_WeatherPatcher/GClassPatch.cs b/Live/CWX_WeatherPatcher/GClassPatch.cs index fd8d192..97dd85d 100644 --- a/Live/CWX_WeatherPatcher/GClassPatch.cs +++ b/Live/CWX_WeatherPatcher/GClassPatch.cs @@ -1,10 +1,9 @@ using Aki.Reflection.Patching; using System.Reflection; -using EFT; namespace CWX_WeatherPatcher { - class GClassPatch : ModulePatch // MAKES CHANGES TO WeatherClass SMETHOD_0 + public class GClassPatch : ModulePatch // MAKES CHANGES TO WeatherClass SMETHOD_0 { protected override MethodBase GetTargetMethod() { diff --git a/Live/CWX_WeatherPatcher/GameWorldPatch.cs b/Live/CWX_WeatherPatcher/GameWorldPatch.cs index fbf36c3..5faa3b4 100644 --- a/Live/CWX_WeatherPatcher/GameWorldPatch.cs +++ b/Live/CWX_WeatherPatcher/GameWorldPatch.cs @@ -1,9 +1,8 @@ using System.Reflection; using Aki.Reflection.Patching; -using CWX_WeatherPatcher; using EFT; -namespace CWX_WeatherPatch +namespace CWX_WeatherPatcher { public class GameWorldPatch : ModulePatch { @@ -15,7 +14,7 @@ namespace CWX_WeatherPatch [PatchPostfix] private static void PatchPostFix() { - Plugin.Fix(); + WeatherPatcher.Fix(); } } } \ No newline at end of file diff --git a/Live/CWX_WeatherPatcher/LevelSettingsPatch.cs b/Live/CWX_WeatherPatcher/LevelSettingsPatch.cs index 39dfb89..64c6405 100644 --- a/Live/CWX_WeatherPatcher/LevelSettingsPatch.cs +++ b/Live/CWX_WeatherPatcher/LevelSettingsPatch.cs @@ -3,7 +3,7 @@ using System.Reflection; namespace CWX_WeatherPatcher { - class LevelSettingsPatch : ModulePatch // MAKES CHANGES TO LevelSettings + public class LevelSettingsPatch : ModulePatch // MAKES CHANGES TO LevelSettings { protected override MethodBase GetTargetMethod() { diff --git a/Live/CWX_WeatherPatcher/TOD_ScatteringPatch.cs b/Live/CWX_WeatherPatcher/TodScatteringPatch.cs similarity index 84% rename from Live/CWX_WeatherPatcher/TOD_ScatteringPatch.cs rename to Live/CWX_WeatherPatcher/TodScatteringPatch.cs index 1042acd..f6a3e98 100644 --- a/Live/CWX_WeatherPatcher/TOD_ScatteringPatch.cs +++ b/Live/CWX_WeatherPatcher/TodScatteringPatch.cs @@ -3,7 +3,7 @@ using System.Reflection; namespace CWX_WeatherPatcher { - class TOD_ScatteringPatch : ModulePatch // MAKES CHANGES TO TOD_SCATTERING FOG + public class TodScatteringPatch : ModulePatch // MAKES CHANGES TO TOD_SCATTERING FOG { protected override MethodBase GetTargetMethod() { diff --git a/Live/CWX_WeatherPatcher/Program.cs b/Live/CWX_WeatherPatcher/WeatherPatcher.cs similarity index 88% rename from Live/CWX_WeatherPatcher/Program.cs rename to Live/CWX_WeatherPatcher/WeatherPatcher.cs index 547d36e..05e15a5 100644 --- a/Live/CWX_WeatherPatcher/Program.cs +++ b/Live/CWX_WeatherPatcher/WeatherPatcher.cs @@ -1,18 +1,17 @@ using BepInEx; -using CWX_WeatherPatch; using EFT.Weather; namespace CWX_WeatherPatcher { - [BepInPlugin("com.CWX.WeatherPatcher", "CWX-WeatherPatcher", "2.4.4")] - public class Plugin : BaseUnityPlugin + [BepInPlugin("com.CWX.WeatherPatcher", "CWX-WeatherPatcher", "2.4.5")] + public class WeatherPatcher : BaseUnityPlugin { private void Awake() { new GClassPatch().Enable(); new CustomGlobalFogPatch().Enable(); new LevelSettingsPatch().Enable(); - new TOD_ScatteringPatch().Enable(); + new TodScatteringPatch().Enable(); new GameWorldPatch().Enable(); } diff --git a/WIP/CWX-HalloweenEvent/CWX_HalloweenEvent.csproj b/WIP/CWX-HalloweenEvent/CWX_HalloweenEvent.csproj new file mode 100644 index 0000000..54c16d4 --- /dev/null +++ b/WIP/CWX-HalloweenEvent/CWX_HalloweenEvent.csproj @@ -0,0 +1,36 @@ + + + + net472 + CWX_HalloweenEvent + 1.0.0 + + + + + ..\..\..\Shared\Aki\Aki.Common.dll + + + ..\..\..\Shared\Aki\Aki.Reflection.dll + + + ..\..\..\Shared\EFT\Assembly-CSharp.dll + + + ..\..\..\Shared\BepInEx\BepInEx.dll + + + ..\..\..\Shared\EFT\Comfort.dll + + + ..\..\..\Shared\EFT\Newtonsoft.Json.dll + + + ..\..\..\Shared\EFT\UnityEngine.dll + + + ..\..\..\Shared\EFT\UnityEngine.CoreModule.dll + + + + diff --git a/WIP/CWX-HalloweenEvent/CWX_HalloweenEvent.sln b/WIP/CWX-HalloweenEvent/CWX_HalloweenEvent.sln new file mode 100644 index 0000000..3e54ea6 --- /dev/null +++ b/WIP/CWX-HalloweenEvent/CWX_HalloweenEvent.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.3.32922.545 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CWX_HalloweenEvent", "CWX_HalloweenEvent.csproj", "{ABD20003-B8FA-4A42-A664-7BBAF4008C5A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {ABD20003-B8FA-4A42-A664-7BBAF4008C5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ABD20003-B8FA-4A42-A664-7BBAF4008C5A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ABD20003-B8FA-4A42-A664-7BBAF4008C5A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ABD20003-B8FA-4A42-A664-7BBAF4008C5A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {63808E07-B7DA-4D9A-B2D9-E0CB4352C497} + EndGlobalSection +EndGlobal diff --git a/WIP/CWX-HalloweenEvent/Changes/EventWeather.cs b/WIP/CWX-HalloweenEvent/Changes/EventWeather.cs new file mode 100644 index 0000000..825265a --- /dev/null +++ b/WIP/CWX-HalloweenEvent/Changes/EventWeather.cs @@ -0,0 +1,80 @@ +using Comfort.Common; +using EFT; +using EFT.Weather; +using GPUInstancer; +using System; +using UnityEngine; + +namespace CWX_HalloweenEvent.Changes +{ + public class EventWeather + { + public WeatherController WController; + public Transform SkyDomeGameObject; + public TOD_Sky SkySettings; + public TOD_Time TimeSettings; + public GameWorld GWorld; + + // The separation isn't needed, but is easier to read. + public void Enable() + { + // Initialise all Vars. + InitVars(); + + // Change all the vars. + ChangeVars(); + } + + private void InitVars() + { + // Finds the GameWorld Instance + GWorld = Singleton.Instance; + + // Finds the WeatherControllers Instance. + WController = WeatherController.Instance; + + // Finds the SkyDome GameObject. + SkyDomeGameObject = WController.transform.Find("Sky Dome"); + + // Finds the TOD_Time attached to SkyDome. + TimeSettings = SkyDomeGameObject.GetComponent(); + + // Finds the TOD_Sky Instance; + SkySettings = TOD_Sky.Instance; + } + + private void ChangeVars() + { + // Enables WeatherDebug and removes clouds and makes lightning 100% possible + WController.WeatherDebug.Enabled = true; + WController.WeatherDebug.CloudDensity = -1f; + WController.WeatherDebug.LightningThunderProbability = 100f; + + // Disables the higher clouds. + SkyDomeGameObject.transform.Find("Clouds").gameObject.SetActive(false); + + // Sets the SkyColor to Red + for (int i = 0; i < SkySettings.Night.SkyColor.colorKeys.Length ; i++) + { + SkySettings.Night.SkyColor.colorKeys[i].color.r = 1f; + SkySettings.Night.SkyColor.colorKeys[i].color.g = 0f; + SkySettings.Night.SkyColor.colorKeys[i].color.b = 0f; + SkySettings.Night.SkyColor.colorKeys[i].color.a = 1f; + } + + // Makes the stars a little brighter + SkySettings.Stars.Brightness = 10f; + + // Makes the moon 200% bigger + SkySettings.Moon.MeshSize = 3f; + + // Disables the lower clouds. + WController.CloudsController.enabled = false; + + WController.RainController.enabled = false; + + // Sets the time to midnight whatever was picked on the raid select screen. + TimeSettings.GameDateTime.Reset(new DateTime(2022, 10, 14, 3, 0, 0)); + } + } +} diff --git a/WIP/CWX-HalloweenEvent/HalloweenEvent.cs b/WIP/CWX-HalloweenEvent/HalloweenEvent.cs new file mode 100644 index 0000000..199e10f --- /dev/null +++ b/WIP/CWX-HalloweenEvent/HalloweenEvent.cs @@ -0,0 +1,37 @@ +using BepInEx; +using CWX_HalloweenEvent.Patches; +using EFT.Weather; +using System; + +namespace CWX_HalloweenEvent +{ + [BepInPlugin("com.cwx.HalloweenEvent", "cwx-HalloweenEvent", "1.0.0")] + public class HalloweenEvent : BaseUnityPlugin + { + public void Start() + { + new LevelSettingsPatch().Enable(); + new RaidStartPatch().Enable(); + } + + /* + * + * 1. Orange Moon and Evening time. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ + } +} diff --git a/WIP/CWX-HalloweenEvent/Patches/LevelSettingPatch.cs b/WIP/CWX-HalloweenEvent/Patches/LevelSettingPatch.cs new file mode 100644 index 0000000..adf4ba6 --- /dev/null +++ b/WIP/CWX-HalloweenEvent/Patches/LevelSettingPatch.cs @@ -0,0 +1,20 @@ +using Aki.Reflection.Patching; +using System.Reflection; + +namespace CWX_HalloweenEvent.Patches +{ + public class LevelSettingsPatch : ModulePatch + { + protected override MethodBase GetTargetMethod() + { + return typeof(LevelSettings).GetMethod("ApplySettings", BindingFlags.Public | BindingFlags.Instance); + } + + [PatchPostfix] + private static void PostFixPatch(ref LevelSettings __instance) + { + __instance.fog = false; + __instance.fogEndDistance = 0f; + } + } +} diff --git a/WIP/CWX-HalloweenEvent/Patches/RaidStartPatch.cs b/WIP/CWX-HalloweenEvent/Patches/RaidStartPatch.cs new file mode 100644 index 0000000..e178211 --- /dev/null +++ b/WIP/CWX-HalloweenEvent/Patches/RaidStartPatch.cs @@ -0,0 +1,22 @@ +using Aki.Reflection.Patching; +using EFT; +using System.Reflection; +using CWX_HalloweenEvent.Changes; + +namespace CWX_HalloweenEvent.Patches +{ + public class RaidStartPatch : ModulePatch + { + protected override MethodBase GetTargetMethod() + { + return typeof(GameWorld).GetMethod("OnGameStarted", BindingFlags.Public | BindingFlags.Instance); + } + + [PatchPostfix] + public static void PatchPostFix() + { + EventWeather eventWeather = new EventWeather(); + eventWeather.Enable(); + } + } +} diff --git a/WIP/CWX-PrePatcher/CWX_NewAiType/CWX_NewAiType.csproj b/WIP/CWX-PrePatcher/CWX_NewAiType/CWX_NewAiType.csproj new file mode 100644 index 0000000..f6c60a4 --- /dev/null +++ b/WIP/CWX-PrePatcher/CWX_NewAiType/CWX_NewAiType.csproj @@ -0,0 +1,39 @@ + + + + net472 + CWX_NewAiType + 1.0.0 + + + + + ..\..\..\..\Shared\BepInEx\0Harmony.dll + + + ..\..\..\..\Shared\Aki\Aki.Common.dll + + + ..\..\..\..\Shared\Aki\Aki.Reflection.dll + + + ..\..\..\..\Shared\EFT\Assembly-CSharp.dll + + + ..\..\..\..\Shared\BepInEx\BepInEx.dll + + + ..\..\..\..\Shared\EFT\Comfort.dll + + + ..\..\..\..\Shared\EFT\Newtonsoft.Json.dll + + + ..\..\..\..\Shared\EFT\UnityEngine.dll + + + ..\..\..\..\Shared\EFT\UnityEngine.CoreModule.dll + + + + diff --git a/WIP/CWX-PrePatcher/CWX_NewAiType/Constants/Constants.cs b/WIP/CWX-PrePatcher/CWX_NewAiType/Constants/Constants.cs new file mode 100644 index 0000000..948433c --- /dev/null +++ b/WIP/CWX-PrePatcher/CWX_NewAiType/Constants/Constants.cs @@ -0,0 +1,16 @@ +namespace CWX_NewAiType.Constants +{ + public static class Constants + { + public static class WildSpawnType + { + public const string sptUsec = "sptUsec"; + + } + + public static class CounterTag + { + public const string KilledSptUsec = "KilledSptUsec"; + } + } +} diff --git a/WIP/CWX-PrePatcher/CWX_NewAiType/NewAiType.cs b/WIP/CWX-PrePatcher/CWX_NewAiType/NewAiType.cs new file mode 100644 index 0000000..c29e3f4 --- /dev/null +++ b/WIP/CWX-PrePatcher/CWX_NewAiType/NewAiType.cs @@ -0,0 +1,15 @@ +using BepInEx; +using CWX_NewAiType.Patches; + +namespace CWX_NewAiType +{ + [BepInPlugin("com.CWX.NewAiType", "CWX-NewAiType", "1.0.0")] + public class NewAiType : BaseUnityPlugin + { + public NewAiType() + { + StaticPatches.PatchBotGlobalSettings(); + StaticPatches.InitKillCounters(); + } + } +} \ No newline at end of file diff --git a/WIP/CWX-PrePatcher/CWX_NewAiType/Patches/PlayerStatTrackerOnKillPatch.cs b/WIP/CWX-PrePatcher/CWX_NewAiType/Patches/PlayerStatTrackerOnKillPatch.cs new file mode 100644 index 0000000..f3d7c25 --- /dev/null +++ b/WIP/CWX-PrePatcher/CWX_NewAiType/Patches/PlayerStatTrackerOnKillPatch.cs @@ -0,0 +1,191 @@ +using CWX_NewAiType.utils; +using EFT; +using HarmonyLib; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection.Emit; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using Aki.Reflection.Patching; +using CWX_NewAiType.Constants; + +namespace CWX_NewAiType.Patches +{ + internal class PlayerStatTrackerOnKillPatch : ModulePatch + { + protected override MethodBase GetTargetMethod() + { + var method = ClassResolver.StatisticsServerClass + .GetMethod("OnEnemyKill", BindingFlags.Public | BindingFlags.Instance); + + if (method == null) + { + throw new NullReferenceException(); + } + + return method; + } + + private static IEnumerable PatchTranspile(ILGenerator generator, IEnumerable instructions) + { + var codes = new List(instructions); + + var newInstructionInsertIndex = -1; + + // Generate various labels we'll be using later + var SptInstructionStartLabel = generator.DefineLabel(); + var killedSptUsecLabel = generator.DefineLabel(); + var SptAddLongJumpLabel = generator.DefineLabel(); + var SptSkipFlagLabel = generator.DefineLabel(); + + // This label we'll need to locate when scanning through instructions + var switchEndLabel = default(Label); + var killXpClassGetter = default(MethodInfo); + + for (var i = 0; i < codes.Count; i++) + { + // We locate the label that points to the end of the switch statement + if (codes[i].opcode == OpCodes.Ldfld && + (FieldInfo)codes[i].operand == AccessTools.Field(ClassResolver.KillExperienceConfigClass, "VictimLevelExp")) + { + switchEndLabel = (Label)codes[i + 2].operand; + continue; + } + + // We locate the index for where our instructions will be inserted + if (codes[i].opcode == OpCodes.Ldfld && + (FieldInfo)codes[i].operand == AccessTools.Field(ClassResolver.KillExperienceConfigClass, "VictimBotLevelExp")) + { + newInstructionInsertIndex = i + 2; + killXpClassGetter = (MethodInfo)codes[i - 2].operand; + continue; + } + + // We locate the instruction from which we can locate the relevant switch statement + if (codes[i].opcode == OpCodes.Ldsfld && + (FieldInfo)codes[i].operand == AccessTools.Field(ClassResolver.StatisticsCounterClass, "KilledUsec")) + { + // From here, 4 codes back is where the switch should start + if (codes[i - 4].opcode != OpCodes.Switch) + { + throw new NullReferenceException(); + } + + // We grab the switch operand, which is just an array of labels + var switchOperand = (Label[])codes[i - 4].operand; + // The third label in the switch operand points to the ArgumentOutOfRangeException + var outOfRangeLabel = switchOperand[2]; + + // We create a new list of labels, and add all the old values to it + var newSwitchOperand = new List