/// <summary> /// SYMCALL方式设置玩家OP等级 /// </summary> /// <param name="api"></param> /// <param name="player">ServerPlayer指针</param> /// <param name="per">等级</param> public static void setPermission(MCCSAPI api, IntPtr player, byte per) { Console.WriteLine("[CS] setPlayer OP level to {0}", per); IntPtr org = api.dlsym((int)THook.RVAs[api.VERSION][2]); // IDA ServerPlayer::setPermissions SETPERMISSION_FUNC func = (SETPERMISSION_FUNC)Marshal.GetDelegateForFunctionPointer(org, typeof(SETPERMISSION_FUNC)); func(player, per); }
public static void tp(MCCSAPI api, int funcaddr, IntPtr pl, Vec3 pos, int dimid) { var functpr = api.dlsym(funcaddr); var _tp = (TP)Marshal.GetDelegateForFunctionPointer(functpr, typeof(TP)); _tp(pl, pos, 0, dimid, 0, 0, 0, new CsPlayer(api, pl).UniqueId); /*?teleport@TeleportCommand@@SAXAEAVActor@@VVec3@@PEAV3@V?$AutomaticID@VDimension@@H@@VRelativeFloat@@4HAEBUActorUniqueID@@@Z*/ }