Beispiel #1
0
        public MemoryHelper()
        {
            if (MemoryHelperState.InFramelock || BotMain.IsRunning)
                return;

            _frameLockRelease = ZetaDia.Memory.ReleaseFrame();
            MemoryHelperState.MemoryHelperLevel++;

            if (ZetaDia.Service.IsInGame)
            {
                if (!MemoryHelperState.UpdatedActorsThisFrame)
                {
                    ZetaDia.Actors.Update();
                    MemoryHelperState.LastUpdatedActorsFrame = MemoryHelperState.CurrentFrame;
                }

                _externalReadCache = ZetaDia.Memory.SaveCacheState();
                ZetaDia.Memory.TemporaryCacheState(false);
            }
        }
Beispiel #2
0
        public MemoryHelper()
        {
            if (MemoryHelperState.InFramelock || BotMain.IsRunning)
            {
                return;
            }

            _frameLockRelease = ZetaDia.Memory.ReleaseFrame();
            MemoryHelperState.MemoryHelperLevel++;

            if (ZetaDia.Service.IsInGame)
            {
                if (!MemoryHelperState.UpdatedActorsThisFrame)
                {
                    ZetaDia.Actors.Update();
                    MemoryHelperState.LastUpdatedActorsFrame = MemoryHelperState.CurrentFrame;
                }

                _externalReadCache = ZetaDia.Memory.SaveCacheState();
                ZetaDia.Memory.TemporaryCacheState(false);
            }
        }
Beispiel #3
0
        protected virtual void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing)
            {
                try
                {
                    if (_frameLockRelease != null)
                    {
                        _frameLockRelease.Dispose();
                    }
                }
                catch (Exception ex)
                {
                }

                try
                {
                    if (_externalReadCache != null)
                    {
                        _externalReadCache.Dispose();
                    }
                }
                catch (Exception ex)
                {
                }
            }

            _externalReadCache = null;
            _frameLockRelease  = null;

            _disposed = true;
        }
Beispiel #4
0
        protected virtual void Dispose(bool disposing)
        {
            if (_disposed)
                return;

            if (disposing)
            {
                try
                {
                    if (_frameLockRelease != null)
                        _frameLockRelease.Dispose();
                }
                catch (Exception ex)
                {
                }

                try
                {
                    if (_externalReadCache != null)
                        _externalReadCache.Dispose();
                }
                catch (Exception ex)
                {
                }
            }

            _externalReadCache = null;
            _frameLockRelease = null;

            _disposed = true;
        }