コード例 #1
0
        private void MemoryModThread()
        {
            while (true)
            {
                // Shared AP mod
                if (_sharedApEnabled)
                {
                    if (!MemoryReader.CheckProcess())
                    {
                        break;
                    }
                    try
                    {
                        Dispatcher.Invoke(UpdateSharedAPState);
                    }
                    catch (Exception ex)
                    {
                        // App probably exited, silent exception
                    }

                    var writeBuffer = new byte[8];
                    for (var i = 0; i < 8; i++)
                    {
                        writeBuffer[i] = _sharedApState[i];
                    }

                    MemoryReader.WriteBytes(_offsetInBattle, writeBuffer);
                    MemoryReader.WriteBytes(_offsetGainedAp, writeBuffer);
                }

                Thread.Sleep(10);
            }
        }
コード例 #2
0
        public void ProcessChecker()
        {
            while (true)
            {
                if (!MemoryReader.CheckProcess())
                {
                    Dispatcher.Invoke((MethodInvoker) delegate
                    {
                        Close();
                    });

                    return;
                }
                Thread.Sleep(100);
            }
        }