mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
allow connecting to lobby port instead of the port in settings
This commit is contained in:
parent
a782ecbe1b
commit
33cc168eb9
@ -2443,12 +2443,16 @@ bool command_event(enum event_command cmd, void *data)
|
||||
break;
|
||||
case CMD_EVENT_NETPLAY_INIT_DIRECT_DEFERRED:
|
||||
{
|
||||
char *hostname = (char *) data;
|
||||
/* buf is expected to be address:port, there must be a better way
|
||||
to do this but for now I'll just use a string list */
|
||||
char *buf = (char *) data;
|
||||
static struct string_list *hostname = NULL;
|
||||
hostname = string_split(buf, ":");
|
||||
|
||||
settings_t *settings = config_get_ptr();
|
||||
command_event(CMD_EVENT_NETPLAY_DEINIT, NULL);
|
||||
if (!init_netplay_deferred(
|
||||
hostname, settings->netplay.port))
|
||||
hostname->elems[0].data, atoi(hostname->elems[1].data)))
|
||||
{
|
||||
command_event(CMD_EVENT_NETPLAY_DEINIT, NULL);
|
||||
return false;
|
||||
|
@ -3130,6 +3130,8 @@ static int action_ok_netplay_connect_room(const char *path,
|
||||
/* For testing purposes
|
||||
strlcpy(tmp_hostname, "192.168.1.241", sizeof(tmp_hostname));*/
|
||||
strlcpy(tmp_hostname, netplay_room_list[idx - 1].address, sizeof(tmp_hostname));
|
||||
snprintf(tmp_hostname, sizeof(tmp_hostname), "%s:%d",
|
||||
netplay_room_list[idx - 1].address, netplay_room_list[idx - 1].port);
|
||||
|
||||
/* If we haven't yet started, this will load on its own */
|
||||
if (!content_is_inited())
|
||||
|
@ -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 ? (!netplay_client_deferred ? server : server_address_deferred) : NULL,
|
||||
port ? port : RARCH_DEFAULT_PORT,
|
||||
port ? ( !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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user