mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-11 23:17:28 +08:00
[+] New APIs
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using HarmonyLib;
|
||||
using MAI2.Util;
|
||||
using Manager;
|
||||
using Manager.UserDatas;
|
||||
using Net.Packet;
|
||||
using Net.Packet.Mai2;
|
||||
|
||||
@@ -64,4 +67,24 @@ public static class Shim
|
||||
throw new MissingMethodException("No matching PacketUpsertUserAll constructor found");
|
||||
}
|
||||
})();
|
||||
|
||||
public static IEnumerable<UserScore>[] GetUserScoreList(UserData userData)
|
||||
{
|
||||
var tUserData = Traverse.Create(userData);
|
||||
|
||||
var tScoreList = tUserData.Property("ScoreList");
|
||||
if (tScoreList.PropertyExists())
|
||||
{
|
||||
return tScoreList.GetValue<List<UserScore>[]>();
|
||||
}
|
||||
|
||||
var tScoreDic = tUserData.Property("ScoreDic");
|
||||
if (tScoreDic.PropertyExists())
|
||||
{
|
||||
var scoreDic = tScoreDic.GetValue<Dictionary<int, UserScore>[]>();
|
||||
return scoreDic.Select(dic => dic.Values).ToArray();
|
||||
}
|
||||
|
||||
throw new MissingFieldException("No matching UserData.ScoreList/ScoreDic found");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AquaMai.Helpers;
|
||||
using AquaMai.Resources;
|
||||
using AquaMai.Utils;
|
||||
using CriAtomDebugDetail;
|
||||
using DB;
|
||||
using HarmonyLib;
|
||||
using MAI2.Util;
|
||||
@@ -16,7 +14,6 @@ using MelonLoader;
|
||||
using Monitor.Entry.Parts.Screens;
|
||||
using Net.Packet;
|
||||
using Net.Packet.Helper;
|
||||
using Net.Packet.Mai2;
|
||||
using Process;
|
||||
using Process.UserDataNet.State.UserDataULState;
|
||||
using UnityEngine;
|
||||
@@ -109,7 +106,6 @@ public class ImmediateSave
|
||||
private static void SaveDataFix(UserData userData)
|
||||
{
|
||||
UserDetail detail = userData.Detail;
|
||||
_ = userData.ScoreList;
|
||||
detail.EventWatchedDate = TimeManager.GetDateString(TimeManager.PlayBaseTime);
|
||||
userData.CalcTotalValue();
|
||||
float num = 0f;
|
||||
@@ -147,7 +143,7 @@ public class ImmediateSave
|
||||
|
||||
List<UserRate> list = new List<UserRate>();
|
||||
List<UserRate> list2 = new List<UserRate>();
|
||||
List<UserScore>[] scoreList = userData.ScoreList;
|
||||
IEnumerable<UserScore>[] scoreList = Shim.GetUserScoreList(userData);
|
||||
List<UserRate> ratingList = userData.RatingList.RatingList;
|
||||
List<UserRate> newRatingList = userData.RatingList.NewRatingList;
|
||||
int achive = RatingTableID.Rate_22.GetAchive();
|
||||
|
||||
Reference in New Issue
Block a user