mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
More careful disconnection.
This commit is contained in:
parent
c8bba9a981
commit
ab989d7f41
@ -298,8 +298,13 @@ static void hangup(netplay_t *netplay, struct netplay_connection *connection)
|
||||
netplay_deinit_socket_buffer(&connection->recv_packet_buffer);
|
||||
|
||||
if (!netplay->is_server)
|
||||
{
|
||||
netplay->self_mode = NETPLAY_CONNECTION_NONE;
|
||||
netplay->connected_players = 0;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Remove this player */
|
||||
if (connection->mode == NETPLAY_CONNECTION_PLAYING)
|
||||
{
|
||||
@ -314,6 +319,8 @@ static void hangup(netplay_t *netplay, struct netplay_connection *connection)
|
||||
netplay_send_raw_cmd_all(netplay, connection, NETPLAY_CMD_MODE, payload, sizeof(payload));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -245,7 +245,8 @@ void netplay_sync_post_frame(netplay_t *netplay)
|
||||
netplay->self_frame_count++;
|
||||
|
||||
/* Only relevant if we're connected */
|
||||
if (netplay->is_server && !netplay->connected_players)
|
||||
if ((netplay->is_server && !netplay->connected_players) ||
|
||||
(netplay->self_mode < NETPLAY_CONNECTION_CONNECTED))
|
||||
{
|
||||
netplay->other_frame_count = netplay->self_frame_count;
|
||||
netplay->other_ptr = netplay->self_ptr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user