mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 06:44:27 +00:00
Whoops, missed one refactor rename.
This commit is contained in:
parent
6946ea1bd3
commit
74901e6161
@ -178,8 +178,8 @@ static bool get_self_input_state(netplay_t *netplay)
|
|||||||
|
|
||||||
ptr->have_real[netplay->self_client_num] = true;
|
ptr->have_real[netplay->self_client_num] = true;
|
||||||
ptr->have_local = true;
|
ptr->have_local = true;
|
||||||
netplay->read_ptr1[netplay->self_client_num] = NEXT_PTR(netplay->self_ptr);
|
netplay->read_ptr[netplay->self_client_num] = NEXT_PTR(netplay->self_ptr);
|
||||||
netplay->read_frame_count1[netplay->self_client_num] = netplay->self_frame_count + 1;
|
netplay->read_frame_count[netplay->self_client_num] = netplay->self_frame_count + 1;
|
||||||
|
|
||||||
/* And send this input to our peers */
|
/* And send this input to our peers */
|
||||||
for (i = 0; i < netplay->connections_size; i++)
|
for (i = 0; i < netplay->connections_size; i++)
|
||||||
@ -394,7 +394,7 @@ static bool netplay_poll(void)
|
|||||||
struct netplay_connection *connection;
|
struct netplay_connection *connection;
|
||||||
if (!(netplay_data->connected_players & (1<<client)))
|
if (!(netplay_data->connected_players & (1<<client)))
|
||||||
continue;
|
continue;
|
||||||
if (netplay_data->read_frame_count1[client] > netplay_data->unread_frame_count)
|
if (netplay_data->read_frame_count[client] > netplay_data->unread_frame_count)
|
||||||
continue;
|
continue;
|
||||||
connection = &netplay_data->connections[client-1];
|
connection = &netplay_data->connections[client-1];
|
||||||
if (connection->active &&
|
if (connection->active &&
|
||||||
@ -960,10 +960,10 @@ static void netplay_force_future(netplay_t *netplay)
|
|||||||
for (client = 0; client < MAX_CLIENTS; client++)
|
for (client = 0; client < MAX_CLIENTS; client++)
|
||||||
{
|
{
|
||||||
if (!(netplay->connected_players & (1<<client))) continue;
|
if (!(netplay->connected_players & (1<<client))) continue;
|
||||||
if (netplay->read_frame_count1[client] < netplay->run_frame_count)
|
if (netplay->read_frame_count[client] < netplay->run_frame_count)
|
||||||
{
|
{
|
||||||
netplay->read_ptr1[client] = netplay->run_ptr;
|
netplay->read_ptr[client] = netplay->run_ptr;
|
||||||
netplay->read_frame_count1[client] = netplay->run_frame_count;
|
netplay->read_frame_count[client] = netplay->run_frame_count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (netplay->server_frame_count < netplay->run_frame_count)
|
if (netplay->server_frame_count < netplay->run_frame_count)
|
||||||
@ -1246,8 +1246,8 @@ static void netplay_toggle_play_spectate(netplay_t *netplay)
|
|||||||
netplay->client_devices[0] = netplay->self_devices = (1<<device);
|
netplay->client_devices[0] = netplay->self_devices = (1<<device);
|
||||||
netplay->device_clients[device] = 1;
|
netplay->device_clients[device] = 1;
|
||||||
netplay->device_share_modes[device] = share_mode;
|
netplay->device_share_modes[device] = share_mode;
|
||||||
netplay->read_ptr1[0] = netplay->self_ptr;
|
netplay->read_ptr[0] = netplay->self_ptr;
|
||||||
netplay->read_frame_count1[0] = netplay->self_frame_count;
|
netplay->read_frame_count[0] = netplay->self_frame_count;
|
||||||
|
|
||||||
dmsg = msg;
|
dmsg = msg;
|
||||||
msg[sizeof(msg)-1] = '\0';
|
msg[sizeof(msg)-1] = '\0';
|
||||||
|
@ -1012,8 +1012,8 @@ bool netplay_handshake_pre_sync(netplay_t *netplay,
|
|||||||
}
|
}
|
||||||
for (i = 0; i < MAX_CLIENTS; i++)
|
for (i = 0; i < MAX_CLIENTS; i++)
|
||||||
{
|
{
|
||||||
netplay->read_ptr1[i] = netplay->self_ptr;
|
netplay->read_ptr[i] = netplay->self_ptr;
|
||||||
netplay->read_frame_count1[i] = netplay->self_frame_count;
|
netplay->read_frame_count[i] = netplay->self_frame_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get and set each input device */
|
/* Get and set each input device */
|
||||||
|
@ -46,7 +46,7 @@ static void print_state(netplay_t *netplay)
|
|||||||
for (client = 0; client < MAX_USERS; client++)
|
for (client = 0; client < MAX_USERS; client++)
|
||||||
{
|
{
|
||||||
if ((netplay->connected_players & (1<<client)))
|
if ((netplay->connected_players & (1<<client)))
|
||||||
APPEND((M, " %u:%u", client, netplay->read_frame_count1[client]));
|
APPEND((M, " %u:%u", client, netplay->read_frame_count[client]));
|
||||||
}
|
}
|
||||||
msg[sizeof(msg)-1] = '\0';
|
msg[sizeof(msg)-1] = '\0';
|
||||||
|
|
||||||
@ -147,7 +147,7 @@ void netplay_hangup(netplay_t *netplay, struct netplay_connection *connection)
|
|||||||
/* This special mode keeps the connection object alive long enough to
|
/* This special mode keeps the connection object alive long enough to
|
||||||
* send the disconnection message at the correct time */
|
* send the disconnection message at the correct time */
|
||||||
connection->mode = NETPLAY_CONNECTION_DELAYED_DISCONNECT;
|
connection->mode = NETPLAY_CONNECTION_DELAYED_DISCONNECT;
|
||||||
connection->delay_frame = netplay->read_frame_count1[client_num];
|
connection->delay_frame = netplay->read_frame_count[client_num];
|
||||||
|
|
||||||
/* Mark them as not playing anymore */
|
/* Mark them as not playing anymore */
|
||||||
netplay->connected_players &= ~(1L<<client_num);
|
netplay->connected_players &= ~(1L<<client_num);
|
||||||
@ -624,7 +624,7 @@ static bool netplay_get_cmd(netplay_t *netplay,
|
|||||||
/* Check the frame number only if they're not in slave mode */
|
/* Check the frame number only if they're not in slave mode */
|
||||||
if (connection->mode == NETPLAY_CONNECTION_PLAYING)
|
if (connection->mode == NETPLAY_CONNECTION_PLAYING)
|
||||||
{
|
{
|
||||||
if (frame_num < netplay->read_frame_count1[client_num])
|
if (frame_num < netplay->read_frame_count[client_num])
|
||||||
{
|
{
|
||||||
uint32_t buf;
|
uint32_t buf;
|
||||||
/* We already had this, so ignore the new transmission */
|
/* We already had this, so ignore the new transmission */
|
||||||
@ -635,7 +635,7 @@ static bool netplay_get_cmd(netplay_t *netplay,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (frame_num > netplay->read_frame_count1[client_num])
|
else if (frame_num > netplay->read_frame_count[client_num])
|
||||||
{
|
{
|
||||||
/* Out of order = out of luck */
|
/* Out of order = out of luck */
|
||||||
RARCH_ERR("Netplay input out of order.\n");
|
RARCH_ERR("Netplay input out of order.\n");
|
||||||
@ -644,8 +644,8 @@ static bool netplay_get_cmd(netplay_t *netplay,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The data's good! */
|
/* The data's good! */
|
||||||
dframe = &netplay->buffer[netplay->read_ptr1[client_num]];
|
dframe = &netplay->buffer[netplay->read_ptr[client_num]];
|
||||||
if (!netplay_delta_frame_ready(netplay, dframe, netplay->read_frame_count1[client_num]))
|
if (!netplay_delta_frame_ready(netplay, dframe, netplay->read_frame_count[client_num]))
|
||||||
{
|
{
|
||||||
/* Hopefully we'll be ready after another round of input */
|
/* Hopefully we'll be ready after another round of input */
|
||||||
goto shrt;
|
goto shrt;
|
||||||
@ -679,8 +679,8 @@ static bool netplay_get_cmd(netplay_t *netplay,
|
|||||||
* handling all network data this frame */
|
* handling all network data this frame */
|
||||||
if (connection->mode == NETPLAY_CONNECTION_PLAYING)
|
if (connection->mode == NETPLAY_CONNECTION_PLAYING)
|
||||||
{
|
{
|
||||||
netplay->read_ptr1[client_num] = NEXT_PTR(netplay->read_ptr1[client_num]);
|
netplay->read_ptr[client_num] = NEXT_PTR(netplay->read_ptr[client_num]);
|
||||||
netplay->read_frame_count1[client_num]++;
|
netplay->read_frame_count[client_num]++;
|
||||||
|
|
||||||
if (netplay->is_server)
|
if (netplay->is_server)
|
||||||
{
|
{
|
||||||
@ -693,8 +693,8 @@ static bool netplay_get_cmd(netplay_t *netplay,
|
|||||||
/* If this was server data, advance our server pointer too */
|
/* If this was server data, advance our server pointer too */
|
||||||
if (!netplay->is_server && client_num == 0)
|
if (!netplay->is_server && client_num == 0)
|
||||||
{
|
{
|
||||||
netplay->server_ptr = netplay->read_ptr1[0];
|
netplay->server_ptr = netplay->read_ptr[0];
|
||||||
netplay->server_frame_count = netplay->read_frame_count1[0];
|
netplay->server_frame_count = netplay->read_frame_count[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_NETPLAY_STEPS
|
#ifdef DEBUG_NETPLAY_STEPS
|
||||||
@ -807,7 +807,7 @@ static bool netplay_get_cmd(netplay_t *netplay,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The frame we haven't received is their end frame */
|
/* The frame we haven't received is their end frame */
|
||||||
connection->delay_frame = netplay->read_frame_count1[client_num];
|
connection->delay_frame = netplay->read_frame_count[client_num];
|
||||||
|
|
||||||
/* Mark them as not playing anymore */
|
/* Mark them as not playing anymore */
|
||||||
connection->mode = NETPLAY_CONNECTION_SPECTATING;
|
connection->mode = NETPLAY_CONNECTION_SPECTATING;
|
||||||
@ -1012,8 +1012,8 @@ static bool netplay_get_cmd(netplay_t *netplay,
|
|||||||
netplay_send_raw_cmd(netplay, connection, NETPLAY_CMD_MODE, payload, sizeof(payload));
|
netplay_send_raw_cmd(netplay, connection, NETPLAY_CMD_MODE, payload, sizeof(payload));
|
||||||
|
|
||||||
/* And expect their data */
|
/* And expect their data */
|
||||||
netplay->read_ptr1[client_num] = NEXT_PTR(netplay->self_ptr);
|
netplay->read_ptr[client_num] = NEXT_PTR(netplay->self_ptr);
|
||||||
netplay->read_frame_count1[client_num] = netplay->self_frame_count + 1;
|
netplay->read_frame_count[client_num] = netplay->self_frame_count + 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1213,8 +1213,8 @@ static bool netplay_get_cmd(netplay_t *netplay,
|
|||||||
if (devices & (1<<device))
|
if (devices & (1<<device))
|
||||||
netplay->device_clients[device] |= (1<<client_num);
|
netplay->device_clients[device] |= (1<<client_num);
|
||||||
|
|
||||||
netplay->read_ptr1[client_num] = netplay->server_ptr;
|
netplay->read_ptr[client_num] = netplay->server_ptr;
|
||||||
netplay->read_frame_count1[client_num] = netplay->server_frame_count;
|
netplay->read_frame_count[client_num] = netplay->server_frame_count;
|
||||||
|
|
||||||
/* Announce it */
|
/* Announce it */
|
||||||
msg[sizeof(msg)-1] = '\0';
|
msg[sizeof(msg)-1] = '\0';
|
||||||
@ -1451,8 +1451,8 @@ static bool netplay_get_cmd(netplay_t *netplay,
|
|||||||
|
|
||||||
if (netplay->is_server)
|
if (netplay->is_server)
|
||||||
{
|
{
|
||||||
load_ptr = netplay->read_ptr1[client_num];
|
load_ptr = netplay->read_ptr[client_num];
|
||||||
load_frame_count = netplay->read_frame_count1[client_num];
|
load_frame_count = netplay->read_frame_count[client_num];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1543,10 +1543,10 @@ static bool netplay_get_cmd(netplay_t *netplay,
|
|||||||
for (client = 0; client < MAX_CLIENTS; client++)
|
for (client = 0; client < MAX_CLIENTS; client++)
|
||||||
{
|
{
|
||||||
if (!(netplay->connected_players & (1<<client))) continue;
|
if (!(netplay->connected_players & (1<<client))) continue;
|
||||||
if (frame > netplay->read_frame_count1[client])
|
if (frame > netplay->read_frame_count[client])
|
||||||
{
|
{
|
||||||
netplay->read_ptr1[client] = load_ptr;
|
netplay->read_ptr[client] = load_ptr;
|
||||||
netplay->read_frame_count1[client] = load_frame_count;
|
netplay->read_frame_count[client] = load_frame_count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1761,7 +1761,7 @@ void netplay_handle_slaves(netplay_t *netplay)
|
|||||||
|
|
||||||
/* This is a slave connection. First, should we do anything at all? If
|
/* This is a slave connection. First, should we do anything at all? If
|
||||||
* we've already "read" this data, then we can just ignore it */
|
* we've already "read" this data, then we can just ignore it */
|
||||||
if (netplay->read_frame_count1[client_num] > netplay->self_frame_count)
|
if (netplay->read_frame_count[client_num] > netplay->self_frame_count)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Alright, we have to send something. Do we need to generate it first? */
|
/* Alright, we have to send something. Do we need to generate it first? */
|
||||||
@ -1793,8 +1793,8 @@ void netplay_handle_slaves(netplay_t *netplay)
|
|||||||
send_input_frame(netplay, frame, NULL, connection, client_num);
|
send_input_frame(netplay, frame, NULL, connection, client_num);
|
||||||
|
|
||||||
/* And mark it as "read" */
|
/* And mark it as "read" */
|
||||||
netplay->read_ptr1[client_num] = NEXT_PTR(netplay->self_ptr);
|
netplay->read_ptr[client_num] = NEXT_PTR(netplay->self_ptr);
|
||||||
netplay->read_frame_count1[client_num] = netplay->self_frame_count + 1;
|
netplay->read_frame_count[client_num] = netplay->self_frame_count + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -476,8 +476,8 @@ struct netplay
|
|||||||
uint32_t unread_frame_count;
|
uint32_t unread_frame_count;
|
||||||
|
|
||||||
/* Pointer to the next frame to read from each client */
|
/* Pointer to the next frame to read from each client */
|
||||||
size_t read_ptr1[MAX_CLIENTS];
|
size_t read_ptr[MAX_CLIENTS];
|
||||||
uint32_t read_frame_count1[MAX_CLIENTS];
|
uint32_t read_frame_count[MAX_CLIENTS];
|
||||||
|
|
||||||
/* Pointer to the next frame to read from the server (as it might not be a
|
/* Pointer to the next frame to read from the server (as it might not be a
|
||||||
* player but still synchronizes) */
|
* player but still synchronizes) */
|
||||||
|
@ -56,10 +56,10 @@ void netplay_update_unread_ptr(netplay_t *netplay)
|
|||||||
{
|
{
|
||||||
if (!(netplay->connected_players & (1<<client))) continue;
|
if (!(netplay->connected_players & (1<<client))) continue;
|
||||||
if ((netplay->connected_slaves & (1<<client))) continue;
|
if ((netplay->connected_slaves & (1<<client))) continue;
|
||||||
if (netplay->read_frame_count1[client] < new_unread_frame_count)
|
if (netplay->read_frame_count[client] < new_unread_frame_count)
|
||||||
{
|
{
|
||||||
new_unread_ptr = netplay->read_ptr1[client];
|
new_unread_ptr = netplay->read_ptr[client];
|
||||||
new_unread_frame_count = netplay->read_frame_count1[client];
|
new_unread_frame_count = netplay->read_frame_count[client];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ netplay_input_state_t netplay_device_client_state(netplay_t *netplay,
|
|||||||
&simframe->real_input[device], client, 3 /* FIXME */, false, true);
|
&simframe->real_input[device], client, 3 /* FIXME */, false, true);
|
||||||
if (!simstate)
|
if (!simstate)
|
||||||
{
|
{
|
||||||
if (netplay->read_frame_count1[client] > simframe->frame)
|
if (netplay->read_frame_count[client] > simframe->frame)
|
||||||
return NULL;
|
return NULL;
|
||||||
simstate = netplay_input_state_for(&simframe->simlated_input[device],
|
simstate = netplay_input_state_for(&simframe->simlated_input[device],
|
||||||
client, 3 /* FIXME */, false, true);
|
client, 3 /* FIXME */, false, true);
|
||||||
@ -322,13 +322,13 @@ bool netplay_resolve_input(netplay_t *netplay, size_t sim_ptr, bool resim)
|
|||||||
if (!simstate)
|
if (!simstate)
|
||||||
{
|
{
|
||||||
/* Don't already have this input, so must simulate if we're supposed to have it at all */
|
/* Don't already have this input, so must simulate if we're supposed to have it at all */
|
||||||
if (netplay->read_frame_count1[client] > simframe->frame)
|
if (netplay->read_frame_count[client] > simframe->frame)
|
||||||
continue;
|
continue;
|
||||||
simstate = netplay_input_state_for(&simframe->simlated_input[device], client, 3 /* FIXME */, false, false);
|
simstate = netplay_input_state_for(&simframe->simlated_input[device], client, 3 /* FIXME */, false, false);
|
||||||
if (!simstate)
|
if (!simstate)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
prev = PREV_PTR(netplay->read_ptr1[client]);
|
prev = PREV_PTR(netplay->read_ptr[client]);
|
||||||
pframe = &netplay->buffer[prev];
|
pframe = &netplay->buffer[prev];
|
||||||
pstate = netplay_input_state_for(&pframe->real_input[device], client, 3 /* FIXME */, false, true);
|
pstate = netplay_input_state_for(&pframe->real_input[device], client, 3 /* FIXME */, false, true);
|
||||||
if (!pstate)
|
if (!pstate)
|
||||||
@ -815,8 +815,8 @@ void netplay_sync_post_frame(netplay_t *netplay, bool stalled)
|
|||||||
for (client = 0; client < MAX_CLIENTS; client++)
|
for (client = 0; client < MAX_CLIENTS; client++)
|
||||||
{
|
{
|
||||||
if (!(netplay->connected_players & (1<<client))) continue;
|
if (!(netplay->connected_players & (1<<client))) continue;
|
||||||
if (netplay->read_frame_count1[client] > hi_frame_count)
|
if (netplay->read_frame_count[client] > hi_frame_count)
|
||||||
hi_frame_count = netplay->read_frame_count1[client];
|
hi_frame_count = netplay->read_frame_count[client];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -889,7 +889,7 @@ void netplay_sync_post_frame(netplay_t *netplay, bool stalled)
|
|||||||
client_num = i + 1;
|
client_num = i + 1;
|
||||||
|
|
||||||
/* Are they ahead? */
|
/* Are they ahead? */
|
||||||
if (netplay->self_frame_count + 3 < netplay->read_frame_count1[client_num])
|
if (netplay->self_frame_count + 3 < netplay->read_frame_count[client_num])
|
||||||
{
|
{
|
||||||
/* Tell them to stall */
|
/* Tell them to stall */
|
||||||
if (connection->stall_frame + NETPLAY_MAX_REQ_STALL_FREQUENCY <
|
if (connection->stall_frame + NETPLAY_MAX_REQ_STALL_FREQUENCY <
|
||||||
@ -897,7 +897,7 @@ void netplay_sync_post_frame(netplay_t *netplay, bool stalled)
|
|||||||
{
|
{
|
||||||
connection->stall_frame = netplay->self_frame_count;
|
connection->stall_frame = netplay->self_frame_count;
|
||||||
netplay_cmd_stall(netplay, connection,
|
netplay_cmd_stall(netplay, connection,
|
||||||
netplay->read_frame_count1[client_num] -
|
netplay->read_frame_count[client_num] -
|
||||||
netplay->self_frame_count + 1);
|
netplay->self_frame_count + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user