add settings -> network entry to force using a MITM server for netplay

This commit is contained in:
Brad Parker 2017-03-04 15:23:59 -05:00
parent 1fc7a50f3e
commit 1f42889936
11 changed files with 41 additions and 0 deletions

View file

@ -843,6 +843,8 @@ static const unsigned netplay_delay_frames = 16;
static const int netplay_check_frames = 30;
static const bool netplay_use_mitm_server = false;
/* On save state load, block SRAM from being overwritten.
* This could potentially lead to buggy games. */
static const bool block_sram_overwrite = false;

View file

@ -734,6 +734,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
SETTING_BOOL("netplay_require_slaves", &settings->netplay.require_slaves, true, netplay_require_slaves, false);
SETTING_BOOL("netplay_stateless_mode", &settings->netplay.stateless_mode, false, netplay_stateless_mode, false);
SETTING_BOOL("netplay_client_swap_input", &settings->netplay.swap_input, true, netplay_client_swap_input, false);
SETTING_BOOL("netplay_use_mitm_server", &settings->netplay.use_mitm_server, false, netplay_use_mitm_server, false);
#endif
SETTING_BOOL("input_descriptor_label_show", &settings->input.input_descriptor_label_show, true, input_descriptor_label_show, false);
SETTING_BOOL("input_descriptor_hide_unbound", &settings->input.input_descriptor_hide_unbound, true, input_descriptor_hide_unbound, false);

View file

@ -418,6 +418,7 @@ typedef struct settings
bool nat_traversal;
char password[128];
char spectate_password[128];
bool use_mitm_server;
} netplay;
#endif

View file

@ -2905,3 +2905,5 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_VIDEO_SHADER_NUM_PASSES,
"Increase or decrease the amount of shader pipeline passes. You can bind a separate shader to each pipeline pass and configure its scale and filtering."
)
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_USE_MITM_SERVER,
"MITMサーバを使用")

View file

@ -1209,3 +1209,5 @@ MSG_HASH(MENU_ENUM_LABEL_BROWSE_START,
"browse_start")
MSG_HASH(MENU_ENUM_LABEL_SHADER_PIPELINE_BOKEH,
"shader_pipeline_bokeh")
MSG_HASH(MENU_ENUM_LABEL_NETPLAY_USE_MITM_SERVER,
"netplay_use_mitm_server")

View file

@ -1611,6 +1611,12 @@ int menu_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len) {
"connections from the public internet, using\n"
"UPnP or similar technologies to escape LANs. \n");
break;
case MENU_ENUM_LABEL_NETPLAY_USE_MITM_SERVER:
snprintf(s, len,
"When hosting, relay connection through a\n"
"man-in-the-middle server\n"
"to get around firewalls or NAT/UPnP issues.\n");
break;
case MENU_ENUM_LABEL_VIDEO_MAX_SWAPCHAIN_IMAGES:
snprintf(s, len,
"Maximum amount of swapchain images. This \n"

View file

@ -2965,3 +2965,5 @@ MSG_HASH(MENU_ENUM_SUBLABEL_VIDEO_VIEWPORT_CUSTOM_X,
"Custom viewport offset used for defining the X-axis position of the viewport. These are ignored if 'Integer Scale' is enabled. It will be automatically centered then.")
MSG_HASH(MENU_ENUM_SUBLABEL_VIDEO_VIEWPORT_CUSTOM_Y,
"Custom viewport offset used for defining the Y-axis position of the viewport. These are ignored if 'Integer Scale' is enabled. It will be automatically centered then.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_USE_MITM_SERVER,
"Use MITM Server")

View file

@ -4844,6 +4844,10 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
MENU_ENUM_LABEL_NETPLAY_PUBLIC_ANNOUNCE,
PARSE_ONLY_BOOL, false) != -1)
count++;
if (menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_NETPLAY_USE_MITM_SERVER,
PARSE_ONLY_BOOL, false) != -1)
count++;
if (menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_NETPLAY_IP_ADDRESS,
PARSE_ONLY_STRING, false) != -1)

View file

@ -5678,6 +5678,21 @@ static bool setting_append_list(
general_read_handler,
SD_FLAG_NONE);
CONFIG_BOOL(
list, list_info,
&settings->netplay.use_mitm_server,
MENU_ENUM_LABEL_NETPLAY_USE_MITM_SERVER,
MENU_ENUM_LABEL_VALUE_NETPLAY_USE_MITM_SERVER,
true,
MENU_ENUM_LABEL_VALUE_OFF,
MENU_ENUM_LABEL_VALUE_ON,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler,
SD_FLAG_NONE);
CONFIG_STRING(
list, list_info,
settings->netplay.server,

View file

@ -1558,6 +1558,9 @@ enum msg_hash_enums
MENU_ENUM_LABEL_VALUE_NETPLAY_LOAD_CONTENT_MANUALLY,
MENU_ENUM_LABEL_VALUE_NETPLAY_COMPAT_CONTENT_FOUND,
MENU_ENUM_LABEL_NETPLAY_USE_MITM_SERVER,
MENU_ENUM_LABEL_VALUE_NETPLAY_USE_MITM_SERVER,
MSG_LAST
};

View file

@ -751,6 +751,9 @@
# The port of the host IP Address. Can be either a TCP or UDP port.
# netplay_ip_port = 55435
# Force game hosting to go through a man-in-the-middle server to get around firewalls and NAT/UPnP problems.
# netplay_use_mitm_server = false
#### Misc
# Enable rewinding. This will take a performance hit when playing, so it is disabled by default.