Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
28602 authored and 28602 committed Jan 4, 2023
1 parent aac1b5d commit 79882a1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Tool/DeckData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public class MyPageSet
public class MyPageReceive
{
public List<MyPage> my_page_info = new List<MyPage>();
public long viewer_id = 0;
public long dmm_viewer_id = 0;
public string dmm_onetime_token;
}
public class BattleLodData
{
Expand Down
15 changes: 14 additions & 1 deletion Tool/Hook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using System.Reflection;
using Coneshell;
using Cute;
using static Elements.ViewNormalArenaResult;

namespace PCRCalculator.Hook
{
Expand All @@ -32,7 +33,19 @@ public static T CallstaticMethod<T>(Type staticType, string methodstr, object[]
return (T)result;
}
}

[HarmonyPatch(typeof(Elements.MasterUnitData.UnitData), "UnitName", MethodType.Getter)]
class HookUnitName
{
static bool Prefix(Elements.MasterUnitData.UnitData __instance, ref ObscuredString __result)
{
if (PCRSettings.unitNameDic.TryGetValue(__instance.UnitId, out string value))
{
__result = value;
return false;
}
return true;
}
}
[HarmonyPatch(typeof(Cute.PABCCELMCAJ), "LHMAODLAGNH", MethodType.Getter)]
class ChangePath
{
Expand Down
6 changes: 6 additions & 0 deletions Tool/PCRSetting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,12 @@ public static int GetOrinUnitid(int unitid)
return unitid;
}
}
/*public bool GetUnitNameBYDic(int unitid,out string value)
{
if (unitNameDic.TryGetValue(GetOrinUnitid(unitid), out value))
return true;
return false;
}*/
public string GetUnitNameByID(int unitid)
{
try
Expand Down
2 changes: 1 addition & 1 deletion Tool/PCRTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public static string GetNetworkresult(string URL, string uploadJson)
var deck = new MusicTop();
result = JsonConvert.SerializeObject(deck);
}
else if (URL.Contains("my_page/set_my_page"))
else if (URL.Contains("my_page/register_my_page"))
{
PCRSettings.Instance.OnSetMyPage(uploadJson);
var deck = new MyPageSet();
Expand Down

0 comments on commit 79882a1

Please sign in to comment.