From 94ac67743821e3082c0390f961ab6f90589184a1 Mon Sep 17 00:00:00 2001 From: awaEric233 Date: Sun, 14 Jun 2026 11:59:51 +0800 Subject: [PATCH 1/5] =?UTF-8?q?Fix:=20=E4=BF=AE=E5=A4=8D=20Microsoft=20?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=BA=8F=E5=88=97=E5=8C=96=20JSON=20?= =?UTF-8?q?=E6=97=B6=E4=BD=BF=E7=94=A8=20CamelCase=20=E5=AF=BC=E8=87=B4=20?= =?UTF-8?q?BadRequest=20=E7=9A=84=E4=B8=A5=E9=87=8D=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E5=86=8D=E6=AC=A1=E5=AE=8C=E5=96=84=E7=9A=AE=E8=82=A4?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Authentication/MicrosoftAuthentication.cs | 8 ++++++-- Skin/Fetchers/MicrosoftSkinFetcher.cs | 2 +- Skin/Fetchers/UnifiedPassSkinFetcher.cs | 15 +++++++++++++-- StarLight.Core.sln | 13 ++++++++++--- Utilities/JsonUtil.cs | 7 ++++--- 5 files changed, 34 insertions(+), 11 deletions(-) diff --git a/Authentication/MicrosoftAuthentication.cs b/Authentication/MicrosoftAuthentication.cs index 2cf28fe..1169765 100644 --- a/Authentication/MicrosoftAuthentication.cs +++ b/Authentication/MicrosoftAuthentication.cs @@ -206,8 +206,12 @@ public async ValueTask GetMicrosoftAuthInfo(GetTokenResponse t RelyingParty = "http://auth.xboxlive.com", TokenType = "JWT" }; + var options = new JsonSerializerOptions() + { + WriteIndented = true + }; - var xblLoginContentString = xboxLoginContent.Serialize(); + var xblLoginContentString = xboxLoginContent.Serialize(options); string xboxResponseString; @@ -238,7 +242,7 @@ public async ValueTask GetMicrosoftAuthInfo(GetTokenResponse t TokenType = "JWT" }; - var xstsPostData = getXstsJsonData.Serialize(); + var xstsPostData = getXstsJsonData.Serialize(options); var xstsResponse = await HttpUtil.SendHttpPostRequest("https://xsts.auth.xboxlive.com/xsts/authorize", xstsPostData, "application/json"); diff --git a/Skin/Fetchers/MicrosoftSkinFetcher.cs b/Skin/Fetchers/MicrosoftSkinFetcher.cs index f942f5a..c9d93a3 100644 --- a/Skin/Fetchers/MicrosoftSkinFetcher.cs +++ b/Skin/Fetchers/MicrosoftSkinFetcher.cs @@ -13,7 +13,7 @@ public class MicrosoftSkinFetcher /// /// 获取微软皮肤 /// - /// 皮肤图片字节信息 + /// 微软账户 /// 皮肤图片字节信息 public static async Task GetMicrosoftSkinAsync(MicrosoftAccount account) { diff --git a/Skin/Fetchers/UnifiedPassSkinFetcher.cs b/Skin/Fetchers/UnifiedPassSkinFetcher.cs index 11c7e7b..1a0b0ca 100644 --- a/Skin/Fetchers/UnifiedPassSkinFetcher.cs +++ b/Skin/Fetchers/UnifiedPassSkinFetcher.cs @@ -1,4 +1,5 @@ using System.Text; +using StarLight_Core.Models.Authentication; using StarLight_Core.Models.Skin; using StarLight_Core.Utilities; @@ -12,9 +13,19 @@ public class UnifiedPassSkinFetcher /// /// 获取统一通行证皮肤 /// - /// 微软账户 Uuid + /// 统一通行证账户 /// 皮肤图片字节信息 - public static async Task GetMicrosoftUnifiedPassSkinAsync(string uuid) + public static async Task GetUnifiedPassSkinAsync(UnifiedPassAccount account) + { + return await GetUnifiedPassSkinAsync(account.Uuid); + } + + /// + /// 获取统一通行证皮肤 + /// + /// 统一通行证账户 Uuid + /// 皮肤图片字节信息 + public static async Task GetUnifiedPassSkinAsync(string uuid) { const string baseUrl = "https://auth.mc-user.com:233/sessionserver/session/minecraft/profile/"; var skinJson = await HttpUtil.GetStringAsync(baseUrl + uuid); diff --git a/StarLight.Core.sln b/StarLight.Core.sln index 60cccd6..121c69c 100644 --- a/StarLight.Core.sln +++ b/StarLight.Core.sln @@ -1,9 +1,12 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.7.34202.233 + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 18 +VisualStudioVersion = 18.6.11819.183 stable MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StarLight.Core", "StarLight.Core.csproj", "{31804C47-220A-4EBA-85E4-041D2153D853}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLDemo", "C:\Users\Xu Zimu\source\repos\SLDemo\SLDemo.csproj", "{67E6FCF2-CCB2-A954-A20E-83AAAE59259F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -14,6 +17,10 @@ Global {31804C47-220A-4EBA-85E4-041D2153D853}.Debug|Any CPU.Build.0 = Debug|Any CPU {31804C47-220A-4EBA-85E4-041D2153D853}.Release|Any CPU.ActiveCfg = Release|Any CPU {31804C47-220A-4EBA-85E4-041D2153D853}.Release|Any CPU.Build.0 = Release|Any CPU + {67E6FCF2-CCB2-A954-A20E-83AAAE59259F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {67E6FCF2-CCB2-A954-A20E-83AAAE59259F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {67E6FCF2-CCB2-A954-A20E-83AAAE59259F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {67E6FCF2-CCB2-A954-A20E-83AAAE59259F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Utilities/JsonUtil.cs b/Utilities/JsonUtil.cs index 91bbdd4..6f6f637 100644 --- a/Utilities/JsonUtil.cs +++ b/Utilities/JsonUtil.cs @@ -79,11 +79,12 @@ public static class JsonUtil /// 将对象序列化为 JSON 字符串 /// /// 要序列化的对象 + /// 可选的序列化选项 /// 表示对象的 JSON 字符串;若 为 null,则返回字符串 "null" /// 为 null 时抛出 - public static string Serialize(this object? obj) + public static string Serialize(this object? obj, JsonSerializerOptions? options = null) { - return obj is null ? throw new ArgumentNullException(nameof(obj)) : JsonSerializer.Serialize(obj, Options); + return obj is null ? throw new ArgumentNullException(nameof(obj)) : JsonSerializer.Serialize(obj, options ?? Options); } /// @@ -95,7 +96,7 @@ public static string Serialize(this object? obj) /// /// JSON 字符串格式无效时抛出 public static JsonNode? ToJsonNode(this string json) => JsonNode.Parse(json); - + /// /// 将 JSON 字符串解析为 对象 /// From 4d3a746f77c0ad22e09cd6959c74e8db3fd7e5b7 Mon Sep 17 00:00:00 2001 From: awaEric233 Date: Sun, 14 Jun 2026 12:14:04 +0800 Subject: [PATCH 2/5] =?UTF-8?q?Fix:=20=E6=9C=AA=E5=8D=B8=E8=BD=BD=20awaEri?= =?UTF-8?q?c233=20=E7=9A=84=E6=B5=8B=E8=AF=95=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- StarLight.Core.sln | 2 -- 1 file changed, 2 deletions(-) diff --git a/StarLight.Core.sln b/StarLight.Core.sln index 121c69c..d868b5f 100644 --- a/StarLight.Core.sln +++ b/StarLight.Core.sln @@ -5,8 +5,6 @@ VisualStudioVersion = 18.6.11819.183 stable MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StarLight.Core", "StarLight.Core.csproj", "{31804C47-220A-4EBA-85E4-041D2153D853}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLDemo", "C:\Users\Xu Zimu\source\repos\SLDemo\SLDemo.csproj", "{67E6FCF2-CCB2-A954-A20E-83AAAE59259F}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU From f7a0e5d81dddafee5e1f403497a45a30a580a37e Mon Sep 17 00:00:00 2001 From: awaEric233 Date: Sun, 14 Jun 2026 12:15:32 +0800 Subject: [PATCH 3/5] =?UTF-8?q?Fix:=20=E4=BF=AE=E5=A4=8D=20SLN=20=E4=B8=AD?= =?UTF-8?q?=20VS=20=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- StarLight.Core.sln | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/StarLight.Core.sln b/StarLight.Core.sln index d868b5f..69a2e58 100644 --- a/StarLight.Core.sln +++ b/StarLight.Core.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 18 -VisualStudioVersion = 18.6.11819.183 stable +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34202.233 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StarLight.Core", "StarLight.Core.csproj", "{31804C47-220A-4EBA-85E4-041D2153D853}" EndProject From 6326a0826691a48b7fe33cb51f12895de0460925 Mon Sep 17 00:00:00 2001 From: awaEric233 Date: Sun, 14 Jun 2026 12:16:46 +0800 Subject: [PATCH 4/5] =?UTF-8?q?Fix:=20=E9=A1=B9=E7=9B=AE=E6=B2=A1=E5=88=A0?= =?UTF-8?q?=E5=AE=8C=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- StarLight.Core.sln | 4 ---- 1 file changed, 4 deletions(-) diff --git a/StarLight.Core.sln b/StarLight.Core.sln index 69a2e58..18fcec9 100644 --- a/StarLight.Core.sln +++ b/StarLight.Core.sln @@ -15,10 +15,6 @@ Global {31804C47-220A-4EBA-85E4-041D2153D853}.Debug|Any CPU.Build.0 = Debug|Any CPU {31804C47-220A-4EBA-85E4-041D2153D853}.Release|Any CPU.ActiveCfg = Release|Any CPU {31804C47-220A-4EBA-85E4-041D2153D853}.Release|Any CPU.Build.0 = Release|Any CPU - {67E6FCF2-CCB2-A954-A20E-83AAAE59259F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {67E6FCF2-CCB2-A954-A20E-83AAAE59259F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {67E6FCF2-CCB2-A954-A20E-83AAAE59259F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {67E6FCF2-CCB2-A954-A20E-83AAAE59259F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From c38a334e79e556a9f3321a0cfd801196a4af07d2 Mon Sep 17 00:00:00 2001 From: awaEric233 Date: Sun, 14 Jun 2026 16:46:56 +0800 Subject: [PATCH 5/5] =?UTF-8?q?Fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E7=9A=84=20SkinProcessor=20=E4=B8=AD=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E7=9A=84=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Skin/SkinProcessor.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Skin/SkinProcessor.cs b/Skin/SkinProcessor.cs index c89b253..20f6393 100644 --- a/Skin/SkinProcessor.cs +++ b/Skin/SkinProcessor.cs @@ -30,7 +30,7 @@ public static void ResizeImage(string inputFilePath, string outputFilePath, int /// /// /// - public static void GetLiftLeg(string base64Image, string outputFilePath, bool isDecoration = false) + public static void GetLeftLeg(string base64Image, string outputFilePath, bool isDecoration = false) { var imageBytes = Convert.FromBase64String(base64Image); @@ -126,7 +126,7 @@ public static void GetRightLeg(string base64Image, string outputFilePath, bool i /// /// /// - public static void GetLiftArm_Alex(string base64Image, string outputFilePath, bool isDecoration = false) + public static void GetLeftArm_Alex(string base64Image, string outputFilePath, bool isDecoration = false) { var imageBytes = Convert.FromBase64String(base64Image); @@ -222,7 +222,7 @@ public static void GetRightArm_Alex(string base64Image, string outputFilePath, b /// /// /// - public static void GetLiftArm_Steve(string base64Image, string outputFilePath, bool isDecoration = false) + public static void GetLeftArm_Steve(string base64Image, string outputFilePath, bool isDecoration = false) { var imageBytes = Convert.FromBase64String(base64Image);