0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 06:50:44 -05:00

Move BTR code into Aki.Custom (!66)

- Move most BTR code to Aki.Custom (Leaving debug commands in Aki.Debugging)
- Make BTR patches public to match other patches
- Disable debug BTR command patches

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: SPT-AKI/Modules#66
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
This commit is contained in:
DrakiaXYZ 2024-01-23 08:47:09 +00:00 committed by chomp
parent dee1e4a76c
commit 701c3a6685
22 changed files with 53 additions and 54 deletions

View File

@ -39,6 +39,7 @@
<ProjectReference Include="..\Aki.PrePatch\Aki.PrePatch.csproj" /> <ProjectReference Include="..\Aki.PrePatch\Aki.PrePatch.csproj" />
<ProjectReference Include="..\Aki.Common\Aki.Common.csproj" /> <ProjectReference Include="..\Aki.Common\Aki.Common.csproj" />
<ProjectReference Include="..\Aki.Reflection\Aki.Reflection.csproj" /> <ProjectReference Include="..\Aki.Reflection\Aki.Reflection.csproj" />
<ProjectReference Include="..\Aki.SinglePlayer\Aki.SinglePlayer.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,6 +1,7 @@
using System; using System;
using Aki.Common; using Aki.Common;
using Aki.Custom.Airdrops.Patches; using Aki.Custom.Airdrops.Patches;
using Aki.Custom.BTR.Patches;
using Aki.Custom.Patches; using Aki.Custom.Patches;
using Aki.Custom.Utils; using Aki.Custom.Utils;
using BepInEx; using BepInEx;
@ -49,6 +50,19 @@ namespace Aki.Custom
new RagfairFeePatch().Enable(); new RagfairFeePatch().Enable();
new ScavQuestPatch().Enable(); new ScavQuestPatch().Enable();
new FixBrokenSpawnOnSandboxPatch().Enable(); new FixBrokenSpawnOnSandboxPatch().Enable();
new BTRPathLoadPatch().Enable();
new BTRActivateTraderDialogPatch().Enable();
new BTRInteractionPatch().Enable();
new BTRExtractPassengersPatch().Enable();
new BTRBotAttachPatch().Enable();
new BTRBotInitPatch().Enable();
new BTRReceiveDamageInfoPatch().Enable();
new BTRTurretCanShootPatch().Enable();
new BTRTurretDefaultAimingPositionPatch().Enable();
new BTRIsDoorsClosedPath().Enable();
new BTRPatch().Enable();
new BTRTransferItemsPatch().Enable();
new BTREndRaidItemDeliveryPatch().Enable();
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -1,4 +1,4 @@
using Aki.Debugging.BTR.Utils; using Aki.Custom.BTR.Utils;
using Aki.SinglePlayer.Utils.TraderServices; using Aki.SinglePlayer.Utils.TraderServices;
using Comfort.Common; using Comfort.Common;
using EFT; using EFT;
@ -14,7 +14,7 @@ using UnityEngine;
using Random = UnityEngine.Random; using Random = UnityEngine.Random;
using BotEventHandler = GClass595; using BotEventHandler = GClass595;
namespace Aki.Debugging.BTR namespace Aki.Custom.BTR
{ {
public class BTRManager : MonoBehaviour public class BTRManager : MonoBehaviour
{ {

View File

@ -2,7 +2,7 @@
using EFT.Interactive; using EFT.Interactive;
using UnityEngine; using UnityEngine;
namespace Aki.Debugging.BTR namespace Aki.Custom.BTR
{ {
public class BTRRoadKillTrigger : DamageTrigger public class BTRRoadKillTrigger : DamageTrigger
{ {

View File

@ -8,9 +8,9 @@ using System;
using System.Reflection; using System.Reflection;
using static EFT.UI.TraderDialogScreen; using static EFT.UI.TraderDialogScreen;
namespace Aki.Debugging.BTR.Patches namespace Aki.Custom.BTR.Patches
{ {
internal class BTRActivateTraderDialogPatch : ModulePatch public class BTRActivateTraderDialogPatch : ModulePatch
{ {
private static FieldInfo _playerInventoryControllerField; private static FieldInfo _playerInventoryControllerField;
private static FieldInfo _playerQuestControllerField; private static FieldInfo _playerQuestControllerField;

View File

@ -8,7 +8,7 @@ using HarmonyLib;
using System; using System;
using System.Reflection; using System.Reflection;
namespace Aki.Debugging.BTR.Patches namespace Aki.Custom.BTR.Patches
{ {
// Fixes the BTR Bot initialization in AttachBot() of BTRTurretView // Fixes the BTR Bot initialization in AttachBot() of BTRTurretView
// //
@ -16,7 +16,7 @@ namespace Aki.Debugging.BTR.Patches
// ClientGameWorld in LiveEFT will register the server-side BTR Bot as type ObservedPlayerView and is stored in GameWorld's allObservedPlayersByID dictionary. // ClientGameWorld in LiveEFT will register the server-side BTR Bot as type ObservedPlayerView and is stored in GameWorld's allObservedPlayersByID dictionary.
// In SPT, GameWorld.allObservedPlayersByID is empty which results in the game never finishing the initialization of the BTR Bot which includes disabling its gun, voice and mesh renderers. // In SPT, GameWorld.allObservedPlayersByID is empty which results in the game never finishing the initialization of the BTR Bot which includes disabling its gun, voice and mesh renderers.
// For now, we do dirty patches to work around the lack of ObservedPlayerView, using Player instead. // For now, we do dirty patches to work around the lack of ObservedPlayerView, using Player instead.
internal class BTRBotAttachPatch : ModulePatch public class BTRBotAttachPatch : ModulePatch
{ {
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
{ {

View File

@ -10,7 +10,7 @@ using System.Linq;
using System.Reflection; using System.Reflection;
using UnityEngine; using UnityEngine;
namespace Aki.Debugging.BTR.Patches namespace Aki.Custom.BTR.Patches
{ {
// Fixes the BTR Bot initialization in method_1() of BTRTurretView // Fixes the BTR Bot initialization in method_1() of BTRTurretView
// //
@ -18,7 +18,7 @@ namespace Aki.Debugging.BTR.Patches
// ClientGameWorld in LiveEFT will register the server-side BTR Bot as type ObservedPlayerView and is stored in GameWorld's allObservedPlayersByID dictionary. // ClientGameWorld in LiveEFT will register the server-side BTR Bot as type ObservedPlayerView and is stored in GameWorld's allObservedPlayersByID dictionary.
// In SPT, allObservedPlayersByID is empty which results in the game never finishing the initialization of the BTR Bot which includes disabling its gun, voice and mesh renderers. // In SPT, allObservedPlayersByID is empty which results in the game never finishing the initialization of the BTR Bot which includes disabling its gun, voice and mesh renderers.
// For now, we do dirty patches to work around the lack of ObservedPlayerView, using Player instead. // For now, we do dirty patches to work around the lack of ObservedPlayerView, using Player instead.
internal class BTRBotInitPatch : ModulePatch public class BTRBotInitPatch : ModulePatch
{ {
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
{ {

View File

@ -1,6 +1,5 @@
using Aki.Common.Http; using Aki.Common.Http;
using Aki.Common.Utils; using Aki.Custom.BTR.Utils;
using Aki.Debugging.BTR.Utils;
using Aki.Reflection.Patching; using Aki.Reflection.Patching;
using Aki.Reflection.Utils; using Aki.Reflection.Utils;
using Comfort.Common; using Comfort.Common;
@ -11,9 +10,9 @@ using System;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
namespace Aki.Debugging.BTR.Patches namespace Aki.Custom.BTR.Patches
{ {
internal class BTREndRaidItemDeliveryPatch : ModulePatch public class BTREndRaidItemDeliveryPatch : ModulePatch
{ {
private static JsonConverter[] _defaultJsonConverters; private static JsonConverter[] _defaultJsonConverters;

View File

@ -5,9 +5,9 @@ using EFT.Vehicle;
using HarmonyLib; using HarmonyLib;
using System.Reflection; using System.Reflection;
namespace Aki.Debugging.BTR.Patches namespace Aki.Custom.BTR.Patches
{ {
internal class BTRExtractPassengersPatch : ModulePatch public class BTRExtractPassengersPatch : ModulePatch
{ {
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
{ {

View File

@ -7,9 +7,9 @@ using HarmonyLib;
using System.Reflection; using System.Reflection;
using GlobalEventHandler = GClass2909; using GlobalEventHandler = GClass2909;
namespace Aki.Debugging.BTR.Patches namespace Aki.Custom.BTR.Patches
{ {
internal class BTRInteractionPatch : ModulePatch public class BTRInteractionPatch : ModulePatch
{ {
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
{ {

View File

@ -4,9 +4,9 @@ using EFT;
using HarmonyLib; using HarmonyLib;
using System.Reflection; using System.Reflection;
namespace Aki.Debugging.BTR.Patches namespace Aki.Custom.BTR.Patches
{ {
internal class BTRIsDoorsClosedPath : ModulePatch public class BTRIsDoorsClosedPath : ModulePatch
{ {
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
{ {

View File

@ -6,12 +6,12 @@ using EFT;
using EFT.UI; using EFT.UI;
using HarmonyLib; using HarmonyLib;
namespace Aki.Debugging.BTR.Patches namespace Aki.Custom.BTR.Patches
{ {
/// <summary> /// <summary>
/// Adds a BTRManager component to the GameWorld game object when raid starts. /// Adds a BTRManager component to the GameWorld game object when raid starts.
/// </summary> /// </summary>
internal class BTRPatch : ModulePatch public class BTRPatch : ModulePatch
{ {
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
{ {

View File

@ -4,11 +4,11 @@ using EFT;
using HarmonyLib; using HarmonyLib;
using System.Reflection; using System.Reflection;
namespace Aki.Debugging.BTR.Patches namespace Aki.Custom.BTR.Patches
{ {
// The BTRManager MapPathsConfiguration loading depends on the game state being set to Starting // The BTRManager MapPathsConfiguration loading depends on the game state being set to Starting
// so set it to Starting while the method is running, then reset it afterwards // so set it to Starting while the method is running, then reset it afterwards
internal class BTRPathLoadPatch : ModulePatch public class BTRPathLoadPatch : ModulePatch
{ {
private static PropertyInfo _statusProperty; private static PropertyInfo _statusProperty;
private static GameStatus originalStatus; private static GameStatus originalStatus;

View File

@ -6,12 +6,12 @@ using HarmonyLib;
using System.Reflection; using System.Reflection;
using BotEventHandler = GClass595; using BotEventHandler = GClass595;
namespace Aki.Debugging.BTR.Patches namespace Aki.Custom.BTR.Patches
{ {
/// <summary> /// <summary>
/// Patches an empty method in <see cref="BTRView"/> to handle updating the BTR bot's Neutrals and Enemies lists in response to taking damage. /// Patches an empty method in <see cref="BTRView"/> to handle updating the BTR bot's Neutrals and Enemies lists in response to taking damage.
/// </summary> /// </summary>
internal class BTRReceiveDamageInfoPatch : ModulePatch public class BTRReceiveDamageInfoPatch : ModulePatch
{ {
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
{ {

View File

@ -1,13 +1,13 @@
using Aki.Debugging.BTR.Utils; using Aki.Custom.BTR.Utils;
using Aki.Reflection.Patching; using Aki.Reflection.Patching;
using Aki.SinglePlayer.Utils.TraderServices; using Aki.SinglePlayer.Utils.TraderServices;
using EFT.UI; using EFT.UI;
using HarmonyLib; using HarmonyLib;
using System.Reflection; using System.Reflection;
namespace Aki.Debugging.BTR.Patches namespace Aki.Custom.BTR.Patches
{ {
internal class BTRTransferItemsPatch : ModulePatch public class BTRTransferItemsPatch : ModulePatch
{ {
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
{ {

View File

@ -4,9 +4,9 @@ using HarmonyLib;
using System.Reflection; using System.Reflection;
using UnityEngine; using UnityEngine;
namespace Aki.Debugging.BTR.Patches namespace Aki.Custom.BTR.Patches
{ {
internal class BTRTurretCanShootPatch : ModulePatch public class BTRTurretCanShootPatch : ModulePatch
{ {
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
{ {

View File

@ -4,9 +4,9 @@ using HarmonyLib;
using System.Reflection; using System.Reflection;
using UnityEngine; using UnityEngine;
namespace Aki.Debugging.BTR.Patches namespace Aki.Custom.BTR.Patches
{ {
internal class BTRTurretDefaultAimingPositionPatch : ModulePatch public class BTRTurretDefaultAimingPositionPatch : ModulePatch
{ {
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
{ {

View File

@ -6,7 +6,7 @@ using EFT.InventoryLogic;
using Newtonsoft.Json; using Newtonsoft.Json;
using System; using System;
namespace Aki.Debugging.BTR.Utils namespace Aki.Custom.BTR.Utils
{ {
public static class BTRUtil public static class BTRUtil
{ {

View File

@ -29,9 +29,9 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Aki.Common\Aki.Common.csproj" /> <ProjectReference Include="..\Aki.Common\Aki.Common.csproj" />
<ProjectReference Include="..\Aki.Custom\Aki.Custom.csproj" />
<ProjectReference Include="..\Aki.PrePatch\Aki.PrePatch.csproj" /> <ProjectReference Include="..\Aki.PrePatch\Aki.PrePatch.csproj" />
<ProjectReference Include="..\Aki.Reflection\Aki.Reflection.csproj" /> <ProjectReference Include="..\Aki.Reflection\Aki.Reflection.csproj" />
<ProjectReference Include="..\Aki.SinglePlayer\Aki.SinglePlayer.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -1,6 +1,5 @@
using System; using System;
using Aki.Common; using Aki.Common;
using Aki.Debugging.BTR.Patches;
using Aki.Debugging.Patches; using Aki.Debugging.Patches;
using BepInEx; using BepInEx;
@ -18,23 +17,10 @@ namespace Aki.Debugging
new EndRaidDebug().Enable(); new EndRaidDebug().Enable();
// new CoordinatesPatch().Enable(); // new CoordinatesPatch().Enable();
// new StaticLootDumper().Enable(); // new StaticLootDumper().Enable();
new BTRPathLoadPatch().Enable();
new BTRActivateTraderDialogPatch().Enable();
new BTRInteractionPatch().Enable();
new BTRExtractPassengersPatch().Enable();
new BTRBotAttachPatch().Enable();
new BTRBotInitPatch().Enable();
new BTRReceiveDamageInfoPatch().Enable();
new BTRTurretCanShootPatch().Enable();
new BTRTurretDefaultAimingPositionPatch().Enable();
new BTRIsDoorsClosedPath().Enable();
new BTRPatch().Enable();
new BTRTransferItemsPatch().Enable();
new BTREndRaidItemDeliveryPatch().Enable();
// Debug command patches, can be disabled later // BTR debug command patches, can be disabled later
new BTRDebugCommandPatch().Enable(); //new BTRDebugCommandPatch().Enable();
new BTRDebugDataPatch().Enable(); //new BTRDebugDataPatch().Enable();
//new PMCBotSpawnLocationPatch().Enable(); //new PMCBotSpawnLocationPatch().Enable();
} }

View File

@ -1,13 +1,12 @@
using Aki.Debugging.BTR.Utils; using Aki.Custom.BTR.Patches;
using Aki.Reflection.Patching; using Aki.Reflection.Patching;
using Aki.SinglePlayer.Utils.TraderServices; using Aki.SinglePlayer.Utils.TraderServices;
using EFT; using EFT;
using EFT.Console.Core;
using EFT.UI; using EFT.UI;
using HarmonyLib; using HarmonyLib;
using System.Reflection; using System.Reflection;
namespace Aki.Debugging.BTR.Patches namespace Aki.Debugging.Patches
{ {
// Enable the `debug_show_dialog_screen` command, and custom `btr_deliver_items` command // Enable the `debug_show_dialog_screen` command, and custom `btr_deliver_items` command
internal class BTRDebugCommandPatch : ModulePatch internal class BTRDebugCommandPatch : ModulePatch