summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorTechjar <tecknojar@gmail.com>2018-07-05 17:52:53 -0400
committerTechjar <tecknojar@gmail.com>2018-07-05 17:52:53 -0400
commiteeff5e07ff1a95ae3d07f026118380968b57eeef (patch)
tree4a6be1d0916a4edc097fe3a2b9315237fbd6f2a2 /Source
parent14317c8a0f28cdf7e67527ebec3bef0ac41c6e2e (diff)
Fix NetPlay using some config values wrongly
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/DolphinQt2/MainWindow.cpp11
-rw-r--r--Source/Core/DolphinQt2/NetPlay/NetPlaySetupDialog.cpp7
2 files changed, 11 insertions, 7 deletions
diff --git a/Source/Core/DolphinQt2/MainWindow.cpp b/Source/Core/DolphinQt2/MainWindow.cpp
index 8bb919079b..bdf8f3f17b 100644
--- a/Source/Core/DolphinQt2/MainWindow.cpp
+++ b/Source/Core/DolphinQt2/MainWindow.cpp
@@ -1066,6 +1066,9 @@ bool MainWindow::NetPlayJoin()
}
// Settings
+ const std::string traversal_choice = Config::Get(Config::NETPLAY_TRAVERSAL_CHOICE);
+ const bool is_traversal = traversal_choice == "traversal";
+
std::string host_ip;
u16 host_port;
if (Settings::Instance().GetNetPlayServer() != nullptr)
@@ -1075,13 +1078,11 @@ bool MainWindow::NetPlayJoin()
}
else
{
- host_ip = Config::Get(Config::NETPLAY_HOST_CODE);
- host_port = Config::Get(Config::NETPLAY_HOST_PORT);
+ host_ip = is_traversal ? Config::Get(Config::NETPLAY_HOST_CODE) :
+ Config::Get(Config::NETPLAY_ADDRESS);
+ host_port = Config::Get(Config::NETPLAY_CONNECT_PORT);
}
- const std::string traversal_choice = Config::Get(Config::NETPLAY_TRAVERSAL_CHOICE);
- const bool is_traversal = traversal_choice == "traversal";
-
const std::string traversal_host = Config::Get(Config::NETPLAY_TRAVERSAL_SERVER);
const u16 traversal_port = Config::Get(Config::NETPLAY_TRAVERSAL_PORT);
const std::string nickname = Config::Get(Config::NETPLAY_NICKNAME);
diff --git a/Source/Core/DolphinQt2/NetPlay/NetPlaySetupDialog.cpp b/Source/Core/DolphinQt2/NetPlay/NetPlaySetupDialog.cpp
index b921fa52af..e873a0726a 100644
--- a/Source/Core/DolphinQt2/NetPlay/NetPlaySetupDialog.cpp
+++ b/Source/Core/DolphinQt2/NetPlay/NetPlaySetupDialog.cpp
@@ -183,7 +183,9 @@ void NetPlaySetupDialog::ConnectWidgets()
void NetPlaySetupDialog::SaveSettings()
{
Config::SetBaseOrCurrent(Config::NETPLAY_NICKNAME, m_nickname_edit->text().toStdString());
- Config::SetBaseOrCurrent(Config::NETPLAY_HOST_CODE, m_ip_edit->text().toStdString());
+ Config::SetBaseOrCurrent(m_connection_type->currentIndex() == 0 ? Config::NETPLAY_ADDRESS :
+ Config::NETPLAY_HOST_CODE,
+ m_ip_edit->text().toStdString());
Config::SetBaseOrCurrent(Config::NETPLAY_CONNECT_PORT,
static_cast<u16>(m_connect_port_box->value()));
Config::SetBaseOrCurrent(Config::NETPLAY_HOST_PORT, static_cast<u16>(m_host_port_box->value()));
@@ -211,7 +213,8 @@ void NetPlaySetupDialog::OnConnectionTypeChanged(int index)
m_reset_traversal_button->setHidden(index == 0);
- std::string address = Config::Get(Config::NETPLAY_HOST_CODE);
+ std::string address =
+ index == 0 ? Config::Get(Config::NETPLAY_ADDRESS) : Config::Get(Config::NETPLAY_HOST_CODE);
m_ip_label->setText(index == 0 ? tr("IP Address:") : tr("Host Code:"));
m_ip_edit->setText(QString::fromStdString(address));