Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
22c4cfb039 | |||
5f0ffb6f9a | |||
1b2a989441 | |||
![]() |
83dfc7152f | ||
d7e5f53e4f | |||
9b08b39a1f | |||
![]() |
8011f9eed7 | ||
1df791e7a8 | |||
![]() |
bbc2f9046f | ||
117ea7df91 | |||
6ec355f931 |
@@ -18,11 +18,11 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="JorgeSerrano.Json.JsonSnakeCaseNamingPolicy" Version="0.9.0" />
|
||||
<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.DependencyResolver.Core" Version="6.6.1" />
|
||||
<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>
|
||||
<IncludeAssets>compile</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
@@ -19,9 +19,9 @@
|
||||
},
|
||||
"NLog": {
|
||||
"type": "Direct",
|
||||
"requested": "[5.2.0, )",
|
||||
"resolved": "5.2.0",
|
||||
"contentHash": "uYBgseY0m/9lQUbZYGsQsTBFOWrfs3iaekzzYMH6vFmpoOAvV8/bp1XxG/suZkwB5h8nAiTJAp7VENWRDKtKPA=="
|
||||
"requested": "[5.2.2, )",
|
||||
"resolved": "5.2.2",
|
||||
"contentHash": "r6Q9740g29gTwmTWlsgdIFm0mhNsfNZmbvWKX/Fxmi8X89ZrpUowHM2T2X1lP7RVpND+ef+XnfKL5g6Q1iNGXA=="
|
||||
},
|
||||
"NuGet.Commands": {
|
||||
"type": "Direct",
|
||||
@@ -54,9 +54,9 @@
|
||||
},
|
||||
"SpaceEngineersDedicated.ReferenceAssemblies": {
|
||||
"type": "Direct",
|
||||
"requested": "[1.202.120, )",
|
||||
"resolved": "1.202.120",
|
||||
"contentHash": "HTP48NOSZY3eQPX3GJN+gjxdW83SM7DX6NcKCFqNIIvjz/J+l8uimHAQp9dnLySb0wb1K1Z1xBPIXyxMQRREIw==",
|
||||
"requested": "[1.203.22.3, )",
|
||||
"resolved": "1.203.22.3",
|
||||
"contentHash": "U7awzB6nGNN3tyZpeWQQjF4MHxJ4CDbvXEuJDkddLa2ellh2SYCV4V3UqukMuVzlrUSC71ITFwDVZZ+uYZYVtw==",
|
||||
"dependencies": {
|
||||
"protobuf-net": "1.0.0"
|
||||
}
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<repository type="git" url="https://github.com/PveTeam/Torch" />
|
||||
<dependencies>
|
||||
<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" />
|
||||
</group>
|
||||
</dependencies>
|
||||
|
@@ -18,7 +18,7 @@
|
||||
<!-- <Import Project="$(SolutionDir)\TransformOnBuild.targets" /> -->
|
||||
<ItemGroup>
|
||||
<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" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@@ -30,9 +30,8 @@ namespace Torch.Server
|
||||
private bool _init;
|
||||
private const string TOOL_DIR = "tool";
|
||||
private const string TOOL_ZIP = "temp.zip";
|
||||
private static readonly string TOOL_EXE = "DepotDownloader.exe";
|
||||
private const string TOOL_ARGS = "-app 298740 -depot {1} -dir \"{0}\" -manifest {2}";
|
||||
private static readonly int[] Depots = { 298741, 1004 };
|
||||
private static readonly string TOOL_EXE = "steamcmd.exe";
|
||||
private const string TOOL_ARGS = "+force_install_dir \"{0}\" +login anonymous +app_update 298740 +quit";
|
||||
private TorchServer _server;
|
||||
|
||||
internal Persistent<TorchConfig> ConfigPersistent { get; }
|
||||
@@ -131,7 +130,7 @@ namespace Torch.Server
|
||||
|
||||
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
|
||||
.CreateSubdirectory(TOOL_DIR).FullName;
|
||||
@@ -141,39 +140,32 @@ namespace Torch.Server
|
||||
Directory.CreateDirectory(path);
|
||||
}
|
||||
|
||||
var steamCmdExePath = Path.Combine(path, TOOL_EXE);
|
||||
if (!File.Exists(steamCmdExePath))
|
||||
var toolExe = Path.Combine(path, TOOL_EXE);
|
||||
if (!File.Exists(toolExe))
|
||||
{
|
||||
try
|
||||
{
|
||||
log.Info("Downloading Steam Tool.");
|
||||
log.Info("Downloading SteamCMD.");
|
||||
using (var client = new HttpClient())
|
||||
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);
|
||||
|
||||
ZipFile.ExtractToDirectory(TOOL_ZIP, path);
|
||||
File.Delete(TOOL_ZIP);
|
||||
log.Info("Steam Tool downloaded successfully!");
|
||||
log.Info("SteamCMD downloaded successfully!");
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
log.Info("Checking for DS updates.");
|
||||
foreach (var depot in Depots)
|
||||
var steamCmdProc = new ProcessStartInfo(toolExe)
|
||||
{
|
||||
await DownloadDepot(depot);
|
||||
}
|
||||
|
||||
async Task DownloadDepot(int depotId)
|
||||
{
|
||||
var steamCmdProc = new ProcessStartInfo(steamCmdExePath)
|
||||
{
|
||||
Arguments = string.Format(TOOL_ARGS, configuration.GetValue("gamePath", "../"), depotId, "3111493184861426002"),
|
||||
Arguments = string.Format(TOOL_ARGS, configuration.GetValue("gamePath", "../")),
|
||||
WorkingDirectory = path,
|
||||
RedirectStandardOutput = true
|
||||
};
|
||||
@@ -187,4 +179,3 @@ namespace Torch.Server
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -28,6 +28,7 @@ using VRage.FileSystem;
|
||||
using VRage.Game;
|
||||
using VRage.Game.ObjectBuilder;
|
||||
using VRage.ObjectBuilders;
|
||||
using VRage.ObjectBuilders.Private;
|
||||
using VRage.Plugins;
|
||||
|
||||
namespace Torch.Server.Managers
|
||||
@@ -363,10 +364,10 @@ namespace Torch.Server.Managers
|
||||
public void SaveSandbox()
|
||||
{
|
||||
using (var f = File.Open(_checkpointPath, FileMode.Create))
|
||||
MyObjectBuilderSerializer.SerializeXML(f, Checkpoint);
|
||||
MyObjectBuilderSerializerKeen.SerializeXML(f, Checkpoint);
|
||||
|
||||
using (var f = File.Open(_worldConfigPath, FileMode.Create))
|
||||
MyObjectBuilderSerializer.SerializeXML(f, WorldConfiguration);
|
||||
MyObjectBuilderSerializerKeen.SerializeXML(f, WorldConfiguration);
|
||||
}
|
||||
|
||||
public void LoadSandbox()
|
||||
|
@@ -41,7 +41,7 @@
|
||||
<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.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="Steamworks.NET" Version="20.1.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
@@ -50,7 +50,7 @@
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||
<PackageReference Include="System.Management" Version="7.0.2" />
|
||||
<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>
|
||||
<IncludeAssets>compile</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
@@ -69,6 +69,14 @@ namespace Torch.Server
|
||||
|
||||
_simUpdateTimer.Elapsed += SimUpdateElapsed;
|
||||
_simUpdateTimer.Start();
|
||||
|
||||
Console.CancelKeyPress += (_, _) =>
|
||||
{
|
||||
if (State == ServerState.Running)
|
||||
Stop();
|
||||
|
||||
Environment.Exit(0);
|
||||
};
|
||||
}
|
||||
|
||||
private void SimUpdateElapsed(object sender, System.Timers.ElapsedEventArgs e)
|
||||
@@ -121,7 +129,38 @@ namespace Torch.Server
|
||||
/// <inheritdoc />
|
||||
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; }
|
||||
|
||||
@@ -132,7 +171,7 @@ namespace Torch.Server
|
||||
base.Init();
|
||||
GetManager<InstanceManager>().LoadInstance(InstancePath);
|
||||
CanRun = true;
|
||||
Initialized?.Invoke(this);
|
||||
_initializedEvent?.Invoke(this);
|
||||
Log.Info($"Initialized server '{InstanceName}' at '{InstancePath}'");
|
||||
}
|
||||
|
||||
@@ -208,9 +247,14 @@ namespace Torch.Server
|
||||
StopInternal();
|
||||
LogManager.Flush();
|
||||
|
||||
if (
|
||||
#if DEBUG
|
||||
Environment.Exit(0);
|
||||
// ReSharper disable once ConditionIsAlwaysTrueOrFalse
|
||||
true ||
|
||||
#endif
|
||||
ApplicationContext.Current.IsService
|
||||
)
|
||||
Environment.Exit(0);
|
||||
|
||||
var exe = Path.Combine(AppContext.BaseDirectory, "Torch.Server.exe");
|
||||
|
||||
|
@@ -116,7 +116,7 @@ namespace Torch.Server
|
||||
if (_server?.State == ServerState.Running)
|
||||
_server.Stop();
|
||||
|
||||
Process.GetCurrentProcess().Kill();
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -92,9 +92,9 @@
|
||||
},
|
||||
"NLog": {
|
||||
"type": "Direct",
|
||||
"requested": "[5.2.0, )",
|
||||
"resolved": "5.2.0",
|
||||
"contentHash": "uYBgseY0m/9lQUbZYGsQsTBFOWrfs3iaekzzYMH6vFmpoOAvV8/bp1XxG/suZkwB5h8nAiTJAp7VENWRDKtKPA=="
|
||||
"requested": "[5.2.2, )",
|
||||
"resolved": "5.2.2",
|
||||
"contentHash": "r6Q9740g29gTwmTWlsgdIFm0mhNsfNZmbvWKX/Fxmi8X89ZrpUowHM2T2X1lP7RVpND+ef+XnfKL5g6Q1iNGXA=="
|
||||
},
|
||||
"nulastudio.NetCoreBeauty": {
|
||||
"type": "Direct",
|
||||
@@ -113,9 +113,9 @@
|
||||
},
|
||||
"SpaceEngineersDedicated.ReferenceAssemblies": {
|
||||
"type": "Direct",
|
||||
"requested": "[1.202.120, )",
|
||||
"resolved": "1.202.120",
|
||||
"contentHash": "HTP48NOSZY3eQPX3GJN+gjxdW83SM7DX6NcKCFqNIIvjz/J+l8uimHAQp9dnLySb0wb1K1Z1xBPIXyxMQRREIw==",
|
||||
"requested": "[1.203.22.3, )",
|
||||
"resolved": "1.203.22.3",
|
||||
"contentHash": "U7awzB6nGNN3tyZpeWQQjF4MHxJ4CDbvXEuJDkddLa2ellh2SYCV4V3UqukMuVzlrUSC71ITFwDVZZ+uYZYVtw==",
|
||||
"dependencies": {
|
||||
"protobuf-net": "1.0.0"
|
||||
}
|
||||
@@ -153,10 +153,10 @@
|
||||
},
|
||||
"HarmonyX": {
|
||||
"type": "Transitive",
|
||||
"resolved": "2.10.2-prerelease.4",
|
||||
"contentHash": "M/44/DhSu1WR8gL62aLPGKqAJ0rrgkw38nT3DgEvLAvyIoQLJmL2Jsn4/d4CC0eDT1Vv82cB9Mxgg0sFD3/qrQ==",
|
||||
"resolved": "2.10.2-prerelease.6",
|
||||
"contentHash": "CPCUR/t5AQ5DDs40bTJ5OwUVTCoZONaJGbWKKjAOwg7c7Ct4KEbfybH6T+KvRGVjf5eN1oyGY5BN7EfWxUh9Xg==",
|
||||
"dependencies": {
|
||||
"MonoModReorg.RuntimeDetour": "23.3.22.1"
|
||||
"MonoMod.RuntimeDetour": "25.0.0"
|
||||
}
|
||||
},
|
||||
"JorgeSerrano.Json.JsonSnakeCaseNamingPolicy": {
|
||||
@@ -313,50 +313,50 @@
|
||||
"resolved": "0.11.4",
|
||||
"contentHash": "IC1h5g0NeJGHIUgzM1P82ld57knhP0IcQfrYITDPXlNpMYGUrsG5TxuaWTjaeqDNQMBDNZkB8L0rBnwsY6JHuQ=="
|
||||
},
|
||||
"MonoModReorg.Backports": {
|
||||
"MonoMod.Backports": {
|
||||
"type": "Transitive",
|
||||
"resolved": "23.3.22.1",
|
||||
"contentHash": "nLx18prtZbS0nVO8YHElP+TUj1kkDswRgQpa9agt3tyNWke9Kqk5lVkGu87Y3cCMhG+m5Ai0ZDH0+V5B6bXF+Q==",
|
||||
"resolved": "1.0.0",
|
||||
"contentHash": "J59I4CMe24aCmWboHCDzQIk37kXqHnJH6KQfDGstlznuDni7Lwdd/8CywmEwVXjVEgfs5yQzvOTW3Xg1NH7fDQ==",
|
||||
"dependencies": {
|
||||
"MonoModReorg.ILHelpers": "23.3.22.1"
|
||||
"MonoMod.ILHelpers": "1.0.0"
|
||||
}
|
||||
},
|
||||
"MonoModReorg.Core": {
|
||||
"MonoMod.Core": {
|
||||
"type": "Transitive",
|
||||
"resolved": "23.3.22.1",
|
||||
"contentHash": "Q3ZOgm6AOTL0icgcHsT/6mV5kYt6meqX3DEN1p/et5PxJsXUhVkiZfAptp8y/i+cO6HNgkcESpXEQ4jUWVwsDA==",
|
||||
"resolved": "1.0.0",
|
||||
"contentHash": "FlzAEa4ujbA1t3rbKxuW3DP36T0/L6k2IP1F4QXM1cOXMJLHm39Azjt98E/9LFRFBWYFdlMUmg+4THLv2xyisA==",
|
||||
"dependencies": {
|
||||
"Mono.Cecil": "0.11.4",
|
||||
"MonoModReorg.Backports": "23.3.22.1",
|
||||
"MonoModReorg.ILHelpers": "23.3.22.1",
|
||||
"MonoModReorg.Utils": "23.3.22.1"
|
||||
"MonoMod.Backports": "1.0.0",
|
||||
"MonoMod.ILHelpers": "1.0.0",
|
||||
"MonoMod.Utils": "25.0.0"
|
||||
}
|
||||
},
|
||||
"MonoModReorg.ILHelpers": {
|
||||
"MonoMod.ILHelpers": {
|
||||
"type": "Transitive",
|
||||
"resolved": "23.3.22.1",
|
||||
"contentHash": "dHE/3VZtnTUTkQ34j8Gu6CxKes1QDL8tBuF3QElxHHpPl/QabGCK938k47WWRcRBMoP7IAthkn+Bob4H97rBgw=="
|
||||
"resolved": "1.0.0",
|
||||
"contentHash": "dTjGA+dYl7W5yQ0oG/Wr57tsa+ueoFUrwPtz9MZF9iheun4n70u7lge52F8UJi9i0zMHRfS2mAY6+nPuRZHQyQ=="
|
||||
},
|
||||
"MonoModReorg.RuntimeDetour": {
|
||||
"MonoMod.RuntimeDetour": {
|
||||
"type": "Transitive",
|
||||
"resolved": "23.3.22.1",
|
||||
"contentHash": "cUES3Hi7QJtBNe0qwVdjZOCDkZDaCpdqS6Au0RaCyQ1PDIR4av13E9qBNAEYew46sgPe0fOrU334md6DLDGHlQ==",
|
||||
"resolved": "25.0.0",
|
||||
"contentHash": "u+G34uSEjU0+fk4Iz3Mfws/+E4kW460i6fBz1b4L/yxSndfmdKkJ+pYbU9pwh7IUxgk0Ko0+Mx3fSUQPaNk8nA==",
|
||||
"dependencies": {
|
||||
"Mono.Cecil": "0.11.4",
|
||||
"MonoModReorg.Backports": "23.3.22.1",
|
||||
"MonoModReorg.Core": "23.3.22.1",
|
||||
"MonoModReorg.ILHelpers": "23.3.22.1",
|
||||
"MonoModReorg.Utils": "23.3.22.1"
|
||||
"MonoMod.Backports": "1.0.0",
|
||||
"MonoMod.Core": "1.0.0",
|
||||
"MonoMod.ILHelpers": "1.0.0",
|
||||
"MonoMod.Utils": "25.0.0"
|
||||
}
|
||||
},
|
||||
"MonoModReorg.Utils": {
|
||||
"MonoMod.Utils": {
|
||||
"type": "Transitive",
|
||||
"resolved": "23.3.22.1",
|
||||
"contentHash": "q1cX0mbYxdw2WcE/qGBB84lVY/ffobEr46VQFuwGcWhtw6f1Ql1k4TZfs8gebpesSxHnca13grLeVHrUSpy1+g==",
|
||||
"resolved": "25.0.0",
|
||||
"contentHash": "E8m0pH3Kact+A2qH+lxMis90K8+ixInwprn0R1nuAMRHfotHUHeYmr304UEPeInSuY3+IlnC+OB8fqbQiTsWlQ==",
|
||||
"dependencies": {
|
||||
"Mono.Cecil": "0.11.4",
|
||||
"MonoModReorg.Backports": "23.3.22.1",
|
||||
"MonoModReorg.ILHelpers": "23.3.22.1"
|
||||
"MonoMod.Backports": "1.0.0",
|
||||
"MonoMod.ILHelpers": "1.0.0"
|
||||
}
|
||||
},
|
||||
"Newtonsoft.Json": {
|
||||
@@ -574,12 +574,12 @@
|
||||
"type": "Project",
|
||||
"dependencies": {
|
||||
"ControlzEx": "[6.0.0, )",
|
||||
"HarmonyX": "[2.10.2-prerelease.4, )",
|
||||
"HarmonyX": "[2.10.2-prerelease.6, )",
|
||||
"MahApps.Metro": "[2.4.9, )",
|
||||
"Microsoft.CodeAnalysis.CSharp": "[4.6.0, )",
|
||||
"Microsoft.CodeAnalysis.Common": "[4.6.0, )",
|
||||
"MonoModReorg.RuntimeDetour": "[23.3.22.1, )",
|
||||
"NLog": "[5.2.0, )",
|
||||
"MonoMod.RuntimeDetour": "[25.0.0, )",
|
||||
"NLog": "[5.2.2, )",
|
||||
"System.ComponentModel.Annotations": "[5.0.0, )",
|
||||
"Torch.API": "[1.0.0, )",
|
||||
"Torch.SixLabors.ImageSharp": "[1.0.0-beta6, )",
|
||||
@@ -591,7 +591,7 @@
|
||||
"dependencies": {
|
||||
"JorgeSerrano.Json.JsonSnakeCaseNamingPolicy": "[0.9.0, )",
|
||||
"Microsoft.Extensions.Configuration.Binder": "[7.0.4, )",
|
||||
"NLog": "[5.2.0, )",
|
||||
"NLog": "[5.2.2, )",
|
||||
"NuGet.Commands": "[6.6.1, )",
|
||||
"NuGet.DependencyResolver.Core": "[6.6.1, )",
|
||||
"SemanticVersioning": "[2.0.2, )",
|
||||
|
@@ -18,7 +18,7 @@
|
||||
<!-- <Import Project="$(SolutionDir)\TransformOnBuild.targets" /> -->
|
||||
<ItemGroup>
|
||||
<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" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@@ -27,6 +27,7 @@ using VRage.Game.ModAPI;
|
||||
using VRage.Groups;
|
||||
using VRage.ModAPI;
|
||||
using VRage.ObjectBuilders;
|
||||
using VRage.ObjectBuilders.Private;
|
||||
using VRage.Sync;
|
||||
using VRageMath;
|
||||
|
||||
@@ -45,14 +46,14 @@ namespace Torch.Managers
|
||||
{
|
||||
var ob = grid.GetObjectBuilder(true);
|
||||
using (var f = File.Open(path, FileMode.CreateNew))
|
||||
MyObjectBuilderSerializer.SerializeXML(f, ob);
|
||||
MyObjectBuilderSerializerKeen.SerializeXML(f, ob);
|
||||
}
|
||||
|
||||
public void ImportGrid(string path, Vector3D position)
|
||||
{
|
||||
MyObjectBuilder_EntityBase gridOb;
|
||||
using (var f = File.OpenRead(path))
|
||||
MyObjectBuilderSerializer.DeserializeXML(f, out gridOb);
|
||||
MyObjectBuilderSerializerKeen.DeserializeXML(f, out gridOb);
|
||||
|
||||
var grid = MyEntities.CreateFromObjectBuilderParallel(gridOb);
|
||||
grid.PositionComp.SetPosition(position);
|
||||
|
@@ -82,7 +82,7 @@ public class ScriptCompilationManager : Manager
|
||||
TerminationReasonSetter(block, MyProgrammableBlock.ScriptTerminationReason.None);
|
||||
|
||||
var component = ScriptComponentGetter(block);
|
||||
component.NextUpdate = UpdateType.None;
|
||||
component.UpdateFrequency = UpdateFrequency.None;
|
||||
component.NeedsUpdate = MyEntityUpdateEnum.NONE;
|
||||
|
||||
try
|
||||
@@ -214,7 +214,8 @@ public class ScriptCompilationManager : Manager
|
||||
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 CSharpCompilation CreateCompilation(string assemblyFileName, IEnumerable<Script> scripts)
|
||||
|
@@ -79,6 +79,9 @@ namespace Torch.Patches
|
||||
[ReflectedSetter(Name = "m_enabled")]
|
||||
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()
|
||||
{
|
||||
using var l = _lockGetter(MyLog.Default).AcquireExclusiveUsing();
|
||||
@@ -122,7 +125,7 @@ namespace Torch.Patches
|
||||
}
|
||||
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}");
|
||||
return false;
|
||||
}
|
||||
|
@@ -72,7 +72,9 @@ namespace Torch.Session
|
||||
{
|
||||
if (_overrideMods.ContainsKey(modId))
|
||||
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);
|
||||
|
||||
OverrideModsChanged?.Invoke(new CollectionChangeEventArgs(CollectionChangeAction.Add, item));
|
||||
|
@@ -24,18 +24,18 @@
|
||||
|
||||
<ItemGroup>
|
||||
<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="MahApps.Metro" Version="2.4.9" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.6.0" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.6.0" />
|
||||
<PackageReference Include="MonoModReorg.RuntimeDetour" Version="23.3.22.1" />
|
||||
<PackageReference Include="NLog" Version="5.2.0" />
|
||||
<PackageReference Include="MonoMod.RuntimeDetour" Version="25.0.0" />
|
||||
<PackageReference Include="NLog" Version="5.2.2" />
|
||||
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0" PrivateAssets="all" />
|
||||
<PackageReference Include="protobuf-net" Version="3.2.26" />
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||
<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>
|
||||
<IncludeAssets>compile</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
@@ -124,7 +124,9 @@ namespace Torch
|
||||
Managers.AddManager(sessionManager);
|
||||
Managers.AddManager(new PatchManager(this));
|
||||
Managers.AddManager(new FilesystemManager(this));
|
||||
#if !DEBUG
|
||||
Managers.AddManager(new UpdateManager(this));
|
||||
#endif
|
||||
Managers.AddManager(new EventManager(this));
|
||||
#pragma warning disable CS0618
|
||||
Managers.AddManager(Plugins);
|
||||
@@ -370,10 +372,10 @@ namespace Torch
|
||||
/// <inheritdoc />
|
||||
public virtual void Stop()
|
||||
{
|
||||
LogManager.Flush();
|
||||
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");
|
||||
LogManager.Flush();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@@ -14,11 +14,11 @@
|
||||
},
|
||||
"HarmonyX": {
|
||||
"type": "Direct",
|
||||
"requested": "[2.10.2-prerelease.4, )",
|
||||
"resolved": "2.10.2-prerelease.4",
|
||||
"contentHash": "M/44/DhSu1WR8gL62aLPGKqAJ0rrgkw38nT3DgEvLAvyIoQLJmL2Jsn4/d4CC0eDT1Vv82cB9Mxgg0sFD3/qrQ==",
|
||||
"requested": "[2.10.2-prerelease.6, )",
|
||||
"resolved": "2.10.2-prerelease.6",
|
||||
"contentHash": "CPCUR/t5AQ5DDs40bTJ5OwUVTCoZONaJGbWKKjAOwg7c7Ct4KEbfybH6T+KvRGVjf5eN1oyGY5BN7EfWxUh9Xg==",
|
||||
"dependencies": {
|
||||
"MonoModReorg.RuntimeDetour": "23.3.22.1"
|
||||
"MonoMod.RuntimeDetour": "25.0.0"
|
||||
}
|
||||
},
|
||||
"InfoOf.Fody": {
|
||||
@@ -61,24 +61,24 @@
|
||||
"Microsoft.CodeAnalysis.Common": "[4.6.0]"
|
||||
}
|
||||
},
|
||||
"MonoModReorg.RuntimeDetour": {
|
||||
"MonoMod.RuntimeDetour": {
|
||||
"type": "Direct",
|
||||
"requested": "[23.3.22.1, )",
|
||||
"resolved": "23.3.22.1",
|
||||
"contentHash": "cUES3Hi7QJtBNe0qwVdjZOCDkZDaCpdqS6Au0RaCyQ1PDIR4av13E9qBNAEYew46sgPe0fOrU334md6DLDGHlQ==",
|
||||
"requested": "[25.0.0, )",
|
||||
"resolved": "25.0.0",
|
||||
"contentHash": "u+G34uSEjU0+fk4Iz3Mfws/+E4kW460i6fBz1b4L/yxSndfmdKkJ+pYbU9pwh7IUxgk0Ko0+Mx3fSUQPaNk8nA==",
|
||||
"dependencies": {
|
||||
"Mono.Cecil": "0.11.4",
|
||||
"MonoModReorg.Backports": "23.3.22.1",
|
||||
"MonoModReorg.Core": "23.3.22.1",
|
||||
"MonoModReorg.ILHelpers": "23.3.22.1",
|
||||
"MonoModReorg.Utils": "23.3.22.1"
|
||||
"MonoMod.Backports": "1.0.0",
|
||||
"MonoMod.Core": "1.0.0",
|
||||
"MonoMod.ILHelpers": "1.0.0",
|
||||
"MonoMod.Utils": "25.0.0"
|
||||
}
|
||||
},
|
||||
"NLog": {
|
||||
"type": "Direct",
|
||||
"requested": "[5.2.0, )",
|
||||
"resolved": "5.2.0",
|
||||
"contentHash": "uYBgseY0m/9lQUbZYGsQsTBFOWrfs3iaekzzYMH6vFmpoOAvV8/bp1XxG/suZkwB5h8nAiTJAp7VENWRDKtKPA=="
|
||||
"requested": "[5.2.2, )",
|
||||
"resolved": "5.2.2",
|
||||
"contentHash": "r6Q9740g29gTwmTWlsgdIFm0mhNsfNZmbvWKX/Fxmi8X89ZrpUowHM2T2X1lP7RVpND+ef+XnfKL5g6Q1iNGXA=="
|
||||
},
|
||||
"PropertyChanged.Fody": {
|
||||
"type": "Direct",
|
||||
@@ -100,9 +100,9 @@
|
||||
},
|
||||
"SpaceEngineersDedicated.ReferenceAssemblies": {
|
||||
"type": "Direct",
|
||||
"requested": "[1.202.120, )",
|
||||
"resolved": "1.202.120",
|
||||
"contentHash": "HTP48NOSZY3eQPX3GJN+gjxdW83SM7DX6NcKCFqNIIvjz/J+l8uimHAQp9dnLySb0wb1K1Z1xBPIXyxMQRREIw==",
|
||||
"requested": "[1.203.22.3, )",
|
||||
"resolved": "1.203.22.3",
|
||||
"contentHash": "U7awzB6nGNN3tyZpeWQQjF4MHxJ4CDbvXEuJDkddLa2ellh2SYCV4V3UqukMuVzlrUSC71ITFwDVZZ+uYZYVtw==",
|
||||
"dependencies": {
|
||||
"protobuf-net": "1.0.0"
|
||||
}
|
||||
@@ -187,38 +187,38 @@
|
||||
"resolved": "0.11.4",
|
||||
"contentHash": "IC1h5g0NeJGHIUgzM1P82ld57knhP0IcQfrYITDPXlNpMYGUrsG5TxuaWTjaeqDNQMBDNZkB8L0rBnwsY6JHuQ=="
|
||||
},
|
||||
"MonoModReorg.Backports": {
|
||||
"MonoMod.Backports": {
|
||||
"type": "Transitive",
|
||||
"resolved": "23.3.22.1",
|
||||
"contentHash": "nLx18prtZbS0nVO8YHElP+TUj1kkDswRgQpa9agt3tyNWke9Kqk5lVkGu87Y3cCMhG+m5Ai0ZDH0+V5B6bXF+Q==",
|
||||
"resolved": "1.0.0",
|
||||
"contentHash": "J59I4CMe24aCmWboHCDzQIk37kXqHnJH6KQfDGstlznuDni7Lwdd/8CywmEwVXjVEgfs5yQzvOTW3Xg1NH7fDQ==",
|
||||
"dependencies": {
|
||||
"MonoModReorg.ILHelpers": "23.3.22.1"
|
||||
"MonoMod.ILHelpers": "1.0.0"
|
||||
}
|
||||
},
|
||||
"MonoModReorg.Core": {
|
||||
"MonoMod.Core": {
|
||||
"type": "Transitive",
|
||||
"resolved": "23.3.22.1",
|
||||
"contentHash": "Q3ZOgm6AOTL0icgcHsT/6mV5kYt6meqX3DEN1p/et5PxJsXUhVkiZfAptp8y/i+cO6HNgkcESpXEQ4jUWVwsDA==",
|
||||
"resolved": "1.0.0",
|
||||
"contentHash": "FlzAEa4ujbA1t3rbKxuW3DP36T0/L6k2IP1F4QXM1cOXMJLHm39Azjt98E/9LFRFBWYFdlMUmg+4THLv2xyisA==",
|
||||
"dependencies": {
|
||||
"Mono.Cecil": "0.11.4",
|
||||
"MonoModReorg.Backports": "23.3.22.1",
|
||||
"MonoModReorg.ILHelpers": "23.3.22.1",
|
||||
"MonoModReorg.Utils": "23.3.22.1"
|
||||
"MonoMod.Backports": "1.0.0",
|
||||
"MonoMod.ILHelpers": "1.0.0",
|
||||
"MonoMod.Utils": "25.0.0"
|
||||
}
|
||||
},
|
||||
"MonoModReorg.ILHelpers": {
|
||||
"MonoMod.ILHelpers": {
|
||||
"type": "Transitive",
|
||||
"resolved": "23.3.22.1",
|
||||
"contentHash": "dHE/3VZtnTUTkQ34j8Gu6CxKes1QDL8tBuF3QElxHHpPl/QabGCK938k47WWRcRBMoP7IAthkn+Bob4H97rBgw=="
|
||||
"resolved": "1.0.0",
|
||||
"contentHash": "dTjGA+dYl7W5yQ0oG/Wr57tsa+ueoFUrwPtz9MZF9iheun4n70u7lge52F8UJi9i0zMHRfS2mAY6+nPuRZHQyQ=="
|
||||
},
|
||||
"MonoModReorg.Utils": {
|
||||
"MonoMod.Utils": {
|
||||
"type": "Transitive",
|
||||
"resolved": "23.3.22.1",
|
||||
"contentHash": "q1cX0mbYxdw2WcE/qGBB84lVY/ffobEr46VQFuwGcWhtw6f1Ql1k4TZfs8gebpesSxHnca13grLeVHrUSpy1+g==",
|
||||
"resolved": "25.0.0",
|
||||
"contentHash": "E8m0pH3Kact+A2qH+lxMis90K8+ixInwprn0R1nuAMRHfotHUHeYmr304UEPeInSuY3+IlnC+OB8fqbQiTsWlQ==",
|
||||
"dependencies": {
|
||||
"Mono.Cecil": "0.11.4",
|
||||
"MonoModReorg.Backports": "23.3.22.1",
|
||||
"MonoModReorg.ILHelpers": "23.3.22.1"
|
||||
"MonoMod.Backports": "1.0.0",
|
||||
"MonoMod.ILHelpers": "1.0.0"
|
||||
}
|
||||
},
|
||||
"Newtonsoft.Json": {
|
||||
@@ -408,7 +408,7 @@
|
||||
"dependencies": {
|
||||
"JorgeSerrano.Json.JsonSnakeCaseNamingPolicy": "[0.9.0, )",
|
||||
"Microsoft.Extensions.Configuration.Binder": "[7.0.4, )",
|
||||
"NLog": "[5.2.0, )",
|
||||
"NLog": "[5.2.2, )",
|
||||
"NuGet.Commands": "[6.6.1, )",
|
||||
"NuGet.DependencyResolver.Core": "[6.6.1, )",
|
||||
"SemanticVersioning": "[2.0.2, )",
|
||||
|
Reference in New Issue
Block a user