Exemplo n.º 1
0
        public void Dispose()
        {
            this.BasePointer = 0;

            this.Client.MemMgr.RemoveMemoryChange(this.MemChkGUIBase);
            this.Client.MemMgr.RemoveMemoryChange(this.MemChkPlayerObj);

            PJInfo?.Dispose();
            PJInfo = null;
        }
Exemplo n.º 2
0
        /*
         * private void LoadGUIBase(object obj)
         * {
         *  var pointer = (uint)obj;
         *
         *  if (pointer == 0 && this.GUI != null)
         *  {
         *      this.GUI?.Dispose();
         *      this.GUI = null;
         *  }
         *
         *  if (pointer > 0 && this.GUI?.BasePointer != pointer)
         *  {
         *      this.GUI?.Dispose();
         *      this.GUI = new GUIBase(this.Client, pointer);
         *  }
         * }
         */

        private void LoadPlayerObj(object obj)
        {
            var pointer = (uint)obj;

            if (pointer == 0 && this.PJInfo != null)
            {
                this.PJInfo?.Dispose();
                this.PJInfo = null;

                OnPlayerConnect?.Invoke(this, false);
            }

            if (pointer > 0 && this.PJInfo?.BasePointer != pointer)
            {
                this.PJInfo?.Dispose();
                this.PJInfo = new PlayerObj(this.Client, pointer);
                OnPlayerConnect?.Invoke(this, true);
            }
        }