mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 04:14:00 +00:00
Move other_addr from netplay to connection.
This commit is contained in:
parent
d1d29143b2
commit
ea722b49c8
@ -202,12 +202,13 @@ static bool init_tcp_socket(netplay_t *netplay, void *direct_host,
|
||||
|
||||
while (tmp_info)
|
||||
{
|
||||
struct sockaddr_storage sad;
|
||||
int fd = init_tcp_connection(
|
||||
tmp_info,
|
||||
direct_host || server,
|
||||
netplay->spectate.enabled,
|
||||
(struct sockaddr*)&netplay->other_addr,
|
||||
sizeof(netplay->other_addr));
|
||||
(struct sockaddr*)&sad,
|
||||
sizeof(sad));
|
||||
|
||||
if (fd >= 0)
|
||||
{
|
||||
@ -216,6 +217,7 @@ static bool init_tcp_socket(netplay_t *netplay, void *direct_host,
|
||||
{
|
||||
netplay->connections[0].active = true;
|
||||
netplay->connections[0].fd = fd;
|
||||
netplay->connections[0].addr = sad;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -262,7 +262,7 @@ static void netplay_handshake_ready(netplay_t *netplay, struct netplay_connectio
|
||||
|
||||
if (netplay->is_server)
|
||||
{
|
||||
netplay_log_connection(&netplay->other_addr, 0, connection->nick);
|
||||
netplay_log_connection(&connection->addr, 0, connection->nick);
|
||||
|
||||
/* Send them the savestate */
|
||||
if (!(netplay->quirks & (NETPLAY_QUIRK_NO_SAVESTATES|NETPLAY_QUIRK_NO_TRANSMISSION)))
|
||||
|
@ -232,6 +232,9 @@ struct netplay_connection
|
||||
/* fd associated with this connection */
|
||||
int fd;
|
||||
|
||||
/* Address of peer */
|
||||
struct sockaddr_storage addr;
|
||||
|
||||
/* Nickname of peer */
|
||||
char nick[32];
|
||||
|
||||
@ -250,9 +253,6 @@ struct netplay
|
||||
/* Our nickname */
|
||||
char nick[32];
|
||||
|
||||
/* Address of peer */
|
||||
struct sockaddr_storage other_addr;
|
||||
|
||||
/* TCP connection for listening (server only) */
|
||||
int listen_fd;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user