/// <summary> /// If there is an error, show a message box to inform the user. If not, goes to the game view /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnJoinRoom_Click(object sender, EventArgs e) { switch (network.TryToRegister(txtBoxIPRoom.Text, txtBoxPassword.Text)) { case Networking.Objects.NetworkError.BadPassword: MessageBox.Show("Mauvais mot de passe", "Attention!"); break; case Networking.Objects.NetworkError.UnknownIp: case Networking.Objects.NetworkError.NoRoomStarted: MessageBox.Show("IP pas disponible", "Attention!"); break; case Networking.Objects.NetworkError.None: //changeForm.ChangeOfForm(this, Other.DifferentForms.Game); FormManager.gameView.Show(); Hide(); break; default: MessageBox.Show("Impossible de rejoinde la room", "Attention!"); break; } }