From f69923cbbbc3d082b88169f57bec24a3917aca55 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Thu, 9 Jan 2025 19:43:20 +0100 Subject: [PATCH] ignore pings, the polute the chat and are unreadable without context --- src/factorio.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/factorio.cpp b/src/factorio.cpp index 519da73..99dbc89 100644 --- a/src/factorio.cpp +++ b/src/factorio.cpp @@ -94,6 +94,12 @@ bool Factorio::onEvent(const FactorioLog::Events::Leave& e) { bool Factorio::onEvent(const FactorioLog::Events::Chat& e) { std::cout << "Factorio: event chat " << e.player_name << ": " << e.message << "\n"; + // ignore pings + constexpr std::string_view ping_prefix{"[gps="}; + if (e.message.size() > ping_prefix.size() && e.message.substr(0, ping_prefix.size()) == ping_prefix) { + return false; + } + std::string message{"<"}; message += e.player_name; message += ">: ";