mirror of
https://github.com/libretro/RetroArch
synced 2025-03-01 16:13:40 +00:00
Nominal support for server sending blank INFO
This commit is contained in:
parent
e79f30604f
commit
60b81e3a51
@ -723,6 +723,7 @@ bool netplay_handshake_pre_info(netplay_t *netplay,
|
|||||||
struct netplay_connection *connection, bool *had_input)
|
struct netplay_connection *connection, bool *had_input)
|
||||||
{
|
{
|
||||||
struct info_buf_s info_buf;
|
struct info_buf_s info_buf;
|
||||||
|
uint32_t cmd_size;
|
||||||
ssize_t recvd;
|
ssize_t recvd;
|
||||||
rarch_system_info_t *core_info;
|
rarch_system_info_t *core_info;
|
||||||
uint32_t *content_crc_ptr;
|
uint32_t *content_crc_ptr;
|
||||||
@ -731,13 +732,32 @@ bool netplay_handshake_pre_info(netplay_t *netplay,
|
|||||||
RECV(&info_buf, sizeof(info_buf));
|
RECV(&info_buf, sizeof(info_buf));
|
||||||
|
|
||||||
if (recvd < 0 ||
|
if (recvd < 0 ||
|
||||||
ntohl(info_buf.cmd[0]) != NETPLAY_CMD_INFO ||
|
ntohl(info_buf.cmd[0]) != NETPLAY_CMD_INFO)
|
||||||
ntohl(info_buf.cmd[1]) != sizeof(info_buf) - 2*sizeof(uint32_t))
|
|
||||||
{
|
{
|
||||||
RARCH_ERR("Failed to receive netplay info.\n");
|
RARCH_ERR("Failed to receive netplay info.\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cmd_size = ntohl(info_buf.cmd[1]);
|
||||||
|
if (cmd_size != sizeof(info_buf) - 2*sizeof(uint32_t))
|
||||||
|
{
|
||||||
|
/* Either the host doesn't have anything loaded, or this is just screwy */
|
||||||
|
if (cmd_size != 0)
|
||||||
|
{
|
||||||
|
/* Huh? */
|
||||||
|
RARCH_ERR("Invalid NETPLAY_CMD_INFO payload size.\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Send our info and hope they load it! */
|
||||||
|
if (!netplay_handshake_info(netplay, connection))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
*had_input = true;
|
||||||
|
netplay_recv_flush(&connection->recv_packet_buffer);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check the core info */
|
/* Check the core info */
|
||||||
core_info = NULL;
|
core_info = NULL;
|
||||||
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &core_info);
|
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &core_info);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user