no need to do nat traversal if using relay

This commit is contained in:
radius 2019-05-26 15:22:29 -05:00 committed by twinaphex
parent 370b9681b8
commit 34be5f399c
2 changed files with 3 additions and 11 deletions

View File

@ -1514,7 +1514,7 @@ bool init_netplay(void *direct_host, const char *server, unsigned port)
settings->bools.netplay_stateless_mode,
settings->ints.netplay_check_frames,
&cbs,
settings->bools.netplay_nat_traversal,
settings->bools.netplay_nat_traversal && !settings->bools.netplay_use_mitm_server,
#ifdef HAVE_DISCORD
discord_get_own_username() ? discord_get_own_username() :
#endif

View File

@ -912,7 +912,6 @@ static bool netplay_get_cmd(netplay_t *netplay,
uint32_t cmd;
uint32_t cmd_size;
ssize_t recvd;
static bool previous_frame_paused = false;
/* We don't handle the initial handshake here */
if (connection->mode < NETPLAY_CONNECTION_CONNECTED)
@ -1788,19 +1787,12 @@ static bool netplay_get_cmd(netplay_t *netplay,
{
snprintf(msg, sizeof(msg)-1, msg_hash_to_str(MSG_NETPLAY_PEER_PAUSED), nick);
}
if (!previous_frame_paused)
{
RARCH_LOG("[netplay] %s\n", msg);
runloop_msg_queue_push(msg, 1, 180, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
}
previous_frame_paused = true;
RARCH_LOG("[netplay] %s\n", msg);
runloop_msg_queue_push(msg, 1, 180, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
break;
}
case NETPLAY_CMD_RESUME:
RARCH_LOG("[netplay] resumed\n");
previous_frame_paused = false;
remote_unpaused(netplay, connection);
break;