Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
22c4cfb039 | |||
5f0ffb6f9a | |||
1b2a989441 | |||
![]() |
83dfc7152f | ||
d7e5f53e4f | |||
9b08b39a1f | |||
![]() |
8011f9eed7 | ||
1df791e7a8 | |||
![]() |
bbc2f9046f | ||
117ea7df91 | |||
6ec355f931 | |||
![]() |
343420f1d8 |
@@ -14,6 +14,9 @@ namespace Torch.API.Managers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fired when plugins are loaded.
|
/// Fired when plugins are loaded.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Fired when plugins are loaded and immediately if subscribed after the plugins are loaded.
|
||||||
|
/// </remarks>
|
||||||
event Action<IReadOnlyCollection<ITorchPlugin>> PluginsLoaded;
|
event Action<IReadOnlyCollection<ITorchPlugin>> PluginsLoaded;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@@ -18,11 +18,11 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="JorgeSerrano.Json.JsonSnakeCaseNamingPolicy" Version="0.9.0" />
|
<PackageReference Include="JorgeSerrano.Json.JsonSnakeCaseNamingPolicy" Version="0.9.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.4" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.4" />
|
||||||
<PackageReference Include="NLog" Version="5.2.0" />
|
<PackageReference Include="NLog" Version="5.2.2" />
|
||||||
<PackageReference Include="NuGet.Commands" Version="6.6.1" />
|
<PackageReference Include="NuGet.Commands" Version="6.6.1" />
|
||||||
<PackageReference Include="NuGet.DependencyResolver.Core" Version="6.6.1" />
|
<PackageReference Include="NuGet.DependencyResolver.Core" Version="6.6.1" />
|
||||||
<PackageReference Include="SemanticVersioning" Version="2.0.2" />
|
<PackageReference Include="SemanticVersioning" Version="2.0.2" />
|
||||||
<PackageReference Include="SpaceEngineersDedicated.ReferenceAssemblies" Version="1.202.120">
|
<PackageReference Include="SpaceEngineersDedicated.ReferenceAssemblies" Version="1.203.22.3">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>compile</IncludeAssets>
|
<IncludeAssets>compile</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
@@ -19,9 +19,9 @@
|
|||||||
},
|
},
|
||||||
"NLog": {
|
"NLog": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[5.2.0, )",
|
"requested": "[5.2.2, )",
|
||||||
"resolved": "5.2.0",
|
"resolved": "5.2.2",
|
||||||
"contentHash": "uYBgseY0m/9lQUbZYGsQsTBFOWrfs3iaekzzYMH6vFmpoOAvV8/bp1XxG/suZkwB5h8nAiTJAp7VENWRDKtKPA=="
|
"contentHash": "r6Q9740g29gTwmTWlsgdIFm0mhNsfNZmbvWKX/Fxmi8X89ZrpUowHM2T2X1lP7RVpND+ef+XnfKL5g6Q1iNGXA=="
|
||||||
},
|
},
|
||||||
"NuGet.Commands": {
|
"NuGet.Commands": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
@@ -54,9 +54,9 @@
|
|||||||
},
|
},
|
||||||
"SpaceEngineersDedicated.ReferenceAssemblies": {
|
"SpaceEngineersDedicated.ReferenceAssemblies": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[1.202.120, )",
|
"requested": "[1.203.22.3, )",
|
||||||
"resolved": "1.202.120",
|
"resolved": "1.203.22.3",
|
||||||
"contentHash": "HTP48NOSZY3eQPX3GJN+gjxdW83SM7DX6NcKCFqNIIvjz/J+l8uimHAQp9dnLySb0wb1K1Z1xBPIXyxMQRREIw==",
|
"contentHash": "U7awzB6nGNN3tyZpeWQQjF4MHxJ4CDbvXEuJDkddLa2ellh2SYCV4V3UqukMuVzlrUSC71ITFwDVZZ+uYZYVtw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"protobuf-net": "1.0.0"
|
"protobuf-net": "1.0.0"
|
||||||
}
|
}
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
<repository type="git" url="https://github.com/PveTeam/Torch" />
|
<repository type="git" url="https://github.com/PveTeam/Torch" />
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<group targetFramework="net7.0-windows7.0">
|
<group targetFramework="net7.0-windows7.0">
|
||||||
<dependency id="SpaceEngineersDedicated.ReferenceAssemblies" version="1.202.120" />
|
<dependency id="SpaceEngineersDedicated.ReferenceAssemblies" version="1.203.22.3" />
|
||||||
<dependency id="Torch.Server" version="torchVersion" />
|
<dependency id="Torch.Server" version="torchVersion" />
|
||||||
</group>
|
</group>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
<!-- <Import Project="$(SolutionDir)\TransformOnBuild.targets" /> -->
|
<!-- <Import Project="$(SolutionDir)\TransformOnBuild.targets" /> -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
|
||||||
<PackageReference Include="NLog" Version="5.2.0" />
|
<PackageReference Include="NLog" Version="5.2.2" />
|
||||||
<PackageReference Include="xunit" Version="2.4.2" />
|
<PackageReference Include="xunit" Version="2.4.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@@ -30,9 +30,8 @@ namespace Torch.Server
|
|||||||
private bool _init;
|
private bool _init;
|
||||||
private const string TOOL_DIR = "tool";
|
private const string TOOL_DIR = "tool";
|
||||||
private const string TOOL_ZIP = "temp.zip";
|
private const string TOOL_ZIP = "temp.zip";
|
||||||
private static readonly string TOOL_EXE = "DepotDownloader.exe";
|
private static readonly string TOOL_EXE = "steamcmd.exe";
|
||||||
private const string TOOL_ARGS = "-app 298740 -depot {1} -dir \"{0}\" -manifest {2}";
|
private const string TOOL_ARGS = "+force_install_dir \"{0}\" +login anonymous +app_update 298740 +quit";
|
||||||
private static readonly int[] Depots = { 298741, 1004 };
|
|
||||||
private TorchServer _server;
|
private TorchServer _server;
|
||||||
|
|
||||||
internal Persistent<TorchConfig> ConfigPersistent { get; }
|
internal Persistent<TorchConfig> ConfigPersistent { get; }
|
||||||
@@ -131,7 +130,7 @@ namespace Torch.Server
|
|||||||
|
|
||||||
public static async Task RunSteamCmdAsync(IConfiguration configuration)
|
public static async Task RunSteamCmdAsync(IConfiguration configuration)
|
||||||
{
|
{
|
||||||
var log = LogManager.GetLogger("SteamTool");
|
var log = LogManager.GetLogger("SteamCMD");
|
||||||
|
|
||||||
var path = configuration.GetValue<string>("steamToolPath") ?? ApplicationContext.Current.TorchDirectory
|
var path = configuration.GetValue<string>("steamToolPath") ?? ApplicationContext.Current.TorchDirectory
|
||||||
.CreateSubdirectory(TOOL_DIR).FullName;
|
.CreateSubdirectory(TOOL_DIR).FullName;
|
||||||
@@ -141,39 +140,32 @@ namespace Torch.Server
|
|||||||
Directory.CreateDirectory(path);
|
Directory.CreateDirectory(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
var steamCmdExePath = Path.Combine(path, TOOL_EXE);
|
var toolExe = Path.Combine(path, TOOL_EXE);
|
||||||
if (!File.Exists(steamCmdExePath))
|
if (!File.Exists(toolExe))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
log.Info("Downloading Steam Tool.");
|
log.Info("Downloading SteamCMD.");
|
||||||
using (var client = new HttpClient())
|
using (var client = new HttpClient())
|
||||||
await using (var file = File.Create(TOOL_ZIP))
|
await using (var file = File.Create(TOOL_ZIP))
|
||||||
await using (var stream = await client.GetStreamAsync("https://github.com/SteamRE/DepotDownloader/releases/download/DepotDownloader_2.4.7/depotdownloader-2.4.7.zip"))
|
await using (var stream = await client.GetStreamAsync("https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip"))
|
||||||
await stream.CopyToAsync(file);
|
await stream.CopyToAsync(file);
|
||||||
|
|
||||||
ZipFile.ExtractToDirectory(TOOL_ZIP, path);
|
ZipFile.ExtractToDirectory(TOOL_ZIP, path);
|
||||||
File.Delete(TOOL_ZIP);
|
File.Delete(TOOL_ZIP);
|
||||||
log.Info("Steam Tool downloaded successfully!");
|
log.Info("SteamCMD downloaded successfully!");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
log.Error(e, "Failed to download Steam Tool, unable to update the DS.");
|
log.Error(e, "Failed to download SteamCMD, unable to update the DS.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Info("Checking for DS updates.");
|
log.Info("Checking for DS updates.");
|
||||||
foreach (var depot in Depots)
|
var steamCmdProc = new ProcessStartInfo(toolExe)
|
||||||
{
|
{
|
||||||
await DownloadDepot(depot);
|
Arguments = string.Format(TOOL_ARGS, configuration.GetValue("gamePath", "../")),
|
||||||
}
|
|
||||||
|
|
||||||
async Task DownloadDepot(int depotId)
|
|
||||||
{
|
|
||||||
var steamCmdProc = new ProcessStartInfo(steamCmdExePath)
|
|
||||||
{
|
|
||||||
Arguments = string.Format(TOOL_ARGS, configuration.GetValue("gamePath", "../"), depotId, "3111493184861426002"),
|
|
||||||
WorkingDirectory = path,
|
WorkingDirectory = path,
|
||||||
RedirectStandardOutput = true
|
RedirectStandardOutput = true
|
||||||
};
|
};
|
||||||
@@ -186,5 +178,4 @@ namespace Torch.Server
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -28,6 +28,7 @@ using VRage.FileSystem;
|
|||||||
using VRage.Game;
|
using VRage.Game;
|
||||||
using VRage.Game.ObjectBuilder;
|
using VRage.Game.ObjectBuilder;
|
||||||
using VRage.ObjectBuilders;
|
using VRage.ObjectBuilders;
|
||||||
|
using VRage.ObjectBuilders.Private;
|
||||||
using VRage.Plugins;
|
using VRage.Plugins;
|
||||||
|
|
||||||
namespace Torch.Server.Managers
|
namespace Torch.Server.Managers
|
||||||
@@ -363,10 +364,10 @@ namespace Torch.Server.Managers
|
|||||||
public void SaveSandbox()
|
public void SaveSandbox()
|
||||||
{
|
{
|
||||||
using (var f = File.Open(_checkpointPath, FileMode.Create))
|
using (var f = File.Open(_checkpointPath, FileMode.Create))
|
||||||
MyObjectBuilderSerializer.SerializeXML(f, Checkpoint);
|
MyObjectBuilderSerializerKeen.SerializeXML(f, Checkpoint);
|
||||||
|
|
||||||
using (var f = File.Open(_worldConfigPath, FileMode.Create))
|
using (var f = File.Open(_worldConfigPath, FileMode.Create))
|
||||||
MyObjectBuilderSerializer.SerializeXML(f, WorldConfiguration);
|
MyObjectBuilderSerializerKeen.SerializeXML(f, WorldConfiguration);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadSandbox()
|
public void LoadSandbox()
|
||||||
|
@@ -41,7 +41,7 @@
|
|||||||
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="7.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.Xml" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.Xml" Version="7.0.0" />
|
||||||
<PackageReference Include="NLog" Version="5.2.0" />
|
<PackageReference Include="NLog" Version="5.2.2" />
|
||||||
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0" PrivateAssets="all" />
|
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0" PrivateAssets="all" />
|
||||||
<PackageReference Include="Steamworks.NET" Version="20.1.0">
|
<PackageReference Include="Steamworks.NET" Version="20.1.0">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||||
<PackageReference Include="System.Management" Version="7.0.2" />
|
<PackageReference Include="System.Management" Version="7.0.2" />
|
||||||
<PackageReference Include="nulastudio.NetCoreBeauty" Version="1.2.9.5" />
|
<PackageReference Include="nulastudio.NetCoreBeauty" Version="1.2.9.5" />
|
||||||
<PackageReference Include="SpaceEngineersDedicated.ReferenceAssemblies" Version="1.202.120">
|
<PackageReference Include="SpaceEngineersDedicated.ReferenceAssemblies" Version="1.203.22.3">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>compile</IncludeAssets>
|
<IncludeAssets>compile</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
@@ -58,7 +58,9 @@ namespace Torch.Server
|
|||||||
AddManager(new EntityControlManager(this));
|
AddManager(new EntityControlManager(this));
|
||||||
AddManager(new RemoteAPIManager(this));
|
AddManager(new RemoteAPIManager(this));
|
||||||
|
|
||||||
|
var sessionManager = Managers.GetManager<ITorchSessionManager>();
|
||||||
|
sessionManager.AddFactory(_ => new MultiplayerManagerDedicated(this));
|
||||||
|
sessionManager.SessionStateChanged += OnSessionStateChanged;
|
||||||
|
|
||||||
// Needs to be done at some point after MyVRageWindows.Init
|
// Needs to be done at some point after MyVRageWindows.Init
|
||||||
// where the debug listeners are registered
|
// where the debug listeners are registered
|
||||||
@@ -67,6 +69,14 @@ namespace Torch.Server
|
|||||||
|
|
||||||
_simUpdateTimer.Elapsed += SimUpdateElapsed;
|
_simUpdateTimer.Elapsed += SimUpdateElapsed;
|
||||||
_simUpdateTimer.Start();
|
_simUpdateTimer.Start();
|
||||||
|
|
||||||
|
Console.CancelKeyPress += (_, _) =>
|
||||||
|
{
|
||||||
|
if (State == ServerState.Running)
|
||||||
|
Stop();
|
||||||
|
|
||||||
|
Environment.Exit(0);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SimUpdateElapsed(object sender, System.Timers.ElapsedEventArgs e)
|
private void SimUpdateElapsed(object sender, System.Timers.ElapsedEventArgs e)
|
||||||
@@ -119,7 +129,38 @@ namespace Torch.Server
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public ServerState State { get; private set; }
|
public ServerState State { get; private set; }
|
||||||
|
|
||||||
public event Action<ITorchServer> Initialized;
|
private Action<ITorchServer> _initializedEvent;
|
||||||
|
|
||||||
|
public event Action<ITorchServer> Initialized
|
||||||
|
{
|
||||||
|
add
|
||||||
|
{
|
||||||
|
var action = _initializedEvent;
|
||||||
|
Action<ITorchServer> action2;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
action2 = action;
|
||||||
|
var action3 = (Action<ITorchServer>)Delegate.Combine(action2, value);
|
||||||
|
action = Interlocked.CompareExchange(ref _initializedEvent, action3, action2);
|
||||||
|
}
|
||||||
|
while (action != action2);
|
||||||
|
|
||||||
|
if (GetManager<InstanceManager>().DedicatedConfig != null)
|
||||||
|
value(this); //if already initialized
|
||||||
|
}
|
||||||
|
remove
|
||||||
|
{
|
||||||
|
var action = _initializedEvent;
|
||||||
|
Action<ITorchServer> action2;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
action2 = action;
|
||||||
|
var action3 = (Action<ITorchServer>)Delegate.Remove(action2, value);
|
||||||
|
action = Interlocked.CompareExchange(ref _initializedEvent, action3, action2);
|
||||||
|
}
|
||||||
|
while (action != action2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public int OnlinePlayers { get; private set; }
|
public int OnlinePlayers { get; private set; }
|
||||||
|
|
||||||
@@ -128,13 +169,9 @@ namespace Torch.Server
|
|||||||
{
|
{
|
||||||
Log.Info("Initializing server");
|
Log.Info("Initializing server");
|
||||||
base.Init();
|
base.Init();
|
||||||
var sessionManager = Managers.GetManager<ITorchSessionManager>();
|
|
||||||
sessionManager.AddFactory(x => new MultiplayerManagerDedicated(this));
|
|
||||||
sessionManager.SessionStateChanged += OnSessionStateChanged;
|
|
||||||
|
|
||||||
GetManager<InstanceManager>().LoadInstance(InstancePath);
|
GetManager<InstanceManager>().LoadInstance(InstancePath);
|
||||||
CanRun = true;
|
CanRun = true;
|
||||||
Initialized?.Invoke(this);
|
_initializedEvent?.Invoke(this);
|
||||||
Log.Info($"Initialized server '{InstanceName}' at '{InstancePath}'");
|
Log.Info($"Initialized server '{InstanceName}' at '{InstancePath}'");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -210,9 +247,14 @@ namespace Torch.Server
|
|||||||
StopInternal();
|
StopInternal();
|
||||||
LogManager.Flush();
|
LogManager.Flush();
|
||||||
|
|
||||||
|
if (
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
Environment.Exit(0);
|
// ReSharper disable once ConditionIsAlwaysTrueOrFalse
|
||||||
|
true ||
|
||||||
#endif
|
#endif
|
||||||
|
ApplicationContext.Current.IsService
|
||||||
|
)
|
||||||
|
Environment.Exit(0);
|
||||||
|
|
||||||
var exe = Path.Combine(AppContext.BaseDirectory, "Torch.Server.exe");
|
var exe = Path.Combine(AppContext.BaseDirectory, "Torch.Server.exe");
|
||||||
|
|
||||||
|
@@ -116,7 +116,7 @@ namespace Torch.Server
|
|||||||
if (_server?.State == ServerState.Running)
|
if (_server?.State == ServerState.Running)
|
||||||
_server.Stop();
|
_server.Stop();
|
||||||
|
|
||||||
Process.GetCurrentProcess().Kill();
|
Environment.Exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -92,9 +92,9 @@
|
|||||||
},
|
},
|
||||||
"NLog": {
|
"NLog": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[5.2.0, )",
|
"requested": "[5.2.2, )",
|
||||||
"resolved": "5.2.0",
|
"resolved": "5.2.2",
|
||||||
"contentHash": "uYBgseY0m/9lQUbZYGsQsTBFOWrfs3iaekzzYMH6vFmpoOAvV8/bp1XxG/suZkwB5h8nAiTJAp7VENWRDKtKPA=="
|
"contentHash": "r6Q9740g29gTwmTWlsgdIFm0mhNsfNZmbvWKX/Fxmi8X89ZrpUowHM2T2X1lP7RVpND+ef+XnfKL5g6Q1iNGXA=="
|
||||||
},
|
},
|
||||||
"nulastudio.NetCoreBeauty": {
|
"nulastudio.NetCoreBeauty": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
@@ -113,9 +113,9 @@
|
|||||||
},
|
},
|
||||||
"SpaceEngineersDedicated.ReferenceAssemblies": {
|
"SpaceEngineersDedicated.ReferenceAssemblies": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[1.202.120, )",
|
"requested": "[1.203.22.3, )",
|
||||||
"resolved": "1.202.120",
|
"resolved": "1.203.22.3",
|
||||||
"contentHash": "HTP48NOSZY3eQPX3GJN+gjxdW83SM7DX6NcKCFqNIIvjz/J+l8uimHAQp9dnLySb0wb1K1Z1xBPIXyxMQRREIw==",
|
"contentHash": "U7awzB6nGNN3tyZpeWQQjF4MHxJ4CDbvXEuJDkddLa2ellh2SYCV4V3UqukMuVzlrUSC71ITFwDVZZ+uYZYVtw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"protobuf-net": "1.0.0"
|
"protobuf-net": "1.0.0"
|
||||||
}
|
}
|
||||||
@@ -153,10 +153,10 @@
|
|||||||
},
|
},
|
||||||
"HarmonyX": {
|
"HarmonyX": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "2.10.2-prerelease.4",
|
"resolved": "2.10.2-prerelease.6",
|
||||||
"contentHash": "M/44/DhSu1WR8gL62aLPGKqAJ0rrgkw38nT3DgEvLAvyIoQLJmL2Jsn4/d4CC0eDT1Vv82cB9Mxgg0sFD3/qrQ==",
|
"contentHash": "CPCUR/t5AQ5DDs40bTJ5OwUVTCoZONaJGbWKKjAOwg7c7Ct4KEbfybH6T+KvRGVjf5eN1oyGY5BN7EfWxUh9Xg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"MonoModReorg.RuntimeDetour": "23.3.22.1"
|
"MonoMod.RuntimeDetour": "25.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"JorgeSerrano.Json.JsonSnakeCaseNamingPolicy": {
|
"JorgeSerrano.Json.JsonSnakeCaseNamingPolicy": {
|
||||||
@@ -313,50 +313,50 @@
|
|||||||
"resolved": "0.11.4",
|
"resolved": "0.11.4",
|
||||||
"contentHash": "IC1h5g0NeJGHIUgzM1P82ld57knhP0IcQfrYITDPXlNpMYGUrsG5TxuaWTjaeqDNQMBDNZkB8L0rBnwsY6JHuQ=="
|
"contentHash": "IC1h5g0NeJGHIUgzM1P82ld57knhP0IcQfrYITDPXlNpMYGUrsG5TxuaWTjaeqDNQMBDNZkB8L0rBnwsY6JHuQ=="
|
||||||
},
|
},
|
||||||
"MonoModReorg.Backports": {
|
"MonoMod.Backports": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "23.3.22.1",
|
"resolved": "1.0.0",
|
||||||
"contentHash": "nLx18prtZbS0nVO8YHElP+TUj1kkDswRgQpa9agt3tyNWke9Kqk5lVkGu87Y3cCMhG+m5Ai0ZDH0+V5B6bXF+Q==",
|
"contentHash": "J59I4CMe24aCmWboHCDzQIk37kXqHnJH6KQfDGstlznuDni7Lwdd/8CywmEwVXjVEgfs5yQzvOTW3Xg1NH7fDQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"MonoModReorg.ILHelpers": "23.3.22.1"
|
"MonoMod.ILHelpers": "1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"MonoModReorg.Core": {
|
"MonoMod.Core": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "23.3.22.1",
|
"resolved": "1.0.0",
|
||||||
"contentHash": "Q3ZOgm6AOTL0icgcHsT/6mV5kYt6meqX3DEN1p/et5PxJsXUhVkiZfAptp8y/i+cO6HNgkcESpXEQ4jUWVwsDA==",
|
"contentHash": "FlzAEa4ujbA1t3rbKxuW3DP36T0/L6k2IP1F4QXM1cOXMJLHm39Azjt98E/9LFRFBWYFdlMUmg+4THLv2xyisA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Mono.Cecil": "0.11.4",
|
"Mono.Cecil": "0.11.4",
|
||||||
"MonoModReorg.Backports": "23.3.22.1",
|
"MonoMod.Backports": "1.0.0",
|
||||||
"MonoModReorg.ILHelpers": "23.3.22.1",
|
"MonoMod.ILHelpers": "1.0.0",
|
||||||
"MonoModReorg.Utils": "23.3.22.1"
|
"MonoMod.Utils": "25.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"MonoModReorg.ILHelpers": {
|
"MonoMod.ILHelpers": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "23.3.22.1",
|
"resolved": "1.0.0",
|
||||||
"contentHash": "dHE/3VZtnTUTkQ34j8Gu6CxKes1QDL8tBuF3QElxHHpPl/QabGCK938k47WWRcRBMoP7IAthkn+Bob4H97rBgw=="
|
"contentHash": "dTjGA+dYl7W5yQ0oG/Wr57tsa+ueoFUrwPtz9MZF9iheun4n70u7lge52F8UJi9i0zMHRfS2mAY6+nPuRZHQyQ=="
|
||||||
},
|
},
|
||||||
"MonoModReorg.RuntimeDetour": {
|
"MonoMod.RuntimeDetour": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "23.3.22.1",
|
"resolved": "25.0.0",
|
||||||
"contentHash": "cUES3Hi7QJtBNe0qwVdjZOCDkZDaCpdqS6Au0RaCyQ1PDIR4av13E9qBNAEYew46sgPe0fOrU334md6DLDGHlQ==",
|
"contentHash": "u+G34uSEjU0+fk4Iz3Mfws/+E4kW460i6fBz1b4L/yxSndfmdKkJ+pYbU9pwh7IUxgk0Ko0+Mx3fSUQPaNk8nA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Mono.Cecil": "0.11.4",
|
"Mono.Cecil": "0.11.4",
|
||||||
"MonoModReorg.Backports": "23.3.22.1",
|
"MonoMod.Backports": "1.0.0",
|
||||||
"MonoModReorg.Core": "23.3.22.1",
|
"MonoMod.Core": "1.0.0",
|
||||||
"MonoModReorg.ILHelpers": "23.3.22.1",
|
"MonoMod.ILHelpers": "1.0.0",
|
||||||
"MonoModReorg.Utils": "23.3.22.1"
|
"MonoMod.Utils": "25.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"MonoModReorg.Utils": {
|
"MonoMod.Utils": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "23.3.22.1",
|
"resolved": "25.0.0",
|
||||||
"contentHash": "q1cX0mbYxdw2WcE/qGBB84lVY/ffobEr46VQFuwGcWhtw6f1Ql1k4TZfs8gebpesSxHnca13grLeVHrUSpy1+g==",
|
"contentHash": "E8m0pH3Kact+A2qH+lxMis90K8+ixInwprn0R1nuAMRHfotHUHeYmr304UEPeInSuY3+IlnC+OB8fqbQiTsWlQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Mono.Cecil": "0.11.4",
|
"Mono.Cecil": "0.11.4",
|
||||||
"MonoModReorg.Backports": "23.3.22.1",
|
"MonoMod.Backports": "1.0.0",
|
||||||
"MonoModReorg.ILHelpers": "23.3.22.1"
|
"MonoMod.ILHelpers": "1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Newtonsoft.Json": {
|
"Newtonsoft.Json": {
|
||||||
@@ -574,12 +574,12 @@
|
|||||||
"type": "Project",
|
"type": "Project",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ControlzEx": "[6.0.0, )",
|
"ControlzEx": "[6.0.0, )",
|
||||||
"HarmonyX": "[2.10.2-prerelease.4, )",
|
"HarmonyX": "[2.10.2-prerelease.6, )",
|
||||||
"MahApps.Metro": "[2.4.9, )",
|
"MahApps.Metro": "[2.4.9, )",
|
||||||
"Microsoft.CodeAnalysis.CSharp": "[4.6.0, )",
|
"Microsoft.CodeAnalysis.CSharp": "[4.6.0, )",
|
||||||
"Microsoft.CodeAnalysis.Common": "[4.6.0, )",
|
"Microsoft.CodeAnalysis.Common": "[4.6.0, )",
|
||||||
"MonoModReorg.RuntimeDetour": "[23.3.22.1, )",
|
"MonoMod.RuntimeDetour": "[25.0.0, )",
|
||||||
"NLog": "[5.2.0, )",
|
"NLog": "[5.2.2, )",
|
||||||
"System.ComponentModel.Annotations": "[5.0.0, )",
|
"System.ComponentModel.Annotations": "[5.0.0, )",
|
||||||
"Torch.API": "[1.0.0, )",
|
"Torch.API": "[1.0.0, )",
|
||||||
"Torch.SixLabors.ImageSharp": "[1.0.0-beta6, )",
|
"Torch.SixLabors.ImageSharp": "[1.0.0-beta6, )",
|
||||||
@@ -591,7 +591,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"JorgeSerrano.Json.JsonSnakeCaseNamingPolicy": "[0.9.0, )",
|
"JorgeSerrano.Json.JsonSnakeCaseNamingPolicy": "[0.9.0, )",
|
||||||
"Microsoft.Extensions.Configuration.Binder": "[7.0.4, )",
|
"Microsoft.Extensions.Configuration.Binder": "[7.0.4, )",
|
||||||
"NLog": "[5.2.0, )",
|
"NLog": "[5.2.2, )",
|
||||||
"NuGet.Commands": "[6.6.1, )",
|
"NuGet.Commands": "[6.6.1, )",
|
||||||
"NuGet.DependencyResolver.Core": "[6.6.1, )",
|
"NuGet.DependencyResolver.Core": "[6.6.1, )",
|
||||||
"SemanticVersioning": "[2.0.2, )",
|
"SemanticVersioning": "[2.0.2, )",
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
<!-- <Import Project="$(SolutionDir)\TransformOnBuild.targets" /> -->
|
<!-- <Import Project="$(SolutionDir)\TransformOnBuild.targets" /> -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
|
||||||
<PackageReference Include="NLog" Version="5.2.0" />
|
<PackageReference Include="NLog" Version="5.2.2" />
|
||||||
<PackageReference Include="xunit" Version="2.4.2" />
|
<PackageReference Include="xunit" Version="2.4.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@@ -27,6 +27,7 @@ using VRage.Game.ModAPI;
|
|||||||
using VRage.Groups;
|
using VRage.Groups;
|
||||||
using VRage.ModAPI;
|
using VRage.ModAPI;
|
||||||
using VRage.ObjectBuilders;
|
using VRage.ObjectBuilders;
|
||||||
|
using VRage.ObjectBuilders.Private;
|
||||||
using VRage.Sync;
|
using VRage.Sync;
|
||||||
using VRageMath;
|
using VRageMath;
|
||||||
|
|
||||||
@@ -45,14 +46,14 @@ namespace Torch.Managers
|
|||||||
{
|
{
|
||||||
var ob = grid.GetObjectBuilder(true);
|
var ob = grid.GetObjectBuilder(true);
|
||||||
using (var f = File.Open(path, FileMode.CreateNew))
|
using (var f = File.Open(path, FileMode.CreateNew))
|
||||||
MyObjectBuilderSerializer.SerializeXML(f, ob);
|
MyObjectBuilderSerializerKeen.SerializeXML(f, ob);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ImportGrid(string path, Vector3D position)
|
public void ImportGrid(string path, Vector3D position)
|
||||||
{
|
{
|
||||||
MyObjectBuilder_EntityBase gridOb;
|
MyObjectBuilder_EntityBase gridOb;
|
||||||
using (var f = File.OpenRead(path))
|
using (var f = File.OpenRead(path))
|
||||||
MyObjectBuilderSerializer.DeserializeXML(f, out gridOb);
|
MyObjectBuilderSerializerKeen.DeserializeXML(f, out gridOb);
|
||||||
|
|
||||||
var grid = MyEntities.CreateFromObjectBuilderParallel(gridOb);
|
var grid = MyEntities.CreateFromObjectBuilderParallel(gridOb);
|
||||||
grid.PositionComp.SetPosition(position);
|
grid.PositionComp.SetPosition(position);
|
||||||
|
@@ -82,7 +82,7 @@ public class ScriptCompilationManager : Manager
|
|||||||
TerminationReasonSetter(block, MyProgrammableBlock.ScriptTerminationReason.None);
|
TerminationReasonSetter(block, MyProgrammableBlock.ScriptTerminationReason.None);
|
||||||
|
|
||||||
var component = ScriptComponentGetter(block);
|
var component = ScriptComponentGetter(block);
|
||||||
component.NextUpdate = UpdateType.None;
|
component.UpdateFrequency = UpdateFrequency.None;
|
||||||
component.NeedsUpdate = MyEntityUpdateEnum.NONE;
|
component.NeedsUpdate = MyEntityUpdateEnum.NONE;
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -214,7 +214,8 @@ public class ScriptCompilationManager : Manager
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly CSharpCompilationOptions _compilationOptions = new(OutputKind.DynamicallyLinkedLibrary);
|
private readonly CSharpCompilationOptions _compilationOptions = new(OutputKind.DynamicallyLinkedLibrary,
|
||||||
|
optimizationLevel: OptimizationLevel.Release, platform: Platform.X64);
|
||||||
private readonly CSharpParseOptions _parseOptions = new(LanguageVersion.CSharp11, DocumentationMode.None);
|
private readonly CSharpParseOptions _parseOptions = new(LanguageVersion.CSharp11, DocumentationMode.None);
|
||||||
|
|
||||||
private CSharpCompilation CreateCompilation(string assemblyFileName, IEnumerable<Script> scripts)
|
private CSharpCompilation CreateCompilation(string assemblyFileName, IEnumerable<Script> scripts)
|
||||||
|
@@ -79,6 +79,9 @@ namespace Torch.Patches
|
|||||||
[ReflectedSetter(Name = "m_enabled")]
|
[ReflectedSetter(Name = "m_enabled")]
|
||||||
private static Action<MyLog, bool> _enabledSetter = null!;
|
private static Action<MyLog, bool> _enabledSetter = null!;
|
||||||
|
|
||||||
|
[ReflectedMethod(Type = typeof(MyLog), Name = "LogFlag")]
|
||||||
|
private static Func<MyLog, LoggingOptions, bool> _logFlag = null!;
|
||||||
|
|
||||||
private static int GetIndentByCurrentThread()
|
private static int GetIndentByCurrentThread()
|
||||||
{
|
{
|
||||||
using var l = _lockGetter(MyLog.Default).AcquireExclusiveUsing();
|
using var l = _lockGetter(MyLog.Default).AcquireExclusiveUsing();
|
||||||
@@ -122,7 +125,7 @@ namespace Torch.Patches
|
|||||||
}
|
}
|
||||||
private static bool PrefixWriteLineOptions(MyLog __instance, string message, LoggingOptions option)
|
private static bool PrefixWriteLineOptions(MyLog __instance, string message, LoggingOptions option)
|
||||||
{
|
{
|
||||||
if (__instance.LogEnabled && __instance.LogFlag(option) && _log.IsDebugEnabled)
|
if (__instance.LogEnabled && _logFlag(__instance, option) && _log.IsDebugEnabled)
|
||||||
_log.Info($"{string.Empty.PadRight(3 * GetIndentByCurrentThread(), ' ')}{message}");
|
_log.Info($"{string.Empty.PadRight(3 * GetIndentByCurrentThread(), ' ')}{message}");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -52,7 +52,39 @@ namespace Torch.Managers
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public IReadOnlyDictionary<Guid, ITorchPlugin> Plugins => _plugins.AsReadOnlyObservable();
|
public IReadOnlyDictionary<Guid, ITorchPlugin> Plugins => _plugins.AsReadOnlyObservable();
|
||||||
|
|
||||||
public event Action<IReadOnlyCollection<ITorchPlugin>> PluginsLoaded;
|
private Action<IReadOnlyCollection<ITorchPlugin>> _pluginsLoaded;
|
||||||
|
private bool _loaded;
|
||||||
|
|
||||||
|
public event Action<IReadOnlyCollection<ITorchPlugin>> PluginsLoaded
|
||||||
|
{
|
||||||
|
add
|
||||||
|
{
|
||||||
|
var action = _pluginsLoaded;
|
||||||
|
Action<IReadOnlyCollection<ITorchPlugin>> action2;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
action2 = action;
|
||||||
|
var action3 = (Action<IReadOnlyCollection<ITorchPlugin>>)Delegate.Combine(action2, value);
|
||||||
|
action = Interlocked.CompareExchange(ref _pluginsLoaded, action3, action2);
|
||||||
|
}
|
||||||
|
while (action != action2);
|
||||||
|
|
||||||
|
if (_loaded)
|
||||||
|
value(_plugins.Values.AsReadOnly());
|
||||||
|
}
|
||||||
|
remove
|
||||||
|
{
|
||||||
|
var action = _pluginsLoaded;
|
||||||
|
Action<IReadOnlyCollection<ITorchPlugin>> action2;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
action2 = action;
|
||||||
|
var action3 = (Action<IReadOnlyCollection<ITorchPlugin>>)Delegate.Remove(action2, value);
|
||||||
|
action = Interlocked.CompareExchange(ref _pluginsLoaded, action3, action2);
|
||||||
|
}
|
||||||
|
while (action != action2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public PluginManager(ITorchBase torchInstance) : base(torchInstance)
|
public PluginManager(ITorchBase torchInstance) : base(torchInstance)
|
||||||
{
|
{
|
||||||
@@ -145,7 +177,8 @@ namespace Torch.Managers
|
|||||||
plugin.Init(Torch);
|
plugin.Init(Torch);
|
||||||
}
|
}
|
||||||
_log.Info($"Loaded {_plugins.Count} plugins.");
|
_log.Info($"Loaded {_plugins.Count} plugins.");
|
||||||
PluginsLoaded?.Invoke(_plugins.Values.AsReadOnly());
|
_loaded = true;
|
||||||
|
_pluginsLoaded?.Invoke(_plugins.Values.AsReadOnly());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,7 +253,8 @@ namespace Torch.Managers
|
|||||||
plugin.Init(Torch);
|
plugin.Init(Torch);
|
||||||
}
|
}
|
||||||
_log.Info($"Loaded {_plugins.Count} plugins.");
|
_log.Info($"Loaded {_plugins.Count} plugins.");
|
||||||
PluginsLoaded?.Invoke(_plugins.Values.AsReadOnly());
|
_loaded = true;
|
||||||
|
_pluginsLoaded?.Invoke(_plugins.Values.AsReadOnly());
|
||||||
}
|
}
|
||||||
|
|
||||||
//debug flag is set when the user asks us to run with a specific plugin for plugin development debug
|
//debug flag is set when the user asks us to run with a specific plugin for plugin development debug
|
||||||
|
@@ -49,8 +49,6 @@ namespace Torch.Session
|
|||||||
public TorchSessionManager(ITorchBase torchInstance) : base(torchInstance)
|
public TorchSessionManager(ITorchBase torchInstance) : base(torchInstance)
|
||||||
{
|
{
|
||||||
_overrideMods = new Dictionary<ulong, MyObjectBuilder_Checkpoint.ModItem>();
|
_overrideMods = new Dictionary<ulong, MyObjectBuilder_Checkpoint.ModItem>();
|
||||||
if (Torch.Config.UgcServiceType == UGCServiceType.Steam)
|
|
||||||
_overrideMods.Add(ModCommunication.MOD_ID, ModItemUtils.Create(ModCommunication.MOD_ID));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
@@ -74,7 +72,9 @@ namespace Torch.Session
|
|||||||
{
|
{
|
||||||
if (_overrideMods.ContainsKey(modId))
|
if (_overrideMods.ContainsKey(modId))
|
||||||
return false;
|
return false;
|
||||||
var item = ModItemUtils.Create(modId);
|
#pragma warning disable CS0618
|
||||||
|
var item = ModItemUtils.Create(modId, TorchBase.Instance.Config.UgcServiceType.ToString());
|
||||||
|
#pragma warning restore CS0618
|
||||||
_overrideMods.Add(modId, item);
|
_overrideMods.Add(modId, item);
|
||||||
|
|
||||||
OverrideModsChanged?.Invoke(new CollectionChangeEventArgs(CollectionChangeAction.Add, item));
|
OverrideModsChanged?.Invoke(new CollectionChangeEventArgs(CollectionChangeAction.Add, item));
|
||||||
@@ -193,6 +193,8 @@ namespace Torch.Session
|
|||||||
MySession.AfterLoading += SessionLoaded;
|
MySession.AfterLoading += SessionLoaded;
|
||||||
MySession.OnUnloading += SessionUnloading;
|
MySession.OnUnloading += SessionUnloading;
|
||||||
MySession.OnUnloaded += SessionUnloaded;
|
MySession.OnUnloaded += SessionUnloaded;
|
||||||
|
if (Torch.Config.UgcServiceType == UGCServiceType.Steam)
|
||||||
|
_overrideMods.Add(ModCommunication.MOD_ID, ModItemUtils.Create(ModCommunication.MOD_ID));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -24,18 +24,18 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ControlzEx" Version="6.0.0" />
|
<PackageReference Include="ControlzEx" Version="6.0.0" />
|
||||||
<PackageReference Include="HarmonyX" Version="2.10.2-prerelease.4" />
|
<PackageReference Include="HarmonyX" Version="2.10.2-prerelease.6" />
|
||||||
<PackageReference Include="InfoOf.Fody" Version="2.1.1" PrivateAssets="all" />
|
<PackageReference Include="InfoOf.Fody" Version="2.1.1" PrivateAssets="all" />
|
||||||
<PackageReference Include="MahApps.Metro" Version="2.4.9" />
|
<PackageReference Include="MahApps.Metro" Version="2.4.9" />
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.6.0" />
|
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.6.0" />
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.6.0" />
|
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.6.0" />
|
||||||
<PackageReference Include="MonoModReorg.RuntimeDetour" Version="23.3.22.1" />
|
<PackageReference Include="MonoMod.RuntimeDetour" Version="25.0.0" />
|
||||||
<PackageReference Include="NLog" Version="5.2.0" />
|
<PackageReference Include="NLog" Version="5.2.2" />
|
||||||
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0" PrivateAssets="all" />
|
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0" PrivateAssets="all" />
|
||||||
<PackageReference Include="protobuf-net" Version="3.2.26" />
|
<PackageReference Include="protobuf-net" Version="3.2.26" />
|
||||||
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||||
<PackageReference Include="Torch.SixLabors.ImageSharp" Version="1.0.0-beta6" />
|
<PackageReference Include="Torch.SixLabors.ImageSharp" Version="1.0.0-beta6" />
|
||||||
<PackageReference Include="SpaceEngineersDedicated.ReferenceAssemblies" Version="1.202.120">
|
<PackageReference Include="SpaceEngineersDedicated.ReferenceAssemblies" Version="1.203.22.3">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>compile</IncludeAssets>
|
<IncludeAssets>compile</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
@@ -116,9 +116,17 @@ namespace Torch
|
|||||||
Plugins = new PluginManager(this);
|
Plugins = new PluginManager(this);
|
||||||
#pragma warning restore CS0618
|
#pragma warning restore CS0618
|
||||||
|
|
||||||
|
var sessionManager = new TorchSessionManager(this);
|
||||||
|
sessionManager.AddFactory(_ => Sync.IsServer ? new ChatManagerServer(this) : new ChatManagerClient(this));
|
||||||
|
sessionManager.AddFactory(_ => Sync.IsServer ? new CommandManager(this) : null);
|
||||||
|
sessionManager.AddFactory(_ => new EntityManager(this));
|
||||||
|
|
||||||
|
Managers.AddManager(sessionManager);
|
||||||
Managers.AddManager(new PatchManager(this));
|
Managers.AddManager(new PatchManager(this));
|
||||||
Managers.AddManager(new FilesystemManager(this));
|
Managers.AddManager(new FilesystemManager(this));
|
||||||
|
#if !DEBUG
|
||||||
Managers.AddManager(new UpdateManager(this));
|
Managers.AddManager(new UpdateManager(this));
|
||||||
|
#endif
|
||||||
Managers.AddManager(new EventManager(this));
|
Managers.AddManager(new EventManager(this));
|
||||||
#pragma warning disable CS0618
|
#pragma warning disable CS0618
|
||||||
Managers.AddManager(Plugins);
|
Managers.AddManager(Plugins);
|
||||||
@@ -283,15 +291,6 @@ namespace Torch
|
|||||||
Game = new VRageGame(this, TweakGameSettings, SteamAppName, SteamAppId, InstancePath, RunArgs);
|
Game = new VRageGame(this, TweakGameSettings, SteamAppName, SteamAppId, InstancePath, RunArgs);
|
||||||
if (!Game.WaitFor(VRageGame.GameState.Stopped))
|
if (!Game.WaitFor(VRageGame.GameState.Stopped))
|
||||||
Log.Warn("Failed to wait for game to be initialized");
|
Log.Warn("Failed to wait for game to be initialized");
|
||||||
|
|
||||||
var sessionManager = new TorchSessionManager(this);
|
|
||||||
sessionManager.AddFactory((x) => Sync.IsServer ? new ChatManagerServer(this) : new ChatManagerClient(this));
|
|
||||||
sessionManager.AddFactory((x) => Sync.IsServer ? new CommandManager(this) : null);
|
|
||||||
sessionManager.AddFactory((x) => new EntityManager(this));
|
|
||||||
|
|
||||||
Managers.AddManager(sessionManager);
|
|
||||||
|
|
||||||
|
|
||||||
Managers.Attach();
|
Managers.Attach();
|
||||||
_init = true;
|
_init = true;
|
||||||
|
|
||||||
@@ -373,10 +372,10 @@ namespace Torch
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual void Stop()
|
public virtual void Stop()
|
||||||
{
|
{
|
||||||
LogManager.Flush();
|
|
||||||
Game.SignalStop();
|
Game.SignalStop();
|
||||||
if (!Game.WaitFor(VRageGame.GameState.Stopped))
|
if (!Game.WaitFor(VRageGame.GameState.Stopped, TimeSpan.FromSeconds(Config.TickTimeout)))
|
||||||
Log.Warn("Failed to wait for the game to be stopped");
|
Log.Warn("Failed to wait for the game to be stopped");
|
||||||
|
LogManager.Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
@@ -14,11 +14,11 @@
|
|||||||
},
|
},
|
||||||
"HarmonyX": {
|
"HarmonyX": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[2.10.2-prerelease.4, )",
|
"requested": "[2.10.2-prerelease.6, )",
|
||||||
"resolved": "2.10.2-prerelease.4",
|
"resolved": "2.10.2-prerelease.6",
|
||||||
"contentHash": "M/44/DhSu1WR8gL62aLPGKqAJ0rrgkw38nT3DgEvLAvyIoQLJmL2Jsn4/d4CC0eDT1Vv82cB9Mxgg0sFD3/qrQ==",
|
"contentHash": "CPCUR/t5AQ5DDs40bTJ5OwUVTCoZONaJGbWKKjAOwg7c7Ct4KEbfybH6T+KvRGVjf5eN1oyGY5BN7EfWxUh9Xg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"MonoModReorg.RuntimeDetour": "23.3.22.1"
|
"MonoMod.RuntimeDetour": "25.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"InfoOf.Fody": {
|
"InfoOf.Fody": {
|
||||||
@@ -61,24 +61,24 @@
|
|||||||
"Microsoft.CodeAnalysis.Common": "[4.6.0]"
|
"Microsoft.CodeAnalysis.Common": "[4.6.0]"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"MonoModReorg.RuntimeDetour": {
|
"MonoMod.RuntimeDetour": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[23.3.22.1, )",
|
"requested": "[25.0.0, )",
|
||||||
"resolved": "23.3.22.1",
|
"resolved": "25.0.0",
|
||||||
"contentHash": "cUES3Hi7QJtBNe0qwVdjZOCDkZDaCpdqS6Au0RaCyQ1PDIR4av13E9qBNAEYew46sgPe0fOrU334md6DLDGHlQ==",
|
"contentHash": "u+G34uSEjU0+fk4Iz3Mfws/+E4kW460i6fBz1b4L/yxSndfmdKkJ+pYbU9pwh7IUxgk0Ko0+Mx3fSUQPaNk8nA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Mono.Cecil": "0.11.4",
|
"Mono.Cecil": "0.11.4",
|
||||||
"MonoModReorg.Backports": "23.3.22.1",
|
"MonoMod.Backports": "1.0.0",
|
||||||
"MonoModReorg.Core": "23.3.22.1",
|
"MonoMod.Core": "1.0.0",
|
||||||
"MonoModReorg.ILHelpers": "23.3.22.1",
|
"MonoMod.ILHelpers": "1.0.0",
|
||||||
"MonoModReorg.Utils": "23.3.22.1"
|
"MonoMod.Utils": "25.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"NLog": {
|
"NLog": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[5.2.0, )",
|
"requested": "[5.2.2, )",
|
||||||
"resolved": "5.2.0",
|
"resolved": "5.2.2",
|
||||||
"contentHash": "uYBgseY0m/9lQUbZYGsQsTBFOWrfs3iaekzzYMH6vFmpoOAvV8/bp1XxG/suZkwB5h8nAiTJAp7VENWRDKtKPA=="
|
"contentHash": "r6Q9740g29gTwmTWlsgdIFm0mhNsfNZmbvWKX/Fxmi8X89ZrpUowHM2T2X1lP7RVpND+ef+XnfKL5g6Q1iNGXA=="
|
||||||
},
|
},
|
||||||
"PropertyChanged.Fody": {
|
"PropertyChanged.Fody": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
@@ -100,9 +100,9 @@
|
|||||||
},
|
},
|
||||||
"SpaceEngineersDedicated.ReferenceAssemblies": {
|
"SpaceEngineersDedicated.ReferenceAssemblies": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[1.202.120, )",
|
"requested": "[1.203.22.3, )",
|
||||||
"resolved": "1.202.120",
|
"resolved": "1.203.22.3",
|
||||||
"contentHash": "HTP48NOSZY3eQPX3GJN+gjxdW83SM7DX6NcKCFqNIIvjz/J+l8uimHAQp9dnLySb0wb1K1Z1xBPIXyxMQRREIw==",
|
"contentHash": "U7awzB6nGNN3tyZpeWQQjF4MHxJ4CDbvXEuJDkddLa2ellh2SYCV4V3UqukMuVzlrUSC71ITFwDVZZ+uYZYVtw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"protobuf-net": "1.0.0"
|
"protobuf-net": "1.0.0"
|
||||||
}
|
}
|
||||||
@@ -187,38 +187,38 @@
|
|||||||
"resolved": "0.11.4",
|
"resolved": "0.11.4",
|
||||||
"contentHash": "IC1h5g0NeJGHIUgzM1P82ld57knhP0IcQfrYITDPXlNpMYGUrsG5TxuaWTjaeqDNQMBDNZkB8L0rBnwsY6JHuQ=="
|
"contentHash": "IC1h5g0NeJGHIUgzM1P82ld57knhP0IcQfrYITDPXlNpMYGUrsG5TxuaWTjaeqDNQMBDNZkB8L0rBnwsY6JHuQ=="
|
||||||
},
|
},
|
||||||
"MonoModReorg.Backports": {
|
"MonoMod.Backports": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "23.3.22.1",
|
"resolved": "1.0.0",
|
||||||
"contentHash": "nLx18prtZbS0nVO8YHElP+TUj1kkDswRgQpa9agt3tyNWke9Kqk5lVkGu87Y3cCMhG+m5Ai0ZDH0+V5B6bXF+Q==",
|
"contentHash": "J59I4CMe24aCmWboHCDzQIk37kXqHnJH6KQfDGstlznuDni7Lwdd/8CywmEwVXjVEgfs5yQzvOTW3Xg1NH7fDQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"MonoModReorg.ILHelpers": "23.3.22.1"
|
"MonoMod.ILHelpers": "1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"MonoModReorg.Core": {
|
"MonoMod.Core": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "23.3.22.1",
|
"resolved": "1.0.0",
|
||||||
"contentHash": "Q3ZOgm6AOTL0icgcHsT/6mV5kYt6meqX3DEN1p/et5PxJsXUhVkiZfAptp8y/i+cO6HNgkcESpXEQ4jUWVwsDA==",
|
"contentHash": "FlzAEa4ujbA1t3rbKxuW3DP36T0/L6k2IP1F4QXM1cOXMJLHm39Azjt98E/9LFRFBWYFdlMUmg+4THLv2xyisA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Mono.Cecil": "0.11.4",
|
"Mono.Cecil": "0.11.4",
|
||||||
"MonoModReorg.Backports": "23.3.22.1",
|
"MonoMod.Backports": "1.0.0",
|
||||||
"MonoModReorg.ILHelpers": "23.3.22.1",
|
"MonoMod.ILHelpers": "1.0.0",
|
||||||
"MonoModReorg.Utils": "23.3.22.1"
|
"MonoMod.Utils": "25.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"MonoModReorg.ILHelpers": {
|
"MonoMod.ILHelpers": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "23.3.22.1",
|
"resolved": "1.0.0",
|
||||||
"contentHash": "dHE/3VZtnTUTkQ34j8Gu6CxKes1QDL8tBuF3QElxHHpPl/QabGCK938k47WWRcRBMoP7IAthkn+Bob4H97rBgw=="
|
"contentHash": "dTjGA+dYl7W5yQ0oG/Wr57tsa+ueoFUrwPtz9MZF9iheun4n70u7lge52F8UJi9i0zMHRfS2mAY6+nPuRZHQyQ=="
|
||||||
},
|
},
|
||||||
"MonoModReorg.Utils": {
|
"MonoMod.Utils": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "23.3.22.1",
|
"resolved": "25.0.0",
|
||||||
"contentHash": "q1cX0mbYxdw2WcE/qGBB84lVY/ffobEr46VQFuwGcWhtw6f1Ql1k4TZfs8gebpesSxHnca13grLeVHrUSpy1+g==",
|
"contentHash": "E8m0pH3Kact+A2qH+lxMis90K8+ixInwprn0R1nuAMRHfotHUHeYmr304UEPeInSuY3+IlnC+OB8fqbQiTsWlQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Mono.Cecil": "0.11.4",
|
"Mono.Cecil": "0.11.4",
|
||||||
"MonoModReorg.Backports": "23.3.22.1",
|
"MonoMod.Backports": "1.0.0",
|
||||||
"MonoModReorg.ILHelpers": "23.3.22.1"
|
"MonoMod.ILHelpers": "1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Newtonsoft.Json": {
|
"Newtonsoft.Json": {
|
||||||
@@ -408,7 +408,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"JorgeSerrano.Json.JsonSnakeCaseNamingPolicy": "[0.9.0, )",
|
"JorgeSerrano.Json.JsonSnakeCaseNamingPolicy": "[0.9.0, )",
|
||||||
"Microsoft.Extensions.Configuration.Binder": "[7.0.4, )",
|
"Microsoft.Extensions.Configuration.Binder": "[7.0.4, )",
|
||||||
"NLog": "[5.2.0, )",
|
"NLog": "[5.2.2, )",
|
||||||
"NuGet.Commands": "[6.6.1, )",
|
"NuGet.Commands": "[6.6.1, )",
|
||||||
"NuGet.DependencyResolver.Core": "[6.6.1, )",
|
"NuGet.DependencyResolver.Core": "[6.6.1, )",
|
||||||
"SemanticVersioning": "[2.0.2, )",
|
"SemanticVersioning": "[2.0.2, )",
|
||||||
|
Reference in New Issue
Block a user