Exemple #1
0
        public OriComponent(LiveSplitState state)
        {
            try {
                mem      = new OriMemory();
                settings = new OriSettings(this);
                mem.AddLogItems(keys);
                mapDisplay = new LayoutComponent("LiveSplit.OriDE.dll", new OriMapDisplayComponent(mem));
                foreach (string key in keys)
                {
                    currentValues[key] = "";
                }

                if (state != null)
                {
                    Model = new TimerModel()
                    {
                        CurrentState = state
                    };
                    state.OnReset     += OnReset;
                    state.OnPause     += OnPause;
                    state.OnResume    += OnResume;
                    state.OnStart     += OnStart;
                    state.OnSplit     += OnSplit;
                    state.OnUndoSplit += OnUndoSplit;
                    state.OnSkipSplit += OnSkipSplit;
                }
            } catch (Exception ex) {
                Console.WriteLine(ex.ToString());
            }
        }
Exemple #2
0
        public OriManager()
        {
            this.DoubleBuffered = true;
            InitializeComponent();
            Memory = new OriMemory();
            Thread t = new Thread(UpdateLoop);

            t.IsBackground = true;
            t.Start();
        }
Exemple #3
0
        public OriManager()
        {
            this.DoubleBuffered = true;
            kbHook = new KeyboardHook(KeyboardHook.Parameters.PassAllKeysToNextApp);
            kbHook.KeyIntercepted += KeyhookPress;
            InitializeComponent();
            Memory = new OriMemory();
            Thread t = new Thread(UpdateLoop);

            t.IsBackground = true;
            t.Start();
        }
Exemple #4
0
 public OriComponent()
 {
     try {
         mem      = new OriMemory();
         settings = new OriSettings(this);
         mem.AddLogItems(keys);
         mapDisplay = new LayoutComponent("LiveSplit.OriDE.dll", new OriMapDisplayComponent(mem));
         foreach (string key in keys)
         {
             currentValues[key] = "";
         }
     } catch (Exception ex) {
         Console.WriteLine(ex.ToString());
     }
 }
        public OriHitboxDisplay(OriState state) {
            try {
                InitializeComponent();
                reader = state.oriMemory;
                OriInfo.Visibility = Visibility.Visible;

                Thread worker = new Thread(UpdateUI);
                worker.IsBackground = true;
                worker.Name = "UI Worker";
                worker.Start();
            } catch (Exception e) {
                System.Windows.MessageBox.Show("Error loading program: " + e.ToString());
                Close();
            }
        }
Exemple #6
0
        public OriHitboxDisplay(OriState state)
        {
            try {
                InitializeComponent();
                reader             = state.oriMemory;
                OriInfo.Visibility = Visibility.Visible;

                Thread worker = new Thread(UpdateUI);
                worker.IsBackground = true;
                worker.Name         = "UI Worker";
                worker.Start();
            } catch (Exception e) {
                System.Windows.MessageBox.Show("Error loading program: " + e.ToString());
                Close();
            }
        }
Exemple #7
0
 public OriComponent()
 {
     try {
         textInfo = new InfoTextComponent("0%", "Swamp 0.00%");
         textInfo.LongestString = "Valley Of The Wind - 100.00%";
         mem      = new OriMemory();
         settings = new OriSettings(this);
         mem.AddLogItems(keys);
         foreach (string key in keys)
         {
             currentValues[key] = "";
         }
     } catch (Exception ex) {
         Console.WriteLine(ex.ToString());
     }
 }
Exemple #8
0
        public void Loop()
        {
            try {
                bool isNowOpen = (oriMemory.HookProcess() && !oriMemory.proc.HasExited);

                if (isNowOpen != isOpen)
                {
                    if (!isNowOpen)
                    {
                        inGame = false;
                        LogWriter.WriteLine("ori.exe is unavailable.");
                    }
                    else
                    {
                        LogWriter.WriteLine("ori.exe is available.");
                    }
                    isOpen = isNowOpen;
                }

                if (isOpen)
                {
                    Pulse();
                }
            } catch (Exception e) {
                if (this.exceptionsCaught < 10 && this.totalExceptionsCaught < 30)
                {
                    this.exceptionsCaught++;
                    this.totalExceptionsCaught++;
                    LogWriter.WriteLine("Exception #{0}: {1}", this.exceptionsCaught, e.ToString());
                }
                else if (this.totalExceptionsCaught < 30)
                {
                    LogWriter.WriteLine("Too many exceptions, rebooting autosplitter.");
                    this.oriMemory.Dispose();
                    this.oriMemory        = new OriMemory();
                    this.exceptionsCaught = 0;
                }
                else if (this.totalExceptionsCaught == 30)
                {
                    LogWriter.WriteLine("Too many total exceptions, no longer logging them.");
                    this.totalExceptionsCaught++;
                }
            }
        }
 public OriMapDisplayComponent(OriMemory memory)
 {
     textInfo = new InfoTextComponent("0%", "Swamp 0.00%");
     textInfo.LongestString = "Valley Of The Wind - 100.00%";
     this.memory            = memory;
 }
        public void Loop() {
            try {
                bool isNowOpen = (oriMemory.HookProcess() && !oriMemory.proc.HasExited);

                if (isNowOpen != isOpen) {
                    if (!isNowOpen) {
                        inGame = false;
                        LogWriter.WriteLine("ori.exe is unavailable.");
                    } else {
                        LogWriter.WriteLine("ori.exe is available.");
                    }
                    isOpen = isNowOpen;
                }

                if (isOpen) Pulse();
            } catch (Exception e) {
                if (this.exceptionsCaught < 10 && this.totalExceptionsCaught < 30) {
                    this.exceptionsCaught++;
                    this.totalExceptionsCaught++;
                    LogWriter.WriteLine("Exception #{0}: {1}", this.exceptionsCaught, e.ToString());
                } else if (this.totalExceptionsCaught < 30) {
                    LogWriter.WriteLine("Too many exceptions, rebooting autosplitter.");
                    this.oriMemory.Dispose();
                    this.oriMemory = new OriMemory();
                    this.exceptionsCaught = 0;
                } else if (this.totalExceptionsCaught == 30) {
                    LogWriter.WriteLine("Too many total exceptions, no longer logging them.");
                    this.totalExceptionsCaught++;
                }
            }
        }
 public OriState() {
     oriMemory = new OriMemory();
     oriTriggers = new OriTriggers();
 }
Exemple #12
0
 public OriState()
 {
     oriMemory   = new OriMemory();
     oriTriggers = new OriTriggers();
 }