public Process BungeeifyInstance(BCArgsObject baobj, string basePath)
        {
            var json = JsonConvert.SerializeObject(baobj).Replace("\"", "\\\"");
            var cmd  = ("cd " + basePath).CombineCommand($"mono {MainForm.BungeeCordHandlerExeName} " + json.Quotate());

            Console.WriteLine(cmd);
            return(PuttyOpener.OpenPutty(cmd));
        }
        public void Next()
        {
            if (OrderIndex == Order.Length - 1) // we're done here
            {
                var argsobj = new ArgsObject();
                argsobj.ServerType  = ServerType;
                argsobj.InstallType = InstallType.Install;
                argsobj.Version     = mcVersion_TextBox.Text;
                argsobj.SpigotType  = SpigotType.DirectDownload;
                if (ServerType == ServerType.Bukkit && useBuildTools_CheckBox.Checked)
                {
                    argsobj.SpigotType = SpigotType.BuildTools;
                }
                argsobj.Url                  = downloadLink_TextBox.Text;
                argsobj.InstanceName         = instanceName_TextBox.Text;
                argsobj.RamMB                = (int)ram_NumericUpDown.Value;
                argsobj.Port                 = (int)port_NumericUpDown.Value;
                argsobj.Difficulty           = (int)difficulty_NumericUpDown.Value;
                argsobj.LevelName            = levelName_TextBox.Text;
                argsobj.LevelType            = levelType_TextBox.Text;
                argsobj.WhiteList            = whiteList_CheckBox.Checked;
                argsobj.Whitelisted          = whiteList_ModifiableListBox.Values;
                argsobj.Ops                  = ops_ModifiableListBox.Values;
                argsobj.OnlineMode           = bungeeCord_CheckBox.Checked ? false : onlineMode_CheckBox.Checked; // disable online mode if bungee is enabled
                argsobj.CommandBlocksEnabled = commandBlocks_CheckBox.Checked;
                argsobj.InstancesPath        = BasePath;
                BCArgsObject bungeeargsobj = null;
                if (bungeeCord_CheckBox.Checked)
                {
                    bungeeargsobj            = new BCArgsObject();
                    bungeeargsobj.Version    = mcVersion_TextBox.Text;
                    bungeeargsobj.BungeeName = instanceName_TextBox.Text.Split('/').Last().Replace(' ', '_');
                    bungeeargsobj.BungeePath = BasePath.BetterPathJoinSlash(bungeeCordPath_TextBox.Text);
                    switch (ServerType)
                    {
                    case ServerType.Bukkit:
                        bungeeargsobj.BungeeType = BungeeType.Spigot;
                        break;

                    case ServerType.Modded:
                        bungeeargsobj.BungeeType = BungeeType.SpongeForge;
                        break;
                    }
                    bungeeargsobj.InstancePath = BasePath.BetterPathJoinSlash(instanceName_TextBox.Text);
                    bungeeargsobj.Port         = (int)port_NumericUpDown.Value;
                }
                ResultValues = Tuple.Create(argsobj, bungeeargsobj);
                DialogResult = DialogResult.OK;
                this.Close();
            }
            if (OrderIndex <= Order.Length - 2)
            {
                this.tabControl1.SelectedIndex = (int)Order[++OrderIndex];
            }
        }