mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-18 08:52:41 +00:00
Reviving netplay_log_connection, i.e. connection messages on the host
This commit is contained in:
parent
cda0324627
commit
49b4143687
@ -898,6 +898,7 @@ void netplay_log_connection(const struct sockaddr_storage *their_addr,
|
|||||||
const char *str = NULL;
|
const char *str = NULL;
|
||||||
char buf_v4[INET_ADDRSTRLEN] = {0};
|
char buf_v4[INET_ADDRSTRLEN] = {0};
|
||||||
char buf_v6[INET6_ADDRSTRLEN] = {0};
|
char buf_v6[INET6_ADDRSTRLEN] = {0};
|
||||||
|
char msg[512] = {0};
|
||||||
|
|
||||||
u.storage = their_addr;
|
u.storage = their_addr;
|
||||||
|
|
||||||
@ -937,14 +938,34 @@ void netplay_log_connection(const struct sockaddr_storage *their_addr,
|
|||||||
|
|
||||||
if (str)
|
if (str)
|
||||||
{
|
{
|
||||||
char msg[512] = {0};
|
snprintf(msg, sizeof(msg), "Got connection from: \"%s (%s)\"",
|
||||||
|
nick, str);
|
||||||
snprintf(msg, sizeof(msg), "Got connection from: \"%s (%s)\" (#%u)",
|
|
||||||
nick, str, slot);
|
|
||||||
runloop_msg_queue_push(msg, 1, 180, false);
|
runloop_msg_queue_push(msg, 1, 180, false);
|
||||||
RARCH_LOG("%s\n", msg);
|
RARCH_LOG("%s\n", msg);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
snprintf(msg, sizeof(msg), "Got connection from: \"%s\"",
|
||||||
|
nick);
|
||||||
|
runloop_msg_queue_push(msg, 1, 180, false);
|
||||||
|
RARCH_LOG("%s\n", msg);
|
||||||
|
}
|
||||||
|
RARCH_LOG("Connection slot %u\n", slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
void netplay_log_connection(const struct sockaddr_storage *their_addr,
|
||||||
|
unsigned slot, const char *nick)
|
||||||
|
{
|
||||||
|
char msg[512] = {0};
|
||||||
|
|
||||||
|
snprintf(msg, sizeof(msg), "Got connection from: \"%s\"",
|
||||||
|
nick);
|
||||||
|
runloop_msg_queue_push(msg, 1, 180, false);
|
||||||
|
RARCH_LOG("%s\n", msg);
|
||||||
|
RARCH_LOG("Connection slot %u\n", slot);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -339,9 +339,7 @@ bool netplay_get_info(netplay_t *netplay)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_SOCKET_LEGACY
|
|
||||||
netplay_log_connection(&netplay->other_addr, 0, netplay->other_nick);
|
netplay_log_connection(&netplay->other_addr, 0, netplay->other_nick);
|
||||||
#endif
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user