示例#1
0
 internal static IntPtr GetPtrForGuid(ulong parGuid)
 {
     if (GetPtrForGuidFunction == null)
     {
         GetPtrForGuidFunction = Memory.Reader.RegisterDelegate <ClntObjMgrObjectPtr>(funcs.GetPtrForGuid);
     }
     return(GetPtrForGuidFunction(parGuid));
 }
 /// <summary>
 /// Initialise Object Manager
 /// </summary>
 internal static void Init()
 {
     if (Prepared)
     {
         return;
     }
     _callback       = Callback;
     getPtrForGuid   = Memory.Reader.RegisterDelegate <ClntObjMgrObjectPtr>(new IntPtr((uint)Offsets.Functions.GetPtrForGuid));
     getActivePlayer = Memory.Reader.RegisterDelegate <ClntObjMgrGetActivePlayer>(new IntPtr((uint)Offsets.Functions.ClntObjMgrGetActivePlayer));
     ourCallback     = Marshal.GetFunctionPointerForDelegate(_callback);
     Prepared        = false;
 }
示例#3
0
        internal static IntPtr GetPtrForGuid(ulong parGuid)
        {
            if (!ObjectManager.Instance.IsIngame)
            {
                return(IntPtr.Zero);
            }
            if (GetPtrForGuidFunction == null)
            {
                GetPtrForGuidFunction = Memory.Reader.RegisterDelegate <ClntObjMgrObjectPtr>(funcs.GetPtrForGuid);
            }

            return(MainThread.Instance.Invoke(() => GetPtrForGuidFunction(parGuid)));
        }