示例#1
0
        private async Task startGame()
        {
            toggleUi(false);

            try
            {
                await Maple.Start((bool)tespiaCheckBox.IsChecked);
            }
            catch (VerdantException.NoAuthException)
            {
                if (noAuth)
                {
                    MessageBox.Show("We failed to auth. Login data will be deleted, and Verdant will be closed. Please try logging in completely again.");
                    File.Delete(PathToCookies);
                    Close();
                    return;
                }

                // last ditch
                noAuth = true;
                await mapleIdSelection(true);

                startButton.IsEnabled = false;

                if (Maple.MapleIds.Count == 1)
                {
                    mapleIdBox.Text = Maple.MapleIds[0];
                    await switchMapleId();

                    Close();
                }
                else if (Maple.MapleIds.Contains(QuickStart))
                {
                    Debug.WriteLine("quickstart id last ditch: " + QuickStart);
                    mapleIdBox.Text = QuickStart;
                    await switchMapleId();

                    Close();
                }
                else
                {
                    MessageBox.Show("There was an error starting the game, but... we have one last trick. Please select the Maple ID in the dropdown box below that you would like to login to, and we can try again!", "Verdant");
                    mapleIdBox.Focus();
                    mapleIdBox.IsDropDownOpen = true;
                }

                return;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error starting game...\n\n" + ex.ToString());
            }

            Close();
        }
示例#2
0
        private async void startButton_Click(object sender, RoutedEventArgs e)
        {
            startButton.IsEnabled = false;

            try
            {
                await Maple.Start();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error starting game...\n\n" + ex.ToString());
            }

            Close();
        }