From 7eee09d32d04910f3b53bd61332036c24c3812cf Mon Sep 17 00:00:00 2001 From: asesidaa <1061472754@qq.com> Date: Sat, 16 Sep 2023 00:49:05 +0800 Subject: [PATCH] Update to .net 8, bump dependencies, fix weird max issue --- .../Game/InitialDataCheckController.cs | 2 +- TaikoLocalServer/Program.cs | 22 ++++--------- TaikoLocalServer/Services/CardService.cs | 2 +- TaikoLocalServer/TaikoLocalServer.csproj | 33 ++++++++++--------- 4 files changed, 25 insertions(+), 34 deletions(-) diff --git a/TaikoLocalServer/Controllers/Game/InitialDataCheckController.cs b/TaikoLocalServer/Controllers/Game/InitialDataCheckController.cs index fae2907..bdc1f96 100644 --- a/TaikoLocalServer/Controllers/Game/InitialDataCheckController.cs +++ b/TaikoLocalServer/Controllers/Game/InitialDataCheckController.cs @@ -50,7 +50,7 @@ public class InitialDataCheckController : BaseController(); - for (var danId = Constants.MIN_DAN_ID; danId <= 18; danId++) + for (var danId = Constants.MIN_DAN_ID; danId <= Constants.MAX_DAN_ID; danId++) { danData.Add(new InitialdatacheckResponse.VerupNoData2.InformationData { diff --git a/TaikoLocalServer/Program.cs b/TaikoLocalServer/Program.cs index 6254ead..093f083 100644 --- a/TaikoLocalServer/Program.cs +++ b/TaikoLocalServer/Program.cs @@ -23,22 +23,12 @@ try { var builder = WebApplication.CreateBuilder(args); - builder.Host.ConfigureAppConfiguration((hostingContext, config) => - { - const string configurationsDirectory = "Configurations"; - config.AddJsonFile($"{configurationsDirectory}/Kestrel.json", optional: true, reloadOnChange: false); - config.AddJsonFile($"{configurationsDirectory}/Logging.json", optional: false, reloadOnChange: false); - config.AddJsonFile($"{configurationsDirectory}/Database.json", optional: false, reloadOnChange: false); - config.AddJsonFile($"{configurationsDirectory}/ServerSettings.json", optional: false, reloadOnChange: false); - config.AddJsonFile($"{configurationsDirectory}/DataSettings.json", optional: true, reloadOnChange: false); - }); - - // Manually enable tls 1.0 - builder.WebHost.UseKestrel(kestrelOptions => - { - kestrelOptions.ConfigureHttpsDefaults(options => - options.SslProtocols = SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12 | SslProtocols.Tls13); - }); + const string configurationsDirectory = "Configurations"; + builder.Configuration.AddJsonFile($"{configurationsDirectory}/Kestrel.json", optional: true, reloadOnChange: false); + builder.Configuration.AddJsonFile($"{configurationsDirectory}/Logging.json", optional: false, reloadOnChange: false); + builder.Configuration.AddJsonFile($"{configurationsDirectory}/Database.json", optional: false, reloadOnChange: false); + builder.Configuration.AddJsonFile($"{configurationsDirectory}/ServerSettings.json", optional: false, reloadOnChange: false); + builder.Configuration.AddJsonFile($"{configurationsDirectory}/DataSettings.json", optional: true, reloadOnChange: false); builder.Host.UseSerilog((context, configuration) => { diff --git a/TaikoLocalServer/Services/CardService.cs b/TaikoLocalServer/Services/CardService.cs index 11d36c1..cfb4426 100644 --- a/TaikoLocalServer/Services/CardService.cs +++ b/TaikoLocalServer/Services/CardService.cs @@ -21,7 +21,7 @@ public class CardService : ICardService public ulong GetNextBaid() { - return context.Cards.Any() ? context.Cards.Max(card => card.Baid) + 1 : 1; + return context.Cards.Any() ? context.Cards.ToList().Max(card => card.Baid) + 1 : 1; } public async Task> GetUsersFromCards() diff --git a/TaikoLocalServer/TaikoLocalServer.csproj b/TaikoLocalServer/TaikoLocalServer.csproj index e35fee8..bb0da36 100644 --- a/TaikoLocalServer/TaikoLocalServer.csproj +++ b/TaikoLocalServer/TaikoLocalServer.csproj @@ -1,10 +1,11 @@  - net6.0 + net8.0 enable enable - 0.3.0-alpha + 0.4.0-alpha + 12 @@ -12,23 +13,23 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - + + + + + + + + + +