Skip to content

Commit 1e5adb0

Browse files
committed
fix: 修复Shim无法匹配某版本的PacketUpsertUserAll
1 parent 5360620 commit 1e5adb0

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

AquaMai.Core/Helpers/Shim.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,26 @@ public static byte[] EncryptNetPacketBody(byte[] data)
189189
return (PacketUpsertUserAll)ctor2.Invoke(args);
190190
};
191191
}
192+
else if (type.GetConstructor(new[]
193+
{
194+
typeof(int),
195+
typeof(UserData),
196+
typeof(int),
197+
typeof(Action<int>),
198+
typeof(Action<PacketStatus>)
199+
}) is ConstructorInfo ctor3)
200+
{
201+
return (index, src, onDone, onError) =>
202+
{
203+
var maxTrackNo =
204+
src.IsEntry && !Singleton<GamePlayManager>.Instance.IsEmpty()
205+
? Singleton<GamePlayManager>.Instance.GetScoreListCount()
206+
: 0;
207+
208+
var args = new object[] { index, src, maxTrackNo, onDone, onError };
209+
return (PacketUpsertUserAll)ctor3.Invoke(args);
210+
};
211+
}
192212
else
193213
{
194214
throw new MissingMethodException("No matching PacketUpsertUserAll constructor found");

0 commit comments

Comments
 (0)