improve proxy command documentation

This commit is contained in:
Martin Michelsen
2022-04-02 14:38:22 -07:00
parent 825437b145
commit 091f3d4da4
3 changed files with 19 additions and 19 deletions
+6 -5
View File
@@ -45,8 +45,7 @@ static void flush_and_free_bufferevent(struct bufferevent* bev) {
ProxyServer::ProxyServer( ProxyServer::ProxyServer(
shared_ptr<struct event_base> base, shared_ptr<struct event_base> base,
shared_ptr<ServerState> state) shared_ptr<ServerState> state)
: save_files(false), : base(base),
base(base),
state(state), state(state),
next_unlicensed_session_id(0xFF00000000000001) { } next_unlicensed_session_id(0xFF00000000000001) { }
@@ -383,6 +382,8 @@ ProxyServer::LinkedSession::LinkedSession(
guild_card_number(0), guild_card_number(0),
suppress_newserv_commands(true), suppress_newserv_commands(true),
enable_chat_filter(true), enable_chat_filter(true),
enable_switch_assist(false),
save_files(false),
override_section_id(-1), override_section_id(-1),
override_lobby_event(-1), override_lobby_event(-1),
override_lobby_number(-1), override_lobby_number(-1),
@@ -1023,7 +1024,7 @@ void ProxyServer::LinkedSession::on_server_input() {
if (this->version != GameVersion::GC) { if (this->version != GameVersion::GC) {
break; break;
} }
if (!this->server->save_files) { if (!this->save_files) {
break; break;
} }
@@ -1060,7 +1061,7 @@ void ProxyServer::LinkedSession::on_server_input() {
if (this->version != GameVersion::GC) { if (this->version != GameVersion::GC) {
break; break;
} }
if (!this->server->save_files) { if (!this->save_files) {
break; break;
} }
@@ -1111,7 +1112,7 @@ void ProxyServer::LinkedSession::on_server_input() {
if (this->version != GameVersion::GC) { if (this->version != GameVersion::GC) {
break; break;
} }
if (!this->server->save_files) { if (!this->save_files) {
break; break;
} }
if (data.size() < 4) { if (data.size() < 4) {
+1 -2
View File
@@ -54,6 +54,7 @@ public:
bool suppress_newserv_commands; bool suppress_newserv_commands;
bool enable_chat_filter; bool enable_chat_filter;
bool enable_switch_assist; bool enable_switch_assist;
bool save_files;
std::string last_switch_enabled_subcommand; std::string last_switch_enabled_subcommand;
int16_t override_section_id; int16_t override_section_id;
int16_t override_lobby_event; int16_t override_lobby_event;
@@ -141,8 +142,6 @@ public:
const ClientConfig& newserv_client_config); const ClientConfig& newserv_client_config);
void delete_session(uint64_t id); void delete_session(uint64_t id);
bool save_files;
private: private:
struct ListeningSocket { struct ListeningSocket {
ProxyServer* server; ProxyServer* server;
+12 -12
View File
@@ -62,6 +62,8 @@ Server commands:\n\
Shut down the server.\n\ Shut down the server.\n\
reload <item> ...\n\ reload <item> ...\n\
Reload data. <item> can be licenses, battle-params, level-table, or quests.\n\ Reload data. <item> 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 <parameters>\n\ add-license <parameters>\n\
Add a license to the server. <parameters> is some subset of the following:\n\ Add a license to the server. <parameters> is some subset of the following:\n\
username=<username> (BB username)\n\ username=<username> (BB username)\n\
@@ -98,11 +100,13 @@ Proxy commands (these will only work when exactly one client is connected):\n\
dchat <data>\n\ dchat <data>\n\
Send a chat message to the server with arbitrary data in it.\n\ Send a chat message to the server with arbitrary data in it.\n\
info-board <text>\n\ info-board <text>\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 <data>\n\ info-board-data <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 <color-id>\n\ marker <color-id>\n\
Send a lobby marker message to the server.\n\ Change your lobby marker color.\n\
warp <area-id>\n\ warp <area-id>\n\
Send yourself to a specific area.\n\ Send yourself to a specific area.\n\
set-override-section-id [section-id]\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\ override.\n\
set-chat-filter <on|off>\n\ set-chat-filter <on|off>\n\
Enable or disable chat filtering (enabled by default). Chat filtering\n\ Enable or disable chat filtering (enabled by default). Chat filtering\n\
applies newserv\'s standard character replacements to chat messages (for\n\ applies newserv\'s standard character replacements to chat messages; for\n\
example, $ becomes a tab character and # becomes a newline).\n\ example, $ becomes a tab character and # becomes a newline.\n\
set-chat-safety <on|off>\n\ set-chat-safety <on|off>\n\
Enable or disable chat safety (enabled by default). When chat safety is on,\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\ 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\ 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\ 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\ the current directory. This includes data like quests, Episode 3 card\n\
definitions, and GBA games. Unlike other proxy commands, this command\n\ definitions, and GBA games.\n\
affects all proxy sessions.\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); set_boolean(&session->enable_switch_assist, command_args);
} else if (command_name == "set-save-files") { } else if (command_name == "set-save-files") {
if (this->state->proxy_server.get()) { auto session = this->get_proxy_session();
set_boolean(&this->state->proxy_server->save_files, command_args); set_boolean(&session->save_files, command_args);
} else {
throw invalid_argument("proxy server is not available");
}
} else { } else {
throw invalid_argument("unknown command; try \'help\'"); throw invalid_argument("unknown command; try \'help\'");