public async Task DownloadAndExtractSteamCmdToTempPath() { // Arrange var updater = new ServerUpdater(_settings); // Act if (Directory.Exists(_settings.SteamCmdInstallDir)) { Directory.Delete(_settings.SteamCmdInstallDir, true); } await updater.EnsureSteamCmdExistsAsync(_cts.Token); // Assert Assert.True(File.Exists(_settings.SteamCmdPath)); }
public async Task RunSteamCmdUpdaterAndInstallToTempPath() { // Arrange var updater = new ServerUpdater(_settings); // Act if (Directory.Exists(_settings.SteamCmdInstallDir)) { Directory.Delete(_settings.SteamCmdInstallDir, true); } await updater.EnsureSteamCmdExistsAsync(_cts.Token); await updater.RunSteamCmdUpdaterAsync(_cts.Token); // Assert Assert.True(File.Exists(Path.Combine(_settings.ServerInstallDir, "StartServer.bat"))); }
private static async Task <int> Execute(string[] args, CancellationToken token) { var settings = SettingsParser.ParseArgs(CesxSettings.Default, args); Console.WriteLine("CESX: starting with settings"); Console.WriteLine(settings); if (!settings.SkipBackup) { Console.WriteLine("CESX: Creating backup..."); var backuper = new ServerBackuper(settings); backuper.DoBackup(); Console.WriteLine("CESX: Done!"); } if (!settings.SkipUpdate) { Console.WriteLine("CESX: Try updating server files"); _updater = new ServerUpdater(settings); Console.WriteLine("CESX: Downloading SteamCmd..."); await _updater.EnsureSteamCmdExistsAsync(token); Console.WriteLine("CESX: Done!"); Console.WriteLine("CESX: Running steamcmd..."); await _updater.RunSteamCmdUpdaterAsync(token); Console.WriteLine("CESX: Done!"); //_updater.Dispose(); } Console.WriteLine("CESX: Starting the server instance"); _server = new ServerRunner(settings); _server.Run(); return((int)ExitCode.Success); }