Skip to content

Commit

Permalink
Merge pull request WindowsGSM#165 from Soulflare3/patch-1
Browse files Browse the repository at this point in the history
Update built-in game plugins
  • Loading branch information
BattlefieldDuck authored Dec 6, 2023
2 parents 2f5fe79 + 7fd3d9a commit 8293c10
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion WindowsGSM/GameServer/CE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CE
public string Notice;

public const string FullName = "Conan Exiles Dedicated Server";
public string StartPath = @"ConanSandbox\Binaries\Win64\ConanSandboxServer-Win64-Test.exe";
public string StartPath = @"ConanSandbox\Binaries\Win64\ConanSandboxServer-Win64-Shipping.exe";
public bool AllowsEmbedConsole = true;
public int PortIncrements = 2;
public dynamic QueryMethod = new Query.A2S();
Expand Down
24 changes: 12 additions & 12 deletions WindowsGSM/GameServer/VTS.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
Expand Down Expand Up @@ -106,30 +106,30 @@ public async Task<Process> Install()
{
string version = await GetRemoteBuild();
if (version == null) { return null; }
string tarName = $"vs_server_{version}.tar.gz";
string address = $"https://cdn.vintagestory.at/gamefiles/stable/{tarName}";
string tarPath = ServerPath.GetServersServerFiles(_serverData.ServerID, tarName);
string zipName = $"vs_server_win-x64_{version}.zip";
string address = $"https://cdn.vintagestory.at/gamefiles/stable/{zipName}";
string zipPath = ServerPath.GetServersServerFiles(_serverData.ServerID, zipName);

// Download vs_server_{version}.tar.gz from https://cdn.vintagestory.at/gamefiles/stable/
// Download vs_server_win-x64_{version}.zip from https://cdn.vintagestory.at/gamefiles/stable/
using (WebClient webClient = new WebClient())
{
try { await webClient.DownloadFileTaskAsync(address, tarPath); }
try { await webClient.DownloadFileTaskAsync(address, zipPath); }
catch
{
Error = $"Fail to download {tarName}";
Error = $"Fail to download {zipName}";
return null;
}
}

// Extract vs_server_{version}.tar.gz
if (!await FileManagement.ExtractTarGZ(tarPath, Directory.GetParent(tarPath).FullName))
// Extract vs_server_win-x64_{version}.zip
if (!await FileManagement.ExtractZip(zipPath, Directory.GetParent(zipPath).FullName))
{
Error = $"Fail to extract {tarName}";
Error = $"Fail to extract {zipName}";
return null;
}

// Delete vs_server_{version}.tar.gz, leave it if fail to delete
await FileManagement.DeleteAsync(tarPath);
// Delete vs_server_win-x64_{version}.zip, leave it if fail to delete
await FileManagement.DeleteAsync(zipPath);

return null;
}
Expand Down

0 comments on commit 8293c10

Please sign in to comment.