diff --git a/Torch.Server/Program.cs b/Torch.Server/Program.cs index 0bc4d7e..aca5ab4 100644 --- a/Torch.Server/Program.cs +++ b/Torch.Server/Program.cs @@ -2,6 +2,7 @@ using System.Diagnostics; using System.IO; using System.IO.Compression; +using System.Linq; using System.Net; using System.Reflection; using System.ServiceProcess; @@ -21,12 +22,20 @@ namespace Torch.Server [STAThread] public static void Main(string[] args) { + + Target.Register("FlowDocument"); //Ensures that all the files are downloaded in the Torch directory. var workingDir = new FileInfo(typeof(Program).Assembly.Location).Directory.ToString(); var binDir = Path.Combine(workingDir, "DedicatedServer64"); Directory.SetCurrentDirectory(workingDir); + //HACK for block skins update + foreach (var f in Directory.EnumerateFiles(workingDir, "System.*", SearchOption.TopDirectoryOnly)) + { + File.Delete(f); + } + if (!TorchLauncher.IsTorchWrapped()) { TorchLauncher.Launch(Assembly.GetEntryAssembly().FullName, args, binDir); diff --git a/Torch.Server/Torch.Server.csproj b/Torch.Server/Torch.Server.csproj index c38317f..c6548df 100644 --- a/Torch.Server/Torch.Server.csproj +++ b/Torch.Server/Torch.Server.csproj @@ -87,6 +87,9 @@ ..\packages\Microsoft.Win32.Registry.4.4.0\lib\net461\Microsoft.Win32.Registry.dll + + ..\GameBinaries\netstandard.dll + ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll diff --git a/Torch.Server/TorchServer.cs b/Torch.Server/TorchServer.cs index c4070cd..60c6268 100644 --- a/Torch.Server/TorchServer.cs +++ b/Torch.Server/TorchServer.cs @@ -123,12 +123,14 @@ 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}"); - } - + //Are you serious, Keen? This is going away until it stops hanging. + //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}"); + //} + Log.Warn("Remote API is disabled because it hangs the server start process. Blame Keen."); + _uptime = Stopwatch.StartNew(); base.Start(); }