Merge pull request #8534 from JosJuice/netplay-index-empty-strings
Properly check for missing netplay session name/region
This commit is contained in:
commit
0755f92979
|
@ -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;
|
||||
|
||||
|
|
|
@ -227,6 +227,14 @@ void NetPlaySetupDialog::ConnectWidgets()
|
|||
connect(m_host_chunked_upload_limit_box,
|
||||
static_cast<void (QSpinBox::*)(int)>(&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<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
||||
&NetPlaySetupDialog::SaveSettings);
|
||||
|
||||
#ifdef USE_UPNP
|
||||
connect(m_host_upnp, &QCheckBox::stateChanged, this, &NetPlaySetupDialog::SaveSettings);
|
||||
#endif
|
||||
|
@ -328,6 +336,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());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue