projects cleanup
This commit is contained in:
@@ -14,7 +14,6 @@ public interface IInstanceManager : IManager
|
||||
|
||||
public interface IWorld
|
||||
{
|
||||
string FolderName { get; }
|
||||
string WorldPath { get; }
|
||||
MyObjectBuilder_SessionSettings KeenSessionSettings { get; }
|
||||
MyObjectBuilder_Checkpoint KeenCheckpoint { get; }
|
||||
|
@@ -12,94 +12,17 @@
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
<Platforms>AnyCPU</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="$(Configuration) == 'Release'">
|
||||
<NoWarn>1591</NoWarn>
|
||||
</PropertyGroup>
|
||||
<!-- <Import Project="$(SolutionDir)\TransformOnBuild.targets" /> -->
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NLog" Version="5.0.0-rc2" />
|
||||
<PackageReference Include="NLog" Version="5.0.4" />
|
||||
<PackageReference Include="SemanticVersioning" Version="2.0.2" />
|
||||
<PackageReference Include="System.Text.Json" Version="6.0.2" Condition="$(TargetFramework) == 'net48'" />
|
||||
<PackageReference Include="System.Net.Http" Version="4.3.4" Condition="$(TargetFramework) == 'net48'" />
|
||||
<PackageReference Include="System.Net.Http.Json" Version="6.0.0" Condition="$(TargetFramework) == 'net48'" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="HavokWrapper, Version=1.0.6278.22649, Culture=neutral, processorArchitecture=AMD64">
|
||||
<HintPath>..\GameBinaries\HavokWrapper.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Sandbox.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\GameBinaries\Sandbox.Common.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Sandbox.Game, Version=0.1.6305.30774, Culture=neutral, processorArchitecture=AMD64">
|
||||
<HintPath>..\GameBinaries\Sandbox.Game.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Sandbox.Graphics, Version=0.1.6305.30761, Culture=neutral, processorArchitecture=AMD64">
|
||||
<HintPath>..\GameBinaries\Sandbox.Graphics.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="SpaceEngineers.Game, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<HintPath>..\GameBinaries\SpaceEngineers.Game.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="SpaceEngineers.ObjectBuilders, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<HintPath>..\GameBinaries\SpaceEngineers.ObjectBuilders.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="VRage">
|
||||
<HintPath>..\GameBinaries\VRage.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Audio, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<HintPath>..\GameBinaries\VRage.Audio.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Dedicated">
|
||||
<HintPath>..\GameBinaries\VRage.Dedicated.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Game, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\GameBinaries\VRage.Game.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Input, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<HintPath>..\GameBinaries\VRage.Input.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Library">
|
||||
<HintPath>..\GameBinaries\VRage.Library.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Math, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\GameBinaries\VRage.Math.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Render, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\GameBinaries\VRage.Render.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Render11, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<HintPath>..\GameBinaries\VRage.Render11.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Scripting, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<HintPath>..\GameBinaries\VRage.Scripting.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<PackageReference Include="SpaceEngineersDedicated.ReferenceAssemblies" Version="1.201.13">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>compile</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
@@ -18,9 +18,9 @@
|
||||
</PropertyGroup>
|
||||
<!-- <Import Project="$(SolutionDir)\TransformOnBuild.targets" /> -->
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
|
||||
<PackageReference Include="NLog" Version="5.0.0-rc2" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
|
||||
<PackageReference Include="NLog" Version="5.0.4" />
|
||||
<PackageReference Include="xunit" Version="2.4.2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="VRage.Game, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
|
@@ -59,14 +59,14 @@ namespace Torch.Server
|
||||
if (!configuration.GetValue("noupdate", false))
|
||||
RunSteamCmd();
|
||||
|
||||
if (configuration.GetSection("waitForPid") is { } processPid)
|
||||
var processPid = configuration.GetValue<int>("waitForPid");
|
||||
if (processPid != 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
var pid = processPid.Get<int>();
|
||||
var waitProc = Process.GetProcessById(pid);
|
||||
var waitProc = Process.GetProcessById(processPid);
|
||||
Log.Info("Continuing in 5 seconds.");
|
||||
Log.Warn($"Waiting for process {pid} to close");
|
||||
Log.Warn($"Waiting for process {processPid} to close");
|
||||
while (!waitProc.HasExited)
|
||||
{
|
||||
Console.Write(".");
|
||||
|
@@ -236,9 +236,9 @@ namespace Torch.Server.Managers
|
||||
{
|
||||
var world = DedicatedConfig.SelectedWorld;
|
||||
|
||||
world.Checkpoint.SessionName = string.IsNullOrEmpty(DedicatedConfig.WorldName)
|
||||
world.Checkpoint.SessionName = string.IsNullOrEmpty(world.Checkpoint.SessionName)
|
||||
? Path.GetDirectoryName(DedicatedConfig.LoadWorld)
|
||||
: DedicatedConfig.WorldName;
|
||||
: world.Checkpoint.SessionName;
|
||||
world.WorldConfiguration.Settings = DedicatedConfig.SessionSettings;
|
||||
world.WorldConfiguration.Mods.Clear();
|
||||
|
||||
@@ -284,7 +284,6 @@ namespace Torch.Server.Managers
|
||||
{
|
||||
private static readonly Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
public string FolderName { get; set; }
|
||||
public string WorldPath { get; }
|
||||
public MyObjectBuilder_SessionSettings KeenSessionSettings => WorldConfiguration.Settings;
|
||||
public MyObjectBuilder_Checkpoint KeenCheckpoint => Checkpoint;
|
||||
@@ -313,7 +312,6 @@ namespace Torch.Server.Managers
|
||||
WorldSizeKB = new DirectoryInfo(worldPath).GetFiles().Sum(x => x.Length) / 1024;
|
||||
_checkpointPath = Path.Combine(WorldPath, "Sandbox.sbc");
|
||||
_worldConfigPath = Path.Combine(WorldPath, "Sandbox_config.sbc");
|
||||
FolderName = Path.GetFileName(worldPath);
|
||||
if (loadFiles)
|
||||
LoadSandbox();
|
||||
}
|
||||
|
@@ -12,7 +12,6 @@ using Sandbox.Engine.Multiplayer;
|
||||
using Sandbox.Engine.Networking;
|
||||
using Sandbox.Game.Gui;
|
||||
using Sandbox.Game.World;
|
||||
using Steamworks;
|
||||
using Torch.API;
|
||||
using Torch.API.Managers;
|
||||
using Torch.Managers;
|
||||
|
@@ -3,6 +3,7 @@ using NLog;
|
||||
using Sandbox.Engine.Networking;
|
||||
using Torch.API.Managers;
|
||||
using Torch.Managers.PatchManager;
|
||||
using Torch.Server;
|
||||
using Torch.Server.Managers;
|
||||
using Torch.Utils;
|
||||
using VRage.Game;
|
||||
@@ -25,6 +26,9 @@ public static class CheckpointLoadPatch
|
||||
private static bool Prefix(ref MyObjectBuilder_Checkpoint __result)
|
||||
{
|
||||
#pragma warning disable CS0618
|
||||
if (!((TorchServer)TorchBase.Instance).HasRun)
|
||||
return true;
|
||||
|
||||
var world = TorchBase.Instance.Managers.GetManager<InstanceManager>().DedicatedConfig.SelectedWorld;
|
||||
#pragma warning restore CS0618
|
||||
if (world is null)
|
||||
|
@@ -22,8 +22,8 @@ namespace Torch.Server
|
||||
|
||||
var context = CreateApplicationContext(configuration);
|
||||
|
||||
SetupLogging(context);
|
||||
var config = SetupConfiguration(context, configurationBuilder);
|
||||
SetupLogging(context, configuration);
|
||||
var config = SetupConfiguration(context, configurationBuilder, out configuration);
|
||||
|
||||
var handler = new UnhandledExceptionHandler(config.Data);
|
||||
AppDomain.CurrentDomain.UnhandledException += handler.OnUnhandledException;
|
||||
@@ -42,24 +42,28 @@ namespace Torch.Server
|
||||
initializer.Run();
|
||||
}
|
||||
|
||||
private static void SetupLogging(IApplicationContext context)
|
||||
private static void SetupLogging(IApplicationContext context, IConfiguration configuration)
|
||||
{
|
||||
var oldNlog = Path.Combine(context.TorchDirectory.FullName, "NLog.config");
|
||||
var newNlog = Path.Combine(context.InstanceDirectory.FullName, "NLog.config");
|
||||
var newNlog = configuration.GetValue("loggingConfigPath", Path.Combine(context.InstanceDirectory.FullName, "NLog.config"));
|
||||
if (File.Exists(oldNlog) && !File.ReadAllText(oldNlog).Contains("FlowDocument"))
|
||||
File.Move(oldNlog, newNlog);
|
||||
else if (!File.Exists(newNlog))
|
||||
using (var f = File.Create(newNlog))
|
||||
using (var f = File.Create(newNlog!))
|
||||
typeof(Program).Assembly.GetManifestResourceStream("Torch.Server.NLog.config")!.CopyTo(f);
|
||||
|
||||
Target.Register<LogViewerTarget>(nameof(LogViewerTarget));
|
||||
TorchLogManager.RegisterTargets(Environment.GetEnvironmentVariable("TORCH_LOG_EXTENSIONS_PATH") ??
|
||||
Path.Combine(context.InstanceDirectory.FullName, "LoggingExtensions"));
|
||||
TorchLogManager.RegisterTargets(configuration.GetValue("loggingExtensionsPath",
|
||||
Path.Combine(
|
||||
context.InstanceDirectory.FullName,
|
||||
"LoggingExtensions")));
|
||||
|
||||
TorchLogManager.SetConfiguration(new XmlLoggingConfiguration(newNlog));
|
||||
}
|
||||
|
||||
private static Persistent<TorchConfig> SetupConfiguration(IApplicationContext context, IConfigurationBuilder builder)
|
||||
private static Persistent<TorchConfig> SetupConfiguration(IApplicationContext context,
|
||||
IConfigurationBuilder builder,
|
||||
out IConfigurationRoot configuration)
|
||||
{
|
||||
var oldTorchCfg = Path.Combine(context.TorchDirectory.FullName, "Torch.cfg");
|
||||
var torchCfg = Path.Combine(context.InstanceDirectory.FullName, "Torch.cfg");
|
||||
@@ -67,17 +71,11 @@ namespace Torch.Server
|
||||
if (File.Exists(oldTorchCfg))
|
||||
File.Move(oldTorchCfg, torchCfg);
|
||||
|
||||
var configurationSource = new XmlConfigurationSource
|
||||
{
|
||||
Path = torchCfg
|
||||
};
|
||||
builder.AddXmlFile(torchCfg, true, true);
|
||||
|
||||
configurationSource.ResolveFileProvider();
|
||||
builder.Sources.Insert(0, configurationSource);
|
||||
configuration = builder.Build();
|
||||
|
||||
var configuration = builder.Build();
|
||||
|
||||
var config = new Persistent<TorchConfig>(torchCfg, configuration.Get<TorchConfig>());
|
||||
var config = new Persistent<TorchConfig>(torchCfg, configuration.Get<TorchConfig>() ?? new());
|
||||
config.Data.InstanceName = context.InstanceName;
|
||||
config.Data.InstancePath = context.InstanceDirectory.FullName;
|
||||
|
||||
|
@@ -3,7 +3,7 @@
|
||||
"profiles": {
|
||||
"Torch.Server": {
|
||||
"commandName": "Project",
|
||||
"commandLineArgs": "-noupdate",
|
||||
"commandLineArgs": "--noupdate true --gamepath \"C:\\Program Files (x86)\\Steam\\steamapps\\common\\SpaceEngineersDedicatedServer\"",
|
||||
"use64Bit": true,
|
||||
"hotReloadEnabled": false
|
||||
}
|
||||
|
@@ -3,7 +3,6 @@
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6-windows</TargetFramework>
|
||||
<LangVersion>10</LangVersion>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
@@ -14,150 +13,61 @@
|
||||
<OutputPath>..\bin\$(Platform)\$(Configuration)\</OutputPath>
|
||||
<UseWPF>true</UseWPF>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
<Platforms>AnyCPU</Platforms>
|
||||
<IsPackable>false</IsPackable>
|
||||
<NeutralLanguage>en</NeutralLanguage>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<BeautyLibsDir>torch64</BeautyLibsDir>
|
||||
<NoBeautyFlag>True</NoBeautyFlag>
|
||||
<ForceBeauty>True</ForceBeauty>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<StartupObject>Torch.Server.Program</StartupObject>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>torchicon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<!-- <Import Project="$(SolutionDir)\TransformOnBuild.targets" /> -->
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AutoCompleteTextBox" Version="1.5.0" />
|
||||
<PackageReference Include="AutoCompleteTextBox" Version="1.6.0" />
|
||||
<PackageReference Include="Ben.Demystifier" Version="0.4.1" />
|
||||
<PackageReference Include="ControlzEx" Version="5.0.1" />
|
||||
<PackageReference Include="MahApps.Metro" Version="2.4.9" />
|
||||
<PackageReference Include="MdXaml" Version="1.13.0" />
|
||||
<PackageReference Include="Microsoft.Diagnostics.Runtime" Version="2.0.226801" />
|
||||
<PackageReference Include="MdXaml" Version="1.16.0" />
|
||||
<PackageReference Include="Microsoft.Diagnostics.Runtime" Version="2.2.332302" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Xml" Version="6.0.0" />
|
||||
<PackageReference Include="NLog" Version="5.0.0-rc2" />
|
||||
<PackageReference Include="PropertyChanged.Fody" Version="4.0.0" PrivateAssets="all" />
|
||||
<PackageReference Include="NLog" Version="5.0.4" />
|
||||
<PackageReference Include="PropertyChanged.Fody" Version="4.0.3" PrivateAssets="all" />
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||
<PackageReference Include="System.Management" Version="6.0.0" />
|
||||
<PackageReference Include="nulastudio.NetCoreBeauty" Version="1.2.9.3" />
|
||||
<PackageReference Include="SpaceEngineersDedicated.ReferenceAssemblies" Version="1.201.13">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>compile</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="HavokWrapper, Version=1.0.6051.28726, Culture=neutral, processorArchitecture=AMD64">
|
||||
<HintPath>..\GameBinaries\HavokWrapper.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CodeAnalysis, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\GameBinaries\Microsoft.CodeAnalysis.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CodeAnalysis.CSharp, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\GameBinaries\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Sandbox.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\GameBinaries\Sandbox.Common.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Sandbox.Game, Version=0.1.6305.30774, Culture=neutral, processorArchitecture=AMD64">
|
||||
<HintPath>..\GameBinaries\Sandbox.Game.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Sandbox.Graphics, Version=0.1.6305.30761, Culture=neutral, processorArchitecture=AMD64">
|
||||
<HintPath>..\GameBinaries\Sandbox.Graphics.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="SpaceEngineers.Game, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<HintPath>..\GameBinaries\SpaceEngineers.Game.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Steamworks.NET">
|
||||
<HintPath>..\GameBinaries\Steamworks.NET.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="VRage, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\GameBinaries\VRage.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Audio, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<HintPath>..\GameBinaries\VRage.Audio.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Dedicated, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<HintPath>..\GameBinaries\VRage.Dedicated.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Game, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\GameBinaries\VRage.Game.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Input, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<HintPath>..\GameBinaries\VRage.Input.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Library, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\GameBinaries\VRage.Library.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Math, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\GameBinaries\VRage.Math.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Platform.Windows, Culture=neutral, PublicKeyToken=null">
|
||||
<HintPath>..\GameBinaries\VRage.Platform.Windows.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Render, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\GameBinaries\VRage.Render.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Render11, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<HintPath>..\GameBinaries\VRage.Render11.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Scripting, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<HintPath>..\GameBinaries\VRage.Scripting.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Steam">
|
||||
<HintPath>..\GameBinaries\VRage.Steam.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="ServerManager.cs" />
|
||||
<Compile Remove="ViewModels\SessionSettingsViewModel1.cs" />
|
||||
<Compile Remove="Views\WorldSelectControl.xaml.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Torch.API\Torch.API.csproj" />
|
||||
<ProjectReference Include="..\Torch\Torch.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="torchicon.ico" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Page Remove="Views\WorldSelectControl.xaml" />
|
||||
<EmbeddedResource Include="..\NLog.config" Visible="false" />
|
||||
|
@@ -210,10 +210,9 @@ namespace Torch.Server
|
||||
|
||||
string exe = Assembly.GetExecutingAssembly().Location.Replace("dll", "exe");
|
||||
|
||||
config.WaitForPID = Environment.ProcessId.ToString();
|
||||
config.TempAutostart = true;
|
||||
|
||||
Process.Start(exe, config.ToString());
|
||||
Process.Start(exe, $"-waitForPid {Environment.ProcessId} {config}");
|
||||
|
||||
Environment.Exit(0);
|
||||
})
|
||||
|
@@ -33,9 +33,7 @@ internal class UnhandledExceptionHandler
|
||||
Thread.Sleep(5000);
|
||||
var exe = typeof(Program).Assembly.Location;
|
||||
|
||||
_config.WaitForPID = Environment.ProcessId.ToString();
|
||||
|
||||
Process.Start(exe, _config.ToString());
|
||||
Process.Start(exe, $"-waitForPid {Environment.ProcessId} {_config}");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -1,23 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Steamworks;
|
||||
|
||||
namespace Torch.Server.ViewModels
|
||||
{
|
||||
public class SteamUserViewModel : ViewModel
|
||||
{
|
||||
public string Name { get; }
|
||||
public ulong SteamId { get; }
|
||||
|
||||
public SteamUserViewModel(ulong id)
|
||||
{
|
||||
SteamId = id;
|
||||
Name = SteamFriends.GetFriendPersonaName(new CSteamID(id));
|
||||
}
|
||||
|
||||
public SteamUserViewModel() : this(0) { }
|
||||
}
|
||||
}
|
@@ -18,9 +18,9 @@
|
||||
</PropertyGroup>
|
||||
<!-- <Import Project="$(SolutionDir)\TransformOnBuild.targets" /> -->
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
|
||||
<PackageReference Include="NLog" Version="5.0.0-rc2" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
|
||||
<PackageReference Include="NLog" Version="5.0.4" />
|
||||
<PackageReference Include="xunit" Version="2.4.2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
|
@@ -11,7 +11,6 @@ using System.Timers;
|
||||
using NLog;
|
||||
using Sandbox.Game.Multiplayer;
|
||||
using Sandbox.ModAPI;
|
||||
using Steamworks;
|
||||
using Torch;
|
||||
using Torch.API;
|
||||
using Torch.API.Managers;
|
||||
|
@@ -20,6 +20,7 @@ namespace Torch
|
||||
public sealed class Persistent<T> : IDisposable where T : new()
|
||||
{
|
||||
private static readonly XmlSerializer Serializer = new(typeof(T));
|
||||
private static readonly XmlSerializerNamespaces Namespaces = new(new[] {new XmlQualifiedName("", "")});
|
||||
private static Logger _log = LogManager.GetCurrentClassLogger();
|
||||
public string Path { get; set; }
|
||||
private T _data;
|
||||
@@ -69,9 +70,10 @@ namespace Torch
|
||||
using var f = File.Create(path);
|
||||
using var writer = new XmlTextWriter(f, Encoding.UTF8)
|
||||
{
|
||||
Formatting = Formatting.Indented
|
||||
Formatting = Formatting.Indented,
|
||||
Namespaces = false
|
||||
};
|
||||
Serializer.Serialize(writer, Data);
|
||||
Serializer.Serialize(writer, Data, Namespaces);
|
||||
}
|
||||
|
||||
public static Persistent<T> Load(string path, bool saveIfNew = true)
|
||||
|
@@ -113,7 +113,7 @@ namespace Torch.Session
|
||||
_currentSession.Detach();
|
||||
}
|
||||
|
||||
_log.Info($"Starting new torch session for {_instanceManager.SelectedWorld.FolderName}");
|
||||
_log.Info($"Starting new torch session for {_instanceManager.SelectedWorld.KeenCheckpoint.SessionName}");
|
||||
|
||||
_currentSession = new TorchSession(Torch, MySession.Static, _instanceManager.SelectedWorld);
|
||||
SetState(TorchSessionState.Loading);
|
||||
@@ -139,7 +139,7 @@ namespace Torch.Session
|
||||
CurrentSession.Managers.AddManager(manager);
|
||||
}
|
||||
(CurrentSession as TorchSession)?.Attach();
|
||||
_log.Info($"Loaded torch session for {CurrentSession.World.FolderName}");
|
||||
_log.Info($"Loaded torch session for {CurrentSession.World.KeenCheckpoint.SessionName}");
|
||||
SetState(TorchSessionState.Loaded);
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -156,7 +156,7 @@ namespace Torch.Session
|
||||
if (_currentSession is null)
|
||||
throw new InvalidOperationException("Session loaded event occurred when we don't have a session.");
|
||||
|
||||
_log.Info($"Unloading torch session for {_currentSession.World.FolderName}");
|
||||
_log.Info($"Unloading torch session for {_currentSession.World.KeenCheckpoint.SessionName}");
|
||||
SetState(TorchSessionState.Unloading);
|
||||
_currentSession.Detach();
|
||||
}
|
||||
@@ -174,7 +174,7 @@ namespace Torch.Session
|
||||
if (_currentSession is null)
|
||||
throw new InvalidOperationException("Session loaded event occurred when we don't have a session.");
|
||||
|
||||
_log.Info($"Unloaded torch session for {_currentSession.World.FolderName}");
|
||||
_log.Info($"Unloaded torch session for {_currentSession.World.KeenCheckpoint.SessionName}");
|
||||
SetState(TorchSessionState.Unloaded);
|
||||
_currentSession = null;
|
||||
}
|
||||
|
@@ -13,117 +13,34 @@
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
<Platforms>AnyCPU</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="$(Configuration) == 'Release'">
|
||||
<NoWarn>1591</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="..\Torch.Mod\Torch.Mod.projitems" Label="Shared" />
|
||||
<!-- <Import Project="$(SolutionDir)\TransformOnBuild.targets" /> -->
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ControlzEx" Version="5.0.1" />
|
||||
<PackageReference Include="HarmonyX" Version="2.10.0" />
|
||||
<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.3.1" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.1" />
|
||||
<PackageReference Include="MonoMod.RuntimeDetour" Version="22.5.1.1" />
|
||||
<PackageReference Include="NLog" Version="5.0.0-rc2" />
|
||||
<PackageReference Include="PropertyChanged.Fody" Version="4.0.0" PrivateAssets="all" />
|
||||
<PackageReference Include="NLog" Version="5.0.4" />
|
||||
<PackageReference Include="PropertyChanged.Fody" Version="4.0.3" PrivateAssets="all" />
|
||||
<PackageReference Include="protobuf-net" Version="2.4.7" />
|
||||
<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.201.13">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>compile</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="HavokWrapper, Version=1.0.6278.22649, Culture=neutral, processorArchitecture=AMD64">
|
||||
<HintPath>..\GameBinaries\HavokWrapper.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CodeAnalysis, Version=2.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
|
||||
<HintPath>..\GameBinaries\Microsoft.CodeAnalysis.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ProtoBuf.Net, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||
<HintPath>..\GameBinaries\ProtoBuf.Net.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ProtoBuf.Net.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||
<HintPath>..\GameBinaries\ProtoBuf.Net.Core.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Sandbox.Common">
|
||||
<HintPath>..\GameBinaries\Sandbox.Common.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Sandbox.Game">
|
||||
<HintPath>..\GameBinaries\Sandbox.Game.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Sandbox.Graphics">
|
||||
<HintPath>..\GameBinaries\Sandbox.Graphics.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="SpaceEngineers.Game">
|
||||
<HintPath>..\GameBinaries\SpaceEngineers.Game.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Steamworks.NET">
|
||||
<HintPath>..\GameBinaries\Steamworks.NET.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="VRage">
|
||||
<HintPath>..\GameBinaries\VRage.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Audio">
|
||||
<HintPath>..\GameBinaries\VRage.Audio.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Dedicated">
|
||||
<HintPath>..\GameBinaries\VRage.Dedicated.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="VRage.EOS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||
<HintPath>..\GameBinaries\VRage.EOS.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Game">
|
||||
<HintPath>..\GameBinaries\VRage.Game.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Input">
|
||||
<HintPath>..\GameBinaries\VRage.Input.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Library">
|
||||
<HintPath>..\GameBinaries\VRage.Library.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Math">
|
||||
<HintPath>..\GameBinaries\VRage.Math.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Mod.Io, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||
<HintPath>..\GameBinaries\VRage.Mod.Io.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Platform.Windows, Culture=neutral, PublicKeyToken=null">
|
||||
<HintPath>..\GameBinaries\VRage.Platform.Windows.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Render">
|
||||
<HintPath>..\GameBinaries\VRage.Render.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Render11">
|
||||
<HintPath>..\GameBinaries\VRage.Render11.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Scripting">
|
||||
<HintPath>..\GameBinaries\VRage.Scripting.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Steam">
|
||||
<HintPath>..\GameBinaries\VRage.Steam.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Torch.API\Torch.API.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@@ -251,6 +251,7 @@ namespace Torch
|
||||
{
|
||||
Debug.Assert(!_init, "Torch instance is already initialized.");
|
||||
ObjectFactoryInitPatch.ForceRegisterAssemblies();
|
||||
VRageGame.SetupVersionInfo();
|
||||
|
||||
Debug.Assert(MyPerGameSettings.BasicGameInfo.GameVersion != null, "MyPerGameSettings.BasicGameInfo.GameVersion != null");
|
||||
GameVersion = new MyVersion(MyPerGameSettings.BasicGameInfo.GameVersion.Value);
|
||||
|
@@ -6,7 +6,6 @@ using System.Threading;
|
||||
using Sandbox.Engine.Multiplayer;
|
||||
using Sandbox.Game.Entities;
|
||||
using Sandbox.Game.World;
|
||||
using Steamworks;
|
||||
|
||||
namespace Torch.Utils
|
||||
{
|
||||
@@ -54,12 +53,6 @@ namespace Torch.Utils
|
||||
return result;
|
||||
}
|
||||
|
||||
public static IPAddress GetRemoteIP(this P2PSessionState_t state)
|
||||
{
|
||||
// What is endianness anyway?
|
||||
return new IPAddress(BitConverter.GetBytes(state.m_nRemoteIP).Reverse().ToArray());
|
||||
}
|
||||
|
||||
public static string GetGridOwnerName(this MyCubeGrid grid)
|
||||
{
|
||||
if (grid.BigOwners.Count == 0 || grid.BigOwners[0] == 0)
|
||||
|
@@ -6,14 +6,13 @@ using System.Reflection;
|
||||
using NLog;
|
||||
using Torch.Event;
|
||||
using Torch.Managers.PatchManager;
|
||||
using VRage.Collections;
|
||||
|
||||
namespace Torch.Utils
|
||||
{
|
||||
public static class TorchLauncher
|
||||
{
|
||||
private static readonly ILogger Log = LogManager.GetCurrentClassLogger();
|
||||
private static readonly MyConcurrentHashSet<Assembly> RegisteredAssemblies = new();
|
||||
private static readonly HashSet<Assembly> RegisteredAssemblies = new();
|
||||
private static readonly Dictionary<string, string> Assemblies = new();
|
||||
|
||||
public static void Launch(params string[] binaryPaths)
|
||||
@@ -94,7 +93,7 @@ namespace Torch.Utils
|
||||
private static Assembly CurrentDomainOnAssemblyResolve(object sender, ResolveEventArgs args)
|
||||
{
|
||||
var name = args.Name;
|
||||
return Assemblies.TryGetValue(name.IndexOf(',') > 0 ? name[..','] : name, out var path) ? Assembly.LoadFrom(path) : null;
|
||||
return Assemblies.TryGetValue(name.IndexOf(',') > 0 ? name[..name.IndexOf(',')] : name, out var path) ? Assembly.LoadFrom(path) : null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -22,7 +22,6 @@ using Sandbox.Game.World;
|
||||
using Sandbox.Graphics.GUI;
|
||||
using SpaceEngineers.Game;
|
||||
using SpaceEngineers.Game.GUI;
|
||||
using Steamworks;
|
||||
using Torch.API;
|
||||
using Torch.Utils;
|
||||
using VRage;
|
||||
@@ -140,15 +139,19 @@ namespace Torch
|
||||
}
|
||||
}
|
||||
|
||||
internal static void SetupVersionInfo()
|
||||
{
|
||||
Game.IsDedicated = true;
|
||||
SpaceEngineersGame.SetupBasicGameInfo();
|
||||
MyFinalBuildConstants.APP_VERSION = MyPerGameSettings.BasicGameInfo.GameVersion;
|
||||
}
|
||||
|
||||
private void Create()
|
||||
{
|
||||
bool dedicated = true;
|
||||
Game.IsDedicated = true;
|
||||
var dedicated = Game.IsDedicated;
|
||||
Environment.SetEnvironmentVariable("SteamAppId", _appSteamId.ToString());
|
||||
MyVRageWindows.Init("SpaceEngineersDedicated", MySandboxGame.Log, null, false);
|
||||
SpaceEngineersGame.SetupBasicGameInfo();
|
||||
SpaceEngineersGame.SetupPerGameSettings();
|
||||
MyFinalBuildConstants.APP_VERSION = MyPerGameSettings.BasicGameInfo.GameVersion;
|
||||
MySessionComponentExtDebug.ForceDisable = true;
|
||||
MyPerGameSettings.SendLogToKeen = false;
|
||||
// SpaceEngineersGame.SetupAnalytics();
|
||||
|
Reference in New Issue
Block a user