Пример #1
0
        public Controller(StagUser stagUser, ScheduleView scheduleView, MainWindow mainWindow)
        {
            Config = new Config();

            this.Client          = new Client(Debug, stagUser);
            this.StudentService  = new StudentService(Debug, Client);
            this.ScheduleService = new ScheduleService(Debug, Client);
            this.TeacherService  = new TeacherService(Debug, Client);

            this.AllServices = new AllServices(StudentService, TeacherService, ScheduleService);

            this.ComonScheduleActionManager  = new ComonScheduleActionManager(Debug, AllServices);
            this.FillerScheduleActionManager = new FillerScheduleActionManager(Debug, AllServices);

            if (Config.LoadedStagUser != null)
            {
                Debug.AddMessage <object>(new Message <object>("Automatically logged in,(using stored user).", MessageTypeEnum.Indifferent));
                Client.StagUser = Config.LoadedStagUser;
            }
            else if (stagUser == null)
            {
                Debug.AddMessage <object>(new Message <object>("Not logged in (yet) => using guest account", MessageTypeEnum.Indifferent));
            }


            this.ScheduleView = scheduleView;
            //InitCustmViews(mainWindow);
            SubscribeEvents();
        }
Пример #2
0
        public void FetchProcess(string name = "game")
        {
            int.TryParse(name.Split('_').Last(), out var pId);
            if (pId == 0)
            {
                if (Process.GetProcessesByName(name).Length > 0)
                {
                    _process = Process.GetProcessesByName(name).First() ??
                               throw new Exception("No process found with name: [" + name + "].");
                }
                else
                {
                    _debug.AddMessage <object>(new Message <object>(
                                                   "[" + GetType().Name + "] Process: " + "name: [" + name + "]" + " not found.",
                                                   MessageTypeEnum.Exception));
                    // MessageBox.Show("No process named [" + name + "] found."); // Annoying
                }

                if (IsProcessFetched())
                {
                    OnProcessFound?.Invoke(this, EventArgs.Empty);
                    WatchProcessState();
                    _debug.AddMessage <object>(new Message <object>(
                                                   "[" + GetType().Name + "] Process: " + "name: [" + name + "]" + " id: [" + Process.Id +
                                                   "] fetched.", MessageTypeEnum.Event));
                }
                else
                {
                    OnNoProcessFound?.Invoke(this, EventArgs.Empty);
                    _debug.AddMessage <object>(new Message <object>(
                                                   "[" + GetType().Name + "] Process: " + "name: [" + name + "]" + " NOT fetched.",
                                                   MessageTypeEnum.Event));
                }
            }
            else
            {
                _process = Process.GetProcessById(pId);
                if (IsProcessFetched())
                {
                    OnProcessFound?.Invoke(this, EventArgs.Empty);
                    WatchProcessState();
                    _debug.AddMessage <object>(new Message <object>(
                                                   "[" + GetType().Name + "] Process: " + "name: [" + Process.ProcessName + "]" + " id: [" + Process.Id +
                                                   "] fetched.", MessageTypeEnum.Event));
                }
                else
                {
                    OnNoProcessFound?.Invoke(this, EventArgs.Empty);
                    _debug.AddMessage <object>(new Message <object>(
                                                   "[" + GetType().Name + "] Process: " + "id: [" + pId + "]" + " NOT fetched.",
                                                   MessageTypeEnum.Event));
                }
            }
        }
Пример #3
0
        private void RPMButton_OnClick(object sender, RoutedEventArgs e)
        {
            //_core._controller.GameOverlayPlugin.StartDemo(_core._controller.GameProcess.Process, Application.Current.Dispatcher);

            //debug.AddMessage<object>(new Message<object>(
            //    //"AdressValue: " + _core._controller.ProcessMethods.RPM<int>(new IntPtr(0x0F6532D0)) +""
            //    "AdressValue: " + _core._controller.ProcessMethods.Rpm<int>(new IntPtr(Convert.ToUInt32(AdressTextBox.Text, 16))) + ""
            //    ));
            //int address = Convert.ToInt32(AdressTextBox.Text,16);
            _debug.AddMessage <object>(new Message <object>(
                                           (_core.Controller.PluginService.Plugins.FirstOrDefault()?.UpdatableTypes.FirstOrDefault() as
                                            UpdatableType <Player>)?.Type.ToString()));
            (_core.Controller.PluginService.Plugins.First().UpdatableTypes.First() as UpdatableType <Player>)?.SetValue(
                "Hp", new Numeric <int>(460, true).EngineValue);
            new Task(() =>
            {
                // Terraria cheatsheetTest: base: "THREADSTACK0"-00000FB8 + 0x54 + 0x24 + 0xEC + F0 + 388
                while (false)
                {
                    Thread.Sleep(22);
                    var i = _core.Controller.ProcessMethods.Rpm <int>(
                        _core.Controller.PluginService.Plugins.First().ModuleBaseAddr,
                        new List <IntPtr>()
                    {
                        new IntPtr(0x25A8B0), new IntPtr(0x30), new IntPtr(0x18), new IntPtr(0x20), new IntPtr(0x38)
                    }, out var intPtr);
                    // <- rpgmaker_vx_ace 4:1.
                    //  debug.AddMessage<object>(new Message<object>(
                    //      "AdressValue: engine[" + new Numeric<int>(i).EngineValue + "] actual[" + new Numeric<int>(i).ActualValue + "]"
                    _debug.AddMessage <object>(
                        new Message <object>(i + "bs" + _core.Controller.PluginService.Plugins.First().ModuleBaseAddr));
                    //  ));
                    // if (i != 0) _core._controller.ProcessMethods.Wpm<int>(
                    //      _core._controller.VxAceModule.RgssBase, new Numeric<int>(250, true).EngineValue
                    //      , new List<IntPtr>() { new IntPtr(0x25A8B0), new IntPtr(0x30), new IntPtr(0x18), new IntPtr(0x20), new IntPtr(0x38) });}}
                }
            }).Start();
        }