mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +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! */
|
||||
if (netplay_data->is_server)
|
||||
{
|
||||
bool fixed = false;
|
||||
for (i = 0; i < netplay_data->connections_size; i++)
|
||||
{
|
||||
struct netplay_connection *connection = &netplay_data->connections[i];
|
||||
if (connection->active &&
|
||||
connection->mode == NETPLAY_CONNECTION_PLAYING &&
|
||||
connection->stall &&
|
||||
now - connection->stall_time >= MAX_SERVER_STALL_TIME_USEC)
|
||||
connection->stall)
|
||||
{
|
||||
netplay_hangup(netplay_data, connection);
|
||||
fixed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (fixed) {
|
||||
/* Not stalled now :) */
|
||||
netplay_data->stall = NETPLAY_STALL_NONE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
goto catastrophe;
|
||||
|
@ -376,8 +376,9 @@ static bool netplay_init_buffers(netplay_t *netplay)
|
||||
{
|
||||
struct delta_frame *delta_frames = NULL;
|
||||
|
||||
/* Enough to get ahead or behind by MAX_STALL_FRAMES frames */
|
||||
netplay->buffer_size = NETPLAY_MAX_STALL_FRAMES + 1;
|
||||
/* Enough to get ahead or behind by MAX_STALL_FRAMES frames, plus one for
|
||||
* 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
|
||||
* MAX_STALL_FRAMES frame */
|
||||
|
Loading…
x
Reference in New Issue
Block a user