mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-07 16:49:27 +00:00
NetPlayClient/Server: apply Parameter Object pattern to traversal parameters
This commit is contained in:
parent
fdb5828d62
commit
4b50e77a26
7 changed files with 37 additions and 25 deletions
|
@ -23,8 +23,9 @@ bool NetPlayLauncher::Host(const NetPlayHostConfig& config)
|
|||
return false;
|
||||
}
|
||||
|
||||
netplay_server = new NetPlayServer(config.listen_port, config.use_traversal,
|
||||
config.traversal_host, config.traversal_port);
|
||||
netplay_server = new NetPlayServer(
|
||||
config.listen_port,
|
||||
NetTraversalConfig{config.use_traversal, config.traversal_host, config.traversal_port});
|
||||
|
||||
if (!netplay_server->is_connected)
|
||||
{
|
||||
|
@ -45,9 +46,8 @@ bool NetPlayLauncher::Host(const NetPlayHostConfig& config)
|
|||
npd = new NetPlayDialog(config.parent_window, config.game_list_ctrl, config.game_name, true);
|
||||
|
||||
NetPlayClient*& netplay_client = NetPlayDialog::GetNetPlayClient();
|
||||
netplay_client =
|
||||
new NetPlayClient("127.0.0.1", netplay_server->GetPort(), npd, config.player_name, false,
|
||||
config.traversal_host, config.traversal_port);
|
||||
netplay_client = new NetPlayClient("127.0.0.1", netplay_server->GetPort(), npd,
|
||||
config.player_name, NetTraversalConfig{});
|
||||
|
||||
if (netplay_client->IsConnected())
|
||||
{
|
||||
|
@ -76,9 +76,9 @@ bool NetPlayLauncher::Join(const NetPlayJoinConfig& config)
|
|||
else
|
||||
host = config.connect_host;
|
||||
|
||||
netplay_client =
|
||||
new NetPlayClient(host, config.connect_port, npd, config.player_name, config.use_traversal,
|
||||
config.traversal_host, config.traversal_port);
|
||||
netplay_client = new NetPlayClient(
|
||||
host, config.connect_port, npd, config.player_name,
|
||||
NetTraversalConfig{config.use_traversal, config.traversal_host, config.traversal_port});
|
||||
if (netplay_client->IsConnected())
|
||||
{
|
||||
npd->SetSize(config.window_pos);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue