Esempio n. 1
0
        private void MultiPlayerLabel_Click(object sender, EventArgs e)
        {
            // Test Ping and Ram. If both pass, hide main menu and make lobby finder form.
            TestPingAndRam pingRamTest = new TestPingAndRam();
            long max_ping = 300;
            string ip = "www.google.com";
            var ramC = new PerformanceCounter("Memory", "Available MBytes");

            if (pingRamTest.CheckPing(max_ping, ip) == true)
            {
                if (pingRamTest.CheckRam(ramC.NextValue()) == true)
                {
                    // hide main menu
                    this.Hide();

                    // make lobby finder form.
                    LobbyFinder lobbyFinder = new LobbyFinder();
                    lobbyFinder.ShowDialog();
                    this.Show();
                }
                else
                {
                    MessageBox.Show("NOT ENOUGH AVAILABLE RAM MEMORY!!!");
                }
            }
            else
            {
                MessageBox.Show("NETWORK CONNECTION FAILED!!! ERROR(Ping Test)");
            }
        }
Esempio n. 2
0
        private void SinglePlayerLabel_Click(object sender, EventArgs e)
        {
            TestPingAndRam ramTest = new TestPingAndRam();
            var ramC = new PerformanceCounter("Memory", "Available MBytes");

            if (ramTest.CheckRam(ramC.NextValue()) == true)
            {
                // hide the main menu
                this.Hide();

                // send user to the lobby
                Lobby lobby = new Lobby();
                lobby.ShowDialog();
                this.Show();
            }
            else
            {
                MessageBox.Show("NOT ENOUGH AVAILABLE RAM MEMORY!!!");
            }
        }