diff --git a/config.def.h b/config.def.h index d31bfec121..26bf0dc0fa 100644 --- a/config.def.h +++ b/config.def.h @@ -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; diff --git a/configuration.c b/configuration.c index 69f552dfad..a9add57595 100644 --- a/configuration.c +++ b/configuration.c @@ -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); diff --git a/configuration.h b/configuration.h index 88ce0d1898..9b1c827b33 100644 --- a/configuration.h +++ b/configuration.h @@ -418,6 +418,7 @@ typedef struct settings bool nat_traversal; char password[128]; char spectate_password[128]; + bool use_mitm_server; } netplay; #endif diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index b3dae4a13a..3b4b8bfa21 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -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サーバを使用") diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index bb46ac2052..663db375f5 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -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") diff --git a/intl/msg_hash_us.c b/intl/msg_hash_us.c index 4decd24c25..237c97b2e9 100644 --- a/intl/msg_hash_us.c +++ b/intl/msg_hash_us.c @@ -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" diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index d09208bf93..fed68d0056 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -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") diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index c1767abfeb..ca6f4e258a 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -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) diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 3247825dc2..e4c90f3835 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -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, diff --git a/msg_hash.h b/msg_hash.h index 73841bce35..33ed4b66ef 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -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 }; diff --git a/retroarch.cfg b/retroarch.cfg index 990783191d..f9a45abb4c 100644 --- a/retroarch.cfg +++ b/retroarch.cfg @@ -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.