(Netplay) Change default for input sharing to "no sharing"

This commit is contained in:
Cthulhu-throwaway 2022-05-25 07:45:02 -03:00
parent af7db7c08f
commit ade5444d5f
2 changed files with 69 additions and 62 deletions

View File

@ -1233,8 +1233,8 @@ static const bool netplay_use_mitm_server = false;
static const unsigned netplay_max_connections = 3; static const unsigned netplay_max_connections = 3;
static const unsigned netplay_max_ping = 0; static const unsigned netplay_max_ping = 0;
static const unsigned netplay_share_digital = RARCH_NETPLAY_SHARE_DIGITAL_NO_PREFERENCE; static const unsigned netplay_share_digital = RARCH_NETPLAY_SHARE_DIGITAL_NO_SHARING;
static const unsigned netplay_share_analog = RARCH_NETPLAY_SHARE_ANALOG_NO_PREFERENCE; static const unsigned netplay_share_analog = RARCH_NETPLAY_SHARE_ANALOG_NO_SHARING;
#endif #endif
/* On save state load, block SRAM from being overwritten. /* On save state load, block SRAM from being overwritten.

View File

@ -7818,9 +7818,11 @@ unsigned menu_displaylist_build_list(
break; break;
case DISPLAYLIST_NETWORK_SETTINGS_LIST: case DISPLAYLIST_NETWORK_SETTINGS_LIST:
{ {
unsigned user;
bool netplay_allow_slaves = settings->bools.netplay_allow_slaves; bool netplay_allow_slaves = settings->bools.netplay_allow_slaves;
bool netplay_use_mitm_server = settings->bools.netplay_use_mitm_server; bool netplay_use_mitm_server = settings->bools.netplay_use_mitm_server;
bool network_cmd_enable = settings->bools.network_cmd_enable; bool network_cmd_enable = settings->bools.network_cmd_enable;
bool network_remote_enable = settings->bools.network_remote_enable;
menu_displaylist_build_info_selective_t build_list[] = { menu_displaylist_build_info_selective_t build_list[] = {
{MENU_ENUM_LABEL_NETPLAY_PUBLIC_ANNOUNCE, PARSE_ONLY_BOOL, true}, {MENU_ENUM_LABEL_NETPLAY_PUBLIC_ANNOUNCE, PARSE_ONLY_BOOL, true},
@ -7856,9 +7858,6 @@ unsigned menu_displaylist_build_list(
build_list[i].checked = true; build_list[i].checked = true;
break; break;
case MENU_ENUM_LABEL_NETPLAY_MITM_SERVER: case MENU_ENUM_LABEL_NETPLAY_MITM_SERVER:
if (netplay_use_mitm_server)
build_list[i].checked = true;
break;
case MENU_ENUM_LABEL_NETPLAY_CUSTOM_MITM_SERVER: case MENU_ENUM_LABEL_NETPLAY_CUSTOM_MITM_SERVER:
if (netplay_use_mitm_server) if (netplay_use_mitm_server)
build_list[i].checked = true; build_list[i].checked = true;
@ -7878,66 +7877,64 @@ unsigned menu_displaylist_build_list(
count++; count++;
} }
{
unsigned user;
for (user = 0; user < MAX_USERS; user++) for (user = 0; user < MAX_USERS; user++)
{ {
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list, if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list,
(enum msg_hash_enums)(MENU_ENUM_LABEL_NETPLAY_REQUEST_DEVICE_1 + user), (enum msg_hash_enums)
PARSE_ONLY_BOOL, false) != -1) MENU_ENUM_LABEL_NETPLAY_REQUEST_DEVICE_1 + user,
PARSE_ONLY_BOOL, false) == 0)
count++; count++;
} }
}
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list, if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list,
MENU_ENUM_LABEL_NETWORK_CMD_ENABLE, MENU_ENUM_LABEL_NETWORK_CMD_ENABLE,
PARSE_ONLY_BOOL, false) != -1) PARSE_ONLY_BOOL, false) == 0)
count++; count++;
if (network_cmd_enable) if (network_cmd_enable)
{ {
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list, if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list,
MENU_ENUM_LABEL_NETWORK_CMD_PORT, MENU_ENUM_LABEL_NETWORK_CMD_PORT,
PARSE_ONLY_UINT, false) != -1) PARSE_ONLY_UINT, false) == 0)
count++; count++;
} }
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list, if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list,
MENU_ENUM_LABEL_NETWORK_REMOTE_ENABLE, MENU_ENUM_LABEL_NETWORK_REMOTE_ENABLE,
PARSE_ONLY_BOOL, false) != -1) PARSE_ONLY_BOOL, false) == 0)
count++;
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list,
MENU_ENUM_LABEL_NETWORK_REMOTE_PORT,
PARSE_ONLY_UINT, false) != -1)
count++; count++;
{ if (network_remote_enable)
unsigned user;
unsigned max_users = settings->uints.input_max_users;
for (user = 0; user < max_users; user++)
{ {
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list, if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list,
(enum msg_hash_enums)( MENU_ENUM_LABEL_NETWORK_REMOTE_PORT,
MENU_ENUM_LABEL_NETWORK_REMOTE_USER_1_ENABLE + user), PARSE_ONLY_UINT, false) == 0)
PARSE_ONLY_BOOL, false) != -1) count++;
for (user = 0; user < settings->uints.input_max_users; user++)
{
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list,
(enum msg_hash_enums)
MENU_ENUM_LABEL_NETWORK_REMOTE_USER_1_ENABLE + user,
PARSE_ONLY_BOOL, false) == 0)
count++; count++;
} }
} }
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list, if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list,
MENU_ENUM_LABEL_STDIN_CMD_ENABLE, MENU_ENUM_LABEL_STDIN_CMD_ENABLE,
PARSE_ONLY_BOOL, false) != -1) PARSE_ONLY_BOOL, false) == 0)
count++; count++;
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list, if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list,
MENU_ENUM_LABEL_NETWORK_ON_DEMAND_THUMBNAILS, MENU_ENUM_LABEL_NETWORK_ON_DEMAND_THUMBNAILS,
PARSE_ONLY_BOOL, false) != -1) PARSE_ONLY_BOOL, false) == 0)
count++; count++;
#ifdef HAVE_ONLINE_UPDATER #ifdef HAVE_ONLINE_UPDATER
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list, if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list,
MENU_ENUM_LABEL_UPDATER_SETTINGS, MENU_ENUM_LABEL_UPDATER_SETTINGS,
PARSE_ACTION, false) != -1) PARSE_ACTION, false) == 0)
count++; count++;
#endif #endif
} }
@ -10692,7 +10689,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
{ {
size_t i; size_t i;
file_list_t *list = info->list; file_list_t *list = info->list;
bool use_mitm_server = settings->bools.netplay_use_mitm_server; bool netplay_allow_slaves = settings->bools.netplay_allow_slaves;
bool netplay_use_mitm_server = settings->bools.netplay_use_mitm_server;
menu_displaylist_build_info_selective_t build_list[] = { menu_displaylist_build_info_selective_t build_list[] = {
{MENU_ENUM_LABEL_NETPLAY_TCP_UDP_PORT, PARSE_ONLY_UINT, true}, {MENU_ENUM_LABEL_NETPLAY_TCP_UDP_PORT, PARSE_ONLY_UINT, true},
{MENU_ENUM_LABEL_NETPLAY_MAX_CONNECTIONS, PARSE_ONLY_UINT, true}, {MENU_ENUM_LABEL_NETPLAY_MAX_CONNECTIONS, PARSE_ONLY_UINT, true},
@ -10703,6 +10702,10 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
{MENU_ENUM_LABEL_NETPLAY_CUSTOM_MITM_SERVER, PARSE_ONLY_STRING, false}, {MENU_ENUM_LABEL_NETPLAY_CUSTOM_MITM_SERVER, PARSE_ONLY_STRING, false},
{MENU_ENUM_LABEL_NETPLAY_PASSWORD, PARSE_ONLY_STRING, true}, {MENU_ENUM_LABEL_NETPLAY_PASSWORD, PARSE_ONLY_STRING, true},
{MENU_ENUM_LABEL_NETPLAY_SPECTATE_PASSWORD, PARSE_ONLY_STRING, true}, {MENU_ENUM_LABEL_NETPLAY_SPECTATE_PASSWORD, PARSE_ONLY_STRING, true},
{MENU_ENUM_LABEL_NETPLAY_ALLOW_PAUSING, PARSE_ONLY_BOOL, true},
{MENU_ENUM_LABEL_NETPLAY_ALLOW_SLAVES, PARSE_ONLY_BOOL, true},
{MENU_ENUM_LABEL_NETPLAY_REQUIRE_SLAVES, PARSE_ONLY_BOOL, false},
{MENU_ENUM_LABEL_NETPLAY_NAT_TRAVERSAL, PARSE_ONLY_BOOL, true},
}; };
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, list); menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, list);
@ -10737,9 +10740,13 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
{ {
switch (build_list[i].enum_idx) switch (build_list[i].enum_idx)
{ {
case MENU_ENUM_LABEL_NETPLAY_REQUIRE_SLAVES:
if (netplay_allow_slaves)
build_list[i].checked = true;
break;
case MENU_ENUM_LABEL_NETPLAY_MITM_SERVER: case MENU_ENUM_LABEL_NETPLAY_MITM_SERVER:
case MENU_ENUM_LABEL_NETPLAY_CUSTOM_MITM_SERVER: case MENU_ENUM_LABEL_NETPLAY_CUSTOM_MITM_SERVER:
if (use_mitm_server) if (netplay_use_mitm_server)
build_list[i].checked = true; build_list[i].checked = true;
break; break;
default: default: