diff --git a/Fika.Core/Coop/GameMode/CoopGame.cs b/Fika.Core/Coop/GameMode/CoopGame.cs index 42c680a6..d44d9a0c 100644 --- a/Fika.Core/Coop/GameMode/CoopGame.cs +++ b/Fika.Core/Coop/GameMode/CoopGame.cs @@ -614,7 +614,10 @@ private void SyncTransitControllers() TransitControllerAbstractClass transitController = Singleton.Instance.TransitController; if (transitController == null) { - Logger.LogError("SyncTransitControllers: TransitController was null!"); + if (FikaPlugin.Instance.EnableTransits) + { + Logger.LogError("SyncTransitControllers: TransitController was null!"); + } return; } @@ -1060,7 +1063,7 @@ public async Task InitPlayer(BotControllerSettings botsSettings, string backendU BackendConfigSettingsClass.GClass1529 transitSettings = instance.transitSettings; transitActive = transitSettings != null && transitSettings.active; } - if (transitActive) + if (transitActive && FikaPlugin.Instance.EnableTransits) { gameWorld.TransitController = isServer ? new FikaHostTransitController(instance.transitSettings, Location_0.transitParameters, Profile_0, localRaidSettings_0) : new FikaClientTransitController(instance.transitSettings, Location_0.transitParameters, @@ -1068,6 +1071,7 @@ public async Task InitPlayer(BotControllerSettings botsSettings, string backendU } else { + Logger.LogInfo("Transits are disabled"); TransitControllerAbstractClass.DisableTransitPoints(); } diff --git a/Fika.Core/FikaPlugin.cs b/Fika.Core/FikaPlugin.cs index 63029ffa..781dfd93 100644 --- a/Fika.Core/FikaPlugin.cs +++ b/Fika.Core/FikaPlugin.cs @@ -11,6 +11,7 @@ using Fika.Core.Coop.Patches.Lighthouse; using Fika.Core.Coop.Patches.SPTBugs; using Fika.Core.EssentialPatches; +using Fika.Core.Models; using Fika.Core.Networking.Http; using Fika.Core.Networking.Websocket; using Fika.Core.UI; @@ -208,6 +209,7 @@ public ManualLogSource FikaLogger public bool UseInertia; public bool SharedQuestProgression; public bool CanEditRaidSettings; + public bool EnableTransits; #endregion #region natpunch config @@ -403,6 +405,7 @@ private void GetClientConfig() UseInertia = clientConfig.UseInertia; SharedQuestProgression = clientConfig.SharedQuestProgression; CanEditRaidSettings = clientConfig.CanEditRaidSettings; + EnableTransits = clientConfig.EnableTransits; clientConfig.LogValues(); } diff --git a/Fika.Core/Models/ClientConfigModel.cs b/Fika.Core/Models/ClientConfigModel.cs index 9254e723..dff2dc42 100644 --- a/Fika.Core/Models/ClientConfigModel.cs +++ b/Fika.Core/Models/ClientConfigModel.cs @@ -2,7 +2,7 @@ using System.Reflection; using System.Runtime.Serialization; -namespace Fika.Core.UI.Models +namespace Fika.Core.Models { [DataContract] public struct ClientConfigModel @@ -40,8 +40,11 @@ public struct ClientConfigModel [DataMember(Name = "canEditRaidSettings")] public bool CanEditRaidSettings; + [DataMember(Name = "enableTransits")] + public bool EnableTransits; + public ClientConfigModel(bool useBTR, bool friendlyFire, bool dynamicVExfils, bool allowFreeCam, bool allowSpectateFreeCam, bool allowItemSending, string[] blacklistedItems, bool forceSaveOnDeath, bool useInertia, - bool sharedQuestProgression, bool canEditRaidSettings) + bool sharedQuestProgression, bool canEditRaidSettings, bool enableTransits) { UseBTR = useBTR; FriendlyFire = friendlyFire; @@ -54,6 +57,7 @@ public ClientConfigModel(bool useBTR, bool friendlyFire, bool dynamicVExfils, bo UseInertia = useInertia; SharedQuestProgression = sharedQuestProgression; CanEditRaidSettings = canEditRaidSettings; + EnableTransits = enableTransits; } public void LogValues() diff --git a/Fika.Core/Networking/Http/FikaRequestHandler.cs b/Fika.Core/Networking/Http/FikaRequestHandler.cs index 91ed1965..2e639dda 100644 --- a/Fika.Core/Networking/Http/FikaRequestHandler.cs +++ b/Fika.Core/Networking/Http/FikaRequestHandler.cs @@ -1,5 +1,6 @@ using EFT; using Fika.Core.Coop.Custom; +using Fika.Core.Models; using Fika.Core.Networking.Models.Presence; using Fika.Core.UI.Models; using Fuyu.Platform.Common.Http;