|
12345678910111213141516171819202122232425262728 |
- using System.Reflection;
- using HarmonyLib;
- using User.Server;
-
- namespace CLre.API.Characters
- {
- [HarmonyPatch]
- class AccountUtility_GetUserFlags_Patch
- {
- internal static bool superuser = false;
-
- private static UserFlags superFlags = UserFlags.userlogged | UserFlags.BucketB | UserFlags.BucketA |
- UserFlags.NoDrop | UserFlags.GiveInv | UserFlags.Dev | UserFlags.None;
-
- [HarmonyPrefix]
- public static bool BeforeMethodCall(ref UserFlags __result)
- {
- if (superuser) __result = superFlags;
- return !superuser;
- }
-
- [HarmonyTargetMethod]
- public static MethodBase Target()
- {
- return AccessTools.Method("Game.Utilities.Account.AccountUtility:GetUserFlags");
- }
- }
- }
|