Example #1
0
        private bool init()
        {
            if (_initilized)
            {
                return(true);
            }

            if (!GetProcess())
            {
                return(false);
            }

            if (_timerInj == null)
            {
                _timerInj = new TimerInjection(_dsProcess);
            }

            if (_worldFlagInj == null)
            {
                _worldFlagInj = new WorldFlagInjection(_dsProcess);
            }

            if (_splits == null)
            {
                IntPtr worldFlagPointer = _worldFlagInj.getWorldFlagBaseAddress();
                if (worldFlagPointer == IntPtr.Zero)
                {
                    return(false);
                }
                _splits = new Ds3Splits(_dsProcess, worldFlagPointer, _settings);
            }

            _initilized = true;
            return(true);
        }
Example #2
0
 private void Reset()
 {
     _dsHandle        = IntPtr.Zero;
     _dsProcess       = null;
     _loadSplitQueued = false;
     _finalSplitFlag  = false;
     _timerInj        = null;
     _worldFlagInj    = null;
     //_splits = null;
     _initilized = false;
 }
Example #3
0
 public Ds3AutoSplitter(LiveSplitState state, TreeView settings)
 {
     _dsHandle            = IntPtr.Zero;
     _dsProcess           = null;
     _splitAttemptCnt     = 0;
     _updateRateMuliplier = 0.2;
     _loadSplitQueued     = false;
     _finalSplitFlag      = false;
     _timerInj            = null;
     _worldFlagInj        = null;
     _splits                      = null;
     _settings                    = settings;
     _initilized                  = false;
     _timer                       = new TimerModel();
     _timer.CurrentState          = state;
     _timer.CurrentState.OnStart += ((sender, args) => ResetSplits());
 }