mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
fix netplay paused spam
This commit is contained in:
parent
7a8d87f24a
commit
370b9681b8
@ -912,6 +912,7 @@ static bool netplay_get_cmd(netplay_t *netplay,
|
||||
uint32_t cmd;
|
||||
uint32_t cmd_size;
|
||||
ssize_t recvd;
|
||||
static bool previous_frame_paused = false;
|
||||
|
||||
/* We don't handle the initial handshake here */
|
||||
if (connection->mode < NETPLAY_CONNECTION_CONNECTED)
|
||||
@ -1787,12 +1788,19 @@ static bool netplay_get_cmd(netplay_t *netplay,
|
||||
{
|
||||
snprintf(msg, sizeof(msg)-1, msg_hash_to_str(MSG_NETPLAY_PEER_PAUSED), nick);
|
||||
}
|
||||
RARCH_LOG("[netplay] %s\n", msg);
|
||||
runloop_msg_queue_push(msg, 1, 180, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
if (!previous_frame_paused)
|
||||
{
|
||||
RARCH_LOG("[netplay] %s\n", msg);
|
||||
runloop_msg_queue_push(msg, 1, 180, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
previous_frame_paused = true;
|
||||
break;
|
||||
}
|
||||
|
||||
case NETPLAY_CMD_RESUME:
|
||||
RARCH_LOG("[netplay] resumed\n");
|
||||
previous_frame_paused = false;
|
||||
remote_unpaused(netplay, connection);
|
||||
break;
|
||||
|
||||
|
@ -4520,10 +4520,14 @@ int runloop_iterate(unsigned *sleep_ms)
|
||||
*sleep_ms = 10;
|
||||
return 1;
|
||||
case RUNLOOP_STATE_END:
|
||||
runloop_netplay_pause();
|
||||
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_ENABLED, NULL)
|
||||
&& settings->bools.menu_pause_libretro)
|
||||
{
|
||||
runloop_netplay_pause();
|
||||
}
|
||||
goto end;
|
||||
case RUNLOOP_STATE_MENU_ITERATE:
|
||||
runloop_netplay_pause();
|
||||
runloop_netplay_pause();
|
||||
return 0;
|
||||
case RUNLOOP_STATE_ITERATE:
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user