Esempio n. 1
0
 private void GameBtn_Click(object sender, EventArgs e)
 {
     LauncherHelper.GenerateConfig("ygopro:/" + Program.Config.ServerAddress + "/" + Program.Config.GamePort + "/20000,U,Replay");
     if (Name == "Decks")
     {
         LauncherHelper.RunGame("-d");
     }
     else
     {
         if (FileList.SelectedItem == null)
         {
             MessageBox.Show("Choose a replay first!");
             return;
         }
         string replayDir = (Program.Config.LauncherDir == "" ? Path.GetDirectoryName(Application.ExecutablePath) + "/" : "") + FileLocation;
         if (!Directory.Exists(replayDir))
         {
             MessageBox.Show("Replay directory doesn't exist!");
             return;
         }
         string fileName = replayDir + FileList.SelectedItem + ".yrp";
         if (!File.Exists(fileName))
         {
             MessageBox.Show("Selected file does not exist!");
             return;
         }
         string tempFile = replayDir + "000000000000000000000000000000000000000000000.yrp";
         if (File.Exists(tempFile))
         {
             File.Delete(tempFile);
         }
         File.Copy(fileName, tempFile);
         LauncherHelper.RunGame("-r", (evSender, evArgs) => File.Delete(tempFile));
     }
 }
Esempio n. 2
0
        private void HostBtn_Click(object sender, EventArgs e)
        {
            Host form = new Host(false, (ServerTabs.SelectedTab.Name == "Ranked"));

            if (ServerTabs.SelectedTab.Name == "Ranked")
            {
                form.Mode.Items.Clear();
                form.Mode.Items.AddRange(new object[] { "Match", "Tag" });
                form.Mode.SelectedItem     = "Match";
                form.BanList.SelectedIndex = 0;
                form.BanList.Enabled       = false;
                form.TimeLimit.Items.Clear();
                form.TimeLimit.Items.Add("Server Defualt");
                form.TimeLimit.SelectedItem = "Server Defualt";
                form.TimeLimit.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[] { "OCG/TCG", "TCG", "OCG" });
                form.CardRules.SelectedItem = "OCG/TCG";
            }

            if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                LauncherHelper.GenerateConfig(form.GenerateURI(Program.Config.ServerAddress, Program.Config.GamePort.ToString(), (ServerTabs.SelectedTab.Name == "Ranked") ? true : false));
                LauncherHelper.RunGame("-j");
            }
        }
Esempio n. 3
0
        public void LoadRoom(object sender, EventArgs e)
        {
            ListView     rooms = (ServerTabs.SelectedTab.Name == "Ranked" ? RankedRooms : listRooms);
            ListViewItem item  = rooms.SelectedItems[0];

            LauncherHelper.GenerateConfig(item.SubItems[8].Text);
            LauncherHelper.RunGame("-j");
        }
Esempio n. 4
0
        private void QuickBtn_Click(object sender, EventArgs e)
        {
            Host form = new Host(false, false);

            form.CardRules.Text         = Program.Config.CardRules;
            form.Mode.Text              = Program.Config.Mode;
            form.Priority.Checked       = Program.Config.EnablePrority;
            form.CheckDeck.Checked      = Program.Config.DisableCheckDeck;
            form.ShuffleDeck.Checked    = Program.Config.DisableShuffleDeck;
            form.LifePoints.Text        = Program.Config.Lifepoints;
            form.GameName.Text          = Program.Config.GameName;
            form.BanList.SelectedItem   = Program.Config.BanList;
            form.TimeLimit.SelectedItem = Program.Config.TimeLimit;

            LauncherHelper.GenerateConfig(form.GenerateURI(Program.Config.ServerAddress, Program.Config.GamePort.ToString(), (ServerTabs.SelectedTab.Name == "Ranked") ? true : false));
            LauncherHelper.RunGame("-j");
            return;
        }
Esempio n. 5
0
 private void ReplaysBtn_Click(object sender, EventArgs e)
 {
     LauncherHelper.GenerateConfig("ygopro:/" + Program.Config.ServerAddress + "/" + Program.Config.GamePort + "/20000,U,Replay");
     LauncherHelper.RunGame("-r");
 }