diff --git a/LANCommander.Launcher.Models/InstallQueueGame.cs b/LANCommander.Launcher.Models/InstallQueueGame.cs index 7b4f28e5..4db95972 100644 --- a/LANCommander.Launcher.Models/InstallQueueGame.cs +++ b/LANCommander.Launcher.Models/InstallQueueGame.cs @@ -60,7 +60,7 @@ namespace LANCommander.Launcher.Models Title = game.Title; Version = game.Archives.OrderByDescending(a => a.CreatedOn).FirstOrDefault()?.Version; QueuedOn = DateTime.Now; - Status = GameInstallStatus.Idle; + Status = GameInstallStatus.Queued; var cover = game.Media.FirstOrDefault(m => m.Type == SDK.Enums.MediaType.Cover); diff --git a/LANCommander.Launcher.Services/InstallService.cs b/LANCommander.Launcher.Services/InstallService.cs index ba9fe3b7..33c76bf7 100644 --- a/LANCommander.Launcher.Services/InstallService.cs +++ b/LANCommander.Launcher.Services/InstallService.cs @@ -173,7 +173,7 @@ namespace LANCommander.Launcher.Services public async Task Next() { - var currentItem = Queue.FirstOrDefault(i => i.State); + var currentItem = Queue.FirstOrDefault(i => i.Status == GameInstallStatus.Queued); if (currentItem == null) return; diff --git a/LANCommander.Launcher/Styles/_authentication.scss b/LANCommander.Launcher/Styles/_authentication.scss index 75697f06..ae798d55 100644 --- a/LANCommander.Launcher/Styles/_authentication.scss +++ b/LANCommander.Launcher/Styles/_authentication.scss @@ -40,9 +40,12 @@ } .login-form-pane { - padding: 24px; background: #000; + .ant-form { + padding: 24px; + } + .ant-form-item:last-child { margin-bottom: 0; } diff --git a/LANCommander.Launcher/UI/Library/Index.razor b/LANCommander.Launcher/UI/Library/Index.razor index e29e850b..22462643 100644 --- a/LANCommander.Launcher/UI/Library/Index.razor +++ b/LANCommander.Launcher/UI/Library/Index.razor @@ -256,7 +256,7 @@ SelectedItem.State = LibraryItemState.Installing; break; - case SDK.Enums.GameInstallStatus.Idle: + case SDK.Enums.GameInstallStatus.Queued: SelectedItem.State = LibraryItemState.Queued; break; diff --git a/LANCommander.Launcher/UI/MainLayout.razor b/LANCommander.Launcher/UI/MainLayout.razor index 58746fa1..cfb95a68 100644 --- a/LANCommander.Launcher/UI/MainLayout.razor +++ b/LANCommander.Launcher/UI/MainLayout.razor @@ -131,7 +131,7 @@ { if (!_MainLayout.Importing) { - await _MainLayout.JS.InvokeVoidAsync("sendMessage", "import"); + await _MainLayout.JS.InvokeVoidAsync("window.external.sendMessage", "import"); _MainLayout.Importing = true; _MainLayout.StateHasChanged(); diff --git a/LANCommander.Launcher/wwwroot/css/app.css b/LANCommander.Launcher/wwwroot/css/app.css index e348564e..7975a61a 100644 --- a/LANCommander.Launcher/wwwroot/css/app.css +++ b/LANCommander.Launcher/wwwroot/css/app.css @@ -288,9 +288,11 @@ footer { margin-bottom: 0; } .authentication-form .login-form-pane { - padding: 24px; background: #000; } +.authentication-form .login-form-pane .ant-form { + padding: 24px; +} .authentication-form .login-form-pane .ant-form-item:last-child { margin-bottom: 0; } diff --git a/LANCommander.Launcher/wwwroot/css/app.css.map b/LANCommander.Launcher/wwwroot/css/app.css.map index 6ca34d85..69b4bc45 100644 --- a/LANCommander.Launcher/wwwroot/css/app.css.map +++ b/LANCommander.Launcher/wwwroot/css/app.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["../../Styles/app.scss","../../Styles/_appbar.scss","../../Styles/_window.scss","../../Styles/_scrollbar.scss","../../Styles/_layout.scss","../../Styles/_footer.scss","../../Styles/_button.scss","../../Styles/_radio.scss","../../Styles/_modal.scss","../../Styles/_collapse.scss","../../Styles/_list.scss","../../Styles/_authentication.scss","../../Styles/_library.scss","../../Styles/_download-queue.scss","../../Styles/_game-actions-dialog.scss","../../Styles/_install-dialog.scss","../../Styles/_checkbox-button-group.scss"],"names":[],"mappings":"AAAA;EACI;;;AAGJ;EACI;;;ACLJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;;AAEA;EAEI;;AAGJ;EACI;;AAGJ;EACI;EACA;EACA;EACA;EACA;;;AAIR;EACI;EACA;EACA;;AAEA;EACI;EACA;EACA;;;ACxCP;EACG;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAKA;EACI;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;;AAGJ;EACI;EACA;;AAGJ;EACI;;AAEA;EACI;EACA;EACA;;AAGJ;EACI;;AAIR;EACI;;AAGJ;EACI;;AAGJ;EACI;;AAGJ;EACI;;;AC1DP;EACG;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;;;AAGJ;EACI;;;ACzBJ;EACI;;;AAGJ;EACI;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;EACA;EACA;;AAGA;EACI;EACA;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGJ;EACI;;;AAIR;EACI;IACI;;;ACjDP;EACG;EACA;EACA;EACA;EACA;;;ACLH;AAAA;AAAA;EAGG;;;ACFA;AAAA;EAEI;;AAGJ;AAAA;EAEI;;;AAIR;EACI;;AAEA;AAAA;EAEI;;;ACfR;AAAA;EAEI;;AAEA;AAAA;EACI;;;AAKJ;EACI;;AAGJ;AAAA;EAEI,cAlBS;;AAqBb;AAAA;EAEI,eAvBS;;;ACCb;EACI;;;ACFR;EACI;EACA;EACA;;;AAIA;EACI;EACA;;AAEA;EAEI;;AAEA;EACI;;AAIR;EACI;EACA;EACA;EACA;EACA;EACA;EACA;;;AC3BX;EACG;EACA;EACA;EACA;EACA;;AAEA;EACI;;AAGJ;EACI;EACA;EACA;;AAGJ;EACI;EACA;;AAEA;EACI;EACA;EACA;;AAGJ;EACI;;AAEA;EACI;EACA;;AAGJ;EACI;;AAKZ;EACI;EACA;;AAEA;EACI;;;AC9CZ;EACI;EACA;EACA;EACA;EACA;;AAEA;EACI;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAIR;EACI;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;EACA;EACA;;AAGA;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGJ;EACI;EACA;;AAIA;EACI;;AAGJ;EACI;;AAIR;EACI;;AAEA;EACI;EACA;EACA;EACA;;AAKZ;EACI;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;EACA;;AAIR;EACI;;AAIR;EACI;EACA;;;AAKJ;EACI;;AAGJ;EACI;;AAEA;EACI;;;AAKZ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;;AAEA;EACI;EACA;EACA;EACA;EACA;EACA;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAIR;EACI;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;;;AAIA;EACI;;AAEA;EACI;;AAGJ;EACI;;;AAMR;EACI;;;AAIR;EACI;EACA;EACA;EACA;EACA;;AAEA;EACI;;AAGJ;EACI;EACA;;;ACxNR;EACI;EACA;EACA;EACA;;AAEA;EACI;EACA;;AAEA;AAAA;AAAA;EAGI;;AAGJ;EACI;;AAGJ;EACI;;AAIR;EACI;EACA;;AAEA;EACI;EACA;EACA;;AAIR;EACI;;AAGJ;EAEI;EACA;;AAGJ;EACI;EACA;;;AAIR;EACI;EACA;EACA;;AAEA;EACI;;AAGJ;EACI;;AAGJ;EACI;EACA;;AAGJ;EACI;EACA;EACA;;AAEA;EACI;;AAGJ;EACI;;AAEA;EACI;;AAIR;EACI;;AAGJ;EACI;EACA;;AAGJ;EACI;;AAIR;EACI;EACA;EACA;EACA;EACA;;;ACzGJ;EACI;;AAGJ;EACI;;;ACHA;EACI;;AAGJ;EACI;;AAIR;EACI;;;ACbP;EACG;;AAEA;EACI;EACA;EACA;;AAEA;EACI;EACA;EACA","file":"app.css"} \ No newline at end of file +{"version":3,"sourceRoot":"","sources":["../../Styles/app.scss","../../Styles/_appbar.scss","../../Styles/_window.scss","../../Styles/_scrollbar.scss","../../Styles/_layout.scss","../../Styles/_footer.scss","../../Styles/_button.scss","../../Styles/_radio.scss","../../Styles/_modal.scss","../../Styles/_collapse.scss","../../Styles/_list.scss","../../Styles/_authentication.scss","../../Styles/_library.scss","../../Styles/_download-queue.scss","../../Styles/_game-actions-dialog.scss","../../Styles/_install-dialog.scss","../../Styles/_checkbox-button-group.scss"],"names":[],"mappings":"AAAA;EACI;;;AAGJ;EACI;;;ACLJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;;AAEA;EAEI;;AAGJ;EACI;;AAGJ;EACI;EACA;EACA;EACA;EACA;;;AAIR;EACI;EACA;EACA;;AAEA;EACI;EACA;EACA;;;ACxCP;EACG;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAKA;EACI;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;;AAGJ;EACI;EACA;;AAGJ;EACI;;AAEA;EACI;EACA;EACA;;AAGJ;EACI;;AAIR;EACI;;AAGJ;EACI;;AAGJ;EACI;;AAGJ;EACI;;;AC1DP;EACG;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;;;AAGJ;EACI;;;ACzBJ;EACI;;;AAGJ;EACI;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;EACA;EACA;;AAGA;EACI;EACA;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGJ;EACI;;;AAIR;EACI;IACI;;;ACjDP;EACG;EACA;EACA;EACA;EACA;;;ACLH;AAAA;AAAA;EAGG;;;ACFA;AAAA;EAEI;;AAGJ;AAAA;EAEI;;;AAIR;EACI;;AAEA;AAAA;EAEI;;;ACfR;AAAA;EAEI;;AAEA;AAAA;EACI;;;AAKJ;EACI;;AAGJ;AAAA;EAEI,cAlBS;;AAqBb;AAAA;EAEI,eAvBS;;;ACCb;EACI;;;ACFR;EACI;EACA;EACA;;;AAIA;EACI;EACA;;AAEA;EAEI;;AAEA;EACI;;AAIR;EACI;EACA;EACA;EACA;EACA;EACA;EACA;;;AC3BX;EACG;EACA;EACA;EACA;EACA;;AAEA;EACI;;AAGJ;EACI;EACA;EACA;;AAGJ;EACI;EACA;;AAEA;EACI;EACA;EACA;;AAGJ;EACI;;AAEA;EACI;EACA;;AAGJ;EACI;;AAKZ;EACI;;AAEA;EACI;;AAGJ;EACI;;;ACjDZ;EACI;EACA;EACA;EACA;EACA;;AAEA;EACI;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAIR;EACI;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;EACA;EACA;;AAGA;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGJ;EACI;EACA;;AAIA;EACI;;AAGJ;EACI;;AAIR;EACI;;AAEA;EACI;EACA;EACA;EACA;;AAKZ;EACI;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;EACA;;AAIR;EACI;;AAIR;EACI;EACA;;;AAKJ;EACI;;AAGJ;EACI;;AAEA;EACI;;;AAKZ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;;AAEA;EACI;EACA;EACA;EACA;EACA;EACA;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAIR;EACI;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;;;AAIA;EACI;;AAEA;EACI;;AAGJ;EACI;;;AAMR;EACI;;;AAIR;EACI;EACA;EACA;EACA;EACA;;AAEA;EACI;;AAGJ;EACI;EACA;;;ACxNR;EACI;EACA;EACA;EACA;;AAEA;EACI;EACA;;AAEA;AAAA;AAAA;EAGI;;AAGJ;EACI;;AAGJ;EACI;;AAIR;EACI;EACA;;AAEA;EACI;EACA;EACA;;AAIR;EACI;;AAGJ;EAEI;EACA;;AAGJ;EACI;EACA;;;AAIR;EACI;EACA;EACA;;AAEA;EACI;;AAGJ;EACI;;AAGJ;EACI;EACA;;AAGJ;EACI;EACA;EACA;;AAEA;EACI;;AAGJ;EACI;;AAEA;EACI;;AAIR;EACI;;AAGJ;EACI;EACA;;AAGJ;EACI;;AAIR;EACI;EACA;EACA;EACA;EACA;;;ACzGJ;EACI;;AAGJ;EACI;;;ACHA;EACI;;AAGJ;EACI;;AAIR;EACI;;;ACbP;EACG;;AAEA;EACI;EACA;EACA;;AAEA;EACI;EACA;EACA","file":"app.css"} \ No newline at end of file diff --git a/LANCommander.SDK/Client.cs b/LANCommander.SDK/Client.cs index b9d96971..614200eb 100644 --- a/LANCommander.SDK/Client.cs +++ b/LANCommander.SDK/Client.cs @@ -106,8 +106,7 @@ namespace LANCommander.SDK BaseUrl = new Uri(baseUrl); ApiClient = new RestClient(new RestClientOptions { - BaseUrl = BaseUrl, - ThrowOnAnyError = true + BaseUrl = BaseUrl }); } } @@ -447,6 +446,20 @@ namespace LANCommander.SDK Password = password })); + if (response.ErrorException != null) + { + Logger?.LogError(response.ErrorException, "Registration failed for user {UserName}", username); + + if (!String.IsNullOrWhiteSpace(response?.Data?.Message)) + { + Logger?.LogError(response.Data.Message); + + throw new Exception(response.Data.Message); + } + else + throw response.ErrorException; + } + switch (response.StatusCode) { case HttpStatusCode.OK: diff --git a/LANCommander.SDK/LANCommander.SDK.csproj b/LANCommander.SDK/LANCommander.SDK.csproj index d1c47a77..25d0663e 100644 --- a/LANCommander.SDK/LANCommander.SDK.csproj +++ b/LANCommander.SDK/LANCommander.SDK.csproj @@ -2,7 +2,7 @@ net8.0 - 1.0.0 + 1.0.3 pathartl LANCommander A .NET library for interacting with a LANCommander server diff --git a/LANCommander.SDK/Services/SaveService.cs b/LANCommander.SDK/Services/SaveService.cs index e28cf29c..30fd0bb3 100644 --- a/LANCommander.SDK/Services/SaveService.cs +++ b/LANCommander.SDK/Services/SaveService.cs @@ -167,6 +167,10 @@ namespace LANCommander.SDK.Services if (File.Exists(entryPath)) { + var destinationDirectory = Path.GetDirectoryName(entryPath); + + Directory.CreateDirectory(destinationDirectory); + // Handle individual files that were saved as an entry in the path if (File.Exists(destinationPath)) File.Delete(destinationPath); @@ -180,6 +184,10 @@ namespace LANCommander.SDK.Services foreach (var entryFile in entryFiles) { + var destinationDirectory = Path.GetDirectoryName(entryFile); + + Directory.CreateDirectory(destinationDirectory); + var fileDestination = entryFile.Replace(entryPath, destinationPath); if (File.Exists(fileDestination)) diff --git a/LANCommander.Server.Services/ServerService.cs b/LANCommander.Server.Services/ServerService.cs index 378089b2..fa5b1372 100644 --- a/LANCommander.Server.Services/ServerService.cs +++ b/LANCommander.Server.Services/ServerService.cs @@ -75,6 +75,7 @@ namespace LANCommander.Server.Services if (manifestConsole != null) { + serverConsole.ServerId = server.Id; serverConsole.Name = manifestConsole.Name; serverConsole.Type = (ServerConsoleType)(int)manifestConsole.Type; serverConsole.Path = manifestConsole.Path; @@ -93,6 +94,7 @@ namespace LANCommander.Server.Services server.ServerConsoles.Add(new ServerConsole() { Id = manifestConsole.Id, + ServerId = server.Id, Name = manifestConsole.Name, Type = (ServerConsoleType)(int)manifestConsole.Type, Path = manifestConsole.Path, diff --git a/LANCommander.Server/Controllers/ServerController.cs b/LANCommander.Server/Controllers/ServerController.cs index 6d4e625a..1f16ff80 100644 --- a/LANCommander.Server/Controllers/ServerController.cs +++ b/LANCommander.Server/Controllers/ServerController.cs @@ -77,7 +77,7 @@ namespace LANCommander.Server.Controllers foreach (var file in files) { - var entryName = file.Substring(server.WorkingDirectory.Length, file.Length - server.WorkingDirectory.Length).Replace(Path.DirectorySeparatorChar, '/'); + var entryName = file.Substring(server.WorkingDirectory.Length, file.Length - server.WorkingDirectory.Length).Replace(Path.DirectorySeparatorChar, '/').TrimStart('/'); if (System.IO.File.Exists(file)) { diff --git a/LANCommander.Server/LANCommander.Server.csproj b/LANCommander.Server/LANCommander.Server.csproj index 9e02bbef..4d6c4cfd 100644 --- a/LANCommander.Server/LANCommander.Server.csproj +++ b/LANCommander.Server/LANCommander.Server.csproj @@ -6,7 +6,7 @@ aspnet-LANCommander-C1F79CFA-9767-4AD7-BD5A-2549F8328A2D wwwroot\favicon.ico none - 1.0.0 + 1.0.3