From 16cbab36521ab1506df0ebb2e01daf1f76190d44 Mon Sep 17 00:00:00 2001 From: AlanMoonbase Date: Sun, 29 Dec 2024 14:50:32 -0800 Subject: [PATCH] add debug http logging --- .gitignore | 2 +- .../Common/AuthenticationController.cs | 2 +- src/Program.cs | 3 +++ src/appsettings.json | 3 ++- src/assets/conf/WIN/3.31.0/DWADragonsMain.xml | 16 ++++++++-------- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 572969d..c21df24 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,4 @@ src/mods/ src/assets-cache/ src/Properties __pycache__/ -src/assets/conf/WIN/3.31.0/DWADragonsMain.xml +src/assets/conf/WIN/3.31.0/DWADragonsMain.xml \ No newline at end of file diff --git a/src/Controllers/Common/AuthenticationController.cs b/src/Controllers/Common/AuthenticationController.cs index c1df62e..84ef49e 100644 --- a/src/Controllers/Common/AuthenticationController.cs +++ b/src/Controllers/Common/AuthenticationController.cs @@ -62,7 +62,7 @@ public class AuthenticationController : Controller { if(userBan is not null) { if (userBan.BanType != UserBanType.IndefiniteSuspension && DateTime.Compare(DateTime.UtcNow, userBan.EndsAt!.Value) >= 0) { moderationService.RemoveBanFromUser(user, userBan); userBan.EndsAt = DateTime.UtcNow; } // remove ban if its up and set retreived userban to have an end date of now if (userBan.BanType == UserBanType.IndefiniteSuspension || (userBan.BanType == UserBanType.TemporarySuspension && DateTime.Compare(DateTime.UtcNow, userBan.EndsAt!.Value) < 0)) { - if (gameVersion <= ClientVersion.Max_OldJS) return Ok(new ParentLoginInfo{ Status = MembershipUserStatus.ProviderError }); // everything 'OldJS' doesn't have 'UserIsBanned', so we use 'ProviderError' i + if (gameVersion <= ClientVersion.Max_OldJS) return Ok(new ParentLoginInfo{ Status = MembershipUserStatus.ProviderError }); // everything 'OldJS' doesn't have 'UserIsBanned', so we use 'ProviderError'. Edit: turns out 'UserIsBanned' just shows an error, so for both errors a user would have to contact a mod for assistance else return Ok(new ParentLoginInfo{ Status = MembershipUserStatus.UserIsBanned }); }; } diff --git a/src/Program.cs b/src/Program.cs index 84874e3..59aaeb5 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -7,6 +7,7 @@ using sodoff.Services; using sodoff.Utils; using System.Xml; using System.Net; +using System.Diagnostics; var builder = WebApplication.CreateBuilder(args); @@ -68,4 +69,6 @@ app.UseAuthorization(); app.MapControllers(); +if (Debugger.IsAttached) app.UseHttpLogging(); + app.Run(); diff --git a/src/appsettings.json b/src/appsettings.json index ac6cfa1..eac9f4c 100644 --- a/src/appsettings.json +++ b/src/appsettings.json @@ -74,7 +74,8 @@ "Logging": { "LogLevel": { "Default": "Information", - "Microsoft.AspNetCore": "Warning" + "Microsoft.AspNetCore": "Warning", + "Microsoft.AspNetCore.HttpLogging.HttpLoggingMiddleware": "Information" } }, "AllowedHosts": "*" diff --git a/src/assets/conf/WIN/3.31.0/DWADragonsMain.xml b/src/assets/conf/WIN/3.31.0/DWADragonsMain.xml index c8848c7..9b690f2 100644 --- a/src/assets/conf/WIN/3.31.0/DWADragonsMain.xml +++ b/src/assets/conf/WIN/3.31.0/DWADragonsMain.xml @@ -52,7 +52,7 @@ http://localhost/launch.aspx - + localhost 9933 @@ -67,13 +67,13 @@ - https://sodoff.com/DWADragonsUnity/WIN/{Version}/Mid/ - https://sodoff.com/DWADragonsUnity/WIN/{Version}/Mid/contentdata - https://sodoff.com/DWADragonsUnity/WIN/{Version}/Mid/data - https://sodoff.com/DWADragonsUnity/WIN/{Version}/Mid/scene - https://sodoff.com/DWADragonsUnity/WIN/{Version}/Mid/shareddata - https://sodoff.com/DWADragonsUnity/WIN/{Version}/Mid/sound - https://sodoff.com/DWADragonsUnity/WIN/{Version}/Mid/movies + https://media.sodoff.spirtix.com/DWADragonsUnity/WIN/{Version}/Mid/ + https://media.sodoff.spirtix.com/DWADragonsUnity/WIN/{Version}/Mid/contentdata + https://media.sodoff.spirtix.com/DWADragonsUnity/WIN/{Version}/Mid/data + https://media.sodoff.spirtix.com/DWADragonsUnity/WIN/{Version}/Mid/scene + https://media.sodoff.spirtix.com/DWADragonsUnity/WIN/{Version}/Mid/shareddata + https://media.sodoff.spirtix.com/DWADragonsUnity/WIN/{Version}/Mid/sound + https://media.sodoff.spirtix.com/DWADragonsUnity/WIN/{Version}/Mid/movies . ./contentdata