Wait ten minutes before updating

This commit is contained in:
sardelka9515 2022-08-22 16:59:00 +08:00
parent 01433f0de6
commit b3e285f92f
2 changed files with 8 additions and 3 deletions

View File

@ -16,7 +16,7 @@ using System.Resources;
// Version informationr(
[assembly: AssemblyVersion("1.5.2.79")]
[assembly: AssemblyFileVersion("1.5.2.79")]
[assembly: AssemblyVersion("1.5.2.80")]
[assembly: AssemblyFileVersion("1.5.2.80")]
[assembly: NeutralResourcesLanguageAttribute( "en-US" )]

View File

@ -138,7 +138,12 @@ namespace RageCoop.Server
var end = versionLine.LastIndexOf('\"');
var latest = Version.Parse(versionLine.AsSpan(start, end - start));
if (latest <= Version) { return; }
API.SendChatMessage($"New server version found: {latest}, downloading update...");
// wait ten minutes for the build to complete
API.SendChatMessage($"New server version found: {latest}, server will update in 10 minutes");
Thread.Sleep(10 * 60 * 1000);
API.SendChatMessage("downloading update...");
var downloadURL = $"https://github.com/RAGECOOP/RAGECOOP-V/releases/download/nightly/RageCoop.Server-{GetRID()}.zip";
if (Directory.Exists("Update")) { Directory.Delete("Update", true); }
HttpHelper.DownloadFile(downloadURL, "Update.zip", null);