Skip to content

Commit

Permalink
7.1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Pik-4 committed Dec 7, 2024
1 parent 4db0d6d commit d195f24
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 46 deletions.
1 change: 1 addition & 0 deletions HsMod/Main.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using BepInEx;
using System;
using System.Diagnostics;
using System.Linq;
using UnityEngine;
using static HsMod.PluginConfig;
Expand Down
83 changes: 46 additions & 37 deletions HsMod/Patcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
Expand Down Expand Up @@ -1738,41 +1739,41 @@ public static void PatchEndGameScreenShow(ref TAG_PLAYSTATE playState, ref Spell
Utils.TryReportOpponent();
}
string finalResult = "未知";
if (GameMgr.Get().GetGameType() != PegasusShared.GameType.GT_BATTLEGROUNDS)
{
switch (playState)
if (GameMgr.Get().GetGameType() != PegasusShared.GameType.GT_BATTLEGROUNDS)
{
case TAG_PLAYSTATE.WINNING:
case TAG_PLAYSTATE.WON:
finalResult = "胜利";
break;
case TAG_PLAYSTATE.CONCEDED:
case TAG_PLAYSTATE.LOST:
case TAG_PLAYSTATE.LOSING:
finalResult = "失败";
break;
case TAG_PLAYSTATE.TIED:
finalResult = "平局";
break;
default:
break;
switch (playState)
{
case TAG_PLAYSTATE.WINNING:
case TAG_PLAYSTATE.WON:
finalResult = "胜利";
break;
case TAG_PLAYSTATE.CONCEDED:
case TAG_PLAYSTATE.LOST:
case TAG_PLAYSTATE.LOSING:
finalResult = "失败";
break;
case TAG_PLAYSTATE.TIED:
finalResult = "平局";
break;
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;
}
}
}
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();

Expand All @@ -1786,10 +1787,10 @@ public static void PatchEndGameScreenShow(ref TAG_PLAYSTATE playState, ref Spell
gameRank = (gameRank == "传说") ? "传说" + currentMedal.legendIndex.ToString() : (currentMedal.earnedStars > 0 ? gameRank + "-" + currentMedal.earnedStars.ToString() : "-");
}
}
else if (GameMgr.Get().GetGameType() == PegasusShared.GameType.GT_BATTLEGROUNDS)
{
else if (GameMgr.Get().GetGameType() == PegasusShared.GameType.GT_BATTLEGROUNDS)
{
gameRank = BaconLobbyMgr.Get()?.GetBattlegroundsActiveGameModeRating().ToString();
}
}
finalResult = $"{String.Join("<br />", DateTime.Now.ToString().Split(' '))},{finalResult},{gameRank},{gameType},{Utils.CacheLastOpponentFullName},";
finalResult += $"High:{Utils.CacheLastOpponentAccountID.High}+Low:{Utils.CacheLastOpponentAccountID.Low}";
if (isAutoReportEnable.Value)
Expand All @@ -1811,7 +1812,15 @@ public static void PatchEndGameScreenShow(ref TAG_PLAYSTATE playState, ref Spell
if (autoQuitTimer.Value > 0 && ConfigValue.Get().RunningTime >= autoQuitTimer.Value)
{
Utils.MyLogger(BepInEx.Logging.LogLevel.Warning, "定时重启!即将退出游戏...");
Application.Quit();
try
{
Application.Quit();
}
finally
{
System.Threading.Thread.Sleep(11451);
Process.GetCurrentProcess().Kill();
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion HsMod/PluginInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ internal class PluginInfo
public const string PLUGIN_GUID = "HsMod";
public const string PLUGIN_NAME = "HsMod";
public const string PLUGIN_AUTHOR = "Pik_4";
public const string PLUGIN_VERSION = "7.1.0.0";
public const string PLUGIN_VERSION = "7.1.1.0";
}
}
16 changes: 8 additions & 8 deletions HsMod/WebPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -911,14 +911,14 @@ public static StringBuilder MatchLogPage()
if (lineSplit[i] == "胜利") temp += $"<td style=\"color:#01FF70\">胜利</td>";
else if (lineSplit[i] == "失败") temp += $"<td style=\"color:#FF4136\">失败</td>";
else if (lineSplit[i] == "未知" || lineSplit[i] == "平局") temp += $"<td>{lineSplit[i]}</td>";
else if (lineSplit[i] == "第一名") temp += $"<td style=\"color:#01FF70\">第一名</td>";
else if (lineSplit[i] == "第二名") temp += $"<td style=\"color:#01FF70\">第二名</td>";
else if (lineSplit[i] == "第三名") temp += $"<td style=\"color:#01FF70\">第三名</td>";
else if (lineSplit[i] == "第四名") temp += $"<td style=\"color:#01FF70\">第四名</td>";
else if (lineSplit[i] == "第五名") temp += $"<td style=\"color:#FF4136\">第五名</td>";
else if (lineSplit[i] == "第六名") temp += $"<td style=\"color:#FF4136\">第六名</td>";
else if (lineSplit[i] == "第七名") temp += $"<td style=\"color:#FF4136\">第七名</td>";
else if (lineSplit[i] == "第八名") temp += $"<td style=\"color:#FF4136\">第八名</td>";
else if (lineSplit[i] == "第一名") temp += $"<td style=\"color:#01FF70\">第一名</td>";
else if (lineSplit[i] == "第二名") temp += $"<td style=\"color:#01FF70\">第二名</td>";
else if (lineSplit[i] == "第三名") temp += $"<td style=\"color:#01FF70\">第三名</td>";
else if (lineSplit[i] == "第四名") temp += $"<td style=\"color:#01FF70\">第四名</td>";
else if (lineSplit[i] == "第五名") temp += $"<td style=\"color:#FF4136\">第五名</td>";
else if (lineSplit[i] == "第六名") temp += $"<td style=\"color:#FF4136\">第六名</td>";
else if (lineSplit[i] == "第七名") temp += $"<td style=\"color:#FF4136\">第七名</td>";
else if (lineSplit[i] == "第八名") temp += $"<td style=\"color:#FF4136\">第八名</td>";
else if (int.Parse(lineSplit[i]) > 0) temp += $"<td style=\"color:#01FF70\">+{int.Parse(lineSplit[i])}</td>";
else if (int.Parse(lineSplit[i]) < 0) temp += $"<td style=\"color:#FF4136\">{lineSplit[i]}</td>";
else temp += $"<td>{lineSplit[i]}</td>";
Expand Down

0 comments on commit d195f24

Please sign in to comment.