refactor(Cape): 直接修改 ProfileJson 以防止卡登录

This commit is contained in:
wyc-26
2026-01-10 11:12:09 +08:00
parent b8eab42c33
commit 8babdf990f
@@ -233,6 +233,8 @@ Retry:
Dim SkinData As JObject = GetJson(McLoginMsLoader.Output.ProfileJson)
'获取玩家的所有披风
Dim SelId As Integer? = Nothing
'获取玩家当前的披风
Dim CurId As Integer? = Nothing
RunInUiWait(
Sub()
Try
@@ -247,9 +249,12 @@ Retry:
{"Common", "普通披风"}, {"Pan", "薄煎饼披风"}, {"Founder's", "创始人披风"}, {"Copper", "铜披风"}
}
Dim SelectionControl As New List(Of IMyRadio) From {New MyRadioBox With {.Text = "无披风"}}
Dim Id As Integer = 0
For Each Cape In SkinData("capes")
Id += 1
Dim CapeName As String = Cape("alias").ToString
If CapeNames.ContainsKey(CapeName) Then CapeName = CapeNames(CapeName)
If Cape("state") = "ACTIVE" Then CurId = Id
SelectionControl.Add(New MyRadioBox With {.Text = CapeName, .Checked = (Cape("state") = "ACTIVE")})
Next
SelId = MyMsgBoxSelect(SelectionControl, "选择披风", "确定", "取消")
@@ -269,7 +274,12 @@ Retry:
Return
Else
Hint("更改披风成功!", HintType.Green)
McLoginMsLoader.Start(PageLoginMsSkin.GetLoginData(), IsForceRestart:=True) '#7894,更换披风后需更新当前选择的披风
'#7894,更换披风后需更新当前选择的披风
SkinData("capes")(SelId - 1)("state") = "ACTIVE"
If CurId IsNot Nothing Then
SkinData("capes")(CurId - 1)("state") = "INACTIVE"
End If
McLoginMsLoader.Output.ProfileJson = SkinData.ToString()
End If
Catch ex As Exception
Log(ex, "更改披风失败", LogLevel.Hint)