Exemplo n.º 1
0
        private async void RunOrDownloadGame()
        {
            if (SelectedGame.IsInstall)
            {
                var rootRegistry = (DisplayRootRegistry)CommonServiceLocator.ServiceLocator.Current.GetInstance(typeof(DisplayRootRegistry));

                var fileVM = new FileSelectViewModel(SelectedGame.LocalPathRom);
                var result = await rootRegistry.ShowModalPresentation(fileVM);

                if (result == true)
                {
                    Service.EmulatorService emulator = new EmulatorService();
                    emulator.StartRom(System.IO.Path.Combine(SelectedGame.LocalPathRom, fileVM.SelectRom));
                }

                //var f_rom = System.IO.Directory.GetFiles(SelectedGame.LocalPathRom)[0];
            }
            else
            {
                downloadPath = fileDownloader.DownloadGame(SelectedGame);
                FileService serv = new FileService();

                SelectedGame.LocalPath = new GamePath()
                {
                    GameId = SelectedGame.GameId, LocalPath = System.IO.Path.GetDirectoryName(downloadPath)
                };
                serv.UpdateGame(SelectedGame);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Configure the IOC Container and get the emulator started
        /// </summary>
        protected override void Configure()
        {
            AggregateCatalog catalog = new AggregateCatalog(AssemblySource.Instance.Select(x => new AssemblyCatalog(x)).OfType <ComposablePartCatalog>());

            container = new CompositionContainer(catalog);

            var batch = new CompositionBatch();

            batch.AddExportedValue <IWindowManager>(new WindowManager());

            IEventAggregator aggregator = new EventAggregator();

            batch.AddExportedValue <IEventAggregator>(aggregator);

            EmulatorService service = new EmulatorService(aggregator);

            batch.AddExportedValue <IEmulatorService>(service);

            batch.AddExportedValue(container);

            container.Compose(batch);

            // Start the emulator
            service.StartEmulator();
        }
Exemplo n.º 3
0
        private void Init()
        {
            _emulatorService        = new EmulatorService(new StatisticsService(), new LuckCalculationService());
            chart.DataContext       = canvasModel = new();
            gridOptions.DataContext = optionsModel = new()
            {
                Repeat                 = 10,
                GuarantFiveWin         = 90,
                ChanceFiveWinPercente  = 0.6M,
                GuarantFourWin         = 10,
                ChanceFourWinPercente  = 5.1M,
                UserOptionsAttemptsMax = 100,
                UserOptionsAttemptsMin = 50,
                UserOptionsCount       = 18000,
                UserOptionsPresetMax   = 89,
                UserOptionsPresetMin   = 0,
                StopAfterGuarantUserOptionsAttemptsMax = 100,
                StopAfterGuarantUserOptionsAttemptsMin = 50,
                StopAfterGuarantUserOptionsCount       = 20000,
                StopAfterGuarantUserOptionsPresetMax   = 89,
                StopAfterGuarantUserOptionsPresetMin   = 0,
                StopAfterGuarantWithLargePresetUserOptionsAttemptsMax = 100,
                StopAfterGuarantWithLargePresetUserOptionsAttemptsMin = 50,
                StopAfterGuarantWithLargePresetUserOptionsCount       = 20000,
                StopAfterGuarantWithLargePresetUserOptionsPresetMax   = 70,
                StopAfterGuarantWithLargePresetUserOptionsPresetMin   = 50,
                StopAfterGuarantWithoutLimitUserOptionsCount          = 2000,
                StopAfterGuarantWithoutLimitUserOptionsPresetMax      = 89,
                StopAfterGuarantWithoutLimitUserOptionsPresetMin      = 0,
                StopBeforeGuarantUserOptionsAttemptsMax  = 100,
                StopBeforeGuarantUserOptionsAttemptsMin  = 50,
                StopBeforeGuarantUserOptionsCount        = 20000,
                StopBeforeGuarantUserOptionsPresetMax    = 70,
                StopBeforeGuarantUserOptionsPresetMin    = 0,
                StopBeforeGuarantUserOptionsStopIndexMax = 70,
                StopBeforeGuarantUserOptionsStopIndexMin = 50,
                ExpectationFourWinUserOptionsAttemptsMax = 100,
                ExpectationFourWinUserOptionsAttemptsMin = 50,
                ExpectationFourWinUserOptionsCount       = 20000,
                ExpectationFourWinUserOptionsPresetMax   = 89,
                ExpectationFourWinUserOptionsPresetMin   = 0,
                ExpectationFourWinUserOptionsCountMax    = 10,
                ExpectationFourWinUserOptionsCountMin    = 3
            };

            Button_Click(null, null);
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            var configuration = CreateBuilder().Build();

            var endpoints = configuration.GetSection(nameof(Endpoints)).Get <Endpoints>();
            var emulator  = new EmulatorService(endpoints);

            Task.Delay(10_000).GetAwaiter().GetResult();

            var tokenSource = new CancellationTokenSource();

            try
            {
                emulator.Emulate(tokenSource.Token);
            }
            catch (Exception e)
            {
            }

            Console.ReadKey();
            tokenSource.Cancel();
        }
Exemplo n.º 5
0
        //[TestCase(20792)]
        public void TestAdbCommand(int processId)
        {
            var process = Process.GetProcessById(processId);

            Assert.IsNotNull(process, $"Process must be running.");

            var emulatorService = new EmulatorService();

            // load emulator data to service
            emulatorService.GetTableWindowHandle(process);

            var outputs = emulatorService.ExecuteAdbCommand(process,
                                                            "shell",
                                                            "\"cat /data/data/com.ylc.qp.Pokermate/shared_prefs/Cocos2dxPrefsFile.xml\"");

            Assert.Multiple(() =>
            {
                foreach (var output in outputs)
                {
                    var result = PKLoginResponse.TryParse(output, out PKLoginResponse loginResponse);
                    Assert.IsTrue(result);
                }
            });
        }
Exemplo n.º 6
0
 public Ds4WebSocketHandler(EmulatorService emulatorService, EmulatedControllersService emulatedControllersService)
 {
     this.emulatorService            = emulatorService;
     this.emulatedControllersService = emulatedControllersService;
 }
Exemplo n.º 7
0
 public Ds4WebSocketHandler(EmulatorService emulatorService, DeviceInfoService deviceInfoService)
 {
     this.emulatorService   = emulatorService;
     this.deviceInfoService = deviceInfoService;
 }
Exemplo n.º 8
0
 public EmulatorsController(EmulatorService emulatorService)
 {
     this.emulatorService = emulatorService;
 }
Exemplo n.º 9
0
 public ListEmulatorsService(EmulatorService emulatorService)
 {
     this.emulatorService = emulatorService;
 }
Exemplo n.º 10
0
 public EmulatedControllersController(EmulatedControllersService networkDeviceInfoService, EmulatorService emulatorService)
 {
     this.emulatedControllersService = networkDeviceInfoService;
     this.emulatorService            = emulatorService;
 }
Exemplo n.º 11
0
 public MappedControllersController(MappedControllers emulatedControllers, EmulatorService emulatorService)
 {
     this.mappedControllers = emulatedControllers;
     this.emulatorService   = emulatorService;
 }
Exemplo n.º 12
0
 public XboxWebSocketHandler(EmulatorService emulatorService)
 {
     this.emulatorService = emulatorService;
 }
Exemplo n.º 13
0
 public MappedControllers(EmulatorService emulatorService)
 {
     this.emulatorService = emulatorService;
 }