From 5192b5f615a6f21b78157cc72d50835b786beef6 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Mon, 27 Nov 2023 21:29:48 -0800 Subject: [PATCH] hide some unnecessary data from log output --- src/Client.cc | 8 ++++++++ src/ReceiveCommands.cc | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/src/Client.cc b/src/Client.cc index 1b5761ea..51b7768d 100644 --- a/src/Client.cc +++ b/src/Client.cc @@ -185,6 +185,14 @@ Client::Client( this->reschedule_save_game_data_event(); this->reschedule_ping_and_timeout_events(); + // 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)) { + this->channel.terminal_recv_color = TerminalFormat::END; + this->channel.terminal_send_color = TerminalFormat::END; + } + this->log.info("Created"); } diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index cdaac0d4..96bf1152 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -1058,6 +1058,13 @@ static void on_93_BB(shared_ptr c, uint16_t, uint32_t, string& data) { // game server phase; we should send the ship select menu or a lobby join // command. on_login_complete(c); + + } else { + // 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"); + c->channel.terminal_recv_color = TerminalFormat::END; + c->channel.terminal_send_color = TerminalFormat::END; } }