Compare commits

...

4 Commits

Author SHA1 Message Date
z__
ba5b611994 add STA thread back, not being added automatically on local build 2022-02-04 10:38:47 +07:00
z__
2bcf79efdd to trigger autobuild to fix warfare 2 update 2022-02-04 09:47:22 +07:00
z__
d5c101bf19 i believe we're done 2022-02-03 19:49:16 +07:00
z__
e9841b4de1 now should work 2022-02-03 19:43:54 +07:00
4 changed files with 7 additions and 9 deletions

View File

@@ -7,6 +7,7 @@ namespace Torch.Server
{ {
internal static class Program internal static class Program
{ {
[STAThread]
public static void Main(string[] args) public static void Main(string[] args)
{ {
var isService = Environment.GetEnvironmentVariable("TORCH_SERVICE") var isService = Environment.GetEnvironmentVariable("TORCH_SERVICE")
@@ -23,8 +24,6 @@ namespace Torch.Server
File.Delete(file); File.Delete(file);
} }
TorchLauncher.Launch(workingDir, binDir);
// Breaks on Windows Server 2019 // Breaks on Windows Server 2019
#if TORCH_SERVICE #if TORCH_SERVICE
if (!new ComputerInfo().OSFullName.Contains("Server 2019") && !Environment.UserInteractive) if (!new ComputerInfo().OSFullName.Contains("Server 2019") && !Environment.UserInteractive)
@@ -45,7 +44,7 @@ namespace Torch.Server
} }
else else
{ {
instancePath = Path.GetFullPath(instanceName); instancePath = Directory.CreateDirectory(instanceName).FullName;
} }
var oldTorchCfg = Path.Combine(workingDir, "Torch.cfg"); var oldTorchCfg = Path.Combine(workingDir, "Torch.cfg");
@@ -70,6 +69,8 @@ namespace Torch.Server
if (!initializer.Initialize(args)) if (!initializer.Initialize(args))
Environment.Exit(1); Environment.Exit(1);
TorchLauncher.Launch(workingDir, binDir);
CopyNative(binDir); CopyNative(binDir);
initializer.Run(isService, instanceName, instancePath); initializer.Run(isService, instanceName, instancePath);
} }

View File

@@ -161,6 +161,5 @@
<ItemGroup> <ItemGroup>
<Page Remove="Views\WorldSelectControl.xaml" /> <Page Remove="Views\WorldSelectControl.xaml" />
<None Include="..\NLog.config" Visible="false" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="Always" /> <None Include="..\NLog.config" Visible="false" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="Always" />
<None Include="..\Dockerfile" Visible="false" CopyToPublishDirectory="Always" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -17,6 +17,7 @@ internal static class GcCollectPatch
{ {
// FUCK YO KEEN // FUCK YO KEEN
// every call results in freeze for seconds // every call results in freeze for seconds
private static readonly MethodBase[] _targets = private static readonly MethodBase[] _targets =
{ {
Info.OfMethod<MyPlanetTextureMapProvider>(nameof(MyPlanetTextureMapProvider.GetHeightmap)), Info.OfMethod<MyPlanetTextureMapProvider>(nameof(MyPlanetTextureMapProvider.GetHeightmap)),

View File

@@ -47,14 +47,11 @@ install:
cache: cache:
- c:\steam\dedi\ - c:\steam\dedi\
- c:\steam\cmd\ - c:\steam\cmd\
before_build:
- pwsh: dotnet restore .\Torch.Server\Torch.Server.csproj
build_script: build_script:
- pwsh: >- - pwsh: >-
dotnet publish .\Torch.Server\Torch.Server.csproj --self-contained -f net6-windows -r win-x64 -c Release -o .\publish\ dotnet publish .\Torch.Server\Torch.Server.csproj --self-contained -f net6-windows -r win-x64 -c Release -o .\publish\
cmd /c "rmdir GameBinaries" Compress-Archive -Path .\publish\* -DestinationPath .\torch-server.zip
Compress-Archive -Path .\publish\* -DestinationPath torch-server.zip
artifacts: artifacts:
- path: torch-server.zip - path: torch-server.zip
deploy: deploy: