mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 08:43:10 +00:00
Fix stall-out causing total disconnection with >2 players
This commit is contained in:
parent
45287628d4
commit
c0ed989738
@ -500,17 +500,24 @@ static bool netplay_poll(void)
|
|||||||
/* Stalled out! */
|
/* Stalled out! */
|
||||||
if (netplay_data->is_server)
|
if (netplay_data->is_server)
|
||||||
{
|
{
|
||||||
|
bool fixed = false;
|
||||||
for (i = 0; i < netplay_data->connections_size; i++)
|
for (i = 0; i < netplay_data->connections_size; i++)
|
||||||
{
|
{
|
||||||
struct netplay_connection *connection = &netplay_data->connections[i];
|
struct netplay_connection *connection = &netplay_data->connections[i];
|
||||||
if (connection->active &&
|
if (connection->active &&
|
||||||
connection->mode == NETPLAY_CONNECTION_PLAYING &&
|
connection->mode == NETPLAY_CONNECTION_PLAYING &&
|
||||||
connection->stall &&
|
connection->stall)
|
||||||
now - connection->stall_time >= MAX_SERVER_STALL_TIME_USEC)
|
|
||||||
{
|
{
|
||||||
netplay_hangup(netplay_data, connection);
|
netplay_hangup(netplay_data, connection);
|
||||||
|
fixed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fixed) {
|
||||||
|
/* Not stalled now :) */
|
||||||
|
netplay_data->stall = NETPLAY_STALL_NONE;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
goto catastrophe;
|
goto catastrophe;
|
||||||
|
@ -376,8 +376,9 @@ static bool netplay_init_buffers(netplay_t *netplay)
|
|||||||
{
|
{
|
||||||
struct delta_frame *delta_frames = NULL;
|
struct delta_frame *delta_frames = NULL;
|
||||||
|
|
||||||
/* Enough to get ahead or behind by MAX_STALL_FRAMES frames */
|
/* Enough to get ahead or behind by MAX_STALL_FRAMES frames, plus one for
|
||||||
netplay->buffer_size = NETPLAY_MAX_STALL_FRAMES + 1;
|
* other remote clients, plus one to send the stall message */
|
||||||
|
netplay->buffer_size = NETPLAY_MAX_STALL_FRAMES + 2;
|
||||||
|
|
||||||
/* If we're the server, we need enough to get ahead AND behind by
|
/* If we're the server, we need enough to get ahead AND behind by
|
||||||
* MAX_STALL_FRAMES frame */
|
* MAX_STALL_FRAMES frame */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user