diff --git a/OpenRA.Server/Program.cs b/OpenRA.Server/Program.cs index 74d76dae6c..00021e16f4 100644 --- a/OpenRA.Server/Program.cs +++ b/OpenRA.Server/Program.cs @@ -11,6 +11,7 @@ using System; using System.IO; +using System.Linq; using System.Net; using System.Threading; using OpenRA.Support; @@ -42,8 +43,12 @@ namespace OpenRA.Server Game.InitializeSettings(arguments); var settings = Game.Settings.Server; + var envModSearchPaths = Environment.GetEnvironmentVariable("MOD_SEARCH_PATHS"); + var modSearchPaths = !string.IsNullOrWhiteSpace(envModSearchPaths) ? + FieldLoader.GetValue("MOD_SEARCH_PATHS", envModSearchPaths) : + new[] { Path.Combine(".", "mods"), Path.Combine("^", "mods") }; + var mod = Game.Settings.Game.Mod; - var modSearchPaths = new[] { Path.Combine(".", "mods"), Path.Combine("^", "mods") }; var mods = new InstalledMods(modSearchPaths, explicitModPaths); // HACK: The engine code *still* assumes that Game.ModData is set diff --git a/OpenRA.Utility/Program.cs b/OpenRA.Utility/Program.cs index 4bdb92bed3..401f2a76fe 100644 --- a/OpenRA.Utility/Program.cs +++ b/OpenRA.Utility/Program.cs @@ -45,7 +45,11 @@ namespace OpenRA Game.InitializeSettings(Arguments.Empty); - var modSearchPaths = new[] { Path.Combine(".", "mods"), Path.Combine("^", "mods") }; + var envModSearchPaths = Environment.GetEnvironmentVariable("MOD_SEARCH_PATHS"); + var modSearchPaths = !string.IsNullOrWhiteSpace(envModSearchPaths) ? + FieldLoader.GetValue("MOD_SEARCH_PATHS", envModSearchPaths) : + new[] { Path.Combine(".", "mods"), Path.Combine("^", "mods") }; + if (args.Length == 0) { PrintUsage(new InstalledMods(modSearchPaths, new string[0]), null);