Browse Source

Rename relay plugin to RenX.Relay

release/1.1
Jessica James 3 years ago
parent
commit
4b6e5626c1
  1. 2
      Configs/RenX.Relay.ini
  2. 2
      MakeRelease.bat
  3. 2
      src/Plugins/RenX/CMakeLists.txt
  4. 3
      src/Plugins/RenX/RenX.FuckCronus/CMakeLists.txt
  5. 3
      src/Plugins/RenX/RenX.Relay/CMakeLists.txt
  6. 4
      src/Plugins/RenX/RenX.Relay/README.md
  7. 20
      src/Plugins/RenX/RenX.Relay/RenX_Relay.cpp
  8. 8
      src/Plugins/RenX/RenX.Relay/RenX_Relay.h

2
Configs/RenX.FuckCronus.ini → Configs/RenX.Relay.ini

@ -1,4 +1,4 @@
; File: RenX.FuckCronus.ini
; File: RenX.Relay.ini
;
; Function:
; Sanitizes logs going to the Renegade X devbot (server list), and sanitizes commands coming from the Renegade X devbot.

2
MakeRelease.bat

@ -4,7 +4,7 @@ ECHO.
SET Platform=Win32
SET NoArgs=False
SET BinDir=cmake-build-release\bin\\
SET BinDir=cmake-build-win-release-x64\bin\\
if "%1" == "" SET NoArgs=True

2
src/Plugins/RenX/CMakeLists.txt

@ -18,7 +18,6 @@ add_subdirectory(RenX.ChatLogging)
add_subdirectory(RenX.CommandLogging)
add_subdirectory(RenX.ExcessiveHeadshots)
add_subdirectory(RenX.ExtraLogging)
add_subdirectory(RenX.FuckCronus)
add_subdirectory(RenX.Greetings)
add_subdirectory(RenX.HybridUUID)
add_subdirectory(RenX.IRCJoin)
@ -37,6 +36,7 @@ add_subdirectory(RenX.MinPlayers)
add_subdirectory(RenX.ModSystem)
add_subdirectory(RenX.NicknameUUID)
add_subdirectory(RenX.Plugin.Template)
add_subdirectory(RenX.Relay)
add_subdirectory(RenX.ServerList)
add_subdirectory(RenX.SetJoin)
add_subdirectory(RenX.Warn)

3
src/Plugins/RenX/RenX.FuckCronus/CMakeLists.txt

@ -1,3 +0,0 @@
add_renx_plugin(RenX.FuckCronus
FuckCronus.cpp
FuckCronus.h)

3
src/Plugins/RenX/RenX.Relay/CMakeLists.txt

@ -0,0 +1,3 @@
add_renx_plugin(RenX.Relay
RenX_Relay.cpp
RenX_Relay.h)

4
src/Plugins/RenX/RenX.FuckCronus/README.md → src/Plugins/RenX/RenX.Relay/README.md

@ -1,6 +1,6 @@
# Setup
1) Setup Jupiter on the same server as your game server
2) Add `RenX.Listen` and `RenX.FuckCronus` to your root `Config.ini`
2) Add `RenX.Listen` and `RenX.Relay` to your root `Config.ini`
3) Configure `RenX-ListenServer` (see RenX.Listen.ini) server block in `RenX.Core.ini`. These are the settings for any servers which connect to your bot.
4) In UDKRenegadeX.ini on the game server, replace `devbot.ren-x.com` with `127.0.0.1`
5) Startup Jupiter Bot
@ -24,7 +24,7 @@ traffic from there.
*Short*: Thieves shouldn't be trusted with personally identifiable information. This prevents that.
*Long* (copied from RenX.FuckCronus.ini):
*Long* (copied from RenX.Relay.ini):
Certain server owners report great unease about a specific Totem Arts sysadmin who is entirely unrestrained, who has
entirely unrestrained access to player personal information such as IP addresses, Hardware IDs (MAC addresses),

20
src/Plugins/RenX/RenX.FuckCronus/FuckCronus.cpp → src/Plugins/RenX/RenX.Relay/RenX_Relay.cpp

@ -3,7 +3,7 @@
* Written by Jessica James <jessica.aj@outlook.com>
*/
#include "FuckCronus.h"
#include "RenX_Relay.h"
#include <regex>
#include <random>
#include <memory>
@ -22,7 +22,7 @@ constexpr const char g_blank_steamid[] = "0x0000000000000000";
constexpr std::chrono::steady_clock::duration g_reconnect_delay = std::chrono::seconds{15 };
constexpr std::chrono::steady_clock::duration g_activity_timeout = std::chrono::seconds{ 60 };
int RenX_FuckCronusPlugin::think() {
int RenX_RelayPlugin::think() {
for (auto& server_pair : m_server_info_map) {
auto server = server_pair.first;
auto& server_info = server_pair.second;
@ -107,7 +107,7 @@ int RenX_FuckCronusPlugin::think() {
return 0;
}
bool RenX_FuckCronusPlugin::initialize() {
bool RenX_RelayPlugin::initialize() {
m_init_time = std::chrono::steady_clock::now();
m_sanitize_names = config.get<bool>("SanitizeNames"_jrs, true);
m_sanitize_ips = config.get<bool>("SanitizeIPs"_jrs, true);
@ -120,7 +120,7 @@ bool RenX_FuckCronusPlugin::initialize() {
return RenX::Plugin::initialize();
}
void RenX_FuckCronusPlugin::RenX_OnServerCreate(RenX::Server &server) {
void RenX_RelayPlugin::RenX_OnServerCreate(RenX::Server &server) {
auto& server_info = m_server_info_map[&server];
server_info.m_socket = std::unique_ptr<Jupiter::TCPSocket>(new Jupiter::TCPSocket());
@ -129,7 +129,7 @@ void RenX_FuckCronusPlugin::RenX_OnServerCreate(RenX::Server &server) {
}
}
void RenX_FuckCronusPlugin::RenX_OnServerDisconnect(RenX::Server &server, RenX::DisconnectReason reason) {
void RenX_RelayPlugin::RenX_OnServerDisconnect(RenX::Server &server, RenX::DisconnectReason reason) {
auto pair_itr = m_server_info_map.find(&server);
if (pair_itr != m_server_info_map.end()) {
auto& socket_ptr = pair_itr->second.m_socket;
@ -428,7 +428,7 @@ static const std::unordered_set<std::string_view> g_blacklist_commands {
"warn"sv
};
void RenX_FuckCronusPlugin::RenX_OnRaw(RenX::Server &server, const Jupiter::ReadableString &line) {
void RenX_RelayPlugin::RenX_OnRaw(RenX::Server &server, const Jupiter::ReadableString &line) {
// Not parsing any escape sequences, so data gets sent to devbot exactly as it's received here. Copy tokens where needed to process escape sequences.
Jupiter::ReadableString::TokenizeResult<Jupiter::String_Strict> tokens = Jupiter::StringS::tokenize(line, RenX::DelimC);
bool required_sanitization = false;
@ -604,7 +604,7 @@ void RenX_FuckCronusPlugin::RenX_OnRaw(RenX::Server &server, const Jupiter::Read
socket->send(line_sanitized);
}
void RenX_FuckCronusPlugin::devbot_connected(RenX::Server& in_server, ext_server_info& in_server_info) {
void RenX_RelayPlugin::devbot_connected(RenX::Server& in_server, ext_server_info& in_server_info) {
in_server_info.m_devbot_connected = true;
in_server_info.m_socket->setBlocking(false);
@ -623,7 +623,7 @@ void RenX_FuckCronusPlugin::devbot_connected(RenX::Server& in_server, ext_server
in_server_info.m_socket->send(version_message.c_str(), version_message.size());
}
void RenX_FuckCronusPlugin::devbot_disconnected(RenX::Server&, ext_server_info& in_server_info) {
void RenX_RelayPlugin::devbot_disconnected(RenX::Server&, ext_server_info& in_server_info) {
in_server_info.m_devbot_connected = false;
if (in_server_info.m_socket) {
@ -631,7 +631,7 @@ void RenX_FuckCronusPlugin::devbot_disconnected(RenX::Server&, ext_server_info&
}
}
void RenX_FuckCronusPlugin::process_devbot_message(RenX::Server* in_server, const Jupiter::ReadableString& in_line) {
void RenX_RelayPlugin::process_devbot_message(RenX::Server* in_server, const Jupiter::ReadableString& in_line) {
if (in_line.isEmpty()) {
return;
}
@ -664,7 +664,7 @@ void RenX_FuckCronusPlugin::process_devbot_message(RenX::Server* in_server, cons
}
// Plugin instantiation and entry point.
RenX_FuckCronusPlugin pluginInstance;
RenX_RelayPlugin pluginInstance;
extern "C" JUPITER_EXPORT Jupiter::Plugin *getPlugin()
{

8
src/Plugins/RenX/RenX.FuckCronus/FuckCronus.h → src/Plugins/RenX/RenX.Relay/RenX_Relay.h

@ -3,15 +3,15 @@
* Written by Jessica James <jessica.aj@outlook.com>
*/
#if !defined _FUCKCRONUS_H_HEADER
#define _FUCKCRONUS_H_HEADER
#if !defined _RELAY_H_HEADER
#define _RELAY_H_HEADER
#include "Jupiter/Plugin.h"
#include "Jupiter/Reference_String.h"
#include "Jupiter/TCPSocket.h"
#include "RenX_Plugin.h"
class RenX_FuckCronusPlugin : public RenX::Plugin
class RenX_RelayPlugin : public RenX::Plugin
{
public: // Jupiter::Thinker
int think() override;
@ -48,4 +48,4 @@ private:
bool m_suppress_chat_logs{};
};
#endif // _FUCKCRONUS_H_HEADER
#endif // _RELAY_H_HEADER
Loading…
Cancel
Save