Beispiel #1
0
 internal static void OnAfterBlockingGetFromDisk(Interop.DBObj dbobj, QualifiedDataID qdid, DBOCache dbocache)
 {
     //if (dataTypesLoadedAsyncCache.Contains(qdid.Type))
     //{
     EnsureObjLoad(qdid, dbobj);
     //}
 }
Beispiel #2
0
 internal static void OnBeforeBlockingGetFromDisk(Interop.DBObj dbobj, QualifiedDataID qdid, DBOCache dbocache)
 {
     if (!Caches.CacheDictPtr.TryGetValue(dbocache.__Instance, out var dbocacheex))
     {
         return;
     }
 }
Beispiel #3
0
 internal static void OnAfterBlockingLoadInto(Interop.DBObj dbobj, QualifiedDataID qdid, DBOCache dbocache)
 {
     if (!Caches.CacheDictPtr.TryGetValue(dbocache.__Instance, out var dbocacheex))
     {
         return;
     }
 }
Beispiel #4
0
        /// <summary>
        /// Called each time after the DBObj is requested by the game engine.
        /// </summary>
        /// <param name="qdid"></param>
        /// <param name="dbobj"></param>
        internal static void OnGetFromDB(QualifiedDataID qdid, Interop.DBObj dbobj)
        {
            var ptr = dbobj.__Instance;

            if (Caches.trackedObjects.Contains(ptr))
            {
                return;
            }
            EnsureObjLoad(qdid, dbobj);
        }
Beispiel #5
0
 /// <summary>
 /// Call this method to ensure that the OnObjLoad is triggered if necessary
 /// </summary>
 private static void EnsureObjLoad(QualifiedDataID qdid, Interop.DBObj dbobj)
 {
     if (dbobj.MPMaintainer == null)
     {
         return;
     }
     if (!Caches.CacheDictPtr.TryGetValue(dbobj.MPMaintainer.__Instance, out var dbocacheex))
     {
         return;
     }
     if (Caches.trackedObjects.Contains(dbobj.__Instance))
     {
         return;
     }
     OnObjLoad(dbocacheex, qdid, dbobj);
 }
Beispiel #6
0
            /// <summary>
            /// The rewritten function that AC Client is actually using in order to retrieve the resource by DID
            /// </summary>
            /// <param name="qdid"></param>
            /// <param name="obj"></param>
            /// <returns></returns>
            public static IntPtr DBObjGet(IntPtr _qdid, IntPtr _unused)
            {
                var cache = DatIOManager._AsyncCache;

                if (cache == null)
                {
                    return(IntPtr.Zero);
                }
                var qdid = QualifiedDataID.__CreateInstance(_qdid);
                var res  = cache.BlockingGet(2, qdid);

                if (res == null)
                {
                    return(IntPtr.Zero);
                }

                DatIOManager.OnGetFromDB(qdid, res);

                return(res.__Instance);
            }
Beispiel #7
0
 internal abstract void OnBeforeBlockingLoadIntoBase(Interop.DBObj dbobj, QualifiedDataID qdid);
Beispiel #8
0
 internal static void OnBeforeBlockingLoadInto(AsyncCache asynccache, Interop.DBObj dbobj, QualifiedDataID qdid, DBOCache dbocache)
 {
     if (!Caches.CacheDictPtr.TryGetValue(dbocache.__Instance, out var dbocacheex))
     {
         return;
     }
     dbocacheex.OnBeforeBlockingLoadIntoBase(dbobj, qdid);
 }
Beispiel #9
0
 internal abstract void OnLoad(Interop.DBObj dbobj, QualifiedDataID qdid);
Beispiel #10
0
 /// <summary>
 /// Called when an object is loaded for the first time.
 /// Note that the timing of this function call may or may not be precise,
 /// determining on the methodology the game engine used to load the object.
 /// This is our best guess for when the object is loaded for the first time.
 /// </summary>
 /// <param name="qdid"></param>
 /// <param name="dbobj"></param>
 private static void OnObjLoad(DBCache cache, QualifiedDataID qdid, Interop.DBObj dbobj)
 {
     Caches.trackedObjects.Add(dbobj.__Instance);
     cache.OnLoad(dbobj, qdid);
 }