From c097c2062ef8b705c0987492fc94c44d4f87f55b Mon Sep 17 00:00:00 2001 From: fr500 Date: Wed, 25 Jan 2017 17:43:17 -0500 Subject: [PATCH 1/3] fix when port is 0 --- network/netplay/netplay_frontend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network/netplay/netplay_frontend.c b/network/netplay/netplay_frontend.c index 61316177ac..53ffe5ebf1 100644 --- a/network/netplay/netplay_frontend.c +++ b/network/netplay/netplay_frontend.c @@ -947,9 +947,9 @@ bool init_netplay(void *direct_host, const char *server, unsigned port) } netplay_data = (netplay_t*)netplay_new( - netplay_is_client ? direct_host : NULL, + netplay_is_client ? direct_host : NULL, netplay_is_client ? (!netplay_client_deferred ? server : server_address_deferred) : NULL, - port ? ( !netplay_client_deferred ? port : server_port_deferred) : RARCH_DEFAULT_PORT, + netplay_is_client ? (!netplay_client_deferred ? port : server_port_deferred ) : RARCH_DEFAULT_PORT, settings->netplay.stateless_mode, settings->netplay.check_frames, &cbs, settings->netplay.nat_traversal, settings->username, quirks); From af14da93d53a5f13d92507eb34952e46581040a5 Mon Sep 17 00:00:00 2001 From: fr500 Date: Wed, 25 Jan 2017 17:43:56 -0500 Subject: [PATCH 2/3] fix whitespace --- network/netplay/netplay_frontend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network/netplay/netplay_frontend.c b/network/netplay/netplay_frontend.c index 53ffe5ebf1..8cf43a3731 100644 --- a/network/netplay/netplay_frontend.c +++ b/network/netplay/netplay_frontend.c @@ -947,7 +947,7 @@ bool init_netplay(void *direct_host, const char *server, unsigned port) } netplay_data = (netplay_t*)netplay_new( - netplay_is_client ? direct_host : NULL, + netplay_is_client ? direct_host : NULL, netplay_is_client ? (!netplay_client_deferred ? server : server_address_deferred) : NULL, netplay_is_client ? (!netplay_client_deferred ? port : server_port_deferred ) : RARCH_DEFAULT_PORT, settings->netplay.stateless_mode, settings->netplay.check_frames, &cbs, From 29a1d504d72a8d214aa26a77af728fca22596531 Mon Sep 17 00:00:00 2001 From: fr500 Date: Wed, 25 Jan 2017 17:48:43 -0500 Subject: [PATCH 3/3] allow different server ports again --- network/netplay/netplay_frontend.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/network/netplay/netplay_frontend.c b/network/netplay/netplay_frontend.c index 8cf43a3731..462c69a611 100644 --- a/network/netplay/netplay_frontend.c +++ b/network/netplay/netplay_frontend.c @@ -948,8 +948,10 @@ bool init_netplay(void *direct_host, const char *server, unsigned port) netplay_data = (netplay_t*)netplay_new( netplay_is_client ? direct_host : NULL, - netplay_is_client ? (!netplay_client_deferred ? server : server_address_deferred) : NULL, - netplay_is_client ? (!netplay_client_deferred ? port : server_port_deferred ) : RARCH_DEFAULT_PORT, + netplay_is_client ? (!netplay_client_deferred ? server + : server_address_deferred) : NULL, + netplay_is_client ? (!netplay_client_deferred ? port + : server_port_deferred ) : (port != 0 ? port : RARCH_DEFAULT_PORT), settings->netplay.stateless_mode, settings->netplay.check_frames, &cbs, settings->netplay.nat_traversal, settings->username, quirks);