mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +00:00
force_send_savestate is global again
We cannot send a savestate to only one player, as sending a savestate is a synchronization event invalidating all prior input.
This commit is contained in:
parent
3d34c0222f
commit
6556af1100
@ -1119,8 +1119,7 @@ static bool netplay_get_cmd(netplay_t *netplay,
|
|||||||
case NETPLAY_CMD_REQUEST_SAVESTATE:
|
case NETPLAY_CMD_REQUEST_SAVESTATE:
|
||||||
/* Delay until next frame so we don't send the savestate after the
|
/* Delay until next frame so we don't send the savestate after the
|
||||||
* input */
|
* input */
|
||||||
connection->force_send_savestate = true;
|
netplay->force_send_savestate = true;
|
||||||
netplay->force_send_savestate_one = true;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NETPLAY_CMD_LOAD_SAVESTATE:
|
case NETPLAY_CMD_LOAD_SAVESTATE:
|
||||||
|
@ -267,8 +267,7 @@ static void netplay_handshake_ready(netplay_t *netplay, struct netplay_connectio
|
|||||||
/* Send them the savestate */
|
/* Send them the savestate */
|
||||||
if (!(netplay->quirks & (NETPLAY_QUIRK_NO_SAVESTATES|NETPLAY_QUIRK_NO_TRANSMISSION)))
|
if (!(netplay->quirks & (NETPLAY_QUIRK_NO_SAVESTATES|NETPLAY_QUIRK_NO_TRANSMISSION)))
|
||||||
{
|
{
|
||||||
connection->force_send_savestate = true;
|
netplay->force_send_savestate = true;
|
||||||
netplay->force_send_savestate_one = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -88,14 +88,12 @@ bool netplay_sync_pre_frame(netplay_t *netplay)
|
|||||||
}
|
}
|
||||||
else if (!(netplay->quirks & NETPLAY_QUIRK_NO_SAVESTATES) && core_serialize(&serial_info))
|
else if (!(netplay->quirks & NETPLAY_QUIRK_NO_SAVESTATES) && core_serialize(&serial_info))
|
||||||
{
|
{
|
||||||
if ((netplay->force_send_savestate_all || netplay->force_send_savestate_one) && !netplay->stall)
|
if (netplay->force_send_savestate && !netplay->stall)
|
||||||
{
|
{
|
||||||
/* Send this along to the other side */
|
/* Send this along to the other side */
|
||||||
serial_info.data_const = netplay->buffer[netplay->self_ptr].state;
|
serial_info.data_const = netplay->buffer[netplay->self_ptr].state;
|
||||||
netplay_load_savestate(netplay, &serial_info, false);
|
netplay_load_savestate(netplay, &serial_info, false);
|
||||||
netplay->force_send_savestate_all =
|
netplay->force_send_savestate = false;
|
||||||
netplay->force_send_savestate_one = false;
|
|
||||||
/* FIXME: Shouldn't send to everyone! */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -249,9 +249,6 @@ struct netplay_connection
|
|||||||
|
|
||||||
/* Player # of connected player */
|
/* Player # of connected player */
|
||||||
int player;
|
int player;
|
||||||
|
|
||||||
/* Force send a savestate, to this connection only */
|
|
||||||
bool force_send_savestate;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct netplay
|
struct netplay
|
||||||
@ -349,13 +346,8 @@ struct netplay
|
|||||||
/* Quirks in the savestate implementation */
|
/* Quirks in the savestate implementation */
|
||||||
uint64_t quirks;
|
uint64_t quirks;
|
||||||
|
|
||||||
/* Force our state to be sent to all connections. Used when we explicitly
|
/* Force our state to be sent to all connections */
|
||||||
* load a state. */
|
bool force_send_savestate;
|
||||||
bool force_send_savestate_all;
|
|
||||||
|
|
||||||
/* Set if there is at least one client which must be sent the state, usually
|
|
||||||
* because they've requested it or just connected. */
|
|
||||||
bool force_send_savestate_one;
|
|
||||||
|
|
||||||
/* Have we requested a savestate as a sync point? */
|
/* Have we requested a savestate as a sync point? */
|
||||||
bool savestate_request_outstanding;
|
bool savestate_request_outstanding;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user