Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
bbdd1c7e01 | |||
e70e1ca4e6 | |||
![]() |
d65c20a05d | ||
f21976cf2d | |||
0c918106bc | |||
6c9ec57d87 | |||
![]() |
b0f491ac88 | ||
![]() |
a426ad9e02 | ||
![]() |
ba75b1583a |
@@ -21,7 +21,7 @@
|
||||
<PackageReference Include="NuGet.Commands" Version="6.4.0" />
|
||||
<PackageReference Include="NuGet.DependencyResolver.Core" Version="6.4.0" />
|
||||
<PackageReference Include="SemanticVersioning" Version="2.0.2" />
|
||||
<PackageReference Include="SpaceEngineersDedicated.ReferenceAssemblies" Version="1.202.66">
|
||||
<PackageReference Include="SpaceEngineersDedicated.ReferenceAssemblies" Version="1.202.120">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>compile</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
@@ -43,9 +43,9 @@
|
||||
},
|
||||
"SpaceEngineersDedicated.ReferenceAssemblies": {
|
||||
"type": "Direct",
|
||||
"requested": "[1.202.66, )",
|
||||
"resolved": "1.202.66",
|
||||
"contentHash": "VTOwwfTPnov6WWJNrsmB9lWs5s+6XVUXtV8SgLvgJTswK11MTA0e+TZFfZJoSZ1WUsE2dvxlMrNOYJ6aL6j0wA==",
|
||||
"requested": "[1.202.120, )",
|
||||
"resolved": "1.202.120",
|
||||
"contentHash": "HTP48NOSZY3eQPX3GJN+gjxdW83SM7DX6NcKCFqNIIvjz/J+l8uimHAQp9dnLySb0wb1K1Z1xBPIXyxMQRREIw==",
|
||||
"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.66" />
|
||||
<dependency id="SpaceEngineersDedicated.ReferenceAssemblies" version="1.202.120" />
|
||||
<dependency id="Torch.Server" version="torchVersion" />
|
||||
</group>
|
||||
</dependencies>
|
||||
|
@@ -30,7 +30,8 @@ namespace Torch.Server
|
||||
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 298741 -dir \"{0}\"";
|
||||
private const string TOOL_ARGS = "-app 298740 -depot {1} -dir \"{0}\" -manifest {2}";
|
||||
private static readonly int[] Depots = { 298741, 1004 };
|
||||
private TorchServer _server;
|
||||
|
||||
internal Persistent<TorchConfig> ConfigPersistent { get; }
|
||||
@@ -122,6 +123,8 @@ namespace Torch.Server
|
||||
Config.TempAutostart = false;
|
||||
_server.Start();
|
||||
}
|
||||
|
||||
uiThread.Join();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,18 +163,26 @@ namespace Torch.Server
|
||||
}
|
||||
|
||||
log.Info("Checking for DS updates.");
|
||||
var steamCmdProc = new ProcessStartInfo(steamCmdExePath)
|
||||
foreach (var depot in Depots)
|
||||
{
|
||||
Arguments = string.Format(TOOL_ARGS, configuration.GetValue("gamePath", "../")),
|
||||
WorkingDirectory = path,
|
||||
RedirectStandardOutput = true
|
||||
};
|
||||
var cmd = Process.Start(steamCmdProc)!;
|
||||
await DownloadDepot(depot);
|
||||
}
|
||||
|
||||
async Task DownloadDepot(int depotId)
|
||||
{
|
||||
var steamCmdProc = new ProcessStartInfo(steamCmdExePath)
|
||||
{
|
||||
Arguments = string.Format(TOOL_ARGS, configuration.GetValue("gamePath", "../"), depotId, "3111493184861426002"),
|
||||
WorkingDirectory = path,
|
||||
RedirectStandardOutput = true
|
||||
};
|
||||
var cmd = Process.Start(steamCmdProc)!;
|
||||
|
||||
while (!cmd.HasExited)
|
||||
{
|
||||
if (await cmd.StandardOutput.ReadLineAsync() is { } line)
|
||||
log.Info(line);
|
||||
while (!cmd.HasExited)
|
||||
{
|
||||
if (await cmd.StandardOutput.ReadLineAsync() is { } line)
|
||||
log.Info(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ namespace Torch.Server.Managers
|
||||
{
|
||||
if (newstate == TorchGameState.Loading && MySandboxGame.ConfigDedicated.RemoteApiEnabled && !string.IsNullOrEmpty(MySandboxGame.ConfigDedicated.RemoteSecurityKey))
|
||||
{
|
||||
var myRemoteServer = new MyRemoteServer(MySandboxGame.ConfigDedicated.RemoteApiPort, MySandboxGame.ConfigDedicated.RemoteSecurityKey);
|
||||
var myRemoteServer = new MyRemoteServer(MySandboxGame.ConfigDedicated.RemoteApiIP, MySandboxGame.ConfigDedicated.RemoteApiPort, MySandboxGame.ConfigDedicated.RemoteSecurityKey);
|
||||
LogManager.GetCurrentClassLogger().Info($"Remote API started on port {myRemoteServer.Port}");
|
||||
}
|
||||
}
|
||||
|
@@ -51,7 +51,7 @@
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||
<PackageReference Include="System.Management" Version="7.0.0" />
|
||||
<PackageReference Include="nulastudio.NetCoreBeauty" Version="1.2.9.3" />
|
||||
<PackageReference Include="SpaceEngineersDedicated.ReferenceAssemblies" Version="1.202.66">
|
||||
<PackageReference Include="SpaceEngineersDedicated.ReferenceAssemblies" Version="1.202.120">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>compile</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
@@ -56,9 +56,7 @@ namespace Torch.Server
|
||||
AddManager(new EntityControlManager(this));
|
||||
AddManager(new RemoteAPIManager(this));
|
||||
|
||||
var sessionManager = Managers.GetManager<ITorchSessionManager>();
|
||||
sessionManager.AddFactory(x => new MultiplayerManagerDedicated(this));
|
||||
sessionManager.SessionStateChanged += OnSessionStateChanged;
|
||||
|
||||
|
||||
// Needs to be done at some point after MyVRageWindows.Init
|
||||
// where the debug listeners are registered
|
||||
@@ -128,6 +126,10 @@ namespace Torch.Server
|
||||
{
|
||||
Log.Info("Initializing server");
|
||||
base.Init();
|
||||
var sessionManager = Managers.GetManager<ITorchSessionManager>();
|
||||
sessionManager.AddFactory(x => new MultiplayerManagerDedicated(this));
|
||||
sessionManager.SessionStateChanged += OnSessionStateChanged;
|
||||
|
||||
GetManager<InstanceManager>().LoadInstance(InstancePath);
|
||||
CanRun = true;
|
||||
Initialized?.Invoke(this);
|
||||
|
@@ -122,9 +122,9 @@
|
||||
},
|
||||
"SpaceEngineersDedicated.ReferenceAssemblies": {
|
||||
"type": "Direct",
|
||||
"requested": "[1.202.66, )",
|
||||
"resolved": "1.202.66",
|
||||
"contentHash": "VTOwwfTPnov6WWJNrsmB9lWs5s+6XVUXtV8SgLvgJTswK11MTA0e+TZFfZJoSZ1WUsE2dvxlMrNOYJ6aL6j0wA==",
|
||||
"requested": "[1.202.120, )",
|
||||
"resolved": "1.202.120",
|
||||
"contentHash": "HTP48NOSZY3eQPX3GJN+gjxdW83SM7DX6NcKCFqNIIvjz/J+l8uimHAQp9dnLySb0wb1K1Z1xBPIXyxMQRREIw==",
|
||||
"dependencies": {
|
||||
"protobuf-net": "1.0.0"
|
||||
}
|
||||
|
@@ -10,6 +10,7 @@ using Torch.Managers.PatchManager;
|
||||
using Torch.Managers.PatchManager.MSIL;
|
||||
using Torch.Utils;
|
||||
using VRage.Game;
|
||||
using VRage.GameServices;
|
||||
|
||||
namespace Torch.Patches
|
||||
{
|
||||
@@ -31,7 +32,7 @@ namespace Torch.Patches
|
||||
}
|
||||
public static void Postfix(MyWorkshop.ResultData __result, List<MyObjectBuilder_Checkpoint.ModItem> mods)
|
||||
{
|
||||
if (__result.Success) return;
|
||||
if (__result.Result is MyGameServiceCallResult.OK) return;
|
||||
_log.Warn("Missing Mods:");
|
||||
var mismatchMods = mods.Where(b => __result.Mods.All(c => b.PublishedFileId != c.Id));
|
||||
foreach (var mod in mismatchMods)
|
||||
|
@@ -35,7 +35,7 @@
|
||||
<PackageReference Include="protobuf-net" Version="3.1.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.66">
|
||||
<PackageReference Include="SpaceEngineersDedicated.ReferenceAssemblies" Version="1.202.120">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>compile</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
@@ -113,12 +113,6 @@ namespace Torch
|
||||
Plugins = new PluginManager(this);
|
||||
#pragma warning restore CS0618
|
||||
|
||||
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.AddManager(new PatchManager(this));
|
||||
Managers.AddManager(new FilesystemManager(this));
|
||||
Managers.AddManager(new UpdateManager(this));
|
||||
@@ -286,6 +280,15 @@ namespace Torch
|
||||
Game = new VRageGame(this, TweakGameSettings, SteamAppName, SteamAppId, InstancePath, RunArgs);
|
||||
if (!Game.WaitFor(VRageGame.GameState.Stopped))
|
||||
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();
|
||||
_init = true;
|
||||
|
||||
|
@@ -47,7 +47,7 @@ namespace Torch.Utils
|
||||
|
||||
private static void CopyNative()
|
||||
{
|
||||
if (ApplicationContext.Current.GameFilesDirectory.Attributes.HasFlag(FileAttributes.ReadOnly))
|
||||
if (ApplicationContext.Current.IsService || ApplicationContext.Current.GameFilesDirectory.Attributes.HasFlag(FileAttributes.ReadOnly))
|
||||
{
|
||||
Log.Warn("Torch directory is readonly. You should copy steam_api64.dll, Havok.dll from bin manually");
|
||||
return;
|
||||
|
@@ -165,7 +165,7 @@ namespace Torch
|
||||
_tweakGameSettings();
|
||||
|
||||
MyFileSystem.Reset();
|
||||
MyInitializer.InvokeBeforeRun(_appSteamId, _appName, _userDataPath);
|
||||
MyInitializer.InvokeBeforeRun(_appSteamId, _appName, MyVRage.Platform.System.GetRootPath(), _userDataPath);
|
||||
|
||||
_log.Info("Loading Dedicated Config");
|
||||
// object created in SpaceEngineersGame.SetupPerGameSettings()
|
||||
@@ -193,7 +193,7 @@ namespace Torch
|
||||
{
|
||||
service = MyEOSService.Create();
|
||||
|
||||
MyEOSService.InitNetworking(dedicated,
|
||||
MyEOSService.InitNetworking(dedicated, true, //true because using Eos
|
||||
"Space Engineers",
|
||||
service,
|
||||
"xyza7891A4WeGrpP85BTlBa3BSfUEABN",
|
||||
@@ -225,7 +225,8 @@ namespace Torch
|
||||
|
||||
MyGameService.WorkshopService.AddAggregate(MyModIoService.Create(service, "spaceengineers", "264",
|
||||
"1fb4489996a5e8ffc6ec1135f9985b5b", "331", "f2b64abe55452252b030c48adc0c1f0e",
|
||||
MyPlatformGameSettings.UGC_TEST_ENVIRONMENT, true));
|
||||
MyPlatformGameSettings.UGC_TEST_ENVIRONMENT, true, MyPlatformGameSettings.MODIO_PLATFORM,
|
||||
MyPlatformGameSettings.MODIO_PORTAL));
|
||||
|
||||
if (!isEos && !MyGameService.HasGameServer)
|
||||
{
|
||||
|
@@ -102,9 +102,9 @@
|
||||
},
|
||||
"SpaceEngineersDedicated.ReferenceAssemblies": {
|
||||
"type": "Direct",
|
||||
"requested": "[1.202.66, )",
|
||||
"resolved": "1.202.66",
|
||||
"contentHash": "VTOwwfTPnov6WWJNrsmB9lWs5s+6XVUXtV8SgLvgJTswK11MTA0e+TZFfZJoSZ1WUsE2dvxlMrNOYJ6aL6j0wA==",
|
||||
"requested": "[1.202.120, )",
|
||||
"resolved": "1.202.120",
|
||||
"contentHash": "HTP48NOSZY3eQPX3GJN+gjxdW83SM7DX6NcKCFqNIIvjz/J+l8uimHAQp9dnLySb0wb1K1Z1xBPIXyxMQRREIw==",
|
||||
"dependencies": {
|
||||
"protobuf-net": "1.0.0"
|
||||
}
|
||||
|
Reference in New Issue
Block a user