citra_qt/multiplayer: Disallow hosting rooms when preferred game is not selected

which can happen if the game list is empty, and would result in a 400 being returned from the server as the preferred_game field is empty.
This commit is contained in:
zhupengfei 2019-04-19 23:12:30 +08:00
parent 36051204cc
commit d6b168d7ed
No known key found for this signature in database
GPG key ID: DD129E108BD09378
3 changed files with 8 additions and 0 deletions

View file

@ -111,6 +111,10 @@ void HostRoomWindow::Host() {
NetworkMessage::ShowError(NetworkMessage::PORT_NOT_VALID);
return;
}
if (ui->game_list->currentIndex() == -1) {
NetworkMessage::ShowError(NetworkMessage::GAME_NOT_SELECTED);
return;
}
if (auto member = Network::GetRoomMember().lock()) {
if (member->GetState() == Network::RoomMember::State::Joining) {
return;