Beispiel #1
0
 private static extern FFIResult _new_outbound_connection(
     UIntPtr index,
     ref SendData sendData,
     ref DisconnectSocket disconnectSocket,
     IntPtr theirNodeId,
     PeerManagerHandle handle,
     out ActOne initialSend
     );
Beispiel #2
0
 internal static FFIResult new_outbound_connection(
     UIntPtr index,
     SendData sendData,
     DisconnectSocket disconnectSocket,
     IntPtr theirNodeId,
     PeerManagerHandle handle,
     out ActOne initialSend,
     bool check = true
     ) => MaybeCheck(_new_outbound_connection(index, ref sendData, ref disconnectSocket, theirNodeId, handle, out initialSend), check);
        private void button1_Click(object sender, EventArgs e)
        {
            MySqlConnection sqlcon = new MySqlConnection(@"server=localhost;user id=root;database=seproject;password=rootpassword");
            MySqlCommand    cmd    = null;
            MySqlDataReader reader = null;

            try
            {
                string sql = "SELECT inGameCurrency FROM seproject.user WHERE username = '******';";

                //sqlcon = new MySqlConnection(Properties.Settings.Default.ConnectionString);
                cmd = new MySqlCommand(sql, sqlcon);

                sqlcon.Open();

                reader = cmd.ExecuteReader();

                while (reader.Read())
                {
                    val = reader.GetInt32("inGameCurrency");
                    //lblContinent.Text = reader.GetInt32("continent");
                    //lblRegion.Text = reader.GetString("region");
                    //lblSurfaceArea.Text = string.Format("{0:0.00}", reader.GetFloat("surfacearea"));
                }
                Console.WriteLine(val);
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("An error occurred {0}", ex.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
                if (sqlcon != null)
                {
                    sqlcon.Close();
                }
            }
            if (x <= 10)
            {
                button1.Enabled = false;
                button1.Text    = "Next question";
                x++;
                unlockButtons();
                startRoundTimer();
                displayTimer();
                scoreLabel.Text = score.ToString();
            }
            switch (x)
            {
            case 1:
                label2.Text  = "Which rapper performs on Usher's 'Yeah'?";
                button2.Text = "Ludacris";
                button3.Text = "B-Real";
                button4.Text = "Pit Bull";
                button5.Text = "50 Cent";
                break;

            case 2:
                label2.Text  = "What is Jack Nicholson’s famous line from The Shining?";
                button2.Text = "I'm not gonna hurt ya. I'm just gonna bash your brains in!";
                button3.Text = "Wendy, I'm home!";
                button4.Text = "Here's Johnny!";
                button5.Text = "All work and no play makes Jack a dull boy.";
                break;

            case 3:
                label2.Text  = "Get Out, and Us were created by what director?";
                button2.Text = "John Carpenter";
                button3.Text = "Jordan Peele";
                button4.Text = "Tim Burton";
                button5.Text = "Mike Flanagan";
                break;

            case 4:
                label2.Text  = "Who did Forbes name the youngest “self-made billionaire ever” in 2019?";
                button2.Text = "Jeff Bezos";
                button3.Text = "Kendall Jenner";
                button4.Text = "Elon Musk";
                button5.Text = "Kylie Jenner";
                break;

            case 5:
                label2.Text  = "What is Chandler Bing’s middle name?";
                button2.Text = "Muriel";
                button3.Text = "McCarthy";
                button4.Text = "Joffrey";
                button5.Text = "Dusty";
                break;

            case 6:
                label2.Text  = "What is the name of Michelle Obama’s 2018 memoir?";
                button2.Text = "Awareness";
                button3.Text = "Aspiration";
                button4.Text = "Becoming";
                button5.Text = "Ascension";
                break;

            case 7:
                label2.Text  = "What day is Star Wars Day?";
                button2.Text = "February 25";
                button3.Text = "May 4";
                button4.Text = "August 17";
                button5.Text = "October 18";
                break;

            case 8:
                label2.Text  = "Which tech entrepreneur named his son X Æ A-12?";
                button2.Text = "Elon Musk";
                button3.Text = "Markus Villig";
                button4.Text = "Leah Busque";
                button5.Text = "Bill Gates";
                break;

            case 9:
                label2.Text  = "What is the name of the alternate dimension in Netflix’s Stranger Things?";
                button2.Text = "The Nether";
                button3.Text = "The Void";
                button4.Text = "The Necropolis";
                button5.Text = "The Upside Down";
                break;

            case 10:
                label2.Text  = "What was the name of 'The book of evil' in Evil Dead?";
                button2.Text = "The Book of Ur";
                button3.Text = "Morellonomicon";
                button4.Text = "Necronomicon";
                button5.Text = "The Forbidden Scripture";
                break;

            default:
                MessageBox.Show("All done! Your score is " + score.ToString());
                sum = val + score;
                try
                {
                    sqlcon.Open();

                    string          Query     = "update seproject.user set inGameCurrency = " + "'" + sum + "' where (username = '******');";
                    MySqlCommand    cmdInsert = new MySqlCommand(Query, sqlcon);
                    MySqlDataReader reader1   = cmdInsert.ExecuteReader();
                    MessageBox.Show("Saved");
                    while (reader1.Read())
                    {
                    }
                    sqlcon.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Insertion failed");
                }
                this.Hide();
                ActOne a1 = new ActOne(MyVal);
                a1.ShowDialog();
                break;
            }
        }
Beispiel #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            MySqlConnection sqlcon = new MySqlConnection(@"server=localhost;user id=root;database=seproject;password=rootpassword");
            MySqlCommand    cmd    = null;
            MySqlDataReader reader = null;

            try
            {
                string sql = "SELECT inGameCurrency FROM seproject.user WHERE username = '******';";

                //sqlcon = new MySqlConnection(Properties.Settings.Default.ConnectionString);
                cmd = new MySqlCommand(sql, sqlcon);

                sqlcon.Open();

                reader = cmd.ExecuteReader();

                while (reader.Read())
                {
                    val = reader.GetInt32("inGameCurrency");
                    //lblContinent.Text = reader.GetInt32("continent");
                    //lblRegion.Text = reader.GetString("region");
                    //lblSurfaceArea.Text = string.Format("{0:0.00}", reader.GetFloat("surfacearea"));
                }
                Console.WriteLine(val);
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("An error occurred {0}", ex.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
                if (sqlcon != null)
                {
                    sqlcon.Close();
                }
            }
            if (x <= 10)
            {
                button1.Enabled = false;
                button1.Text    = "Next question";
                x++;
                unlockButtons();
                startRoundTimer();
                displayTimer();
                scoreLabel.Text = score.ToString();
            }
            switch (x)
            {
            case 1:
                label2.Text  = "Which of the four Marauders turns evil?";
                button2.Text = "Peter Pettigrew";
                button3.Text = "Sirius Black";
                button4.Text = "Remus Lupin";
                button5.Text = "James Potter";
                break;

            case 2:
                label2.Text  = "How does Harry catch his first snitch?";
                button2.Text = "Before the oposing team scores";
                button3.Text = "While falling off the broom";
                button4.Text = "With his mouth";
                button5.Text = "While being upside down";
                break;

            case 3:
                label2.Text  = "What is the nickname of Alastor Moody?";
                button2.Text = "Crazy Tongue Moody";
                button3.Text = "Mad Eye Moody";
                button4.Text = "Insane Auror Moody";
                button5.Text = "Moody the Mad";
                break;

            case 4:
                label2.Text  = "Who is the Half Blood Prince?";
                button2.Text = "Frank Longbottom";
                button3.Text = "Lucius Malfoy";
                button4.Text = "Gellert Grindelwald";
                button5.Text = "Severus Snape";
                break;

            case 5:
                label2.Text  = "What does the Mirror of Erised do?";
                button2.Text = "Show a person's deepest desires";
                button3.Text = "Show a person's future";
                button4.Text = "Show a person's place of death";
                button5.Text = "Show a person's dark inner self";
                break;

            case 6:
                label2.Text  = "What is Snape's patronus?";
                button2.Text = "Stag";
                button3.Text = "Gryphon";
                button4.Text = "Deer";
                button5.Text = "Horse";
                break;

            case 7:
                label2.Text  = "Who is the seeker for the Bulgarian Quidditch team?";
                button2.Text = "Cedric Diggory";
                button3.Text = "Viktor Krum";
                button4.Text = "Lev Zograf";
                button5.Text = "Ivan Volkov";
                break;

            case 8:
                label2.Text  = "Who tells Harry he's a Wizard?";
                button2.Text = "Hagrid";
                button3.Text = "Dumbledore";
                button4.Text = "Vernon Dursley";
                button5.Text = "Molly Weasley";
                break;

            case 9:
                label2.Text  = "What was the name of Hagrid's Acronamntula?";
                button2.Text = "Fawkes";
                button3.Text = "Nagini";
                button4.Text = "Aragorn";
                button5.Text = "Aragog";
                break;

            case 10:
                label2.Text  = "What does Prof. Lupin offer Harry to make him feel better when the Dementors try to attack him?";
                button2.Text = "Pale ale";
                button3.Text = "Tea";
                button4.Text = "Chocolate";
                button5.Text = "Acid Pops";
                break;

            default:
                MessageBox.Show("All done! Your score is " + score.ToString());
                sum = val + score;
                try
                {
                    sqlcon.Open();

                    string          Query     = "update seproject.user set inGameCurrency = " + "'" + sum + "' where (username = '******');";
                    MySqlCommand    cmdInsert = new MySqlCommand(Query, sqlcon);
                    MySqlDataReader reader1   = cmdInsert.ExecuteReader();
                    MessageBox.Show("Saved");
                    while (reader1.Read())
                    {
                    }
                    sqlcon.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Insertion failed");
                }
                this.Hide();
                ActOne a1 = new ActOne(MyVal);
                a1.ShowDialog();
                break;
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            MySqlConnection sqlcon = new MySqlConnection(@"server=localhost;user id=root;database=seproject;password=rootpassword");
            MySqlCommand    cmd    = null;
            MySqlDataReader reader = null;

            try
            {
                string sql = "SELECT inGameCurrency FROM seproject.user WHERE username = '******';";

                //sqlcon = new MySqlConnection(Properties.Settings.Default.ConnectionString);
                cmd = new MySqlCommand(sql, sqlcon);

                sqlcon.Open();

                reader = cmd.ExecuteReader();

                while (reader.Read())
                {
                    val = reader.GetInt32("inGameCurrency");
                    //lblContinent.Text = reader.GetInt32("continent");
                    //lblRegion.Text = reader.GetString("region");
                    //lblSurfaceArea.Text = string.Format("{0:0.00}", reader.GetFloat("surfacearea"));
                }
                Console.WriteLine(val);
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("An error occurred {0}", ex.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
                if (sqlcon != null)
                {
                    sqlcon.Close();
                }
            }
            label2.Text = "Whose country is the following flag?";
            if (x <= 10)
            {
                button1.Enabled = false;
                button1.Text    = "Next question";
                x++;
                unlockButtons();
                startRoundTimer();
                displayTimer();
                scoreLabel.Text = score.ToString();
            }
            switch (x)
            {
            case 1:
                pictureBox1.Image = SEProject.Properties.Resources.trivia_jamaica;
                button2.Text      = "Jamaica";
                button3.Text      = "Morocco";
                button4.Text      = "Iran";
                button5.Text      = "Turkey";
                break;

            case 2:
                pictureBox1.Image = SEProject.Properties.Resources.trivia_greece;
                button2.Text      = "Estonia";
                button3.Text      = "Sweden";
                button4.Text      = "Greece";
                button5.Text      = "Latvia";
                break;

            case 3:
                pictureBox1.Image = SEProject.Properties.Resources.trivia_colombia;
                button2.Text      = "Bahamas";
                button3.Text      = "Colombia";
                button4.Text      = "Mongolia";
                button5.Text      = "Nepal";
                break;

            case 4:
                pictureBox1.Image = SEProject.Properties.Resources.trivia_cuba;
                button2.Text      = "Armenia";
                button3.Text      = "Thailans";
                button4.Text      = "Myanmar";
                button5.Text      = "Cuba";
                break;

            case 5:
                pictureBox1.Image = SEProject.Properties.Resources.trivia_brazil;
                button2.Text      = "Brazil";
                button3.Text      = "Uganda";
                button4.Text      = "Azerbaijan";
                button5.Text      = "Indonesia";
                break;

            case 6:
                pictureBox1.Image = SEProject.Properties.Resources.trivia_israel;
                button2.Text      = "Laos";
                button3.Text      = "Yemen";
                button4.Text      = "Israel";
                button5.Text      = "Qatar";
                break;

            case 7:
                pictureBox1.Image = SEProject.Properties.Resources.trivia_lebanon;
                button2.Text      = "Bangladesh";
                button3.Text      = "Lebanon";
                button4.Text      = "Bahrain";
                button5.Text      = "Jordan";
                break;

            case 8:
                pictureBox1.Image = SEProject.Properties.Resources.trivia_norway;
                button2.Text      = "Norway";
                button3.Text      = "Croatia";
                button4.Text      = "Slovenia";
                button5.Text      = "Slovakia";
                break;

            case 9:
                pictureBox1.Image = SEProject.Properties.Resources.trivia_egypt;
                button2.Text      = "Paraguay";
                button3.Text      = "Algeria";
                button4.Text      = "Tunisia";
                button5.Text      = "Egypt";
                break;

            case 10:
                pictureBox1.Image = SEProject.Properties.Resources.trivia_portugal;
                button2.Text      = "Argentina";
                button3.Text      = "Spain";
                button4.Text      = "Portugal";
                button5.Text      = "Italy";
                break;

            default:
                MessageBox.Show("All done! Your score is " + score.ToString());
                sum = val + score;
                try
                {
                    sqlcon.Open();

                    string          Query     = "update seproject.user set inGameCurrency = " + "'" + sum + "' where (username = '******');";
                    MySqlCommand    cmdInsert = new MySqlCommand(Query, sqlcon);
                    MySqlDataReader reader1   = cmdInsert.ExecuteReader();
                    MessageBox.Show("Saved");
                    while (reader1.Read())
                    {
                    }
                    sqlcon.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Insertion failed");
                }
                this.Hide();
                ActOne a1 = new ActOne(MyVal);
                a1.ShowDialog();
                break;
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            MySqlConnection sqlcon = new MySqlConnection(@"server=localhost;user id=root;database=seproject;password=rootpassword");
            MySqlCommand    cmd    = null;
            MySqlDataReader reader = null;

            try
            {
                string sql = "SELECT inGameCurrency FROM seproject.user WHERE username = '******';";

                //sqlcon = new MySqlConnection(Properties.Settings.Default.ConnectionString);
                cmd = new MySqlCommand(sql, sqlcon);

                sqlcon.Open();

                reader = cmd.ExecuteReader();

                while (reader.Read())
                {
                    val = reader.GetInt32("inGameCurrency");
                    //lblContinent.Text = reader.GetInt32("continent");
                    //lblRegion.Text = reader.GetString("region");
                    //lblSurfaceArea.Text = string.Format("{0:0.00}", reader.GetFloat("surfacearea"));
                }
                Console.WriteLine(val);
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("An error occurred {0}", ex.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
                if (sqlcon != null)
                {
                    sqlcon.Close();
                }
            }
            if (x <= 10)
            {
                button1.Enabled = false;
                button1.Text    = "Next question";
                x++;
                unlockButtons();
                startRoundTimer();
                displayTimer();
                scoreLabel.Text = score.ToString();
            }
            switch (x)
            {
            case 1:
                label2.Text  = "Blizzard Entertainment is most well known for which game franchise?";
                button2.Text = "World of Warcraft";
                button3.Text = "Diablo";
                button4.Text = "Starcraft";
                button5.Text = "The Lost Vikings";
                break;

            case 2:
                label2.Text  = "What is the most expensive video game made to date?";
                button2.Text = "Fallout 76";
                button3.Text = "Far Cry 5";
                button4.Text = "Grand Theft Auto V";
                button5.Text = "Call of Duty: Mordern Warfare 2";
                break;

            case 3:
                label2.Text  = "What is the name of Mario's dinosaur sidekick?";
                button2.Text = "Wario";
                button3.Text = "Yoshi";
                button4.Text = "Bowser";
                button5.Text = "King K. Rool";
                break;

            case 4:
                label2.Text  = "What are the professions of Mario and his brother Luigi?";
                button2.Text = "Death Eaters";
                button3.Text = "Bakers";
                button4.Text = "Miners";
                button5.Text = "Plumbers";
                break;

            case 5:
                label2.Text  = "Which video game franchise features the character Lara Croft?";
                button2.Text = "Tomb Raider";
                button3.Text = "Uncharted";
                button4.Text = "Prince of Persia";
                button5.Text = "Assassin's Creed";
                break;

            case 6:
                label2.Text  = "What is the title of the frst expansion released for World of Warcraft?";
                button2.Text = "Cataclysm";
                button3.Text = "Wrath of the Lich King";
                button4.Text = "The Burning Crusade";
                button5.Text = "Mists of Pandaria";
                break;

            case 7:
                label2.Text  = "What pokemon type is Gengar?";
                button2.Text = "Poison/Psychic";
                button3.Text = "Ghost/Poison";
                button4.Text = "Ghost/Dark";
                button5.Text = "Dark/Psychic";
                break;

            case 8:
                label2.Text  = "What is the first weapon you use in Cuphead?";
                button2.Text = "Peashooter";
                button3.Text = "Crossbow";
                button4.Text = "Pea Cannon";
                button5.Text = "Leaf Sword";
                break;

            case 9:
                label2.Text  = "Which is the most popular game in the US?";
                button2.Text = "World of Warcraft";
                button3.Text = "Call of Duty: Modern Warfare 3";
                button4.Text = "League of Legends";
                button5.Text = "Minecraft";
                break;

            case 10:
                label2.Text  = "Which video game features the fictional world named Azeroth?";
                button2.Text = "Legend of Zelda";
                button3.Text = "Bioshock";
                button4.Text = "World of Warcraft";
                button5.Text = "Resident Evil";
                break;

            default:
                MessageBox.Show("All done! Your score is " + score.ToString());
                sum = val + score;
                try
                {
                    sqlcon.Open();

                    string          Query     = "update seproject.user set inGameCurrency = " + "'" + sum + "' where (username = '******');";
                    MySqlCommand    cmdInsert = new MySqlCommand(Query, sqlcon);
                    MySqlDataReader reader1   = cmdInsert.ExecuteReader();
                    MessageBox.Show("Saved");
                    while (reader1.Read())
                    {
                    }
                    sqlcon.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Insertion failed");
                }
                this.Hide();
                ActOne a1 = new ActOne(MyVal);
                a1.ShowDialog();
                break;
            }
        }