Unofficial CardLife revival project, pronounced like "celery"
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
828B

  1. using System.Reflection;
  2. using HarmonyLib;
  3. using User.Server;
  4. namespace CLre.API.Characters
  5. {
  6. [HarmonyPatch]
  7. class AccountUtility_GetUserFlags_Patch
  8. {
  9. internal static bool superuser = false;
  10. private static UserFlags superFlags = UserFlags.userlogged | UserFlags.BucketB | UserFlags.BucketA |
  11. UserFlags.NoDrop | UserFlags.GiveInv | UserFlags.Dev | UserFlags.None;
  12. [HarmonyPrefix]
  13. public static bool BeforeMethodCall(ref UserFlags __result)
  14. {
  15. if (superuser) __result = superFlags;
  16. return !superuser;
  17. }
  18. [HarmonyTargetMethod]
  19. public static MethodBase Target()
  20. {
  21. return AccessTools.Method("Game.Utilities.Account.AccountUtility:GetUserFlags");
  22. }
  23. }
  24. }