Port multiplayer related PRs from yuzu (yuzu-emu/yuzu#9661 and yuzu-emu/yuzu#9713) (#6319)

Co-authored-by: SoRadGaming <sohorhab.azizdel@outlook.com>
Co-authored-by: Luke Sawczak <luke@unfamiliarplace.com>
This commit is contained in:
Tobias 2023-03-08 00:51:46 +01:00 committed by GitHub
parent 455a0198d9
commit 07e02a1acf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 65 additions and 33 deletions

View file

@ -70,20 +70,13 @@ void DirectConnectWindow::Connect() {
}
}
}
switch (static_cast<ConnectionType>(ui->connection_type->currentIndex())) {
case ConnectionType::TraversalServer:
break;
case ConnectionType::IP:
if (!ui->ip->hasAcceptableInput()) {
NetworkMessage::ErrorManager::ShowError(
NetworkMessage::ErrorManager::IP_ADDRESS_NOT_VALID);
return;
}
if (!ui->port->hasAcceptableInput()) {
NetworkMessage::ErrorManager::ShowError(NetworkMessage::ErrorManager::PORT_NOT_VALID);
return;
}
break;
if (!ui->ip->hasAcceptableInput()) {
NetworkMessage::ErrorManager::ShowError(NetworkMessage::ErrorManager::IP_ADDRESS_NOT_VALID);
return;
}
if (!ui->port->hasAcceptableInput()) {
NetworkMessage::ErrorManager::ShowError(NetworkMessage::ErrorManager::PORT_NOT_VALID);
return;
}
// Store settings