[+] Log user ID on login

pull/55/head
Clansty 2024-09-11 00:56:15 +08:00
parent 39dc6c576a
commit b7c5d18df1
No known key found for this signature in database
GPG Key ID: 3A6BE8BAF2EDE134
5 changed files with 33 additions and 0 deletions

View File

@ -302,6 +302,7 @@
<Compile Include="Performance\ImproveLoadSpeed.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Main.cs" />
<Compile Include="Utils\LogUserId.cs" />
<Compile Include="UX\CustomPlaceName.cs" />
<Compile Include="UX\CustomVersionString.cs" />
<Compile Include="UX\DemoMaster.cs" />

View File

@ -69,3 +69,7 @@ SkipVersionCheck=true
RemoveEncryption=true
ForceAsServer=true
ForceFreePlay=true
[Utils]
# Log user ID on login
LogUserId=false

View File

@ -85,3 +85,7 @@ RemoveEncryption=true
# 如果要配置店内招募的话,应该要把这个关闭
ForceAsServer=true
ForceFreePlay=true
[Utils]
# 登录时将 UserID 输出到日志
LogUserId=false

View File

@ -10,6 +10,7 @@ namespace AquaMai
public CheatConfig Cheat { get; set; }
public PerformanceConfig Performance { get; set; }
public FixConfig Fix { get; set; }
public UtilsConfig Utils { get; set; }
public class CheatConfig
{
@ -55,5 +56,10 @@ namespace AquaMai
public bool ForceAsServer { get; set; } = true;
public bool ForceFreePlay { get; set; } = true;
}
public class UtilsConfig
{
public bool LogUserId { get; set; }
}
}
}

View File

@ -0,0 +1,18 @@
using System;
using HarmonyLib;
using MelonLoader;
using Net.Packet;
using Net.Packet.Mai2;
using Net.VO.Mai2;
namespace AquaMai.Utils;
public class LogUserId
{
[HarmonyPostfix]
[HarmonyPatch(typeof(PacketGetUserPreview), MethodType.Constructor, typeof(ulong), typeof(string), typeof(Action<ulong, UserPreviewResponseVO>), typeof(Action<PacketStatus>))]
public static void Postfix(ulong userId)
{
MelonLogger.Msg($"UserLogin: {userId}");
}
}