diff options
| author | Zexaron <20824154+Zexaron@users.noreply.github.com> | 2018-10-10 00:52:19 +0200 |
|---|---|---|
| committer | Zexaron <20824154+Zexaron@users.noreply.github.com> | 2018-10-13 10:35:42 +0200 |
| commit | 550aa93ed050af73016e77fd6176d98c91a5f2d4 (patch) | |
| tree | 4c1efa10c75945549d0259edd0ecd8a0ee4a9904 /Source/Core/DolphinQt/MainWindow.cpp | |
| parent | 480972612c17912b58d4a3163101baa9735efbf2 (diff) | |
NetPlay: Properly save Hosting GUI settings
Diffstat (limited to 'Source/Core/DolphinQt/MainWindow.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/MainWindow.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index 6330fb7fcf..e359309775 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -1093,16 +1093,18 @@ bool MainWindow::NetPlayJoin() return false; } + auto server = Settings::Instance().GetNetPlayServer(); + // 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()) + if (server) { host_ip = "127.0.0.1"; - host_port = Settings::Instance().GetNetPlayServer()->GetPort(); + host_port = server->GetPort(); } else { @@ -1114,9 +1116,17 @@ bool MainWindow::NetPlayJoin() 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); + const bool host_input_authority = Config::Get(Config::NETPLAY_HOST_INPUT_AUTHORITY); + + if (server) + { + server->SetHostInputAuthority(host_input_authority); + if (!host_input_authority) + server->AdjustPadBufferSize(Config::Get(Config::NETPLAY_BUFFER_SIZE)); + } // Create Client - const bool is_hosting_netplay = Settings::Instance().GetNetPlayServer() != nullptr; + const bool is_hosting_netplay = server != nullptr; Settings::Instance().ResetNetPlayClient(new NetPlay::NetPlayClient( host_ip, host_port, m_netplay_dialog, nickname, NetPlay::NetTraversalConfig{is_hosting_netplay ? false : is_traversal, traversal_host, @@ -1128,8 +1138,8 @@ bool MainWindow::NetPlayJoin() return false; } - if (Settings::Instance().GetNetPlayServer() != nullptr) - Settings::Instance().GetNetPlayServer()->SetNetPlayUI(m_netplay_dialog); + if (server != nullptr) + server->SetNetPlayUI(m_netplay_dialog); m_netplay_setup_dialog->close(); m_netplay_dialog->show(nickname, is_traversal); |
