1
0
mirror of https://github.com/libretro/RetroArch synced 2025-02-28 22:13:51 +00:00

Merge pull request from Cthulhu-throwaway/netplay-cleanup

(Netplay) Some refactoring and cleaning
This commit is contained in:
LibretroAdmin 2022-05-27 23:37:43 +01:00 committed by GitHub
commit b65c933a09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 464 additions and 435 deletions

@ -294,8 +294,6 @@ typedef struct
/* Only used before init_netplay */
bool netplay_enabled;
bool netplay_is_client;
/* Used to avoid recursive netplay calls */
bool in_netplay;
bool has_set_netplay_mode;
bool has_set_netplay_ip_address;
bool has_set_netplay_ip_port;
@ -400,18 +398,6 @@ bool netplay_is_alive(netplay_t *netplay);
**/
bool netplay_should_skip(netplay_t *netplay);
/**
* netplay_post_frame:
* @netplay : pointer to netplay object
*
* Post-frame for Netplay.
* We check if we have new input and replay from recorded input.
* Call this after running retro_run().
**/
void netplay_post_frame(netplay_t *netplay);
void deinit_netplay(void);
/**
* init_netplay
* @server : server address to connect to (client only)
@ -428,6 +414,8 @@ bool init_netplay(const char *server, unsigned port, const char *mitm_session);
bool init_netplay_deferred(const char *server, unsigned port, const char *mitm_session);
void deinit_netplay(void);
void video_frame_net(const void *data, unsigned width,
unsigned height, size_t pitch);
void audio_sample_net(int16_t left, int16_t right);

File diff suppressed because it is too large Load Diff

@ -883,13 +883,6 @@ int netplay_poll_net_input(netplay_t *netplay, bool block);
*/
void netplay_handle_slaves(netplay_t *netplay);
/**
* netplay_announce_nat_traversal
*
* Announce successful NAT traversal.
*/
void netplay_announce_nat_traversal(netplay_t *netplay);
/**
* netplay_init_nat_traversal
*

@ -276,7 +276,11 @@ finished:
static void netplay_nat_traversal_callback(retro_task_t *task,
void *task_data, void *user_data, const char *error)
{
netplay_driver_ctl(RARCH_NETPLAY_CTL_FINISHED_NAT_TRAVERSAL, NULL);
struct nat_traversal_data *data = (struct nat_traversal_data*)task_data;
uintptr_t ext_port = ntohs(data->request.addr.sin_port);
netplay_driver_ctl(RARCH_NETPLAY_CTL_FINISHED_NAT_TRAVERSAL,
(void*)ext_port);
}
static bool nat_task_finder(retro_task_t *task, void *userdata)