Ejemplo n.º 1
0
        private void OnExecute()
        {
            if (!AssetLoader.FindAssetRoot(Assets))
            {
                Log.Print(LogType.Error, "AtlasReactor_Data folder not found, please specify with --assets!");
                Log.Print(LogType.Misc, "Alternatively, place Win64 or AtlasReactor_Data in this folder.");
                return;
            }

            HashResolver.Init(AssetLoader.BasePath);

            PacketProvider provider;

            if (!PacketsDir.IsNullOrEmpty())
            {
                provider = new DirectoryPacketProvider(PacketsDir);
            }
            else if (!ReplayFile.IsNullOrEmpty())
            {
                provider = new ReplayPacketProvider(ReplayFile);
            }
            else
            {
                throw new ArgumentOutOfRangeException(nameof(provider), "Neither PacketsDir or ReplayFile provided!");
            }

            var pdp = new PacketDumpProcessor(provider);

            pdp.Process();
        }
Ejemplo n.º 2
0
        private void OnExecute()
        {
            Application.Init();

            var app = new Application("EvoS.PacketInspector", GLib.ApplicationFlags.NonUnique);

            app.Register(GLib.Cancellable.Current);

            // We require data from the game assets, so ensure we have a valid data path
            if (!AssetLoader.FindAssetRoot(Settings.AtlasReactorData))
            {
                using var settingsUi = new SettingsUi();
                settingsUi.Show();
                app.AddWindow(settingsUi);
                var x = (ResponseType)settingsUi.Run();

                if (x != ResponseType.Ok)
                {
                    return;
                }
            }

            HashResolver.Init(AssetLoader.BasePath);
            Patcher.ResolveSyncListFields();
            Patcher.PatchAll();

            var win = new MainWindow();

            if (!PacketsDir.IsNullOrEmpty())
            {
                win.LoadPacketDump(PacketDumpType.PacketDirectory, PacketsDir);
            }
            else if (!ReplayFile.IsNullOrEmpty())
            {
                win.LoadPacketDump(PacketDumpType.ReplayFile, ReplayFile);
            }

            app.AddWindow(win);
            win.Show();
            Application.Run();
        }