Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b60100171d | ||
![]() |
65e2f342a3 | ||
![]() |
6a695f2abf | ||
![]() |
9289ab8003 |
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
@@ -140,6 +141,22 @@ namespace Torch.API
|
||||
event Action<ITorchServer> Initialized;
|
||||
|
||||
TimeSpan ElapsedPlayTime { get; set; }
|
||||
|
||||
#region Backwards compat
|
||||
|
||||
/// <summary>
|
||||
/// Path of the dedicated instance folder.
|
||||
/// </summary>
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
new string InstancePath => ((ITorchBase)this).InstancePath;
|
||||
|
||||
/// <summary>
|
||||
/// Name of the dedicated instance.
|
||||
/// </summary>
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
new string InstanceName => ((ITorchBase)this).InstanceName;
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@@ -45,6 +45,12 @@ namespace Torch.Patches
|
||||
private static void WhitelistCtorPrefix(MyScriptCompiler scriptCompiler)
|
||||
{
|
||||
var baseDir = new FileInfo(typeof(Type).Assembly.Location).DirectoryName!;
|
||||
var binDir =
|
||||
#if DEBUG
|
||||
baseDir;
|
||||
#else
|
||||
Path.Join(AppContext.BaseDirectory, "torch64");
|
||||
#endif
|
||||
|
||||
scriptCompiler.AddReferencedAssemblies(
|
||||
typeof(Type).Assembly.Location,
|
||||
@@ -57,22 +63,22 @@ namespace Torch.Patches
|
||||
typeof(TypeConverter).Assembly.Location,
|
||||
typeof(System.Diagnostics.TraceSource).Assembly.Location,
|
||||
typeof(System.Security.Policy.Evidence).Assembly.Location,
|
||||
Path.Combine(baseDir, "System.Xml.ReaderWriter.dll"),
|
||||
Path.Combine(MyFileSystem.ExePath, "ProtoBuf.Net.dll"),
|
||||
Path.Combine(MyFileSystem.ExePath, "ProtoBuf.Net.Core.dll"),
|
||||
Path.Combine(baseDir, "netstandard.dll"),
|
||||
Path.Combine(baseDir, "System.Runtime.dll"),
|
||||
Path.Combine(MyFileSystem.ExePath, "Sandbox.Game.dll"),
|
||||
Path.Combine(MyFileSystem.ExePath, "Sandbox.Common.dll"),
|
||||
Path.Combine(MyFileSystem.ExePath, "Sandbox.Graphics.dll"),
|
||||
Path.Combine(MyFileSystem.ExePath, "VRage.dll"),
|
||||
Path.Combine(MyFileSystem.ExePath, "VRage.Library.dll"),
|
||||
Path.Combine(MyFileSystem.ExePath, "VRage.Math.dll"),
|
||||
Path.Combine(MyFileSystem.ExePath, "VRage.Game.dll"),
|
||||
Path.Combine(MyFileSystem.ExePath, "VRage.Render.dll"),
|
||||
Path.Combine(MyFileSystem.ExePath, "VRage.Input.dll"),
|
||||
Path.Combine(MyFileSystem.ExePath, "SpaceEngineers.ObjectBuilders.dll"),
|
||||
Path.Combine(MyFileSystem.ExePath, "SpaceEngineers.Game.dll"));
|
||||
Path.Join(binDir, "System.Xml.ReaderWriter.dll"),
|
||||
Path.Join(MyFileSystem.ExePath, "ProtoBuf.Net.dll"),
|
||||
Path.Join(MyFileSystem.ExePath, "ProtoBuf.Net.Core.dll"),
|
||||
Path.Join(binDir, "netstandard.dll"),
|
||||
Path.Join(baseDir, "System.Runtime.dll"),
|
||||
Path.Join(MyFileSystem.ExePath, "Sandbox.Game.dll"),
|
||||
Path.Join(MyFileSystem.ExePath, "Sandbox.Common.dll"),
|
||||
Path.Join(MyFileSystem.ExePath, "Sandbox.Graphics.dll"),
|
||||
Path.Join(MyFileSystem.ExePath, "VRage.dll"),
|
||||
Path.Join(MyFileSystem.ExePath, "VRage.Library.dll"),
|
||||
Path.Join(MyFileSystem.ExePath, "VRage.Math.dll"),
|
||||
Path.Join(MyFileSystem.ExePath, "VRage.Game.dll"),
|
||||
Path.Join(MyFileSystem.ExePath, "VRage.Render.dll"),
|
||||
Path.Join(MyFileSystem.ExePath, "VRage.Input.dll"),
|
||||
Path.Join(MyFileSystem.ExePath, "SpaceEngineers.ObjectBuilders.dll"),
|
||||
Path.Join(MyFileSystem.ExePath, "SpaceEngineers.Game.dll"));
|
||||
}
|
||||
|
||||
private static bool InitializePrefix(Thread updateThread, Type[] referencedTypes, string[] symbols)
|
||||
|
@@ -21,6 +21,9 @@ internal static class AssemblyRewriter
|
||||
_zipResolver = new(_defaultResolver);
|
||||
_defaultResolver.AddSearchDirectory(Directory.GetCurrentDirectory());
|
||||
_defaultResolver.AddSearchDirectory(Path.Combine(Directory.GetCurrentDirectory(), "DedicatedServer64"));
|
||||
#if !DEBUG
|
||||
_defaultResolver.AddSearchDirectory(Path.Join(Directory.GetCurrentDirectory(), "torch64"));
|
||||
#endif
|
||||
}
|
||||
|
||||
public static Assembly ProcessWeavers(this Stream stream, ZipArchive archive)
|
||||
|
@@ -312,7 +312,7 @@ namespace Torch
|
||||
|
||||
private void Destroy()
|
||||
{
|
||||
_game.Dispose();
|
||||
_game?.Dispose();
|
||||
_game = null;
|
||||
|
||||
MyGameService.ShutDown();
|
||||
@@ -462,7 +462,8 @@ namespace Torch
|
||||
public void SignalDestroy()
|
||||
{
|
||||
_destroyGame = true;
|
||||
SignalStop();
|
||||
if (_game is not null)
|
||||
SignalStop();
|
||||
_commandChanged.Set();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user