Hotfix for assembly loading issues

This commit is contained in:
John Gross
2018-07-19 11:57:30 -07:00
parent b829e90edb
commit 21e45b5e45
3 changed files with 19 additions and 5 deletions

View File

@@ -52,9 +52,17 @@ quit";
AppDomain.CurrentDomain.UnhandledException += HandleException; AppDomain.CurrentDomain.UnhandledException += HandleException;
#endif #endif
if (!args.Contains("-noupdate")) // This is what happens when Keen is bad and puts extensions into the System namespace.
if (!Enumerable.Contains(args, "-noupdate"))
RunSteamCmd(); RunSteamCmd();
var basePath = new FileInfo(typeof(Program).Assembly.Location).Directory.ToString();
var apiSource = Path.Combine(basePath, "DedicatedServer64", "steam_api64.dll");
var apiTarget = Path.Combine(basePath, "steam_api64.dll");
if (!File.Exists(apiTarget))
File.Copy(apiSource, apiTarget);
_config = InitConfig(); _config = InitConfig();
if (!_config.Parse(args)) if (!_config.Parse(args))
return false; return false;
@@ -129,7 +137,7 @@ quit";
} }
} }
private static void RunSteamCmd() public static void RunSteamCmd()
{ {
var log = LogManager.GetLogger("SteamCMD"); var log = LogManager.GetLogger("SteamCMD");

View File

@@ -1,7 +1,13 @@
using System; using System;
using System.Diagnostics;
using System.IO; using System.IO;
using System.IO.Compression;
using System.Net;
using System.Reflection; using System.Reflection;
using System.ServiceProcess; using System.ServiceProcess;
using System.Text;
using System.Threading;
using NLog;
using NLog.Targets; using NLog.Targets;
using Torch.Utils; using Torch.Utils;
@@ -23,7 +29,7 @@ namespace Torch.Server
if (!TorchLauncher.IsTorchWrapped()) if (!TorchLauncher.IsTorchWrapped())
{ {
TorchLauncher.Launch(Assembly.GetEntryAssembly().FullName,args, binDir); TorchLauncher.Launch(Assembly.GetEntryAssembly().FullName, args, binDir);
return; return;
} }
@@ -41,4 +47,4 @@ namespace Torch.Server
initializer.Run(); initializer.Run();
} }
} }
} }

View File

@@ -176,7 +176,7 @@ namespace Torch.Managers.PatchManager
_log.Info("Patching begins..."); _log.Info("Patching begins...");
_finishedPatchCount = 0; _finishedPatchCount = 0;
_dirtyPatchCount = _rewritePatterns.Values.Sum(x => x.HasChanged() ? 1 : 0); _dirtyPatchCount = _rewritePatterns.Values.Sum(x => x.HasChanged() ? 1 : 0);
#if true #if false
ParallelTasks.Parallel.ForEach(_rewritePatterns.Values.Where(x => !x.PrintMsil), DoCommit); ParallelTasks.Parallel.ForEach(_rewritePatterns.Values.Where(x => !x.PrintMsil), DoCommit);
foreach (DecoratedMethod m in _rewritePatterns.Values.Where(x => x.PrintMsil)) foreach (DecoratedMethod m in _rewritePatterns.Values.Where(x => x.PrintMsil))
DoCommit(m); DoCommit(m);