From 2fa4ef729fbb058d78f50a591eabba8e29ca5b4a Mon Sep 17 00:00:00 2001 From: JosJuice Date: Mon, 23 Dec 2019 22:50:53 +0100 Subject: [PATCH 1/3] DolphinQt: Check presence of region in NetPlaySetupDialog --- Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp b/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp index 268b151df7..44ed4f8b5b 100644 --- a/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp +++ b/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp @@ -328,6 +328,14 @@ void NetPlaySetupDialog::accept() return; } + if (m_host_server_browser->isChecked() && + m_host_server_region->currentData().toString().isEmpty()) + { + ModalMessageBox::critical(this, tr("Error"), + tr("You must provide a region for your session!")); + return; + } + emit Host(items[0]->text()); } } From 8e278b80532d315fcd889405dd24fd1bb7d99e34 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Mon, 23 Dec 2019 22:55:19 +0100 Subject: [PATCH 2/3] Check presence of name and region in NetPlayServer --- Source/Core/Core/NetPlayServer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/NetPlayServer.cpp b/Source/Core/Core/NetPlayServer.cpp index 797436976d..4789ef8900 100644 --- a/Source/Core/Core/NetPlayServer.cpp +++ b/Source/Core/Core/NetPlayServer.cpp @@ -169,8 +169,11 @@ static void ClearPeerPlayerId(ENetPeer* peer) void NetPlayServer::SetupIndex() { - if (!Config::Get(Config::NETPLAY_USE_INDEX)) + if (!Config::Get(Config::NETPLAY_USE_INDEX) || Config::Get(Config::NETPLAY_INDEX_NAME).empty() || + Config::Get(Config::NETPLAY_INDEX_REGION).empty()) + { return; + } NetPlaySession session; From 0c12dbe860bc14fd7b39e94a13914eb7c97e24be Mon Sep 17 00:00:00 2001 From: JosJuice Date: Mon, 23 Dec 2019 23:07:05 +0100 Subject: [PATCH 3/3] DolphinQt: Properly save netplay session settings when changed --- Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp b/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp index 44ed4f8b5b..634c3fb17d 100644 --- a/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp +++ b/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp @@ -227,6 +227,14 @@ void NetPlaySetupDialog::ConnectWidgets() connect(m_host_chunked_upload_limit_box, static_cast(&QSpinBox::valueChanged), this, &NetPlaySetupDialog::SaveSettings); + + connect(m_host_server_browser, &QCheckBox::toggled, this, &NetPlaySetupDialog::SaveSettings); + connect(m_host_server_name, &QLineEdit::textChanged, this, &NetPlaySetupDialog::SaveSettings); + connect(m_host_server_password, &QLineEdit::textChanged, this, &NetPlaySetupDialog::SaveSettings); + connect(m_host_server_region, + static_cast(&QComboBox::currentIndexChanged), this, + &NetPlaySetupDialog::SaveSettings); + #ifdef USE_UPNP connect(m_host_upnp, &QCheckBox::stateChanged, this, &NetPlaySetupDialog::SaveSettings); #endif