private void RequestSettingsbtn_Click(object sender, EventArgs e)
        {
            var form = new Host
            {
                Text        = Program.LanguageManager.Translation.chatoptionsRequestFormText,
                HostBtn     = { Text = Program.LanguageManager.Translation.chatoptionsBtnSave },
                ShuffleDeck = { Enabled = false },
                CheckDeck   = { Enabled = false },
                Priority    = { Enabled = false },
                LifePoints  = { Enabled = false }
            };

            form.Mode.Items.Remove("Tag");

            if (form.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            Program.Config.chtCardRules          = form.CardRules.Text;
            Program.Config.chtMode               = form.Mode.Text;
            Program.Config.chtEnablePrority      = form.Priority.Checked;
            Program.Config.chtDisableCheckDeck   = form.CheckDeck.Checked;
            Program.Config.chtDisableShuffleDeck = form.ShuffleDeck.Checked;
            Program.Config.chtLifepoints         = form.LifePoints.Text;
            Program.Config.chtBanList            = form.BanList.Text;
            Program.Config.chtTimeLimit          = form.TimeLimit.Text;
        }
        private void QuickSettingsBtn_Click(object sender, EventArgs e)
        {
            var form = new Host(true, false)
            {
                Text    = Program.LanguageManager.Translation.QuickHostSetting,
                HostBtn = { Text = Program.LanguageManager.Translation.QuickHostBtn }
            };

            if (form.ShowDialog() == DialogResult.OK)
            {
                Program.Config.CardRules          = form.CardRules.Text;
                Program.Config.Mode               = form.Mode.Text;
                Program.Config.EnablePrority      = form.Priority.Checked;
                Program.Config.DisableCheckDeck   = form.CheckDeck.Checked;
                Program.Config.DisableShuffleDeck = form.ShuffleDeck.Checked;
                Program.Config.Lifepoints         = form.LifePoints.Text;
                Program.Config.BanList            = form.BanList.Text;
                Program.Config.TimeLimit          = form.TimeLimit.Text;
            }
        }
        private bool JoinQueue(bool isQuick=false)
        {
            
            var form = new Host(false);

            form.Mode.Items.Clear();
            form.HostBtn.Text = "Join Queue";
            form.Mode.Items.AddRange(new object[] { "Single", "Match"});
            form.Mode.SelectedItem = form.Mode.Items.Contains(Program.Config.Mode) ? Program.Config.Mode : "Match";               
            if (form.BanList.Items.Count > 0)
                form.BanList.SelectedIndex = 0;
            form.CardRules.SelectedIndexChanged += form.FormatChanged;
            form.BanList.Enabled = false;
            form.Priority.Enabled = false;
            form.ShuffleDeck.Enabled = false;
            form.CheckDeck.Enabled = false;
            form.LifePoints.Enabled = false;
            form.TimeLimit.Enabled = false;
            form.PasswordInput.Enabled = false;
            form.CardRules.Items.Clear();
            form.CardRules.Items.AddRange(new object[] { "TCG", "OCG" });
            form.CardRules.SelectedItem = form.CardRules.Items.Contains(Program.Config.CardRules) ? Program.Config.CardRules : "TCG";      

            if (isQuick || form.ShowDialog() == DialogResult.OK) 
            {
                QueueRequest request = new QueueRequest(form.CardRules.SelectedItem.ToString(), form.Mode.SelectedItem.ToString());

                Program.ChatServer.SendPacket(DevServerPackets.JoinQueue, JsonSerializer.SerializeToString(request));
                QueueLabel.Text = "Queue Status: searching";
                return true;
            }
            return false;
        }
        private void HostGame()
        {
            var form = new Host(false);

            if (form.ShowDialog() == DialogResult.OK)
            {
                if (m_rooms.ContainsKey(form.PasswordInput.Text))
                {
                    MessageBox.Show(Program.LanguageManager.Translation.GamePasswordExsists);
                    return;
                }
                if (Program.ServerList.Count == 0)
                {
                    MessageBox.Show(Program.LanguageManager.Translation.GameNoServers);
                    return;
                }

                LauncherHelper.GenerateConfig(GetServer(), form.GenerateURI(false));
                LauncherHelper.RunGame("-j");
                Program.ChatServer.SendPacket(DevServerPackets.HostDuel);
            }
        }
        private void RequestSettingsbtn_Click(object sender, EventArgs e)
        {
            var form = new Host
                {
                    Text = Program.LanguageManager.Translation.chatoptionsRequestFormText,
                    HostBtn = {Text = Program.LanguageManager.Translation.chatoptionsBtnSave},
                    ShuffleDeck = {Enabled = false},
                    CheckDeck = {Enabled = false},
                    Priority = {Enabled = true},
                    LifePoints = {Enabled = false}
                };
            form.Mode.Items.Remove("Tag");

            if(form.ShowDialog() == DialogResult.OK)
            {
                Program.Config.chtCardRules = form.CardRules.Text;
                Program.Config.chtMode = form.Mode.Text;
                Program.Config.chtEnablePrority = form.Priority.Checked;
                Program.Config.chtDisableCheckDeck = form.CheckDeck.Checked;
                Program.Config.chtDisableShuffleDeck = form.ShuffleDeck.Checked;
                Program.Config.chtLifepoints = form.LifePoints.Text;
                Program.Config.chtBanList = form.BanList.Text;
                Program.Config.chtTimeLimit = form.TimeLimit.Text;
                Program.Config.EnablePrerelease = form.Prerelease.Checked;
            }
        }
        private void QuickSettingsBtn_Click(object sender, EventArgs e)
        {

            var form = new Host(false)
                {
                    Text = Program.LanguageManager.Translation.QuickHostSetting,
                    HostBtn = {Text = Program.LanguageManager.Translation.QuickHostBtn}
                };

            if (form.ShowDialog() == DialogResult.OK)
            {
                Program.Config.CardRules = form.CardRules.Text;
                Program.Config.Mode = form.Mode.Text;
                Program.Config.EnablePrority = form.Priority.Checked;
                Program.Config.DisableCheckDeck = form.CheckDeck.Checked;
                Program.Config.DisableShuffleDeck = form.ShuffleDeck.Checked;
                Program.Config.Lifepoints = form.LifePoints.Text;
                Program.Config.BanList = form.BanList.Text;
                Program.Config.TimeLimit = form.TimeLimit.Text;
                Program.Config.EnablePrerelease = form.Prerelease.Checked;
            }

        }
        private void HostGame(object sender, EventArgs e)
        {
            var button = (ToolStripMenuItem)sender;
            var form = new Host(false, (button.Name == "Ranked"));
            if (button.Name == "Ranked")
            {
                form.Mode.Items.Clear();
                form.Mode.Items.AddRange(new object[] { "Single", "Match", "Tag" });
                form.Mode.SelectedItem = "Match";
                if (form.BanList.Items.Count > 0)
                    form.BanList.SelectedIndex = 0;
                form.CardRules.SelectedIndexChanged += form.FormatChanged;
                form.BanList.Enabled = false;
                form.Priority.Enabled = false;
                form.ShuffleDeck.Enabled = false;
                form.CheckDeck.Enabled = false;
                form.LifePoints.Enabled = false;
                form.CardRules.Items.Clear();
                form.CardRules.Items.AddRange(new object[] { "TCG", "OCG" });
                form.CardRules.SelectedItem = "TCG";
            }

            if (form.ShowDialog() == DialogResult.OK)
            {

                if (m_rooms.ContainsKey(form.PasswordInput.Text))
                {
                    MessageBox.Show(Program.LanguageManager.Translation.GamePasswordExsists);
                    return;
                }
                if (Program.ServerList.Count == 0)
                {
                    MessageBox.Show(Program.LanguageManager.Translation.GameNoServers);
                    return;
                }

                LauncherHelper.GenerateConfig(GetServer(), form.GenerateURI((button.Name == "Ranked")));
                LauncherHelper.RunGame("-j");
            }
        }
        private void HostGame()
        {
            var form = new Host(false);

            if (form.ShowDialog() == DialogResult.OK)
            {
                if (m_rooms.ContainsKey(form.PasswordInput.Text))
                {
                    MessageBox.Show(Program.LanguageManager.Translation.GamePasswordExsists);
                    return;
                }

                ServerInfo server = form.CardRules.Text == "2099" ? GetServer(Program.Config.Server2099) : GetServer(false);

                if (server != null)
                {
                    LauncherHelper.GenerateConfig(server, form.GenerateURI(false));
                    LauncherHelper.RunGame("-j");
                    Program.ChatServer.SendPacket(DevServerPackets.HostDuel);
                }
                else
                {
                    MessageBox.Show(Program.LanguageManager.Translation.GameNoServers);
                    return;
                }
            }
        }