Skip to content

Commit 3e5b29c

Browse files
committed
I think I actually fixed it
1 parent 5d19cc7 commit 3e5b29c

3 files changed

Lines changed: 20 additions & 6 deletions

File tree

‎Torch.Server/Program.cs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Diagnostics;
33
using System.IO;
44
using System.IO.Compression;
5+
using System.Linq;
56
using System.Net;
67
using System.Reflection;
78
using System.ServiceProcess;
@@ -21,12 +22,20 @@ internal static class Program
2122
[STAThread]
2223
public static void Main(string[] args)
2324
{
25+
26+
2427
Target.Register<FlowDocumentTarget>("FlowDocument");
2528
//Ensures that all the files are downloaded in the Torch directory.
2629
var workingDir = new FileInfo(typeof(Program).Assembly.Location).Directory.ToString();
2730
var binDir = Path.Combine(workingDir, "DedicatedServer64");
2831
Directory.SetCurrentDirectory(workingDir);
2932

33+
//HACK for block skins update
34+
foreach (var f in Directory.EnumerateFiles(workingDir, "System.*", SearchOption.TopDirectoryOnly))
35+
{
36+
File.Delete(f);
37+
}
38+
3039
if (!TorchLauncher.IsTorchWrapped())
3140
{
3241
TorchLauncher.Launch(Assembly.GetEntryAssembly().FullName, args, binDir);

‎Torch.Server/Torch.Server.csproj‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@
8787
<HintPath>..\packages\Microsoft.Win32.Registry.4.4.0\lib\net461\Microsoft.Win32.Registry.dll</HintPath>
8888
</Reference>
8989
<Reference Include="mscorlib" />
90+
<Reference Include="netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51">
91+
<HintPath>..\GameBinaries\netstandard.dll</HintPath>
92+
</Reference>
9093
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
9194
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
9295
</Reference>

‎Torch.Server/TorchServer.cs‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,14 @@ public override void Start()
123123
_hasRun = true;
124124
Log.Info("Starting server.");
125125
MySandboxGame.ConfigDedicated = DedicatedInstance.DedicatedConfig.Model;
126-
if (MySandboxGame.ConfigDedicated.RemoteApiEnabled && !string.IsNullOrEmpty(MySandboxGame.ConfigDedicated.RemoteSecurityKey))
127-
{
128-
var myRemoteServer = new MyRemoteServer(MySandboxGame.ConfigDedicated.RemoteApiPort, MySandboxGame.ConfigDedicated.RemoteSecurityKey);
129-
Log.Info($"Remote API started on port {myRemoteServer.Port}");
130-
}
131-
126+
//Are you serious, Keen? This is going away until it stops hanging.
127+
//if (MySandboxGame.ConfigDedicated.RemoteApiEnabled && !string.IsNullOrEmpty(MySandboxGame.ConfigDedicated.RemoteSecurityKey))
128+
//{
129+
// var myRemoteServer = new MyRemoteServer(MySandboxGame.ConfigDedicated.RemoteApiPort, MySandboxGame.ConfigDedicated.RemoteSecurityKey);
130+
// Log.Info($"Remote API started on port {myRemoteServer.Port}");
131+
//}
132+
Log.Warn("Remote API is disabled because it hangs the server start process. Blame Keen.");
133+
132134
_uptime = Stopwatch.StartNew();
133135
base.Start();
134136
}

0 commit comments

Comments
 (0)