diff --git a/src/ProxyServer.cc b/src/ProxyServer.cc index 8c45ada9..0dbeec9c 100644 --- a/src/ProxyServer.cc +++ b/src/ProxyServer.cc @@ -45,8 +45,7 @@ static void flush_and_free_bufferevent(struct bufferevent* bev) { ProxyServer::ProxyServer( shared_ptr base, shared_ptr state) - : save_files(false), - base(base), + : base(base), state(state), next_unlicensed_session_id(0xFF00000000000001) { } @@ -383,6 +382,8 @@ ProxyServer::LinkedSession::LinkedSession( guild_card_number(0), suppress_newserv_commands(true), enable_chat_filter(true), + enable_switch_assist(false), + save_files(false), override_section_id(-1), override_lobby_event(-1), override_lobby_number(-1), @@ -1023,7 +1024,7 @@ void ProxyServer::LinkedSession::on_server_input() { if (this->version != GameVersion::GC) { break; } - if (!this->server->save_files) { + if (!this->save_files) { break; } @@ -1060,7 +1061,7 @@ void ProxyServer::LinkedSession::on_server_input() { if (this->version != GameVersion::GC) { break; } - if (!this->server->save_files) { + if (!this->save_files) { break; } @@ -1111,7 +1112,7 @@ void ProxyServer::LinkedSession::on_server_input() { if (this->version != GameVersion::GC) { break; } - if (!this->server->save_files) { + if (!this->save_files) { break; } if (data.size() < 4) { diff --git a/src/ProxyServer.hh b/src/ProxyServer.hh index 8d665445..07257c46 100644 --- a/src/ProxyServer.hh +++ b/src/ProxyServer.hh @@ -54,6 +54,7 @@ public: bool suppress_newserv_commands; bool enable_chat_filter; bool enable_switch_assist; + bool save_files; std::string last_switch_enabled_subcommand; int16_t override_section_id; int16_t override_lobby_event; @@ -141,8 +142,6 @@ public: const ClientConfig& newserv_client_config); void delete_session(uint64_t id); - bool save_files; - private: struct ListeningSocket { ProxyServer* server; diff --git a/src/ServerShell.cc b/src/ServerShell.cc index 5a679f75..73195e60 100644 --- a/src/ServerShell.cc +++ b/src/ServerShell.cc @@ -62,6 +62,8 @@ Server commands:\n\ Shut down the server.\n\ reload ...\n\ Reload data. can be licenses, battle-params, level-table, or quests.\n\ + Reloading will not affect items that are in use; for example, if a client\'s\n\ + license is deleted by reloading, they will not be disconnected immediately.\n\ add-license \n\ Add a license to the server. is some subset of the following:\n\ username= (BB username)\n\ @@ -98,11 +100,13 @@ Proxy commands (these will only work when exactly one client is connected):\n\ dchat \n\ Send a chat message to the server with arbitrary data in it.\n\ info-board \n\ - Set your info board contents.\n\ + Set your info board contents. This will affect the current session only,\n\ + and will not be saved for future sessions.\n\ info-board-data \n\ - Set your info board contents with arbitrary data.\n\ + Set your info board contents with arbitrary data. Like the above, affects\n\ + the current session only.\n\ marker \n\ - Send a lobby marker message to the server.\n\ + Change your lobby marker color.\n\ warp \n\ Send yourself to a specific area.\n\ set-override-section-id [section-id]\n\ @@ -119,8 +123,8 @@ Proxy commands (these will only work when exactly one client is connected):\n\ override.\n\ set-chat-filter \n\ Enable or disable chat filtering (enabled by default). Chat filtering\n\ - applies newserv\'s standard character replacements to chat messages (for\n\ - example, $ becomes a tab character and # becomes a newline).\n\ + applies newserv\'s standard character replacements to chat messages; for\n\ + example, $ becomes a tab character and # becomes a newline.\n\ set-chat-safety \n\ Enable or disable chat safety (enabled by default). When chat safety is on,\n\ all chat messages that begin with a $ are not sent to the remote server.\n\ @@ -136,8 +140,7 @@ Proxy commands (these will only work when exactly one client is connected):\n\ Enable or disable saving of game files (disabled by default). When this is\n\ on, any file that the remote server sends to the client will be saved to\n\ the current directory. This includes data like quests, Episode 3 card\n\ - definitions, and GBA games. Unlike other proxy commands, this command\n\ - affects all proxy sessions.\n\ + definitions, and GBA games.\n\ "); @@ -381,11 +384,8 @@ Proxy commands (these will only work when exactly one client is connected):\n\ set_boolean(&session->enable_switch_assist, command_args); } else if (command_name == "set-save-files") { - if (this->state->proxy_server.get()) { - set_boolean(&this->state->proxy_server->save_files, command_args); - } else { - throw invalid_argument("proxy server is not available"); - } + auto session = this->get_proxy_session(); + set_boolean(&session->save_files, command_args); } else { throw invalid_argument("unknown command; try \'help\'");