Revert "(Cthulhu88) Add netplay hotkey bind"

This reverts commit deaf116d38904f80bbcfa18f56bcf7f6560c6aa3.
This commit is contained in:
twinaphex 2021-11-12 19:00:24 +01:00
parent 3b6196144f
commit d7a8bc55a3
4 changed files with 11 additions and 21 deletions

View File

@ -202,8 +202,6 @@ enum event_command
CMD_EVENT_NETPLAY_DEINIT,
/* Switch between netplay gaming and watching. */
CMD_EVENT_NETPLAY_GAME_WATCH,
/* Open a netplay chat input menu. */
CMD_EVENT_NETPLAY_PLAYER_CHAT,
/* Start hosting netplay. */
CMD_EVENT_NETPLAY_ENABLE_HOST,
/* Disconnect from the netplay host. */

View File

@ -43,7 +43,6 @@ enum rarch_netplay_ctl_state
{
RARCH_NETPLAY_CTL_NONE = 0,
RARCH_NETPLAY_CTL_GAME_WATCH,
RARCH_NETPLAY_CTL_PLAYER_CHAT,
RARCH_NETPLAY_CTL_POST_FRAME,
RARCH_NETPLAY_CTL_PRE_FRAME,
RARCH_NETPLAY_CTL_ENABLE_SERVER,
@ -189,6 +188,7 @@ typedef struct
{
netplay_t *data; /* Used while Netplay is running */
struct netplay_room host_room; /* ptr alignment */
netplay_t *ref;
struct netplay_room *room_list;
struct netplay_rooms *rooms_data;
/* List of discovered hosts */

View File

@ -893,14 +893,9 @@ static void handshake_password(void *ignore, const char *line)
struct password_buf_s password_buf;
char password[8+NETPLAY_PASS_LEN]; /* 8 for salt, 128 for password */
char hash[NETPLAY_PASS_HASH_LEN+1]; /* + NULL terminator */
struct netplay_connection *connection;
net_driver_state_t *net_st = &networking_driver_st;
netplay_t *netplay = net_st->data;
if (!netplay)
return;
connection = &netplay->connections[0];
netplay_t *netplay = net_st->ref;
struct netplay_connection *connection = &netplay->connections[0];
snprintf(password, sizeof(password), "%08lX", (unsigned long)connection->salt);
if (!string_is_empty(line))
@ -1076,6 +1071,11 @@ bool netplay_handshake_init(netplay_t *netplay,
#ifdef HAVE_MENU
menu_input_ctx_line_t line;
retroarch_menu_running();
#endif
net_st->ref = netplay;
#ifdef HAVE_MENU
memset(&line, 0, sizeof(line));
line.label = msg_hash_to_str(MSG_NETPLAY_ENTER_PASSWORD);
line.label_setting = "no_setting";
@ -4470,7 +4470,7 @@ static void send_chat(void *userdata, const char *line)
char chat_msg[MAX_CHAT_SIZE];
size_t chat_len;
net_driver_state_t *net_st = &networking_driver_st;
netplay_t *netplay = net_st->data;
netplay_t *netplay = net_st->ref;
/* We perform the same checks,
just in case something has changed. */
@ -4512,6 +4512,8 @@ void netplay_input_chat(netplay_t *netplay)
retroarch_menu_running();
net_st->ref = netplay;
chat_input.label = msg_hash_to_str(MSG_NETPLAY_ENTER_CHAT);
chat_input.label_setting = "no_setting";
chat_input.cb = send_chat;
@ -7729,9 +7731,6 @@ bool netplay_driver_ctl(enum rarch_netplay_ctl_state state, void *data)
case RARCH_NETPLAY_CTL_GAME_WATCH:
netplay_toggle_play_spectate(netplay);
break;
case RARCH_NETPLAY_CTL_PLAYER_CHAT:
netplay_input_chat(netplay);
break;
case RARCH_NETPLAY_CTL_PAUSE:
if (netplay->local_paused != true)
netplay_frontend_paused(netplay, true);

View File

@ -5227,9 +5227,6 @@ bool command_event(enum event_command cmd, void *data)
case CMD_EVENT_NETPLAY_GAME_WATCH:
netplay_driver_ctl(RARCH_NETPLAY_CTL_GAME_WATCH, NULL);
break;
case CMD_EVENT_NETPLAY_PLAYER_CHAT:
netplay_driver_ctl(RARCH_NETPLAY_CTL_PLAYER_CHAT, NULL);
break;
case CMD_EVENT_NETPLAY_DEINIT:
deinit_netplay();
break;
@ -5466,7 +5463,6 @@ bool command_event(enum event_command cmd, void *data)
case CMD_EVENT_NETPLAY_DISCONNECT:
case CMD_EVENT_NETPLAY_ENABLE_HOST:
case CMD_EVENT_NETPLAY_GAME_WATCH:
case CMD_EVENT_NETPLAY_PLAYER_CHAT:
return false;
#endif
case CMD_EVENT_FULLSCREEN_TOGGLE:
@ -15001,9 +14997,6 @@ static enum runloop_state_enum runloop_check_state(
#ifdef HAVE_NETWORKING
/* Check Netplay */
HOTKEY_CHECK(RARCH_NETPLAY_GAME_WATCH, CMD_EVENT_NETPLAY_GAME_WATCH, true, NULL);
#if NETPLAY_PROTOCOL_VERSION >= 6
HOTKEY_CHECK(RARCH_NETPLAY_PLAYER_CHAT, CMD_EVENT_NETPLAY_PLAYER_CHAT, true, NULL);
#endif
#endif
/* Check if we have pressed the pause button */