Skip to content

Commit

Permalink
Add SuppressChatLogs
Browse files Browse the repository at this point in the history
Fix handshake
  • Loading branch information
JAJames committed Oct 29, 2021
1 parent 4a2c778 commit 860da01
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions Configs/RenX.FuckCronus.ini
Expand Up @@ -19,4 +19,5 @@
; SanitizeSteamIDs=Bool (Default: true; sanitizes all player SteamIDs from all messages)
; SanitizeUnknownCmds=Bool (Default: true; sanitizes all unknown commands coming from devbot)
; SanitizeBlacklistedCmds=Bool (Default: true; sanitizes all non-informational commands coming from devbot)
; SuppressChatLogs=Bool (Default: true; suppresses all chat logs)
;
10 changes: 10 additions & 0 deletions src/Plugins/RenX/RenX.FuckCronus/FuckCronus.cpp
Expand Up @@ -115,6 +115,7 @@ bool RenX_FuckCronusPlugin::initialize() {
m_sanitize_steam_ids = config.get<bool>("SanitizeSteamIDs"_jrs, true);
m_sanitize_unknown_commands = config.get<bool>("SanitizeUnknownCmds"_jrs, true);
m_sanitize_blacklisted_commands = config.get<bool>("SanitizeBlacklistedCmds"_jrs, true);
m_suppress_chat_logs = config.get<bool>("SuppressChatLogs"_jrs, true);

return RenX::Plugin::initialize();
}
Expand Down Expand Up @@ -450,6 +451,11 @@ void RenX_FuckCronusPlugin::RenX_OnRaw(RenX::Server &server, const Jupiter::Read
}
}

if (m_suppress_chat_logs
&& tokens.getToken(0) == "lCHAT") {
return;
}

auto findPlayerByIP = [&server](const Jupiter::ReadableString& in_ip) -> const RenX::PlayerInfo* {
// Parse into integer so we're doing int comparisons instead of strings
auto ip32 = Jupiter::Socket::pton4(static_cast<std::string>(in_ip).c_str());
Expand Down Expand Up @@ -610,6 +616,10 @@ void RenX_FuckCronusPlugin::devbot_connected(RenX::Server& in_server, ext_server
version_message += RenX::DelimC;
version_message.append(version_str.ptr(), version_str.size());
version_message += '\n';

// Tack on aDevBot
version_message += "aDevBot\n";

in_server_info.m_socket->send(version_message.c_str(), version_message.size());
}

Expand Down
1 change: 1 addition & 0 deletions src/Plugins/RenX/RenX.FuckCronus/FuckCronus.h
Expand Up @@ -45,6 +45,7 @@ class RenX_FuckCronusPlugin : public RenX::Plugin
bool m_sanitize_steam_ids{};
bool m_sanitize_unknown_commands{};
bool m_sanitize_blacklisted_commands{};
bool m_suppress_chat_logs{};
};

#endif // _FUCKCRONUS_H_HEADER

0 comments on commit 860da01

Please sign in to comment.