Add remote API support
This commit is contained in:
@@ -24,6 +24,7 @@ using Torch.Server.Managers;
|
||||
using Torch.Utils;
|
||||
using VRage;
|
||||
using VRage.Dedicated;
|
||||
using VRage.Dedicated.RemoteAPI;
|
||||
using VRage.GameServices;
|
||||
using VRage.Steam;
|
||||
using Timer = System.Threading.Timer;
|
||||
@@ -122,6 +123,11 @@ namespace Torch.Server
|
||||
_hasRun = true;
|
||||
Log.Info("Starting server.");
|
||||
MySandboxGame.ConfigDedicated = DedicatedInstance.DedicatedConfig.Model;
|
||||
if (MySandboxGame.ConfigDedicated.RemoteApiEnabled && !string.IsNullOrEmpty(MySandboxGame.ConfigDedicated.RemoteSecurityKey))
|
||||
{
|
||||
var myRemoteServer = new MyRemoteServer(MySandboxGame.ConfigDedicated.RemoteApiPort, MySandboxGame.ConfigDedicated.RemoteSecurityKey);
|
||||
Log.Info($"Remote API started on port {myRemoteServer.Port}");
|
||||
}
|
||||
|
||||
_uptime = Stopwatch.StartNew();
|
||||
base.Start();
|
||||
|
Reference in New Issue
Block a user