上传文件至 Common
This commit is contained in:
37
Common/IgnoreAnyGameInformation.cs
Normal file
37
Common/IgnoreAnyGameInformation.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using HarmonyLib;
|
||||
using MelonLoader;
|
||||
using Net.Packet;
|
||||
using Net.Packet.Mai2;
|
||||
using Net.VO;
|
||||
using Net.VO.Mai2;
|
||||
|
||||
namespace SinmaiAssist.Common
|
||||
{
|
||||
public class IgnoreAnyGameInformation
|
||||
{
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(PacketGetUserData), "SafeNullMember")]
|
||||
public static bool SafeNullMember(PacketGetUserData __instance, UserDetailResponseVO src)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (src.userData.eventWatchedDate != null && SinmaiAssist.MainConfig.Common.IgnoreAnyGameInformation)
|
||||
{
|
||||
src.userData.eventWatchedDate = "2099-12-31 23:59:59";
|
||||
}
|
||||
else if (src.userData.eventWatchedDate != null && DateTime.Parse(src.userData.eventWatchedDate) > DateTime.Now)
|
||||
{
|
||||
src.userData.eventWatchedDate = "2000-01-01 00:00:00";
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MelonLogger.Error($"Failed to patch: {e}");
|
||||
MelonLogger.Error(e.StackTrace);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user