make hide_download_commands configurable

This commit is contained in:
Martin Michelsen
2023-12-24 22:50:33 -08:00
parent 84ed80365c
commit ad32c0a986
7 changed files with 14 additions and 3 deletions
+2 -1
View File
@@ -191,7 +191,8 @@ Client::Client(
// Don't print data sent to patch clients to the logs. The patch server
// protocol is fully understood and data logs for patch clients are generally
// more annoying than helpful at this point.
if ((this->channel.version == Version::PC_PATCH) || (this->channel.version == Version::BB_PATCH)) {
if ((server->get_state()->hide_download_commands) &&
((this->channel.version == Version::PC_PATCH) || (this->channel.version == Version::BB_PATCH))) {
this->channel.terminal_recv_color = TerminalFormat::END;
this->channel.terminal_send_color = TerminalFormat::END;
}
+1 -1
View File
@@ -1135,7 +1135,7 @@ static void on_93_BB(shared_ptr<Client> c, uint16_t, uint32_t, string& data) {
// command.
on_login_complete(c);
} else {
} else if (s->hide_download_commands) {
// The BB data server protocol is fairly well-understood and has some large
// commands, so we omit data logging for clients on the data server.
c->log.info("Client is in the BB data server phase; disabling command data logging for the rest of this client\'s session");
+2 -1
View File
@@ -3206,7 +3206,8 @@ void send_quest_file_chunk(
cmd.data_size = size;
c->log.info("Sending quest file chunk %s:%zu", filename.c_str(), chunk_index);
c->channel.send(is_download_quest ? 0xA7 : 0x13, chunk_index, &cmd, sizeof(cmd), true);
const auto& s = c->require_server_state();
c->channel.send(is_download_quest ? 0xA7 : 0x13, chunk_index, &cmd, sizeof(cmd), s->hide_download_commands);
}
template <typename CommandT>
+2
View File
@@ -67,6 +67,7 @@ ServerState::ServerState(shared_ptr<struct event_base> base, const string& confi
ep3_final_round_meseta_bonus(300),
ep3_jukebox_is_free(false),
ep3_behavior_flags(0),
hide_download_commands(true),
run_shell_behavior(RunShellBehavior::DEFAULT),
cheat_mode_behavior(BehaviorSwitch::OFF_BY_DEFAULT),
bb_global_exp_multiplier(1),
@@ -719,6 +720,7 @@ void ServerState::parse_config(const JSON& json, bool is_reload) {
this->ep3_jukebox_is_free = json.get_bool("Episode3JukeboxIsFree", this->ep3_jukebox_is_free);
this->ep3_behavior_flags = json.get_int("Episode3BehaviorFlags", this->ep3_behavior_flags);
this->ep3_card_auction_points = json.get_int("CardAuctionPoints", this->ep3_card_auction_points);
this->hide_download_commands = json.get_bool("HideDownloadCommands", this->hide_download_commands);
this->proxy_allow_save_files = json.get_bool("ProxyAllowSaveFiles", this->proxy_allow_save_files);
this->proxy_enable_login_options = json.get_bool("ProxyEnableLoginOptions", this->proxy_enable_login_options);
+1
View File
@@ -105,6 +105,7 @@ struct ServerState : public std::enable_shared_from_this<ServerState> {
uint32_t ep3_final_round_meseta_bonus;
bool ep3_jukebox_is_free;
uint32_t ep3_behavior_flags;
bool hide_download_commands;
RunShellBehavior run_shell_behavior;
BehaviorSwitch cheat_mode_behavior;
std::vector<std::shared_ptr<const PSOBBEncryption::KeyFile>> bb_private_keys;
+5
View File
@@ -226,6 +226,11 @@
// Static game data messages describe the loading of any kind of game data.
"StaticGameData": "INFO",
},
// Some large commands (especially during the BB login sequence) can clutter
// up logs, so we hide these commands by default. If you're investigating or
// submitting a bug report that occurs on BB clients, set this to false to get
// a full session log before submitting your report.
"HideDownloadCommands": true,
// If this option is disabled, the server only allows users who have licenses
// on the server to connect. If this is enabled, all users will be allowed to
+1
View File
@@ -105,6 +105,7 @@
"GameServer": "INFO",
"StaticGameData": "INFO",
},
"HideDownloadCommands": true,
"AllowUnregisteredUsers": true,
"AllowPCNTE": true,