diff --git a/src/Main.cc b/src/Main.cc index 9e556f6c..711a291c 100644 --- a/src/Main.cc +++ b/src/Main.cc @@ -159,6 +159,11 @@ void populate_state_from_config(shared_ptr s, } catch (const out_of_range&) { s->proxy_allow_save_files = true; } + try { + s->proxy_enable_login_options = d.at("ProxyEnableLoginOptions")->as_bool(); + } catch (const out_of_range&) { + s->proxy_enable_login_options = false; + } try { s->ep3_behavior_flags = d.at("Episode3BehaviorFlags")->as_int(); diff --git a/src/ProxyServer.cc b/src/ProxyServer.cc index 075b96a5..0466b427 100644 --- a/src/ProxyServer.cc +++ b/src/ProxyServer.cc @@ -742,6 +742,7 @@ void ProxyServer::LinkedSession::send_to_game_server(const char* error_message) } this->client_channel.send(0x19, 0x00, &reconnect_cmd, sizeof(reconnect_cmd)); + this->close_on_disconnect = true; } } diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index 8f7224a9..908f0318 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -109,10 +109,12 @@ static vector proxy_options_menu_for_client( ret.emplace_back(ProxyOptionsMenuItemID::SAVE_FILES, c->options.save_files ? u"Save files ON" : u"Save files OFF", u"", 0); } - ret.emplace_back(ProxyOptionsMenuItemID::SUPPRESS_LOGIN, - c->options.suppress_remote_login ? u"Skip login ON" : u"Skip login OFF", u"", 0); - ret.emplace_back(ProxyOptionsMenuItemID::SKIP_CARD, - c->options.zero_remote_guild_card ? u"Skip card ON" : u"Skip card OFF", u"", 0); + if (s->proxy_enable_login_options) { + ret.emplace_back(ProxyOptionsMenuItemID::SUPPRESS_LOGIN, + c->options.suppress_remote_login ? u"Skip login ON" : u"Skip login OFF", u"", 0); + ret.emplace_back(ProxyOptionsMenuItemID::SKIP_CARD, + c->options.zero_remote_guild_card ? u"Skip card ON" : u"Skip card OFF", u"", 0); + } return ret; } @@ -137,7 +139,8 @@ static void send_client_to_proxy_server(shared_ptr s, shared_ptrlicense, local_port, c->version(), c->export_config_bb()); session->options = c->options; session->options.save_files &= s->proxy_allow_save_files; - if (session->options.zero_remote_guild_card) { + session->options.suppress_remote_login &= s->proxy_enable_login_options; + if (session->options.zero_remote_guild_card && s->proxy_enable_login_options) { session->remote_guild_card_number = 0; } diff --git a/src/ServerShell.cc b/src/ServerShell.cc index 9e303afc..c54d73d9 100644 --- a/src/ServerShell.cc +++ b/src/ServerShell.cc @@ -572,7 +572,7 @@ Proxy commands (these will only work when exactly one client is connected):\n\ auto session = this->get_proxy_session(); set_boolean(&session->options.switch_assist, command_args); - } else if (command_name == "set-save-files") { + } else if (command_name == "set-save-files" && this->state->proxy_allow_save_files) { auto session = this->get_proxy_session(); set_boolean(&session->options.save_files, command_args); diff --git a/src/ServerState.cc b/src/ServerState.cc index 21462d43..84c2d9c6 100644 --- a/src/ServerState.cc +++ b/src/ServerState.cc @@ -34,7 +34,8 @@ ServerState::ServerState() ep3_menu_song(-1), local_address(0), external_address(0), - proxy_allow_save_files(true) { + proxy_allow_save_files(true), + proxy_enable_login_options(false) { vector> non_v1_only_lobbies; vector> ep3_only_lobbies; diff --git a/src/ServerState.hh b/src/ServerState.hh index b58a4001..35398fe9 100644 --- a/src/ServerState.hh +++ b/src/ServerState.hh @@ -111,6 +111,7 @@ struct ServerState { uint32_t external_address; bool proxy_allow_save_files; + bool proxy_enable_login_options; std::shared_ptr proxy_server; std::shared_ptr game_server;