Skip to content

Commit fc9a9f8

Browse files
committed
Merge branch 'master' into PreRelease
2 parents 990ed0f + db283fa commit fc9a9f8

18 files changed

Lines changed: 135 additions & 20 deletions

‎Torch.Client.Tests/Torch.Client.Tests.csproj‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
</ProjectReference>
8787
</ItemGroup>
8888
<ItemGroup>
89+
<None Include="app.config" />
8990
<None Include="packages.config" />
9091
</ItemGroup>
9192
<ItemGroup>

‎Torch.Client.Tests/app.config‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<runtime>
4+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
5+
<dependentAssembly>
6+
<assemblyIdentity name="protobuf-net" publicKeyToken="257b51d87d2e4d67" culture="neutral" />
7+
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
8+
</dependentAssembly>
9+
</assemblyBinding>
10+
</runtime>
11+
</configuration>

‎Torch.Client/Torch.Client.csproj‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@
147147
<Generator>ResXFileCodeGenerator</Generator>
148148
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
149149
</EmbeddedResource>
150+
<None Include="app.config" />
150151
<None Include="packages.config" />
151152
<None Include="Properties\Settings.settings">
152153
<Generator>SettingsSingleFileGenerator</Generator>

‎Torch.Client/TorchClientConfig.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ public class TorchClientConfig : ITorchConfig
2323
public bool NoGui { get; set; } = false;
2424
public bool RestartOnCrash { get; set; } = false;
2525
public string WaitForPID { get; set; } = null;
26+
public string ChatName { get; set; }
27+
public string ChatColor { get; set; }
2628

2729
public bool Save(string path = null)
2830
{

‎Torch.Client/app.config‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<runtime>
4+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
5+
<dependentAssembly>
6+
<assemblyIdentity name="protobuf-net" publicKeyToken="257b51d87d2e4d67" culture="neutral" />
7+
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
8+
</dependentAssembly>
9+
</assemblyBinding>
10+
</runtime>
11+
</configuration>

‎Torch.Server.Tests/Torch.Server.Tests.csproj‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
</ProjectReference>
9393
</ItemGroup>
9494
<ItemGroup>
95+
<None Include="app.config" />
9596
<None Include="packages.config" />
9697
</ItemGroup>
9798
<ItemGroup>

‎Torch.Server.Tests/app.config‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<runtime>
4+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
5+
<dependentAssembly>
6+
<assemblyIdentity name="protobuf-net" publicKeyToken="257b51d87d2e4d67" culture="neutral" />
7+
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
8+
</dependentAssembly>
9+
</assemblyBinding>
10+
</runtime>
11+
</configuration>

‎Torch.Server/Initializer.cs‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ public bool Initialize(string[] args)
6565

6666
if (!File.Exists(apiTarget))
6767
File.Copy(apiSource, apiTarget);
68-
69-
var protoSource = Path.Combine(basePath, "DedicatedServer64", "protobuf-net.dll");
70-
var protoTarget = Path.Combine(basePath, "protobuf-net.dll");
71-
72-
if(!File.Exists(protoTarget))
73-
File.Copy(protoSource, protoTarget);
68+
69+
var havokSource = Path.Combine(basePath, "DedicatedServer64", "Havok.dll");
70+
var havokTarget = Path.Combine(basePath, "Havok.dll");
71+
72+
if (!File.Exists(havokTarget))
73+
File.Copy(havokSource, havokTarget);
7474

7575
_config = InitConfig();
7676
if (!_config.Parse(args))
@@ -177,9 +177,10 @@ public static void RunSteamCmd()
177177
File.Delete(STEAMCMD_ZIP);
178178
log.Info("SteamCMD downloaded successfully!");
179179
}
180-
catch
180+
catch (Exception e)
181181
{
182182
log.Error("Failed to download SteamCMD, unable to update the DS.");
183+
log.Error(e);
183184
return;
184185
}
185186
}

‎Torch.Server/Program.cs‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
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;
89
using System.Text;
910
using System.Threading;
1011
using NLog;
12+
using NLog.Fluent;
1113
using NLog.Targets;
1214
using Torch.Utils;
1315

@@ -21,12 +23,34 @@ internal static class Program
2123
[STAThread]
2224
public static void Main(string[] args)
2325
{
26+
27+
2428
Target.Register<FlowDocumentTarget>("FlowDocument");
2529
//Ensures that all the files are downloaded in the Torch directory.
2630
var workingDir = new FileInfo(typeof(Program).Assembly.Location).Directory.ToString();
2731
var binDir = Path.Combine(workingDir, "DedicatedServer64");
2832
Directory.SetCurrentDirectory(workingDir);
2933

34+
//HACK for block skins update
35+
var badDlls = new[]
36+
{
37+
"System.Security.Principal.Windows.dll"
38+
};
39+
40+
try
41+
{
42+
foreach (var file in badDlls)
43+
{
44+
if (File.Exists(file))
45+
File.Delete(file);
46+
}
47+
}
48+
catch
49+
{
50+
LogManager.GetCurrentClassLogger().Error($"Error updating. Please delete the following files from the Torch root folder manually:\r\n{string.Join("\r\n", badDlls)}");
51+
return;
52+
}
53+
3054
if (!TorchLauncher.IsTorchWrapped())
3155
{
3256
TorchLauncher.Launch(Assembly.GetEntryAssembly().FullName, args, binDir);

‎Torch.Server/Torch.Server.csproj‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,19 @@
8686
<Reference Include="Microsoft.Win32.Registry, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
8787
<HintPath>..\packages\Microsoft.Win32.Registry.4.4.0\lib\net461\Microsoft.Win32.Registry.dll</HintPath>
8888
</Reference>
89+
<Reference Include="mscorlib" />
90+
<Reference Include="netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51">
91+
<HintPath>..\GameBinaries\netstandard.dll</HintPath>
92+
</Reference>
8993
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
9094
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
9195
</Reference>
9296
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
9397
<HintPath>..\packages\NLog.4.4.12\lib\net45\NLog.dll</HintPath>
9498
<Private>True</Private>
9599
</Reference>
96-
<Reference Include="protobuf-net, Version=2.1.0.0, Culture=neutral, PublicKeyToken=257b51d87d2e4d67, processorArchitecture=MSIL">
97-
<HintPath>..\packages\protobuf-net.2.1.0\lib\net451\protobuf-net.dll</HintPath>
100+
<Reference Include="protobuf-net, Version=2.4.0.0, Culture=neutral, PublicKeyToken=257b51d87d2e4d67, processorArchitecture=MSIL">
101+
<HintPath>..\packages\protobuf-net.2.4.0\lib\net40\protobuf-net.dll</HintPath>
98102
</Reference>
99103
<Reference Include="Sandbox.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
100104
<SpecificVersion>False</SpecificVersion>
@@ -130,17 +134,24 @@
130134
<HintPath>..\GameBinaries\Steamworks.NET.dll</HintPath>
131135
</Reference>
132136
<Reference Include="System" />
137+
<Reference Include="System.ComponentModel.Annotations, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
138+
<HintPath>..\packages\System.ComponentModel.Annotations.4.5.0\lib\net461\System.ComponentModel.Annotations.dll</HintPath>
139+
<Private>True</Private>
140+
</Reference>
133141
<Reference Include="System.ComponentModel.DataAnnotations" />
142+
<Reference Include="System.Configuration" />
134143
<Reference Include="System.Configuration.Install" />
135144
<Reference Include="System.Data" />
136145
<Reference Include="System.Drawing" />
137146
<Reference Include="System.IO.Compression.FileSystem" />
147+
<Reference Include="System.Runtime.Serialization" />
138148
<Reference Include="System.Security.AccessControl, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
139149
<HintPath>..\packages\System.Security.AccessControl.4.4.0\lib\net461\System.Security.AccessControl.dll</HintPath>
140150
</Reference>
141151
<Reference Include="System.Security.Principal.Windows, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
142152
<HintPath>..\packages\System.Security.Principal.Windows.4.4.0\lib\net461\System.Security.Principal.Windows.dll</HintPath>
143153
</Reference>
154+
<Reference Include="System.ServiceModel" />
144155
<Reference Include="System.ServiceProcess" />
145156
<Reference Include="System.Windows.Forms" />
146157
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

0 commit comments

Comments
 (0)