From 513ef23736cde14c34c34f8dbf039b21a78cd19b Mon Sep 17 00:00:00 2001 From: henryz Date: Fri, 6 Dec 2024 01:01:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=B7=AF=E5=BE=84patch=EF=BC=9B=E6=B7=BB=E5=8A=A0=E5=AF=B9?= =?UTF-8?q?=E5=B1=80=E8=AE=B0=E5=BD=95=E5=86=99=E5=85=A5=E6=88=98=E6=97=97?= =?UTF-8?q?=E5=90=8D=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HsMod/Patcher.cs | 20 +++++++++++++++++++- HsMod/WebPage.cs | 9 +++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/HsMod/Patcher.cs b/HsMod/Patcher.cs index 39989c8..124f498 100644 --- a/HsMod/Patcher.cs +++ b/HsMod/Patcher.cs @@ -1738,6 +1738,8 @@ public static void PatchEndGameScreenShow(ref TAG_PLAYSTATE playState, ref Spell Utils.TryReportOpponent(); } string finalResult = "未知"; + if (GameMgr.Get().GetGameType() != PegasusShared.GameType.GT_BATTLEGROUNDS) + { switch (playState) { case TAG_PLAYSTATE.WINNING: @@ -1755,6 +1757,22 @@ public static void PatchEndGameScreenShow(ref TAG_PLAYSTATE playState, ref Spell default: break; } + } + else + { + switch (GameState.Get().GetFriendlySidePlayer().GetHero().GetRealTimePlayerLeaderboardPlace()) + { + case 1: finalResult = "第一名"; break; + case 2: finalResult = "第二名"; break; + case 3: finalResult = "第三名"; break; + case 4: finalResult = "第四名"; break; + case 5: finalResult = "第五名"; break; + case 6: finalResult = "第六名"; break; + case 7: finalResult = "第七名"; break; + case 8: finalResult = "第八名"; break; + default: break; + } + } string gameType = (GameMgr.Get().GetGameType() == PegasusShared.GameType.GT_RANKED) ? GameMgr.Get().GetFormatType().ToString() : GameMgr.Get().GetGameType().ToString(); @@ -1947,7 +1965,7 @@ public class PatchLogArchive [HarmonyTargetMethod] private static MethodInfo PublicLogArchiveLogPath() { - return AccessTools.TypeByName("Log").GetMethod("get_LogsPath"); ; + return AccessTools.TypeByName("LogSessionConfig").GetMethod("get_LogSessionDirectory"); ; } [HarmonyPostfix] diff --git a/HsMod/WebPage.cs b/HsMod/WebPage.cs index 1a214d7..6992a71 100644 --- a/HsMod/WebPage.cs +++ b/HsMod/WebPage.cs @@ -912,6 +912,15 @@ public static StringBuilder MatchLogPage() else if (lineSplit[i] == "失败") temp += $"失败"; else if (lineSplit[i] == "未知" || lineSplit[i] == "平局") temp += $"{lineSplit[i]}"; else if (int.Parse(lineSplit[i]) > 0) temp += $"+{int.Parse(lineSplit[i])}"; + else if (lineSplit[i] == "第一名") temp += $"第一名"; + else if (lineSplit[i] == "第二名") temp += $"第二名"; + else if (lineSplit[i] == "第三名") temp += $"第三名"; + else if (lineSplit[i] == "第四名") temp += $"第四名"; + else if (lineSplit[i] == "第五名") temp += $"第五名"; + else if (lineSplit[i] == "第六名") temp += $"第六名"; + else if (lineSplit[i] == "第七名") temp += $"第七名"; + else if (lineSplit[i] == "第八名") temp += $"第八名"; + else if (int.Parse(lineSplit[i]) > 0) temp += $"+{int.Parse(lineSplit[i])}"; else if (int.Parse(lineSplit[i]) < 0) temp += $"{lineSplit[i]}"; else temp += $"{lineSplit[i]}"; } From 88d0725ce4ae0a38e691da328ea71deb1c60dfbd Mon Sep 17 00:00:00 2001 From: henryz Date: Fri, 6 Dec 2024 01:11:26 +0800 Subject: [PATCH 2/2] fix --- HsMod/WebPage.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/HsMod/WebPage.cs b/HsMod/WebPage.cs index 6992a71..20beb44 100644 --- a/HsMod/WebPage.cs +++ b/HsMod/WebPage.cs @@ -911,7 +911,6 @@ public static StringBuilder MatchLogPage() if (lineSplit[i] == "胜利") temp += $"胜利"; else if (lineSplit[i] == "失败") temp += $"失败"; else if (lineSplit[i] == "未知" || lineSplit[i] == "平局") temp += $"{lineSplit[i]}"; - else if (int.Parse(lineSplit[i]) > 0) temp += $"+{int.Parse(lineSplit[i])}"; else if (lineSplit[i] == "第一名") temp += $"第一名"; else if (lineSplit[i] == "第二名") temp += $"第二名"; else if (lineSplit[i] == "第三名") temp += $"第三名"; @@ -920,7 +919,7 @@ public static StringBuilder MatchLogPage() else if (lineSplit[i] == "第六名") temp += $"第六名"; else if (lineSplit[i] == "第七名") temp += $"第七名"; else if (lineSplit[i] == "第八名") temp += $"第八名"; - else if (int.Parse(lineSplit[i]) > 0) temp += $"+{int.Parse(lineSplit[i])}"; + else if (int.Parse(lineSplit[i]) > 0) temp += $"+{int.Parse(lineSplit[i])}"; else if (int.Parse(lineSplit[i]) < 0) temp += $"{lineSplit[i]}"; else temp += $"{lineSplit[i]}"; }