diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 709f151e4..5b7c5cd72 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -58,6 +58,7 @@ END TEMPLATE--> * `RobustSerializer` no longer needs to be called from threads with an active IoC context. * This makes it possible to use from thread pool threads without `IoCManager.InitThread`. * Removed finalizer dispose from `Overlay`. +* Stopped integration tests watching for prototype reload file changes, speeding stuff up. ### Internal diff --git a/Robust.Client/Prototypes/ClientPrototypeManager.cs b/Robust.Client/Prototypes/ClientPrototypeManager.cs index 76bfb1642..74fd04bdd 100644 --- a/Robust.Client/Prototypes/ClientPrototypeManager.cs +++ b/Robust.Client/Prototypes/ClientPrototypeManager.cs @@ -6,6 +6,8 @@ using System.Linq; using System.Threading; using Robust.Client.Graphics; using Robust.Client.Timing; +using Robust.Shared; +using Robust.Shared.Configuration; using Robust.Shared.ContentPack; using Robust.Shared.IoC; using Robust.Shared.Log; @@ -22,6 +24,7 @@ namespace Robust.Client.Prototypes [Dependency] private readonly IClyde _clyde = default!; [Dependency] private readonly INetManager _netManager = default!; [Dependency] private readonly IClientGameTiming _timing = default!; + [Dependency] private readonly IConfigurationManager _cfg = default!; private readonly List _watchers = new(); private readonly TimeSpan _reloadDelay = TimeSpan.FromMilliseconds(10); @@ -77,6 +80,9 @@ namespace Robust.Client.Prototypes private void WatchResources() { + if (!_cfg.GetCVar(CVars.ResPrototypeReloadWatch)) + return; + #if !FULL_RELEASE foreach (var path in Resources.GetContentRoots().Select(r => r.ToString()) .Where(r => Directory.Exists(r + "/Prototypes")).Select(p => p + "/Prototypes")) diff --git a/Robust.Shared/CVars.cs b/Robust.Shared/CVars.cs index a67ac6801..3dd4b9c0c 100644 --- a/Robust.Shared/CVars.cs +++ b/Robust.Shared/CVars.cs @@ -1214,6 +1214,15 @@ namespace Robust.Shared public static readonly CVarDef ResStreamSeekMode = CVarDef.Create("res.stream_seek_mode", (int)ContentPack.StreamSeekMode.None); + /// + /// Whether to watch prototype files for prototype reload on the client. Only applies to development builds. + /// + /// + /// The client sends a reload signal to the server on refocus, if you're wondering why this is client-only. + /// + public static readonly CVarDef ResPrototypeReloadWatch = + CVarDef.Create("res.prototype_reload_watch", true, CVar.CLIENTONLY); + /* * DEBUG */ diff --git a/Robust.UnitTesting/RobustIntegrationTest.cs b/Robust.UnitTesting/RobustIntegrationTest.cs index 9d9d4dbe1..59bfc4821 100644 --- a/Robust.UnitTesting/RobustIntegrationTest.cs +++ b/Robust.UnitTesting/RobustIntegrationTest.cs @@ -820,7 +820,9 @@ namespace Robust.UnitTesting (CVars.SysGCCollectStart.Name, "false"), - (RTCVars.FailureLogLevel.Name, (Options?.FailureLogLevel ?? RTCVars.FailureLogLevel.DefaultValue).ToString()) + (RTCVars.FailureLogLevel.Name, (Options?.FailureLogLevel ?? RTCVars.FailureLogLevel.DefaultValue).ToString()), + + (CVars.ResPrototypeReloadWatch.Name, "false"), }); GameLoop = new IntegrationGameLoop(DependencyCollection.Resolve(),