mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
Add enum netplay_modus
This commit is contained in:
parent
9de805c9b1
commit
e2621a8474
@ -268,6 +268,19 @@ enum rarch_netplay_stall_reason
|
|||||||
NETPLAY_STALL_SERVER_REQUESTED
|
NETPLAY_STALL_SERVER_REQUESTED
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum netplay_modus
|
||||||
|
{
|
||||||
|
/* Netplay operates by having all participants send input data every
|
||||||
|
frame and run cores deterministically in sync on all connected devices.
|
||||||
|
It will rewind frames when input data from the past arrives. */
|
||||||
|
NETPLAY_MODUS_INPUT_FRAME_SYNC = 0,
|
||||||
|
|
||||||
|
/* Netplay operates by having the active core send and receive custom
|
||||||
|
packets once connection setup and handshake has been completed.
|
||||||
|
Time skips (pausing, fast forward, save state loading) are refused. */
|
||||||
|
NETPLAY_MODUS_CORE_PACKET_INTERFACE = 1,
|
||||||
|
};
|
||||||
|
|
||||||
/* Input state for a particular client-device pair */
|
/* Input state for a particular client-device pair */
|
||||||
typedef struct netplay_input_state
|
typedef struct netplay_input_state
|
||||||
{
|
{
|
||||||
@ -607,6 +620,9 @@ struct netplay
|
|||||||
/* Are we stalled? */
|
/* Are we stalled? */
|
||||||
enum rarch_netplay_stall_reason stall;
|
enum rarch_netplay_stall_reason stall;
|
||||||
|
|
||||||
|
/* Netplay mode of operation (cannot change at runtime) */
|
||||||
|
enum netplay_modus modus;
|
||||||
|
|
||||||
/* Keyboard mapping (network and host) */
|
/* Keyboard mapping (network and host) */
|
||||||
uint16_t mapping_hton[RETROK_LAST];
|
uint16_t mapping_hton[RETROK_LAST];
|
||||||
uint16_t mapping_ntoh[NETPLAY_KEY_LAST];
|
uint16_t mapping_ntoh[NETPLAY_KEY_LAST];
|
||||||
|
@ -2915,6 +2915,10 @@ bool command_event(enum event_command cmd, void *data)
|
|||||||
#ifdef HAVE_CHEEVOS
|
#ifdef HAVE_CHEEVOS
|
||||||
if (rcheevos_hardcore_active())
|
if (rcheevos_hardcore_active())
|
||||||
return false;
|
return false;
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETWORKING
|
||||||
|
if (!netplay_driver_ctl(RARCH_NETPLAY_CTL_ALLOW_TIMESKIP, NULL))
|
||||||
|
return false;
|
||||||
#endif
|
#endif
|
||||||
if (rewind_enable)
|
if (rewind_enable)
|
||||||
{
|
{
|
||||||
|
10
runloop.c
10
runloop.c
@ -3487,9 +3487,15 @@ bool runloop_environment_cb(unsigned cmd, void *data)
|
|||||||
case RETRO_ENVIRONMENT_SET_NETPACKET_INTERFACE:
|
case RETRO_ENVIRONMENT_SET_NETPACKET_INTERFACE:
|
||||||
#ifdef HAVE_NETWORKING
|
#ifdef HAVE_NETWORKING
|
||||||
RARCH_LOG("[Environ]: RETRO_ENVIRONMENT_SET_NETPACKET_INTERFACE.\n");
|
RARCH_LOG("[Environ]: RETRO_ENVIRONMENT_SET_NETPACKET_INTERFACE.\n");
|
||||||
netplay_driver_ctl(RARCH_NETPLAY_CTL_SET_CORE_PACKET_INTERFACE, data);
|
if (!netplay_driver_ctl(RARCH_NETPLAY_CTL_SET_CORE_PACKET_INTERFACE, data))
|
||||||
#endif
|
{
|
||||||
|
RARCH_ERR("[Environ] RETRO_ENVIRONMENT_SET_NETPACKET_INTERFACE set too late\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
RARCH_LOG("[Environ]: UNSUPPORTED (#%u).\n", cmd);
|
RARCH_LOG("[Environ]: UNSUPPORTED (#%u).\n", cmd);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user