Adding Netplay quirk for untransmittable savestates
This commit is contained in:
parent
44931586b7
commit
5676d0b848
|
@ -1280,6 +1280,10 @@ void netplay_load_savestate(netplay_t *netplay, retro_ctx_serialize_info_t *seri
|
||||||
netplay->other_frame_count = netplay->self_frame_count;
|
netplay->other_frame_count = netplay->self_frame_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If we can't send it to the peer, loading a state was a bad idea */
|
||||||
|
if (netplay->quirks & (NETPLAY_QUIRK_NO_SAVESTATES|NETPLAY_QUIRK_NO_TRANSMISSION))
|
||||||
|
return;
|
||||||
|
|
||||||
/* And send it to the peer (FIXME: this is an ugly way to do this) */
|
/* And send it to the peer (FIXME: this is an ugly way to do this) */
|
||||||
header[0] = htonl(NETPLAY_CMD_LOAD_SAVESTATE);
|
header[0] = htonl(NETPLAY_CMD_LOAD_SAVESTATE);
|
||||||
header[1] = htonl(serial_info->size + sizeof(uint32_t));
|
header[1] = htonl(serial_info->size + sizeof(uint32_t));
|
||||||
|
|
|
@ -85,9 +85,12 @@ static bool netplay_net_pre_frame(netplay_t *netplay)
|
||||||
* remote input on EVERY frame, because we can't recover */
|
* remote input on EVERY frame, because we can't recover */
|
||||||
netplay->quirks |= NETPLAY_QUIRK_NO_SAVESTATES;
|
netplay->quirks |= NETPLAY_QUIRK_NO_SAVESTATES;
|
||||||
netplay->stall_frames = 0;
|
netplay->stall_frames = 0;
|
||||||
if (!netplay->has_connection)
|
|
||||||
netplay->stall = RARCH_NETPLAY_STALL_NO_CONNECTION;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If we can't transmit savestates, we must stall until the client is ready */
|
||||||
|
if (!netplay->has_connection &&
|
||||||
|
(netplay->quirks & (NETPLAY_QUIRK_NO_SAVESTATES|NETPLAY_QUIRK_NO_TRANSMISSION)))
|
||||||
|
netplay->stall = RARCH_NETPLAY_STALL_NO_CONNECTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (netplay->is_server && !netplay->has_connection)
|
if (netplay->is_server && !netplay->has_connection)
|
||||||
|
@ -135,10 +138,8 @@ static bool netplay_net_pre_frame(netplay_t *netplay)
|
||||||
netplay->has_connection = true;
|
netplay->has_connection = true;
|
||||||
|
|
||||||
/* Send them the savestate */
|
/* Send them the savestate */
|
||||||
if (!(netplay->quirks & NETPLAY_QUIRK_NO_SAVESTATES) && !(netplay->quirks & NETPLAY_QUIRK_NO_TRANSMISSION))
|
if (!(netplay->quirks & (NETPLAY_QUIRK_NO_SAVESTATES|NETPLAY_QUIRK_NO_TRANSMISSION)))
|
||||||
{
|
|
||||||
netplay_load_savestate(netplay, NULL, true);
|
netplay_load_savestate(netplay, NULL, true);
|
||||||
}
|
|
||||||
|
|
||||||
/* And expect the current frame from the other side */
|
/* And expect the current frame from the other side */
|
||||||
netplay->read_frame_count = netplay->other_frame_count = netplay->self_frame_count;
|
netplay->read_frame_count = netplay->other_frame_count = netplay->self_frame_count;
|
||||||
|
|
Loading…
Reference in New Issue