Browse Source

First pass on removing Readable_String and Reference_String

master
Jessica James 3 years ago
parent
commit
709c5e2989
  1. 2
      src/Bot/include/IRC_Command.h
  2. 7
      src/Bot/src/IRC_Command.cpp
  3. 16
      src/Bot/src/Main.cpp
  4. 2
      src/Jupiter
  5. 6
      src/Plugins/ChannelRelay/ChannelRelay.cpp
  6. 3
      src/Plugins/ChannelRelay/ChannelRelay.h
  7. 3
      src/Plugins/CoreCommands/CoreCommands.cpp
  8. 2
      src/Plugins/ExtraCommands/ExtraCommands.cpp
  9. 4
      src/Plugins/FunCommands/FunCommands.cpp
  10. 6
      src/Plugins/PluginManager/PluginManager.cpp
  11. 4
      src/Plugins/RenX/RenX.Announcements/RenX_Announcements.cpp
  12. 2
      src/Plugins/RenX/RenX.CommandLogging/RenX_CommandLogging.cpp
  13. 173
      src/Plugins/RenX/RenX.Commands/RenX_Commands.cpp
  14. 8
      src/Plugins/RenX/RenX.Commands/RenX_Commands.h
  15. 4
      src/Plugins/RenX/RenX.Core/RenX_Plugin.cpp
  16. 4
      src/Plugins/RenX/RenX.Core/RenX_Plugin.h
  17. 43
      src/Plugins/RenX/RenX.Core/RenX_Server.cpp
  18. 2
      src/Plugins/RenX/RenX.Core/RenX_Server.h
  19. 374
      src/Plugins/RenX/RenX.Core/RenX_Tags.cpp
  20. 689
      src/Plugins/RenX/RenX.Core/RenX_Tags.h
  21. 8
      src/Plugins/RenX/RenX.ExtraLogging/RenX_ExtraLogging.cpp
  22. 6
      src/Plugins/RenX/RenX.ExtraLogging/RenX_ExtraLogging.h
  23. 2
      src/Plugins/RenX/RenX.Greetings/RenX_Greetings.cpp
  24. 3
      src/Plugins/RenX/RenX.HybridUUID/RenX_HybridUUID.cpp
  25. 108
      src/Plugins/RenX/RenX.Ladder.Web/RenX_Ladder_Web.cpp
  26. 14
      src/Plugins/RenX/RenX.Ladder.Web/RenX_Ladder_Web.h
  27. 562
      src/Plugins/RenX/RenX.Logging/RenX_Logging.cpp
  28. 210
      src/Plugins/RenX/RenX.Logging/RenX_Logging.h
  29. 18
      src/Plugins/RenX/RenX.Medals/RenX_Medals.cpp
  30. 4
      src/Plugins/RenX/RenX.Medals/RenX_Medals.h
  31. 48
      src/Plugins/RenX/RenX.ServerList/RenX_ServerList.cpp
  32. 22
      src/Plugins/RenX/RenX.ServerList/RenX_ServerList.h

2
src/Bot/include/IRC_Command.h

@ -161,7 +161,7 @@ private:
std::vector<IRCCommand::TypeAccessPair> m_types; /** Access levels for channel types */ std::vector<IRCCommand::TypeAccessPair> m_types; /** Access levels for channel types */
struct ChannelAccessPair { struct ChannelAccessPair {
Jupiter::StringS channel; std::string channel;
int access; int access;
}; };
std::vector<IRCCommand::ChannelAccessPair> m_channels; /** Access levels for specific channels */ std::vector<IRCCommand::ChannelAccessPair> m_channels; /** Access levels for specific channels */

7
src/Bot/src/IRC_Command.cpp

@ -16,6 +16,7 @@
* Written by Jessica James <jessica.aj@outlook.com> * Written by Jessica James <jessica.aj@outlook.com>
*/ */
#include "jessilib/unicode.hpp"
#include "IRC_Command.h" #include "IRC_Command.h"
std::vector<IRCCommand*> g_IRCMasterCommandList; std::vector<IRCCommand*> g_IRCMasterCommandList;
@ -72,7 +73,7 @@ int IRCCommand::getAccessLevel(int type) {
int IRCCommand::getAccessLevel(const Jupiter::ReadableString &channel) { int IRCCommand::getAccessLevel(const Jupiter::ReadableString &channel) {
for (const auto& pair : m_channels) { for (const auto& pair : m_channels) {
if (pair.channel.equalsi(channel)) { if (jessilib::equalsi(pair.channel, channel)) {
return pair.access; return pair.access;
} }
} }
@ -82,7 +83,7 @@ int IRCCommand::getAccessLevel(const Jupiter::ReadableString &channel) {
int IRCCommand::getAccessLevel(Jupiter::IRC::Client::Channel *channel) { int IRCCommand::getAccessLevel(Jupiter::IRC::Client::Channel *channel) {
for (const auto& pair : m_channels) { for (const auto& pair : m_channels) {
if (pair.channel.equalsi(channel->getName())) { if (jessilib::equalsi(pair.channel, channel->getName())) {
return pair.access; return pair.access;
} }
} }
@ -105,7 +106,7 @@ void IRCCommand::setAccessLevel(int type, int accessLevel) {
} }
void IRCCommand::setAccessLevel(const Jupiter::ReadableString &channel, int accessLevel) { void IRCCommand::setAccessLevel(const Jupiter::ReadableString &channel, int accessLevel) {
m_channels.push_back({ channel, accessLevel }); m_channels.push_back({ static_cast<std::string>(channel), accessLevel });
} }
void IRCCommand::create() { void IRCCommand::create() {

16
src/Bot/src/Main.cpp

@ -23,6 +23,7 @@
#include <exception> #include <exception>
#include <thread> #include <thread>
#include <mutex> #include <mutex>
#include "jessilib/unicode.hpp"
#include "Jupiter/Functions.h" #include "Jupiter/Functions.h"
#include "Jupiter/INIConfig.h" #include "Jupiter/INIConfig.h"
#include "Jupiter/Socket.h" #include "Jupiter/Socket.h"
@ -183,17 +184,18 @@ int main(int argc, const char **args) {
const char *configFileName = "Config.ini"; const char *configFileName = "Config.ini";
for (int i = 1; i < argc; i++) { for (int i = 1; i < argc; i++) {
if ("-help"_jrs.equalsi(args[i])) { std::string_view arg_view = args[i];
if (jessilib::equalsi("-help"_jrs, arg_view)) {
puts("Help coming soon, to a theatre near you!"); puts("Help coming soon, to a theatre near you!");
return 0; return 0;
} }
else if ("-config"_jrs.equalsi(args[i]) && ++i < argc) else if (jessilib::equalsi("-config"_jrs, arg_view) && ++i < argc)
configFileName = args[i]; configFileName = args[i];
else if ("-pluginsdir"_jrs.equalsi(args[i]) && ++i < argc) else if (jessilib::equalsi("-pluginsdir"_jrs, arg_view) && ++i < argc)
plugins_directory = args[i]; plugins_directory = arg_view;
else if ("-configsdir"_jrs.equalsi(args[i]) && ++i < argc) else if (jessilib::equalsi("-configsdir"_jrs, arg_view) && ++i < argc)
configs_directory = args[i]; configs_directory = arg_view;
else if ("-configFormat"_jrs.equalsi(args[i]) && ++i < argc) else if (jessilib::equalsi("-configFormat"_jrs, arg_view) && ++i < argc)
puts("Feature not yet supported!"); puts("Feature not yet supported!");
else else
printf("Warning: Unknown command line argument \"%s\" specified. Ignoring...", args[i]); printf("Warning: Unknown command line argument \"%s\" specified. Ignoring...", args[i]);

2
src/Jupiter

@ -1 +1 @@
Subproject commit 8bd27485a9bca535a598447aa550d862ba3a8b42 Subproject commit dbb4d0d147503f3bacdff87a7dd71d8a12665fab

6
src/Plugins/ChannelRelay/ChannelRelay.cpp

@ -35,7 +35,7 @@ bool ChannelRelayPlugin::initialize() {
} }
for (const auto& type : split_types) { for (const auto& type : split_types) {
ChannelRelayPlugin::types.concat(Jupiter::asInt(type)); m_types.push_back(Jupiter::asInt(type));
} }
return true; return true;
@ -44,7 +44,7 @@ bool ChannelRelayPlugin::initialize() {
int ChannelRelayPlugin::OnRehash() { int ChannelRelayPlugin::OnRehash() {
Jupiter::Plugin::OnRehash(); Jupiter::Plugin::OnRehash();
ChannelRelayPlugin::types.erase(); m_types.clear();
return this->initialize() ? 0 : -1; return this->initialize() ? 0 : -1;
} }
@ -52,7 +52,7 @@ void ChannelRelayPlugin::OnChat(Jupiter::IRC::Client *server, std::string_view c
Jupiter::IRC::Client::Channel *chan = server->getChannel(channel); Jupiter::IRC::Client::Channel *chan = server->getChannel(channel);
if (chan != nullptr) { if (chan != nullptr) {
int type = chan->getType(); int type = chan->getType();
if (ChannelRelayPlugin::types.find(type) != std::string_view::npos) { if (std::find(m_types.begin(), m_types.end(), type) != m_types.end()) {
size_t serverCount = serverManager->size(); size_t serverCount = serverManager->size();
char prefix = chan->getUserPrefix(nick); char prefix = chan->getUserPrefix(nick);
std::string user_string; std::string user_string;

3
src/Plugins/ChannelRelay/ChannelRelay.h

@ -29,8 +29,9 @@ public: // Jupiter::Plugin
int OnRehash() override; int OnRehash() override;
virtual bool initialize() override; virtual bool initialize() override;
private: private:
Jupiter::String_Strict<int> types; std::vector<int> m_types;
}; };
#endif // _CHANNELRELAY_H_HEADER #endif // _CHANNELRELAY_H_HEADER

3
src/Plugins/CoreCommands/CoreCommands.cpp

@ -23,6 +23,7 @@
#include "IRC_Bot.h" #include "IRC_Bot.h"
using namespace Jupiter::literals; using namespace Jupiter::literals;
using namespace std::literals;
// Help Console Command // Help Console Command
@ -120,7 +121,7 @@ VersionGenericCommand::VersionGenericCommand() {
} }
Jupiter::GenericCommand::ResponseLine *VersionGenericCommand::trigger(const Jupiter::ReadableString &parameters) { Jupiter::GenericCommand::ResponseLine *VersionGenericCommand::trigger(const Jupiter::ReadableString &parameters) {
Jupiter::GenericCommand::ResponseLine *ret = new Jupiter::GenericCommand::ResponseLine("Version: "_jrs + Jupiter::ReferenceString(Jupiter::version), GenericCommand::DisplayType::PublicSuccess); Jupiter::GenericCommand::ResponseLine *ret = new Jupiter::GenericCommand::ResponseLine("Version: "s + Jupiter::ReferenceString(Jupiter::version), GenericCommand::DisplayType::PublicSuccess);
ret->next = new Jupiter::GenericCommand::ResponseLine(Jupiter::ReferenceString(Jupiter::copyright), GenericCommand::DisplayType::PublicSuccess); ret->next = new Jupiter::GenericCommand::ResponseLine(Jupiter::ReferenceString(Jupiter::copyright), GenericCommand::DisplayType::PublicSuccess);
return ret; return ret;
} }

2
src/Plugins/ExtraCommands/ExtraCommands.cpp

@ -46,7 +46,7 @@ Jupiter::GenericCommand::ResponseLine *SelectGenericCommand::trigger(const Jupit
IRCCommand::selected_server = serverManager->getServer(parameters); IRCCommand::selected_server = serverManager->getServer(parameters);
if (IRCCommand::selected_server == nullptr) if (IRCCommand::selected_server == nullptr)
return new Jupiter::GenericCommand::ResponseLine("Error: IRC server \""_jrs + parameters + "\" not found. No IRC server is currently selected."_jrs, GenericCommand::DisplayType::PublicError); return new Jupiter::GenericCommand::ResponseLine("Error: IRC server \""s + parameters + "\" not found. No IRC server is currently selected."_jrs, GenericCommand::DisplayType::PublicError);
if (IRCCommand::active_server == nullptr) if (IRCCommand::active_server == nullptr)
IRCCommand::active_server = IRCCommand::selected_server; IRCCommand::active_server = IRCCommand::selected_server;

4
src/Plugins/FunCommands/FunCommands.cpp

@ -190,9 +190,9 @@ const Jupiter::ReadableString &ResolveGenericCommand::getHelp(const Jupiter::Rea
static STRING_LITERAL_AS_NAMED_REFERENCE(hostHelp, "Resolves a hostname to an IP address. Syntax: resolve hostname <address>"); static STRING_LITERAL_AS_NAMED_REFERENCE(hostHelp, "Resolves a hostname to an IP address. Syntax: resolve hostname <address>");
static STRING_LITERAL_AS_NAMED_REFERENCE(ipHelp, "Reverse-resolves an IP address to a hostname. Syntax: resolve ip <address>"); static STRING_LITERAL_AS_NAMED_REFERENCE(ipHelp, "Reverse-resolves an IP address to a hostname. Syntax: resolve ip <address>");
if (parameters.equalsi("hostname"_jrs) || parameters.equalsi("host"_jrs)) if (jessilib::equalsi(parameters, "hostname"_jrs) || jessilib::equalsi(parameters, "host"_jrs))
return hostHelp; return hostHelp;
if (parameters.equalsi("ip"_jrs)) if (jessilib::equalsi(parameters, "ip"_jrs))
return ipHelp; return ipHelp;
return defaultHelp; return defaultHelp;

6
src/Plugins/PluginManager/PluginManager.cpp

@ -118,15 +118,15 @@ const Jupiter::ReadableString &PluginGenericCommand::getHelp(const Jupiter::Read
static STRING_LITERAL_AS_NAMED_REFERENCE(listHelp, "Lists all of the plugins currently loaded. Syntax: plugin [list]"); static STRING_LITERAL_AS_NAMED_REFERENCE(listHelp, "Lists all of the plugins currently loaded. Syntax: plugin [list]");
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Manages plugins. Syntax: plugin {[list], <load> <plugin>, <unload> <plugin>, <reload> [plugin]}"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Manages plugins. Syntax: plugin {[list], <load> <plugin>, <unload> <plugin>, <reload> [plugin]}");
if (parameters.equalsi(STRING_LITERAL_AS_REFERENCE("load"))) { if (jessilib::equalsi(parameters, STRING_LITERAL_AS_REFERENCE("load"))) {
return loadHelp; return loadHelp;
} }
if (parameters.equalsi(STRING_LITERAL_AS_REFERENCE("unload"))) { if (jessilib::equalsi(parameters, STRING_LITERAL_AS_REFERENCE("unload"))) {
return unloadHelp; return unloadHelp;
} }
if (parameters.equalsi(STRING_LITERAL_AS_REFERENCE("list"))) { if (jessilib::equalsi(parameters, STRING_LITERAL_AS_REFERENCE("list"))) {
return listHelp; return listHelp;
} }

4
src/Plugins/RenX/RenX.Announcements/RenX_Announcements.cpp

@ -46,10 +46,10 @@ void RenX_AnnouncementsPlugin::announce(unsigned int, void *)
while (trand == RenX_AnnouncementsPlugin::lastLine); while (trand == RenX_AnnouncementsPlugin::lastLine);
RenX_AnnouncementsPlugin::lastLine = trand; RenX_AnnouncementsPlugin::lastLine = trand;
} }
Jupiter::StringS announcement = RenX_AnnouncementsPlugin::announcementsFile.getLine(RenX_AnnouncementsPlugin::lastLine); std::string announcement = RenX_AnnouncementsPlugin::announcementsFile.getLine(RenX_AnnouncementsPlugin::lastLine);
RenX::sanitizeTags(announcement); RenX::sanitizeTags(announcement);
Jupiter::String msg; std::string msg;
RenX::Core *core = RenX::getCore(); RenX::Core *core = RenX::getCore();
RenX::Server *server; RenX::Server *server;
for (unsigned int i = 0; i != RenX::getCore()->getServerCount(); i++) for (unsigned int i = 0; i != RenX::getCore()->getServerCount(); i++)

2
src/Plugins/RenX/RenX.CommandLogging/RenX_CommandLogging.cpp

@ -67,7 +67,7 @@ void RenX_CommandLoggingPlugin::RenX_OnCommandTriggered(RenX::Server& server, co
return; return;
} }
WriteToLog(server, player, trigger + " " + parameters); WriteToLog(server, player, static_cast<std::string>(trigger) + " " + parameters);
} }
std::ostream& operator<<(std::ostream& in_stream, const Jupiter::ReadableString& in_string) { std::ostream& operator<<(std::ostream& in_stream, const Jupiter::ReadableString& in_string) {

173
src/Plugins/RenX/RenX.Commands/RenX_Commands.cpp

@ -82,7 +82,7 @@ bool RenX_CommandsPlugin::initialize() {
m_playerInfoFormat = this->config.get("PlayerInfoFormat"_jrs, IRCCOLOR "03[Player Info]" IRCCOLOR "{TCOLOR} Name: " IRCBOLD "{RNAME}" IRCBOLD " - ID: {ID} - Team: " IRCBOLD "{TEAML}" IRCBOLD " - Vehicle Kills: {VEHICLEKILLS} - Building Kills {BUILDINGKILLS} - Kills {KILLS} - Deaths: {DEATHS} - KDR: {KDR} - Access: {ACCESS}"_jrs); m_playerInfoFormat = this->config.get("PlayerInfoFormat"_jrs, IRCCOLOR "03[Player Info]" IRCCOLOR "{TCOLOR} Name: " IRCBOLD "{RNAME}" IRCBOLD " - ID: {ID} - Team: " IRCBOLD "{TEAML}" IRCBOLD " - Vehicle Kills: {VEHICLEKILLS} - Building Kills {BUILDINGKILLS} - Kills {KILLS} - Deaths: {DEATHS} - KDR: {KDR} - Access: {ACCESS}"_jrs);
m_adminPlayerInfoFormat = this->config.get("AdminPlayerInfoFormat"_jrs, Jupiter::StringS::Format("%.*s - IP: " IRCBOLD "{IP}" IRCBOLD " - HWID: " IRCBOLD "{HWID}" IRCBOLD " - RDNS: " IRCBOLD "{RDNS}" IRCBOLD " - Steam ID: " IRCBOLD "{STEAM}", m_playerInfoFormat.size(), m_adminPlayerInfoFormat = this->config.get("AdminPlayerInfoFormat"_jrs, Jupiter::StringS::Format("%.*s - IP: " IRCBOLD "{IP}" IRCBOLD " - HWID: " IRCBOLD "{HWID}" IRCBOLD " - RDNS: " IRCBOLD "{RDNS}" IRCBOLD " - Steam ID: " IRCBOLD "{STEAM}", m_playerInfoFormat.size(),
m_playerInfoFormat.data())); m_playerInfoFormat.data()));
m_buildingInfoFormat = this->config.get("BuildingInfoFormat"_jrs, ""_jrs IRCCOLOR + RenX::tags->buildingTeamColorTag + RenX::tags->buildingNameTag + IRCCOLOR " - " IRCCOLOR "07"_jrs + RenX::tags->buildingHealthPercentageTag + "%"_jrs); m_buildingInfoFormat = this->config.get("BuildingInfoFormat"_jrs, ""s IRCCOLOR + RenX::tags->buildingTeamColorTag + RenX::tags->buildingNameTag + IRCCOLOR " - " IRCCOLOR "07"_jrs + RenX::tags->buildingHealthPercentageTag + "%"_jrs);
m_staffTitle = this->config.get("StaffTitle"_jrs, "Moderator"_jrs); m_staffTitle = this->config.get("StaffTitle"_jrs, "Moderator"_jrs);
RenX::sanitizeTags(m_playerInfoFormat); RenX::sanitizeTags(m_playerInfoFormat);
@ -730,7 +730,7 @@ void PlayerInfoIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableStrin
Jupiter::IRC::Client::Channel *chan = source->getChannel(channel); Jupiter::IRC::Client::Channel *chan = source->getChannel(channel);
if (chan != nullptr) { if (chan != nullptr) {
int type = chan->getType(); int type = chan->getType();
Jupiter::StringL msg; std::string msg;
RenX::Server *server; RenX::Server *server;
const Jupiter::ReadableString &player_info_format = source->getAccessLevel(channel, nick) > 1 ? pluginInstance.getAdminPlayerInfoFormat() : pluginInstance.getPlayerInfoFormat(); const Jupiter::ReadableString &player_info_format = source->getAccessLevel(channel, nick) > 1 ? pluginInstance.getAdminPlayerInfoFormat() : pluginInstance.getPlayerInfoFormat();
size_t index = 0; size_t index = 0;
@ -792,13 +792,14 @@ void BuildingInfoIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableStr
int type = chan->getType(); int type = chan->getType();
bool seenStrip; bool seenStrip;
std::forward_list<Jupiter::String *> gStrings; bool foundServer{};
std::forward_list<Jupiter::String *> nStrings; std::forward_list<std::string> gStrings;
std::forward_list<Jupiter::String *> oStrings; std::forward_list<std::string> nStrings;
std::forward_list<Jupiter::String *> cStrings; std::forward_list<std::string> oStrings;
Jupiter::String *str = nullptr; std::forward_list<std::string> cStrings;
for (const auto& server : RenX::getCore()->getServers()) { for (const auto& server : RenX::getCore()->getServers()) {
if (server->isLogChanType(type)) { if (server->isLogChanType(type)) {
foundServer = true;
seenStrip = false; seenStrip = false;
for (const auto& building : server->buildings){ for (const auto& building : server->buildings){
if (building->name.find("Rx_Building_Air"_jrs) == 0) { if (building->name.find("Rx_Building_Air"_jrs) == 0) {
@ -808,8 +809,8 @@ void BuildingInfoIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableStr
seenStrip = true; seenStrip = true;
} }
str = new Jupiter::String(pluginInstance.getBuildingInfoFormat()); std::string str(pluginInstance.getBuildingInfoFormat());
RenX::processTags(*str, server, nullptr, nullptr, building.get()); RenX::processTags(str, server, nullptr, nullptr, building.get());
if (building->capturable) if (building->capturable)
cStrings.push_front(str); cStrings.push_front(str);
@ -822,33 +823,27 @@ void BuildingInfoIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableStr
} }
while (gStrings.empty() == false) { while (gStrings.empty() == false) {
str = gStrings.front();
gStrings.pop_front(); gStrings.pop_front();
source->sendMessage(channel, *str); source->sendMessage(channel, gStrings.front());
delete str;
} }
while (nStrings.empty() == false) { while (nStrings.empty() == false) {
str = nStrings.front();
nStrings.pop_front(); nStrings.pop_front();
source->sendMessage(channel, *str); source->sendMessage(channel, nStrings.front());
delete str;
} }
while (oStrings.empty() == false) { while (oStrings.empty() == false) {
str = oStrings.front();
oStrings.pop_front(); oStrings.pop_front();
source->sendMessage(channel, *str); source->sendMessage(channel, oStrings.front());
delete str;
} }
while (cStrings.empty() == false) { while (cStrings.empty() == false) {
str = cStrings.front();
cStrings.pop_front(); cStrings.pop_front();
source->sendMessage(channel, *str); source->sendMessage(channel, cStrings.front());
delete str;
} }
} }
} }
if (str == nullptr)
if (!foundServer) {
source->sendMessage(channel, "Error: Channel not attached to any connected Renegade X servers."_jrs); source->sendMessage(channel, "Error: Channel not attached to any connected Renegade X servers."_jrs);
}
} }
const Jupiter::ReadableString &BuildingInfoIRCCommand::getHelp(const Jupiter::ReadableString &) { const Jupiter::ReadableString &BuildingInfoIRCCommand::getHelp(const Jupiter::ReadableString &) {
@ -880,7 +875,7 @@ void MutatorsIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString
{ {
list = STRING_LITERAL_AS_REFERENCE(IRCCOLOR "03[Mutators]" IRCNORMAL); list = STRING_LITERAL_AS_REFERENCE(IRCCOLOR "03[Mutators]" IRCNORMAL);
for (const auto& mutator : server->mutators) { for (const auto& mutator : server->mutators) {
list += " "_jrs + mutator; list += " "s + mutator;
} }
if (server->mutators.empty()) { if (server->mutators.empty()) {
@ -925,10 +920,10 @@ void RotationIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString
list = STRING_LITERAL_AS_REFERENCE(IRCCOLOR "03[Rotation]" IRCNORMAL); list = STRING_LITERAL_AS_REFERENCE(IRCCOLOR "03[Rotation]" IRCNORMAL);
for (const auto& map : server->maps) { for (const auto& map : server->maps) {
if (jessilib::equalsi(server->getMap().name, map.name)) { if (jessilib::equalsi(server->getMap().name, map.name)) {
list += STRING_LITERAL_AS_REFERENCE(" " IRCBOLD "[") + map.name + STRING_LITERAL_AS_REFERENCE("]" IRCBOLD); list += std::string(" " IRCBOLD "[") + map.name + STRING_LITERAL_AS_REFERENCE("]" IRCBOLD);
} }
else { else {
list += " "_jrs + map.name; list += " "s + map.name;
} }
} }
@ -968,7 +963,7 @@ void MapIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &chan
if (server->isLogChanType(type)) { if (server->isLogChanType(type)) {
match = true; match = true;
const RenX::Map &map = server->getMap(); const RenX::Map &map = server->getMap();
source->sendMessage(channel, "Current Map: "_jrs + map.name + "; GUID: "_jrs + RenX::formatGUID(map)); source->sendMessage(channel, "Current Map: "s + map.name + "; GUID: "_jrs + RenX::formatGUID(map));
} }
} }
if (match == false) { if (match == false) {
@ -1011,7 +1006,7 @@ void GameInfoIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString
const RenX::Map &map = server->getMap(); const RenX::Map &map = server->getMap();
std::chrono::seconds time = std::chrono::duration_cast<std::chrono::seconds>(server->getGameTime()); std::chrono::seconds time = std::chrono::duration_cast<std::chrono::seconds>(server->getGameTime());
source->sendMessage(channel, Jupiter::StringS::Format(IRCCOLOR "03[GameInfo] " IRCCOLOR "%.*s", server->getGameVersion().size(), server->getGameVersion().data())); source->sendMessage(channel, Jupiter::StringS::Format(IRCCOLOR "03[GameInfo] " IRCCOLOR "%.*s", server->getGameVersion().size(), server->getGameVersion().data()));
source->sendMessage(channel, IRCCOLOR "03[GameInfo] " IRCCOLOR "10Map" IRCCOLOR ": "_jrs + map.name + "; " IRCCOLOR "10GUID" IRCCOLOR ": "_jrs + RenX::formatGUID(map)); source->sendMessage(channel, IRCCOLOR "03[GameInfo] " IRCCOLOR "10Map" IRCCOLOR ": "s + map.name + "; " IRCCOLOR "10GUID" IRCCOLOR ": "_jrs + RenX::formatGUID(map));
source->sendMessage(channel, Jupiter::StringS::Format(IRCCOLOR "03[GameInfo] " IRCCOLOR "10Elapsed time" IRCCOLOR ": %.2lld:%.2lld:%.2lld", time.count() / 3600, (time.count() % 3600) / 60, time.count() % 60)); source->sendMessage(channel, Jupiter::StringS::Format(IRCCOLOR "03[GameInfo] " IRCCOLOR "10Elapsed time" IRCCOLOR ": %.2lld:%.2lld:%.2lld", time.count() / 3600, (time.count() % 3600) / 60, time.count() % 60));
source->sendMessage(channel, Jupiter::StringS::Format(IRCCOLOR "03[GameInfo] " IRCCOLOR "There are " IRCCOLOR "10%d" IRCCOLOR " players online.", server->players.size())); source->sendMessage(channel, Jupiter::StringS::Format(IRCCOLOR "03[GameInfo] " IRCCOLOR "There are " IRCCOLOR "10%d" IRCCOLOR " players online.", server->players.size()));
} }
@ -1212,44 +1207,45 @@ void ModsIRCCommand::create()
this->addTrigger(STRING_LITERAL_AS_REFERENCE("mods")); this->addTrigger(STRING_LITERAL_AS_REFERENCE("mods"));
} }
void ModsIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &channel, const Jupiter::ReadableString &nick, const Jupiter::ReadableString &parameters) void ModsIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &channel, const Jupiter::ReadableString &nick, const Jupiter::ReadableString &parameters) {
{ if (jessilib::equalsi(parameters, "show"sv)) {
if (parameters.equalsi("show")) ShowModsIRCCommand_instance.trigger(source, channel, nick, parameters); ShowModsIRCCommand_instance.trigger(source, channel, nick, parameters);
else }
{ else {
Jupiter::IRC::Client::Channel *chan = source->getChannel(channel); Jupiter::IRC::Client::Channel *chan = source->getChannel(channel);
if (chan != nullptr) if (chan != nullptr) {
{
int type = chan->getType(); int type = chan->getType();
Jupiter::StringL msg; Jupiter::StringL msg;
const Jupiter::ReadableString &staff_word = pluginInstance.getStaffTitle(); const Jupiter::ReadableString &staff_word = pluginInstance.getStaffTitle();
for (unsigned int i = 0; i != RenX::getCore()->getServerCount(); i++) for (unsigned int i = 0; i != RenX::getCore()->getServerCount(); i++) {
{
RenX::Server *server = RenX::getCore()->getServer(i); RenX::Server *server = RenX::getCore()->getServer(i);
if (server->isLogChanType(type)) if (server->isLogChanType(type)) {
{
msg = ""; msg = "";
if (server->players.size() != 0) if (server->players.size() != 0) {
{ for (auto node = server->players.begin(); node != server->players.end(); ++node) {
for (auto node = server->players.begin(); node != server->players.end(); ++node) if (node->isBot == false && (!node->adminType.empty() || (node->access != 0 && (!node->gamePrefix.empty() || !node->formatNamePrefix.empty())))) {
{ if (!msg.empty()) {
if (node->isBot == false && (!node->adminType.empty() || (node->access != 0 && (!node->gamePrefix.empty() || !node->formatNamePrefix.empty()))))
{
if (!msg.empty())
msg += ", "; msg += ", ";
else msg += staff_word + "s in-game: "_jrs; }
else {
msg += staff_word;
msg += "s in-game: "_jrs;
}
msg += node->gamePrefix; msg += node->gamePrefix;
msg += node->name; msg += node->name;
} }
} }
} }
if (msg.empty()) if (msg.empty()) {
msg = "No "_jrs + staff_word + "s are in-game."_jrs; msg = "No "s + staff_word + "s are in-game."_jrs;
}
source->sendMessage(channel, msg); source->sendMessage(channel, msg);
} }
} }
if (msg.empty()) if (msg.empty()) {
source->sendMessage(channel, STRING_LITERAL_AS_REFERENCE("Error: Channel not attached to any connected Renegade X servers.")); source->sendMessage(channel,
STRING_LITERAL_AS_REFERENCE("Error: Channel not attached to any connected Renegade X servers."));
}
} }
} }
} }
@ -1308,7 +1304,9 @@ void RulesIRCCommand::create()
void RulesIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &channel, const Jupiter::ReadableString &nick, const Jupiter::ReadableString &parameters) void RulesIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &channel, const Jupiter::ReadableString &nick, const Jupiter::ReadableString &parameters)
{ {
if (parameters.equalsi("show")) ShowRulesIRCCommand_instance.trigger(source, channel, nick, parameters); if (jessilib::equalsi(parameters, "show"sv)) {
ShowRulesIRCCommand_instance.trigger(source, channel, nick, parameters);
}
else else
{ {
Jupiter::IRC::Client::Channel *chan = source->getChannel(channel); Jupiter::IRC::Client::Channel *chan = source->getChannel(channel);
@ -1406,16 +1404,16 @@ void GameOverIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString
if (server->isLogChanType(type)) if (server->isLogChanType(type))
{ {
match = true; match = true;
if (parameters.equalsi("empty"_jrs)) if (jessilib::equalsi(parameters, "empty"_jrs))
server->gameoverWhenEmpty(); server->gameoverWhenEmpty();
else if (parameters.equalsi("if empty"_jrs)) else if (jessilib::equalsi(parameters, "if empty"_jrs))
{ {
if (server->players.size() == server->getBotCount()) if (server->players.size() == server->getBotCount())
server->gameover(); server->gameover();
} }
else if (parameters.equalsi("now"_jrs)) else if (jessilib::equalsi(parameters, "now"_jrs))
server->gameover(); server->gameover();
else if (parameters.equalsi("stop"_jrs) || parameters.equalsi("cancel"_jrs)) else if (jessilib::equalsi(parameters, "stop"_jrs) || jessilib::equalsi(parameters, "cancel"_jrs))
{ {
if (server->gameoverStop()) if (server->gameoverStop())
server->sendMessage("Notice: The scheduled gameover has been cancelled."_jrs); server->sendMessage("Notice: The scheduled gameover has been cancelled."_jrs);
@ -1664,7 +1662,7 @@ void DisarmIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &c
if (player != nullptr) if (player != nullptr)
{ {
if (server->disarm(*player)) if (server->disarm(*player))
source->sendMessage(channel, STRING_LITERAL_AS_REFERENCE("All deployables (c4, beacons, etc) belonging to ") + RenX::getFormattedPlayerName(*player) + STRING_LITERAL_AS_REFERENCE(IRCCOLOR " have been disarmed.")); source->sendMessage(channel, std::string("All deployables (c4, beacons, etc) belonging to ") + RenX::getFormattedPlayerName(*player) + STRING_LITERAL_AS_REFERENCE(IRCCOLOR " have been disarmed."));
else else
source->sendMessage(channel, "Error: Server does not support disarms."_jrs); source->sendMessage(channel, "Error: Server does not support disarms."_jrs);
} }
@ -1715,7 +1713,7 @@ void DisarmC4IRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString
if (player != nullptr) if (player != nullptr)
{ {
if (server->disarmC4(*player)) if (server->disarmC4(*player))
source->sendMessage(channel, STRING_LITERAL_AS_REFERENCE("All C4 belonging to ") + RenX::getFormattedPlayerName(*player) + STRING_LITERAL_AS_REFERENCE(IRCCOLOR " have been disarmed.")); source->sendMessage(channel, std::string("All C4 belonging to ") + RenX::getFormattedPlayerName(*player) + STRING_LITERAL_AS_REFERENCE(IRCCOLOR " have been disarmed."));
else else
source->sendMessage(channel, "Error: Server does not support disarms."_jrs); source->sendMessage(channel, "Error: Server does not support disarms."_jrs);
} }
@ -1768,7 +1766,7 @@ void DisarmBeaconIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableStr
if (player != nullptr) if (player != nullptr)
{ {
if (server->disarmBeacon(*player)) if (server->disarmBeacon(*player))
source->sendMessage(channel, STRING_LITERAL_AS_REFERENCE("All beacons belonging to ") + RenX::getFormattedPlayerName(*player) + STRING_LITERAL_AS_REFERENCE(IRCCOLOR " have been disarmed.")); source->sendMessage(channel, std::string("All beacons belonging to ") + RenX::getFormattedPlayerName(*player) + STRING_LITERAL_AS_REFERENCE(IRCCOLOR " have been disarmed."));
else else
source->sendMessage(channel, "Error: Server does not support disarms."_jrs); source->sendMessage(channel, "Error: Server does not support disarms."_jrs);
} }
@ -2447,7 +2445,7 @@ const Jupiter::ReadableString &AddBanIRCCommand::getHelp(const Jupiter::Readable
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Adds a ban entry to the ban list. Use \"help addban keys\" for a list of input keys. Syntax: AddBan <Key> <Value> [<Key> <Value> ...]"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Adds a ban entry to the ban list. Use \"help addban keys\" for a list of input keys. Syntax: AddBan <Key> <Value> [<Key> <Value> ...]");
static STRING_LITERAL_AS_NAMED_REFERENCE(keyHelp, "Valueless keys (flags): Game, Chat, Bot, Vote, Mine, Ladder, Alert; Value-paired keys: Name, IP, Steam, RDNS, Duration, Reason (MUST BE LAST)"); static STRING_LITERAL_AS_NAMED_REFERENCE(keyHelp, "Valueless keys (flags): Game, Chat, Bot, Vote, Mine, Ladder, Alert; Value-paired keys: Name, IP, Steam, RDNS, Duration, Reason (MUST BE LAST)");
if (!parameters.empty() && parameters.equalsi("keys"_jrs)) if (!parameters.empty() && jessilib::equalsi(parameters, "keys"_jrs))
return keyHelp; return keyHelp;
return defaultHelp; return defaultHelp;
} }
@ -2752,7 +2750,7 @@ void AddExemptionIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableStr
uint32_t ip = 0U; uint32_t ip = 0U;
uint8_t prefix_length = 32U; uint8_t prefix_length = 32U;
uint64_t steamid = 0U; uint64_t steamid = 0U;
Jupiter::String setter = nick + "@IRC"_jrs; std::string setter = static_cast<std::string>(nick) + "@IRC"_jrs;
std::chrono::seconds duration = std::chrono::seconds::zero(); std::chrono::seconds duration = std::chrono::seconds::zero();
uint8_t flags = 0; uint8_t flags = 0;
@ -2849,7 +2847,7 @@ const Jupiter::ReadableString &AddExemptionIRCCommand::getHelp(const Jupiter::Re
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Adds an exemption entry to the exemption list. Use \"help addexemption keys\" for a list of input keys. Syntax: AddExemption <Key> <Value> [<Key> <Value> ...]"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Adds an exemption entry to the exemption list. Use \"help addexemption keys\" for a list of input keys. Syntax: AddExemption <Key> <Value> [<Key> <Value> ...]");
static STRING_LITERAL_AS_NAMED_REFERENCE(keyHelp, "Valueless keys (flags): Ban, Kick; Value-paired keys: IP, Steam, Duration"); static STRING_LITERAL_AS_NAMED_REFERENCE(keyHelp, "Valueless keys (flags): Ban, Kick; Value-paired keys: IP, Steam, Duration");
if (!parameters.empty() && parameters.equalsi("keys"_jrs)) if (!parameters.empty() && jessilib::equalsi(parameters, "keys"_jrs))
return keyHelp; return keyHelp;
return defaultHelp; return defaultHelp;
} }
@ -3021,7 +3019,8 @@ void PhaseBotsIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString
server->sendMessage(STRING_LITERAL_AS_REFERENCE("Bot phasing has been disabled.")); server->sendMessage(STRING_LITERAL_AS_REFERENCE("Bot phasing has been disabled."));
} }
} }
else if (parameters.equalsi("true") || parameters.equalsi("on") || parameters.equalsi("start") || parameters.equalsi("1")) { else if (jessilib::equalsi(parameters, "true"sv) || jessilib::equalsi(parameters, "on"sv)
|| jessilib::equalsi(parameters, "start"sv) || jessilib::equalsi(parameters, "1"sv)) {
togglePhasing(server, true); togglePhasing(server, true);
server->sendMessage(STRING_LITERAL_AS_REFERENCE("Bot phasing has been enabled.")); server->sendMessage(STRING_LITERAL_AS_REFERENCE("Bot phasing has been enabled."));
} }
@ -3342,15 +3341,15 @@ void CancelVoteIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableStrin
if (parameters.empty()) { if (parameters.empty()) {
cancel_all = true; cancel_all = true;
} else { } else {
if (parameters.equalsi("all") || parameters.equalsi("a")) { if (jessilib::equalsi(parameters, "all"sv) || jessilib::equalsi(parameters, "a"sv)) {
cancel_all = true; cancel_all = true;
} else if (parameters.equalsi("public") || parameters.equalsi("p")) { } else if (jessilib::equalsi(parameters, "public"sv) || jessilib::equalsi(parameters, "p"sv)) {
target = RenX::TeamType::None; target = RenX::TeamType::None;
} else if (parameters.equalsi("gdi") || parameters.equalsi("g")) { } else if (jessilib::equalsi(parameters, "gdi"sv) || jessilib::equalsi(parameters, "g"sv)) {
target = RenX::TeamType::GDI; target = RenX::TeamType::GDI;
} else if (parameters.equalsi("blackhand") || parameters.equalsi("bh") || parameters.equalsi("b")) { } else if (jessilib::equalsi(parameters, "blackhand"sv) || jessilib::equalsi(parameters, "bh"sv) || jessilib::equalsi(parameters, "b"sv)) {
target = RenX::TeamType::GDI; target = RenX::TeamType::GDI;
} else if (parameters.equalsi("nod") || parameters.equalsi("n")) { } else if (jessilib::equalsi(parameters, "nod"sv) || jessilib::equalsi(parameters, "n"sv)) {
target = RenX::TeamType::Nod; target = RenX::TeamType::Nod;
} else { } else {
source->sendNotice(nick, STRING_LITERAL_AS_REFERENCE("Error: Invalid Team. Allowed values are all/a, public/p, gdi/g, nod/n, blackhand/bh/b.")); source->sendNotice(nick, STRING_LITERAL_AS_REFERENCE("Error: Invalid Team. Allowed values are all/a, public/p, gdi/g, nod/n, blackhand/bh/b."));
@ -3469,7 +3468,7 @@ void ModsGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *, const Ju
for (auto node = source->players.begin(); node != source->players.end(); ++node) { for (auto node = source->players.begin(); node != source->players.end(); ++node) {
if (node->isBot == false && (!node->adminType.empty() || (node->access != 0 && (!node->gamePrefix.empty() || !node->formatNamePrefix.empty())))) { if (node->isBot == false && (!node->adminType.empty() || (node->access != 0 && (!node->gamePrefix.empty() || !node->formatNamePrefix.empty())))) {
if (msg.empty()) if (msg.empty())
msg = staff_word + "s in-game: "_jrs; msg = static_cast<std::string>(staff_word) + "s in-game: "_jrs;
else else
msg += ", "; msg += ", ";
@ -3478,7 +3477,7 @@ void ModsGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *, const Ju
} }
} }
if (msg.empty()) { if (msg.empty()) {
msg += "No "_jrs + staff_word + "s are in-game"_jrs; msg += "No "s + staff_word + "s are in-game"_jrs;
RenX::GameCommand *cmd = source->getCommand(STRING_LITERAL_AS_REFERENCE("modrequest")); RenX::GameCommand *cmd = source->getCommand(STRING_LITERAL_AS_REFERENCE("modrequest"));
if (cmd != nullptr) if (cmd != nullptr)
msg.aformat("; please use \"%.*s%.*s\" if you require assistance.", source->getCommandPrefix().size(), source->getCommandPrefix().data(), cmd->getTrigger().size(), cmd->getTrigger().data()); msg.aformat("; please use \"%.*s%.*s\" if you require assistance.", source->getCommandPrefix().size(), source->getCommandPrefix().data(), cmd->getTrigger().size(), cmd->getTrigger().data());
@ -3638,7 +3637,7 @@ void PAdminMessageGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *p
message += split_parameters.second; message += split_parameters.second;
source->sendAdminMessage(*target, message); source->sendAdminMessage(*target, message);
source->sendMessage(*player, "Message sent to "_jrs + target->name); source->sendMessage(*player, "Message sent to "s + target->name);
} }
} }
else { else {
@ -3667,7 +3666,7 @@ void KillGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, co
source->sendMessage(*player, "Error: Player not found."_jrs); source->sendMessage(*player, "Error: Player not found."_jrs);
} }
else if (target->access >= player->access) { else if (target->access >= player->access) {
source->sendMessage(*player, "Error: You can not kill higher level "_jrs + pluginInstance.getStaffTitle() + "s."_jrs); source->sendMessage(*player, "Error: You can not kill higher level "s + pluginInstance.getStaffTitle() + "s."_jrs);
} }
else { else {
source->kill(*target); source->kill(*target);
@ -3698,7 +3697,7 @@ void DisarmGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player,
if (target == nullptr) if (target == nullptr)
source->sendMessage(*player, "Error: Player not found."_jrs); source->sendMessage(*player, "Error: Player not found."_jrs);
else if (target->access >= player->access) else if (target->access >= player->access)
source->sendMessage(*player, "Error: You can not disarm higher level "_jrs + pluginInstance.getStaffTitle() + "s."_jrs); source->sendMessage(*player, "Error: You can not disarm higher level "s + pluginInstance.getStaffTitle() + "s."_jrs);
else if (source->disarm(*target) == false) else if (source->disarm(*target) == false)
source->sendMessage(*player, "Error: Server does not support disarms."_jrs); source->sendMessage(*player, "Error: Server does not support disarms."_jrs);
else else
@ -3728,7 +3727,7 @@ void DisarmC4GameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player
if (target == nullptr) if (target == nullptr)
source->sendMessage(*player, "Error: Player not found."_jrs); source->sendMessage(*player, "Error: Player not found."_jrs);
else if (target->access >= player->access) else if (target->access >= player->access)
source->sendMessage(*player, "Error: You can not disarm higher level "_jrs + pluginInstance.getStaffTitle() + "s."_jrs); source->sendMessage(*player, "Error: You can not disarm higher level "s + pluginInstance.getStaffTitle() + "s."_jrs);
else if (source->disarmC4(*target) == false) else if (source->disarmC4(*target) == false)
source->sendMessage(*player, "Error: Server does not support disarms."_jrs); source->sendMessage(*player, "Error: Server does not support disarms."_jrs);
else else
@ -3760,7 +3759,7 @@ void DisarmBeaconGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *pl
if (target == nullptr) if (target == nullptr)
source->sendMessage(*player, "Error: Player not found."_jrs); source->sendMessage(*player, "Error: Player not found."_jrs);
else if (target->access >= player->access) else if (target->access >= player->access)
source->sendMessage(*player, "Error: You can not disarm higher level "_jrs + pluginInstance.getStaffTitle() + "s."_jrs); source->sendMessage(*player, "Error: You can not disarm higher level "s + pluginInstance.getStaffTitle() + "s."_jrs);
else if (source->disarmBeacon(*target) == false) else if (source->disarmBeacon(*target) == false)
source->sendMessage(*player, "Error: Server does not support disarms."_jrs); source->sendMessage(*player, "Error: Server does not support disarms."_jrs);
else else
@ -3791,7 +3790,7 @@ void MineBanGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player,
if (target == nullptr) if (target == nullptr)
source->sendMessage(*player, "Error: Player not found."_jrs); source->sendMessage(*player, "Error: Player not found."_jrs);
else if (target->access >= player->access) else if (target->access >= player->access)
source->sendMessage(*player, "Error: You can not mine-ban higher level "_jrs + pluginInstance.getStaffTitle() + "s."_jrs); source->sendMessage(*player, "Error: You can not mine-ban higher level "s + pluginInstance.getStaffTitle() + "s."_jrs);
else else
{ {
source->mineBan(*target); source->mineBan(*target);
@ -3834,7 +3833,7 @@ void KickGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, co
source->sendMessage(*player, "Error: You cannot kick yourself."_jrs); source->sendMessage(*player, "Error: You cannot kick yourself."_jrs);
} }
else if (target->access >= player->access) { else if (target->access >= player->access) {
source->sendMessage(*player, "Error: You can not kick higher level "_jrs + pluginInstance.getStaffTitle() + "s."_jrs); source->sendMessage(*player, "Error: You can not kick higher level "s + pluginInstance.getStaffTitle() + "s."_jrs);
} }
else else
{ {
@ -3873,7 +3872,7 @@ void MuteGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, co
else if (player == target) else if (player == target)
source->sendMessage(*player, "Error: You cannot mute yourself."_jrs); source->sendMessage(*player, "Error: You cannot mute yourself."_jrs);
else if (target->access >= player->access) else if (target->access >= player->access)
source->sendMessage(*player, "Error: You can not mute higher level "_jrs + pluginInstance.getStaffTitle() + "s."_jrs); source->sendMessage(*player, "Error: You can not mute higher level "s + pluginInstance.getStaffTitle() + "s."_jrs);
else else
{ {
source->mute(*target); source->mute(*target);
@ -3931,7 +3930,7 @@ void TempBanGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player,
else if (player == target) else if (player == target)
source->sendMessage(*player, "Error: You can't ban yourself."_jrs); source->sendMessage(*player, "Error: You can't ban yourself."_jrs);
else if (target->access >= player->access) else if (target->access >= player->access)
source->sendMessage(*player, "Error: You can't ban higher level "_jrs + pluginInstance.getStaffTitle() + "s."_jrs); source->sendMessage(*player, "Error: You can't ban higher level "s + pluginInstance.getStaffTitle() + "s."_jrs);
else else
{ {
source->banPlayer(*target, player->name, reason, duration); source->banPlayer(*target, player->name, reason, duration);
@ -3989,7 +3988,7 @@ void TempChatBanGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *pla
else if (player == target) else if (player == target)
source->sendMessage(*player, "Error: You can not ban yourself."_jrs); source->sendMessage(*player, "Error: You can not ban yourself."_jrs);
else if (target->access >= player->access) else if (target->access >= player->access)
source->sendMessage(*player, "Error: You can not ban higher level "_jrs + pluginInstance.getStaffTitle() + "s."_jrs); source->sendMessage(*player, "Error: You can not ban higher level "s + pluginInstance.getStaffTitle() + "s."_jrs);
else { else {
source->mute(*target); source->mute(*target);
RenX::banDatabase->add(source, *target, player->name, reason, duration, RenX::BanDatabase::Entry::FLAG_TYPE_CHAT); RenX::banDatabase->add(source, *target, player->name, reason, duration, RenX::BanDatabase::Entry::FLAG_TYPE_CHAT);
@ -4032,7 +4031,7 @@ void KickBanGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player,
source->sendMessage(*player, "Error: You can not ban yourself."_jrs); source->sendMessage(*player, "Error: You can not ban yourself."_jrs);
} }
else if (target->access >= player->access) { else if (target->access >= player->access) {
source->sendMessage(*player, "Error: You can not ban higher level "_jrs + pluginInstance.getStaffTitle() + "s."_jrs); source->sendMessage(*player, "Error: You can not ban higher level "s + pluginInstance.getStaffTitle() + "s."_jrs);
} }
else { else {
source->banPlayer(*target, player->name, reason); source->banPlayer(*target, player->name, reason);
@ -4143,8 +4142,8 @@ void PhaseBotsGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *playe
source->sendMessage(*player, STRING_LITERAL_AS_REFERENCE("Bot phasing has been enabled.")); source->sendMessage(*player, STRING_LITERAL_AS_REFERENCE("Bot phasing has been enabled."));
else source->sendMessage(*player, STRING_LITERAL_AS_REFERENCE("Bot phasing has been disabled.")); else source->sendMessage(*player, STRING_LITERAL_AS_REFERENCE("Bot phasing has been disabled."));
} }
else if (parameters.equalsi("true") || parameters.equalsi("on") || parameters.equalsi("start") || parameters.equalsi("1")) else if (jessilib::equalsi(parameters, "true"sv) || jessilib::equalsi(parameters, "on"sv)
{ || jessilib::equalsi(parameters, "start"sv) || jessilib::equalsi(parameters, "1"sv)) {
togglePhasing(source, true); togglePhasing(source, true);
source->sendMessage(*player, STRING_LITERAL_AS_REFERENCE("Bot phasing has been enabled.")); source->sendMessage(*player, STRING_LITERAL_AS_REFERENCE("Bot phasing has been enabled."));
} }
@ -4247,15 +4246,15 @@ void CancelVoteGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *play
cancel_all = true; cancel_all = true;
} }
else { else {
if (parameters.equalsi("all") || parameters.equalsi("a")) { if (jessilib::equalsi(parameters, "all"sv) || jessilib::equalsi(parameters, "a"sv)) {
cancel_all = true; cancel_all = true;
} else if (parameters.equalsi("public") || parameters.equalsi("p")) { } else if (jessilib::equalsi(parameters, "public"sv) || jessilib::equalsi(parameters, "p"sv)) {
target = RenX::TeamType::None; target = RenX::TeamType::None;
} else if (parameters.equalsi("gdi") || parameters.equalsi("g")) { } else if (jessilib::equalsi(parameters, "gdi"sv) || jessilib::equalsi(parameters, "g"sv)) {
target = RenX::TeamType::GDI; target = RenX::TeamType::GDI;
} else if (parameters.equalsi("blackhand") || parameters.equalsi("bh") || parameters.equalsi("b")) { } else if (jessilib::equalsi(parameters, "blackhand"sv) || jessilib::equalsi(parameters, "bh"sv) || jessilib::equalsi(parameters, "b"sv)) {
target = RenX::TeamType::GDI; target = RenX::TeamType::GDI;
} else if (parameters.equalsi("nod") || parameters.equalsi("n")) { } else if (jessilib::equalsi(parameters, "nod"sv) || jessilib::equalsi(parameters, "n"sv)) {
target = RenX::TeamType::Nod; target = RenX::TeamType::Nod;
} else { } else {
source->sendMessage(*player, STRING_LITERAL_AS_REFERENCE("Error: Invalid Team. Allowed values are all/a, public/p, gdi/g, nod/n, blackhand/bh/b.")); source->sendMessage(*player, STRING_LITERAL_AS_REFERENCE("Error: Invalid Team. Allowed values are all/a, public/p, gdi/g, nod/n, blackhand/bh/b."));

8
src/Plugins/RenX/RenX.Commands/RenX_Commands.h

@ -47,10 +47,10 @@ public:
private: private:
std::chrono::seconds m_defaultTempBanTime; std::chrono::seconds m_defaultTempBanTime;
std::chrono::seconds m_maxTempBanTime; std::chrono::seconds m_maxTempBanTime;
Jupiter::StringS m_playerInfoFormat; std::string m_playerInfoFormat;
Jupiter::StringS m_adminPlayerInfoFormat; std::string m_adminPlayerInfoFormat;
Jupiter::StringS m_buildingInfoFormat; std::string m_buildingInfoFormat;
Jupiter::StringS m_staffTitle; std::string m_staffTitle;
}; };
GENERIC_CONSOLE_COMMAND(RawRCONConsoleCommand) GENERIC_CONSOLE_COMMAND(RawRCONConsoleCommand)

4
src/Plugins/RenX/RenX.Core/RenX_Plugin.cpp

@ -33,11 +33,11 @@ RenX::Plugin::~Plugin() {
} }
} }
void RenX::Plugin::RenX_SanitizeTags(Jupiter::StringType &) { void RenX::Plugin::RenX_SanitizeTags(std::string&) {
return; return;
} }
void RenX::Plugin::RenX_ProcessTags(Jupiter::StringType &, const Server *, const PlayerInfo *, const PlayerInfo *, const BuildingInfo *) { void RenX::Plugin::RenX_ProcessTags(std::string&, const Server *, const PlayerInfo *, const PlayerInfo *, const BuildingInfo *) {
return; return;
} }

4
src/Plugins/RenX/RenX.Core/RenX_Plugin.h

@ -42,8 +42,8 @@ namespace RenX
{ {
public: public:
/** Tag-related events */ /** Tag-related events */
virtual void RenX_SanitizeTags(Jupiter::StringType &fmt); virtual void RenX_SanitizeTags(std::string& fmt);
virtual void RenX_ProcessTags(Jupiter::StringType &msg, const Server *server, const PlayerInfo *player, const PlayerInfo *victim, const BuildingInfo *building); virtual void RenX_ProcessTags(std::string& msg, const Server *server, const PlayerInfo *player, const PlayerInfo *victim, const BuildingInfo *building);
/** Non-RCON RenX logs */ /** Non-RCON RenX logs */
virtual void RenX_OnPlayerCreate(Server &server, const PlayerInfo &player); virtual void RenX_OnPlayerCreate(Server &server, const PlayerInfo &player);

43
src/Plugins/RenX/RenX.Core/RenX_Server.cpp

@ -166,7 +166,7 @@ int RenX::Server::think() {
int RenX::Server::OnRehash() { int RenX::Server::OnRehash() {
std::string oldHostname = m_hostname; std::string oldHostname = m_hostname;
std::string oldClientHostname = m_clientHostname; std::string oldClientHostname = m_clientHostname;
Jupiter::StringS oldPass = m_pass; std::string oldPass = m_pass;
unsigned short oldPort = m_port; unsigned short oldPort = m_port;
int oldSteamFormat = m_steamFormat; int oldSteamFormat = m_steamFormat;
m_commands.clear(); m_commands.clear();
@ -177,10 +177,10 @@ int RenX::Server::OnRehash() {
m_pass = oldPass; m_pass = oldPass;
m_port = oldPort; m_port = oldPort;
} }
else if (Jupiter::ReferenceString(oldHostname.c_str()).equalsi(m_hostname) == false else if (!jessilib::equalsi(oldHostname, m_hostname)
|| oldPort != m_port || oldPort != m_port
|| Jupiter::ReferenceString(oldClientHostname.c_str()).equalsi(m_clientHostname) == false || !jessilib::equalsi(oldClientHostname, m_clientHostname)
|| oldPass.equalsi(m_pass) == false) { || !jessilib::equalsi(oldPass, m_pass)) {
reconnect(RenX::DisconnectReason::Rehash); reconnect(RenX::DisconnectReason::Rehash);
} }
@ -260,7 +260,7 @@ bool RenX::Server::isPure() const {
} }
int RenX::Server::send(const Jupiter::ReadableString &command) { int RenX::Server::send(const Jupiter::ReadableString &command) {
return sendSocket("c"_jrs + RenX::escapifyRCON(command) + '\n'); return sendSocket("c"s + RenX::escapifyRCON(command) + '\n');
} }
int RenX::Server::sendSocket(const Jupiter::ReadableString &text) { int RenX::Server::sendSocket(const Jupiter::ReadableString &text) {
@ -283,23 +283,23 @@ int RenX::Server::sendMessage(std::string_view message) {
return result; return result;
} }
return sendSocket("chostsay "_jrs + msg + '\n'); return sendSocket("chostsay "s + msg + '\n');
} }
int RenX::Server::sendMessage(const RenX::PlayerInfo &player, std::string_view message) { int RenX::Server::sendMessage(const RenX::PlayerInfo &player, std::string_view message) {
return sendSocket("chostprivatesay pid"_jrs + Jupiter::StringS::Format("%d ", player.id) + RenX::escapifyRCON(message) + '\n'); return sendSocket("chostprivatesay pid"s + Jupiter::StringS::Format("%d ", player.id) + RenX::escapifyRCON(message) + '\n');
} }
int RenX::Server::sendAdminMessage(const Jupiter::ReadableString &message) { int RenX::Server::sendAdminMessage(const Jupiter::ReadableString &message) {
return sendSocket("camsg "_jrs + RenX::escapifyRCON(message) + '\n'); return sendSocket("camsg "s + RenX::escapifyRCON(message) + '\n');
} }
int RenX::Server::sendAdminMessage(const RenX::PlayerInfo &player, std::string_view message) { int RenX::Server::sendAdminMessage(const RenX::PlayerInfo &player, std::string_view message) {
return sendSocket("cpamsg pid"_jrs + Jupiter::StringS::Format("%d ", player.id) + RenX::escapifyRCON(message) + '\n'); return sendSocket("cpamsg pid"s + Jupiter::StringS::Format("%d ", player.id) + RenX::escapifyRCON(message) + '\n');
} }
int RenX::Server::sendWarnMessage(const RenX::PlayerInfo &player, std::string_view message) { int RenX::Server::sendWarnMessage(const RenX::PlayerInfo &player, std::string_view message) {
return sendSocket("cwarn pid"_jrs + Jupiter::StringS::Format("%d ", player.id) + RenX::escapifyRCON(message) + '\n'); return sendSocket("cwarn pid"s + Jupiter::StringS::Format("%d ", player.id) + RenX::escapifyRCON(message) + '\n');
} }
int RenX::Server::sendData(const Jupiter::ReadableString &data) { int RenX::Server::sendData(const Jupiter::ReadableString &data) {
@ -927,13 +927,14 @@ bool RenX::Server::smodePlayer(const RenX::PlayerInfo &player) {
} }
const Jupiter::ReadableString &RenX::Server::getPrefix() const { const Jupiter::ReadableString &RenX::Server::getPrefix() const {
static Jupiter::String parsed; // TODO: What the hell? static std::string parsed; // TODO: What the hell?
RenX::processTags(parsed = m_IRCPrefix, this); RenX::processTags(parsed = m_IRCPrefix, this);
return parsed; return parsed;
} }
void RenX::Server::setPrefix(std::string_view prefix) { void RenX::Server::setPrefix(std::string_view prefix) {
Jupiter::StringS tagged_prefix = Jupiter::ReferenceString{ prefix }; // TODO: pass in std::string here instead
std::string tagged_prefix = static_cast<std::string>(prefix);
RenX::sanitizeTags(tagged_prefix); RenX::sanitizeTags(tagged_prefix);
m_IRCPrefix = tagged_prefix; m_IRCPrefix = tagged_prefix;
} }
@ -1356,7 +1357,7 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
}; };
auto tokens_as_command_table = [&tokens, this]() { auto tokens_as_command_table = [&tokens, this]() {
std::unordered_map<Jupiter::StringS, Jupiter::StringS, Jupiter::default_hash_function> table; std::unordered_map<std::string_view, std::string_view, Jupiter::default_hash_function> table;
size_t total_tokens = std::min(tokens.size(), m_commandListFormat.size()); size_t total_tokens = std::min(tokens.size(), m_commandListFormat.size());
for (size_t index = 0; index != total_tokens; ++index) { for (size_t index = 0; index != total_tokens; ++index) {
table[m_commandListFormat[index]] = tokens[index]; table[m_commandListFormat[index]] = tokens[index];
@ -1654,7 +1655,7 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
steamid = Jupiter::from_string<uint64_t>(steamToken); steamid = Jupiter::from_string<uint64_t>(steamToken);
team = RenX::getTeam(teamToken); team = RenX::getTeam(teamToken);
if (adminToken.equalsi("None"_jrs)) if (jessilib::equalsi(adminToken, "None"_jrs))
getPlayerOrAdd(getToken(5), id, team, isBot, steamid, getToken(1), ""_jrs); getPlayerOrAdd(getToken(5), id, team, isBot, steamid, getToken(1), ""_jrs);
else else
getPlayerOrAdd(getToken(5), id, team, isBot, steamid, getToken(1), ""_jrs)->adminType = adminToken; getPlayerOrAdd(getToken(5), id, team, isBot, steamid, getToken(1), ""_jrs)->adminType = adminToken;
@ -1674,7 +1675,7 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
*/ */
auto table = tokens_as_command_table(); auto table = tokens_as_command_table();
auto table_get = [&table](const Jupiter::ReadableString& in_key) -> Jupiter::StringS* { auto table_get = [&table](const Jupiter::ReadableString& in_key) -> std::string_view* {
auto value = table.find(in_key); auto value = table.find(in_key);
if (value != table.end()) { if (value != table.end()) {
return &value->second; return &value->second;
@ -1843,7 +1844,7 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
*/ */
auto table = tokens_as_command_table(); auto table = tokens_as_command_table();
auto table_get = [&table](const Jupiter::ReadableString& in_key) -> Jupiter::StringS* { auto table_get = [&table](const Jupiter::ReadableString& in_key) -> std::string_view* {
auto value = table.find(in_key); auto value = table.find(in_key);
if (value != table.end()) { if (value != table.end()) {
return &value->second; return &value->second;
@ -1961,7 +1962,7 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
*/ */
auto table = tokens_as_command_table(); auto table = tokens_as_command_table();
auto table_get = [&table](const Jupiter::ReadableString& in_key) -> Jupiter::StringS* { auto table_get = [&table](const Jupiter::ReadableString& in_key) -> std::string_view* {
auto value = table.find(in_key); auto value = table.find(in_key);
if (value != table.end()) { if (value != table.end()) {
return &value->second; return &value->second;
@ -2071,13 +2072,13 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
m_competitive = Jupiter::from_string<bool>(getToken(23)); m_competitive = Jupiter::from_string<bool>(getToken(23));
const Jupiter::ReadableString &match_state_token = getToken(25); const Jupiter::ReadableString &match_state_token = getToken(25);
if (match_state_token.equalsi("PendingMatch"_jrs)) if (jessilib::equalsi(match_state_token, "PendingMatch"_jrs))
m_match_state = 0; m_match_state = 0;
else if (match_state_token.equalsi("MatchInProgress"_jrs)) else if (jessilib::equalsi(match_state_token, "MatchInProgress"_jrs))
m_match_state = 1; m_match_state = 1;
else if (match_state_token.equalsi("RoundOver"_jrs) || match_state_token.equalsi("MatchOver"_jrs)) else if (jessilib::equalsi(match_state_token, "RoundOver"_jrs) || jessilib::equalsi(match_state_token, "MatchOver"_jrs))
m_match_state = 2; m_match_state = 2;
else if (match_state_token.equalsi("TravelTheWorld"_jrs)) else if (jessilib::equalsi(match_state_token, "TravelTheWorld"_jrs))
m_match_state = 3; m_match_state = 3;
else // Unknown state -- assume it's in progress else // Unknown state -- assume it's in progress
m_match_state = 1; m_match_state = 1;

2
src/Plugins/RenX/RenX.Core/RenX_Server.h

@ -1143,7 +1143,7 @@ namespace RenX
std::chrono::milliseconds m_pingTimeoutThreshold; std::chrono::milliseconds m_pingTimeoutThreshold;
std::string m_clientHostname; std::string m_clientHostname;
std::string m_hostname; std::string m_hostname;
Jupiter::StringS m_pass; std::string m_pass;
std::string m_configSection; std::string m_configSection;
Jupiter::StringS m_rules; Jupiter::StringS m_rules;
Jupiter::StringS m_ban_from_str; Jupiter::StringS m_ban_from_str;

374
src/Plugins/RenX/RenX.Core/RenX_Tags.cpp

@ -31,9 +31,9 @@ using namespace Jupiter::literals;
struct TagsImp : RenX::Tags struct TagsImp : RenX::Tags
{ {
bool initialize(); bool initialize();
void processTags(Jupiter::StringType &msg, const RenX::Server *server, const RenX::PlayerInfo *player, const RenX::PlayerInfo *victim, const RenX::BuildingInfo *building); void processTags(std::string& msg, const RenX::Server *server, const RenX::PlayerInfo *player, const RenX::PlayerInfo *victim, const RenX::BuildingInfo *building);
void processTags(Jupiter::StringType &msg, const RenX::LadderDatabase::Entry &entry); void processTags(std::string& msg, const RenX::LadderDatabase::Entry &entry);
void sanitizeTags(Jupiter::StringType &fmt); void sanitizeTags(std::string& fmt);
const Jupiter::ReadableString &getUniqueInternalTag(); const Jupiter::ReadableString &getUniqueInternalTag();
private: private:
Jupiter::StringS uniqueTag; Jupiter::StringS uniqueTag;
@ -443,7 +443,7 @@ double get_ratio(double num, double denom)
return num / denom; return num / denom;
} }
void TagsImp::processTags(Jupiter::StringType &msg, const RenX::Server *server, const RenX::PlayerInfo *player, const RenX::PlayerInfo *victim, const RenX::BuildingInfo *building) void TagsImp::processTags(std::string& msg, const RenX::Server *server, const RenX::PlayerInfo *player, const RenX::PlayerInfo *victim, const RenX::BuildingInfo *building)
{ {
size_t index; size_t index;
PROCESS_TAG(this->INTERNAL_DATE_TAG, std::string_view(getTimeFormat(this->dateFmt.c_str()))); PROCESS_TAG(this->INTERNAL_DATE_TAG, std::string_view(getTimeFormat(this->dateFmt.c_str())));
@ -586,7 +586,7 @@ void TagsImp::processTags(Jupiter::StringType &msg, const RenX::Server *server,
} }
} }
void TagsImp::processTags(Jupiter::StringType &msg, const RenX::LadderDatabase::Entry &entry) void TagsImp::processTags(std::string& msg, const RenX::LadderDatabase::Entry &entry)
{ {
size_t index; size_t index;
uint32_t total_tied_games = entry.total_wins - entry.total_gdi_wins - entry.total_nod_wins; uint32_t total_tied_games = entry.total_wins - entry.total_gdi_wins - entry.total_nod_wins;
@ -681,191 +681,191 @@ void TagsImp::processTags(Jupiter::StringType &msg, const RenX::LadderDatabase::
PROCESS_TAG(this->INTERNAL_VICTIM_PROXY_DISARMS_TAG, Jupiter::StringS::Format("%u", entry.top_proxy_disarms)); PROCESS_TAG(this->INTERNAL_VICTIM_PROXY_DISARMS_TAG, Jupiter::StringS::Format("%u", entry.top_proxy_disarms));
} }
void TagsImp::sanitizeTags(Jupiter::StringType &fmt) void TagsImp::sanitizeTags(std::string& fmt)
{ {
/** Global tags */ /** Global tags */
fmt.replace(this->dateTag, this->INTERNAL_DATE_TAG); RenX::replace_tag(fmt, this->dateTag, this->INTERNAL_DATE_TAG);
fmt.replace(this->timeTag, this->INTERNAL_TIME_TAG); RenX::replace_tag(fmt, this->timeTag, this->INTERNAL_TIME_TAG);
/** Server tags */ /** Server tags */
fmt.replace(this->rconVersionTag, this->INTERNAL_RCON_VERSION_TAG); RenX::replace_tag(fmt, this->rconVersionTag, this->INTERNAL_RCON_VERSION_TAG);
fmt.replace(this->gameVersionTag, this->INTERNAL_GAME_VERSION_TAG); RenX::replace_tag(fmt, this->gameVersionTag, this->INTERNAL_GAME_VERSION_TAG);
fmt.replace(this->rulesTag, this->INTERNAL_RULES_TAG); RenX::replace_tag(fmt, this->rulesTag, this->INTERNAL_RULES_TAG);
fmt.replace(this->userTag, this->INTERNAL_USER_TAG); RenX::replace_tag(fmt, this->userTag, this->INTERNAL_USER_TAG);
fmt.replace(this->serverNameTag, this->INTERNAL_SERVER_NAME_TAG); RenX::replace_tag(fmt, this->serverNameTag, this->INTERNAL_SERVER_NAME_TAG);
fmt.replace(this->mapTag, this->INTERNAL_MAP_TAG); RenX::replace_tag(fmt, this->mapTag, this->INTERNAL_MAP_TAG);
fmt.replace(this->mapGUIDTag, this->INTERNAL_MAP_GUID_TAG); RenX::replace_tag(fmt, this->mapGUIDTag, this->INTERNAL_MAP_GUID_TAG);
fmt.replace(this->serverHostnameTag, this->INTERNAL_SERVER_HOSTNAME_TAG); RenX::replace_tag(fmt, this->serverHostnameTag, this->INTERNAL_SERVER_HOSTNAME_TAG);
fmt.replace(this->serverPortTag, this->INTERNAL_SERVER_PORT_TAG); RenX::replace_tag(fmt, this->serverPortTag, this->INTERNAL_SERVER_PORT_TAG);
fmt.replace(this->socketHostnameTag, this->INTERNAL_SOCKET_HOSTNAME_TAG); RenX::replace_tag(fmt, this->socketHostnameTag, this->INTERNAL_SOCKET_HOSTNAME_TAG);
fmt.replace(this->socketPortTag, this->INTERNAL_SOCKET_PORT_TAG); RenX::replace_tag(fmt, this->socketPortTag, this->INTERNAL_SOCKET_PORT_TAG);
fmt.replace(this->serverPrefixTag, this->INTERNAL_SERVER_PREFIX_TAG); RenX::replace_tag(fmt, this->serverPrefixTag, this->INTERNAL_SERVER_PREFIX_TAG);
/** Player tags */ /** Player tags */
fmt.replace(this->nameTag, this->INTERNAL_NAME_TAG); RenX::replace_tag(fmt, this->nameTag, this->INTERNAL_NAME_TAG);
fmt.replace(this->rawNameTag, this->INTERNAL_RAW_NAME_TAG); RenX::replace_tag(fmt, this->rawNameTag, this->INTERNAL_RAW_NAME_TAG);
fmt.replace(this->ipTag, this->INTERNAL_IP_TAG); RenX::replace_tag(fmt, this->ipTag, this->INTERNAL_IP_TAG);
fmt.replace(this->hwidTag, this->INTERNAL_HWID_TAG); RenX::replace_tag(fmt, this->hwidTag, this->INTERNAL_HWID_TAG);
fmt.replace(this->rdnsTag, this->INTERNAL_RDNS_TAG); RenX::replace_tag(fmt, this->rdnsTag, this->INTERNAL_RDNS_TAG);
fmt.replace(this->steamTag, this->INTERNAL_STEAM_TAG); RenX::replace_tag(fmt, this->steamTag, this->INTERNAL_STEAM_TAG);
fmt.replace(this->uuidTag, this->INTERNAL_UUID_TAG); RenX::replace_tag(fmt, this->uuidTag, this->INTERNAL_UUID_TAG);
fmt.replace(this->idTag, this->INTERNAL_ID_TAG); RenX::replace_tag(fmt, this->idTag, this->INTERNAL_ID_TAG);
fmt.replace(this->characterTag, this->INTERNAL_CHARACTER_TAG); RenX::replace_tag(fmt, this->characterTag, this->INTERNAL_CHARACTER_TAG);
fmt.replace(this->vehicleTag, this->INTERNAL_VEHICLE_TAG); RenX::replace_tag(fmt, this->vehicleTag, this->INTERNAL_VEHICLE_TAG);
fmt.replace(this->adminTag, this->INTERNAL_ADMIN_TAG); RenX::replace_tag(fmt, this->adminTag, this->INTERNAL_ADMIN_TAG);
fmt.replace(this->prefixTag, this->INTERNAL_PREFIX_TAG); RenX::replace_tag(fmt, this->prefixTag, this->INTERNAL_PREFIX_TAG);
fmt.replace(this->gamePrefixTag, this->INTERNAL_GAME_PREFIX_TAG); RenX::replace_tag(fmt, this->gamePrefixTag, this->INTERNAL_GAME_PREFIX_TAG);
fmt.replace(this->teamColorTag, this->INTERNAL_TEAM_COLOR_TAG); RenX::replace_tag(fmt, this->teamColorTag, this->INTERNAL_TEAM_COLOR_TAG);
fmt.replace(this->teamShortTag, this->INTERNAL_TEAM_SHORT_TAG); RenX::replace_tag(fmt, this->teamShortTag, this->INTERNAL_TEAM_SHORT_TAG);
fmt.replace(this->teamLongTag, this->INTERNAL_TEAM_LONG_TAG); RenX::replace_tag(fmt, this->teamLongTag, this->INTERNAL_TEAM_LONG_TAG);
fmt.replace(this->pingTag, this->INTERNAL_PING_TAG); RenX::replace_tag(fmt, this->pingTag, this->INTERNAL_PING_TAG);
fmt.replace(this->scoreTag, this->INTERNAL_SCORE_TAG); RenX::replace_tag(fmt, this->scoreTag, this->INTERNAL_SCORE_TAG);
fmt.replace(this->scorePerMinuteTag, this->INTERNAL_SCORE_PER_MINUTE_TAG); RenX::replace_tag(fmt, this->scorePerMinuteTag, this->INTERNAL_SCORE_PER_MINUTE_TAG);
fmt.replace(this->creditsTag, this->INTERNAL_CREDITS_TAG); RenX::replace_tag(fmt, this->creditsTag, this->INTERNAL_CREDITS_TAG);
fmt.replace(this->killsTag, this->INTERNAL_KILLS_TAG); RenX::replace_tag(fmt, this->killsTag, this->INTERNAL_KILLS_TAG);
fmt.replace(this->deathsTag, this->INTERNAL_DEATHS_TAG); RenX::replace_tag(fmt, this->deathsTag, this->INTERNAL_DEATHS_TAG);
fmt.replace(this->kdrTag, this->INTERNAL_KDR_TAG); RenX::replace_tag(fmt, this->kdrTag, this->INTERNAL_KDR_TAG);
fmt.replace(this->suicidesTag, this->INTERNAL_SUICIDES_TAG); RenX::replace_tag(fmt, this->suicidesTag, this->INTERNAL_SUICIDES_TAG);
fmt.replace(this->headshotsTag, this->INTERNAL_HEADSHOTS_TAG); RenX::replace_tag(fmt, this->headshotsTag, this->INTERNAL_HEADSHOTS_TAG);
fmt.replace(this->headshotKillRatioTag, this->INTERNAL_HEADSHOT_KILL_RATIO_TAG); RenX::replace_tag(fmt, this->headshotKillRatioTag, this->INTERNAL_HEADSHOT_KILL_RATIO_TAG);
fmt.replace(this->vehicleKillsTag, this->INTERNAL_VEHICLE_KILLS_TAG); RenX::replace_tag(fmt, this->vehicleKillsTag, this->INTERNAL_VEHICLE_KILLS_TAG);
fmt.replace(this->buildingKillsTag, this->INTERNAL_BUILDING_KILLS_TAG); RenX::replace_tag(fmt, this->buildingKillsTag, this->INTERNAL_BUILDING_KILLS_TAG);
fmt.replace(this->defenceKillsTag, this->INTERNAL_DEFENCE_KILLS_TAG); RenX::replace_tag(fmt, this->defenceKillsTag, this->INTERNAL_DEFENCE_KILLS_TAG);
fmt.replace(this->gameTimeTag, this->INTERNAL_GAME_TIME_TAG); RenX::replace_tag(fmt, this->gameTimeTag, this->INTERNAL_GAME_TIME_TAG);
fmt.replace(this->gamesTag, this->INTERNAL_GAMES_TAG); RenX::replace_tag(fmt, this->gamesTag, this->INTERNAL_GAMES_TAG);
fmt.replace(this->GDIGamesTag, this->INTERNAL_GDI_GAMES_TAG); RenX::replace_tag(fmt, this->GDIGamesTag, this->INTERNAL_GDI_GAMES_TAG);
fmt.replace(this->NodGamesTag, this->INTERNAL_NOD_GAMES_TAG); RenX::replace_tag(fmt, this->NodGamesTag, this->INTERNAL_NOD_GAMES_TAG);
fmt.replace(this->winsTag, this->INTERNAL_WINS_TAG); RenX::replace_tag(fmt, this->winsTag, this->INTERNAL_WINS_TAG);
fmt.replace(this->GDIWinsTag, this->INTERNAL_GDI_WINS_TAG); RenX::replace_tag(fmt, this->GDIWinsTag, this->INTERNAL_GDI_WINS_TAG);
fmt.replace(this->NodWinsTag, this->INTERNAL_NOD_WINS_TAG); RenX::replace_tag(fmt, this->NodWinsTag, this->INTERNAL_NOD_WINS_TAG);
fmt.replace(this->tiesTag, this->INTERNAL_TIES_TAG); RenX::replace_tag(fmt, this->tiesTag, this->INTERNAL_TIES_TAG);
fmt.replace(this->lossesTag, this->INTERNAL_LOSSES_TAG); RenX::replace_tag(fmt, this->lossesTag, this->INTERNAL_LOSSES_TAG);
fmt.replace(this->GDILossesTag, this->INTERNAL_GDI_LOSSES_TAG); RenX::replace_tag(fmt, this->GDILossesTag, this->INTERNAL_GDI_LOSSES_TAG);
fmt.replace(this->NodLossesTag, this->INTERNAL_NOD_LOSSES_TAG); RenX::replace_tag(fmt, this->NodLossesTag, this->INTERNAL_NOD_LOSSES_TAG);
fmt.replace(this->winLossRatioTag, this->INTERNAL_WIN_LOSS_RATIO_TAG); RenX::replace_tag(fmt, this->winLossRatioTag, this->INTERNAL_WIN_LOSS_RATIO_TAG);
fmt.replace(this->GDIWinLossRatioTag, this->INTERNAL_GDI_WIN_LOSS_RATIO_TAG); RenX::replace_tag(fmt, this->GDIWinLossRatioTag, this->INTERNAL_GDI_WIN_LOSS_RATIO_TAG);
fmt.replace(this->NodWinLossRatioTag, this->INTERNAL_NOD_WIN_LOSS_RATIO_TAG); RenX::replace_tag(fmt, this->NodWinLossRatioTag, this->INTERNAL_NOD_WIN_LOSS_RATIO_TAG);
fmt.replace(this->beaconPlacementsTag, this->INTERNAL_BEACON_PLACEMENTS_TAG); RenX::replace_tag(fmt, this->beaconPlacementsTag, this->INTERNAL_BEACON_PLACEMENTS_TAG);
fmt.replace(this->beaconDisarmsTag, this->INTERNAL_BEACON_DISARMS_TAG); RenX::replace_tag(fmt, this->beaconDisarmsTag, this->INTERNAL_BEACON_DISARMS_TAG);
fmt.replace(this->proxyPlacementsTag, this->INTERNAL_PROXY_PLACEMENTS_TAG); RenX::replace_tag(fmt, this->proxyPlacementsTag, this->INTERNAL_PROXY_PLACEMENTS_TAG);
fmt.replace(this->proxyDisarmsTag, this->INTERNAL_PROXY_DISARMS_TAG); RenX::replace_tag(fmt, this->proxyDisarmsTag, this->INTERNAL_PROXY_DISARMS_TAG);
fmt.replace(this->capturesTag, this->INTERNAL_CAPTURES_TAG); RenX::replace_tag(fmt, this->capturesTag, this->INTERNAL_CAPTURES_TAG);
fmt.replace(this->stealsTag, this->INTERNAL_STEALS_TAG); RenX::replace_tag(fmt, this->stealsTag, this->INTERNAL_STEALS_TAG);
fmt.replace(this->stolenTag, this->INTERNAL_STOLEN_TAG); RenX::replace_tag(fmt, this->stolenTag, this->INTERNAL_STOLEN_TAG);
fmt.replace(this->accessTag, this->INTERNAL_ACCESS_TAG); RenX::replace_tag(fmt, this->accessTag, this->INTERNAL_ACCESS_TAG);
/** Victim tags */ /** Victim tags */
fmt.replace(this->victimNameTag, this->INTERNAL_VICTIM_NAME_TAG); RenX::replace_tag(fmt, this->victimNameTag, this->INTERNAL_VICTIM_NAME_TAG);
fmt.replace(this->victimRawNameTag, this->INTERNAL_VICTIM_RAW_NAME_TAG); RenX::replace_tag(fmt, this->victimRawNameTag, this->INTERNAL_VICTIM_RAW_NAME_TAG);
fmt.replace(this->victimIPTag, this->INTERNAL_VICTIM_IP_TAG); RenX::replace_tag(fmt, this->victimIPTag, this->INTERNAL_VICTIM_IP_TAG);
fmt.replace(this->victimHWIDTag, this->INTERNAL_VICTIM_HWID_TAG); RenX::replace_tag(fmt, this->victimHWIDTag, this->INTERNAL_VICTIM_HWID_TAG);
fmt.replace(this->victimRDNSTag, this->INTERNAL_VICTIM_RDNS_TAG); RenX::replace_tag(fmt, this->victimRDNSTag, this->INTERNAL_VICTIM_RDNS_TAG);
fmt.replace(this->victimSteamTag, this->INTERNAL_VICTIM_STEAM_TAG); RenX::replace_tag(fmt, this->victimSteamTag, this->INTERNAL_VICTIM_STEAM_TAG);
fmt.replace(this->victimUUIDTag, this->INTERNAL_VICTIM_UUID_TAG); RenX::replace_tag(fmt, this->victimUUIDTag, this->INTERNAL_VICTIM_UUID_TAG);
fmt.replace(this->victimIDTag, this->INTERNAL_VICTIM_ID_TAG); RenX::replace_tag(fmt, this->victimIDTag, this->INTERNAL_VICTIM_ID_TAG);
fmt.replace(this->victimCharacterTag, this->INTERNAL_VICTIM_CHARACTER_TAG); RenX::replace_tag(fmt, this->victimCharacterTag, this->INTERNAL_VICTIM_CHARACTER_TAG);
fmt.replace(this->victimVehicleTag, this->INTERNAL_VICTIM_VEHICLE_TAG); RenX::replace_tag(fmt, this->victimVehicleTag, this->INTERNAL_VICTIM_VEHICLE_TAG);
fmt.replace(this->victimAdminTag, this->INTERNAL_VICTIM_ADMIN_TAG); RenX::replace_tag(fmt, this->victimAdminTag, this->INTERNAL_VICTIM_ADMIN_TAG);
fmt.replace(this->victimPrefixTag, this->INTERNAL_VICTIM_PREFIX_TAG); RenX::replace_tag(fmt, this->victimPrefixTag, this->INTERNAL_VICTIM_PREFIX_TAG);
fmt.replace(this->victimGamePrefixTag, this->INTERNAL_VICTIM_GAME_PREFIX_TAG); RenX::replace_tag(fmt, this->victimGamePrefixTag, this->INTERNAL_VICTIM_GAME_PREFIX_TAG);
fmt.replace(this->victimTeamColorTag, this->INTERNAL_VICTIM_TEAM_COLOR_TAG); RenX::replace_tag(fmt, this->victimTeamColorTag, this->INTERNAL_VICTIM_TEAM_COLOR_TAG);
fmt.replace(this->victimTeamShortTag, this->INTERNAL_VICTIM_TEAM_SHORT_TAG); RenX::replace_tag(fmt, this->victimTeamShortTag, this->INTERNAL_VICTIM_TEAM_SHORT_TAG);
fmt.replace(this->victimTeamLongTag, this->INTERNAL_VICTIM_TEAM_LONG_TAG); RenX::replace_tag(fmt, this->victimTeamLongTag, this->INTERNAL_VICTIM_TEAM_LONG_TAG);
fmt.replace(this->victimPingTag, this->INTERNAL_VICTIM_PING_TAG); RenX::replace_tag(fmt, this->victimPingTag, this->INTERNAL_VICTIM_PING_TAG);
fmt.replace(this->victimScoreTag, this->INTERNAL_VICTIM_SCORE_TAG); RenX::replace_tag(fmt, this->victimScoreTag, this->INTERNAL_VICTIM_SCORE_TAG);
fmt.replace(this->victimScorePerMinuteTag, this->INTERNAL_VICTIM_SCORE_PER_MINUTE_TAG); RenX::replace_tag(fmt, this->victimScorePerMinuteTag, this->INTERNAL_VICTIM_SCORE_PER_MINUTE_TAG);
fmt.replace(this->victimCreditsTag, this->INTERNAL_VICTIM_CREDITS_TAG); RenX::replace_tag(fmt, this->victimCreditsTag, this->INTERNAL_VICTIM_CREDITS_TAG);
fmt.replace(this->victimKillsTag, this->INTERNAL_VICTIM_KILLS_TAG); RenX::replace_tag(fmt, this->victimKillsTag, this->INTERNAL_VICTIM_KILLS_TAG);
fmt.replace(this->victimDeathsTag, this->INTERNAL_VICTIM_DEATHS_TAG); RenX::replace_tag(fmt, this->victimDeathsTag, this->INTERNAL_VICTIM_DEATHS_TAG);
fmt.replace(this->victimKDRTag, this->INTERNAL_VICTIM_KDR_TAG); RenX::replace_tag(fmt, this->victimKDRTag, this->INTERNAL_VICTIM_KDR_TAG);
fmt.replace(this->victimSuicidesTag, this->INTERNAL_VICTIM_SUICIDES_TAG); RenX::replace_tag(fmt, this->victimSuicidesTag, this->INTERNAL_VICTIM_SUICIDES_TAG);
fmt.replace(this->victimHeadshotsTag, this->INTERNAL_VICTIM_HEADSHOTS_TAG); RenX::replace_tag(fmt, this->victimHeadshotsTag, this->INTERNAL_VICTIM_HEADSHOTS_TAG);
fmt.replace(this->victimHeadshotKillRatioTag, this->INTERNAL_VICTIM_HEADSHOT_KILL_RATIO_TAG); RenX::replace_tag(fmt, this->victimHeadshotKillRatioTag, this->INTERNAL_VICTIM_HEADSHOT_KILL_RATIO_TAG);
fmt.replace(this->victimVehicleKillsTag, this->INTERNAL_VICTIM_VEHICLE_KILLS_TAG); RenX::replace_tag(fmt, this->victimVehicleKillsTag, this->INTERNAL_VICTIM_VEHICLE_KILLS_TAG);
fmt.replace(this->victimBuildingKillsTag, this->INTERNAL_VICTIM_BUILDING_KILLS_TAG); RenX::replace_tag(fmt, this->victimBuildingKillsTag, this->INTERNAL_VICTIM_BUILDING_KILLS_TAG);
fmt.replace(this->victimDefenceKillsTag, this->INTERNAL_VICTIM_DEFENCE_KILLS_TAG); RenX::replace_tag(fmt, this->victimDefenceKillsTag, this->INTERNAL_VICTIM_DEFENCE_KILLS_TAG);
fmt.replace(this->victimGameTimeTag, this->INTERNAL_VICTIM_GAME_TIME_TAG); RenX::replace_tag(fmt, this->victimGameTimeTag, this->INTERNAL_VICTIM_GAME_TIME_TAG);
fmt.replace(this->victimGamesTag, this->INTERNAL_VICTIM_GAMES_TAG); RenX::replace_tag(fmt, this->victimGamesTag, this->INTERNAL_VICTIM_GAMES_TAG);
fmt.replace(this->victimGDIGamesTag, this->INTERNAL_VICTIM_GDI_GAMES_TAG); RenX::replace_tag(fmt, this->victimGDIGamesTag, this->INTERNAL_VICTIM_GDI_GAMES_TAG);
fmt.replace(this->victimNodGamesTag, this->INTERNAL_VICTIM_NOD_GAMES_TAG); RenX::replace_tag(fmt, this->victimNodGamesTag, this->INTERNAL_VICTIM_NOD_GAMES_TAG);
fmt.replace(this->victimWinsTag, this->INTERNAL_VICTIM_WINS_TAG); RenX::replace_tag(fmt, this->victimWinsTag, this->INTERNAL_VICTIM_WINS_TAG);
fmt.replace(this->victimGDIWinsTag, this->INTERNAL_VICTIM_GDI_WINS_TAG); RenX::replace_tag(fmt, this->victimGDIWinsTag, this->INTERNAL_VICTIM_GDI_WINS_TAG);
fmt.replace(this->victimNodWinsTag, this->INTERNAL_VICTIM_NOD_WINS_TAG); RenX::replace_tag(fmt, this->victimNodWinsTag, this->INTERNAL_VICTIM_NOD_WINS_TAG);
fmt.replace(this->victimTiesTag, this->INTERNAL_VICTIM_TIES_TAG); RenX::replace_tag(fmt, this->victimTiesTag, this->INTERNAL_VICTIM_TIES_TAG);
fmt.replace(this->victimLossesTag, this->INTERNAL_VICTIM_LOSSES_TAG); RenX::replace_tag(fmt, this->victimLossesTag, this->INTERNAL_VICTIM_LOSSES_TAG);
fmt.replace(this->victimGDILossesTag, this->INTERNAL_VICTIM_GDI_LOSSES_TAG); RenX::replace_tag(fmt, this->victimGDILossesTag, this->INTERNAL_VICTIM_GDI_LOSSES_TAG);
fmt.replace(this->victimNodLossesTag, this->INTERNAL_VICTIM_NOD_LOSSES_TAG); RenX::replace_tag(fmt, this->victimNodLossesTag, this->INTERNAL_VICTIM_NOD_LOSSES_TAG);
fmt.replace(this->victimWinLossRatioTag, this->INTERNAL_VICTIM_WIN_LOSS_RATIO_TAG); RenX::replace_tag(fmt, this->victimWinLossRatioTag, this->INTERNAL_VICTIM_WIN_LOSS_RATIO_TAG);
fmt.replace(this->victimGDIWinLossRatioTag, this->INTERNAL_VICTIM_GDI_WIN_LOSS_RATIO_TAG); RenX::replace_tag(fmt, this->victimGDIWinLossRatioTag, this->INTERNAL_VICTIM_GDI_WIN_LOSS_RATIO_TAG);
fmt.replace(this->victimNodWinLossRatioTag, this->INTERNAL_VICTIM_NOD_WIN_LOSS_RATIO_TAG); RenX::replace_tag(fmt, this->victimNodWinLossRatioTag, this->INTERNAL_VICTIM_NOD_WIN_LOSS_RATIO_TAG);
fmt.replace(this->victimBeaconPlacementsTag, this->INTERNAL_VICTIM_BEACON_PLACEMENTS_TAG); RenX::replace_tag(fmt, this->victimBeaconPlacementsTag, this->INTERNAL_VICTIM_BEACON_PLACEMENTS_TAG);
fmt.replace(this->victimBeaconDisarmsTag, this->INTERNAL_VICTIM_BEACON_DISARMS_TAG); RenX::replace_tag(fmt, this->victimBeaconDisarmsTag, this->INTERNAL_VICTIM_BEACON_DISARMS_TAG);
fmt.replace(this->victimProxyPlacementsTag, this->INTERNAL_VICTIM_PROXY_PLACEMENTS_TAG); RenX::replace_tag(fmt, this->victimProxyPlacementsTag, this->INTERNAL_VICTIM_PROXY_PLACEMENTS_TAG);
fmt.replace(this->victimProxyDisarmsTag, this->INTERNAL_VICTIM_PROXY_DISARMS_TAG); RenX::replace_tag(fmt, this->victimProxyDisarmsTag, this->INTERNAL_VICTIM_PROXY_DISARMS_TAG);
fmt.replace(this->victimCapturesTag, this->INTERNAL_VICTIM_CAPTURES_TAG); RenX::replace_tag(fmt, this->victimCapturesTag, this->INTERNAL_VICTIM_CAPTURES_TAG);
fmt.replace(this->victimStealsTag, this->INTERNAL_VICTIM_STEALS_TAG); RenX::replace_tag(fmt, this->victimStealsTag, this->INTERNAL_VICTIM_STEALS_TAG);
fmt.replace(this->victimStolenTag, this->INTERNAL_VICTIM_STOLEN_TAG); RenX::replace_tag(fmt, this->victimStolenTag, this->INTERNAL_VICTIM_STOLEN_TAG);
fmt.replace(this->victimAccessTag, this->INTERNAL_VICTIM_ACCESS_TAG); RenX::replace_tag(fmt, this->victimAccessTag, this->INTERNAL_VICTIM_ACCESS_TAG);
/** Building tags */ /** Building tags */
fmt.replace(this->buildingNameTag, this->INTERNAL_BUILDING_NAME_TAG); RenX::replace_tag(fmt, this->buildingNameTag, this->INTERNAL_BUILDING_NAME_TAG);
fmt.replace(this->buildingRawNameTag, this->INTERNAL_BUILDING_RAW_NAME_TAG); RenX::replace_tag(fmt, this->buildingRawNameTag, this->INTERNAL_BUILDING_RAW_NAME_TAG);
fmt.replace(this->buildingHealthTag, this->INTERNAL_BUILDING_HEALTH_TAG); RenX::replace_tag(fmt, this->buildingHealthTag, this->INTERNAL_BUILDING_HEALTH_TAG);
fmt.replace(this->buildingMaxHealthTag, this->INTERNAL_BUILDING_MAX_HEALTH_TAG); RenX::replace_tag(fmt, this->buildingMaxHealthTag, this->INTERNAL_BUILDING_MAX_HEALTH_TAG);
fmt.replace(this->buildingHealthPercentageTag, this->INTERNAL_BUILDING_HEALTH_PERCENTAGE_TAG); RenX::replace_tag(fmt, this->buildingHealthPercentageTag, this->INTERNAL_BUILDING_HEALTH_PERCENTAGE_TAG);
fmt.replace(this->buildingArmorTag, this->INTERNAL_BUILDING_ARMOR_TAG); RenX::replace_tag(fmt, this->buildingArmorTag, this->INTERNAL_BUILDING_ARMOR_TAG);
fmt.replace(this->buildingMaxArmorTag, this->INTERNAL_BUILDING_MAX_ARMOR_TAG); RenX::replace_tag(fmt, this->buildingMaxArmorTag, this->INTERNAL_BUILDING_MAX_ARMOR_TAG);
fmt.replace(this->buildingArmorPercentageTag, this->INTERNAL_BUILDING_ARMOR_PERCENTAGE_TAG); RenX::replace_tag(fmt, this->buildingArmorPercentageTag, this->INTERNAL_BUILDING_ARMOR_PERCENTAGE_TAG);
fmt.replace(this->buildingDurabilityTag, this->INTERNAL_BUILDING_DURABILITY_TAG); RenX::replace_tag(fmt, this->buildingDurabilityTag, this->INTERNAL_BUILDING_DURABILITY_TAG);
fmt.replace(this->buildingMaxDurabilityTag, this->INTERNAL_BUILDING_MAX_DURABILITY_TAG); RenX::replace_tag(fmt, this->buildingMaxDurabilityTag, this->INTERNAL_BUILDING_MAX_DURABILITY_TAG);
fmt.replace(this->buildingDurabilityPercentageTag, this->INTERNAL_BUILDING_DURABILITY_PERCENTAGE_TAG); RenX::replace_tag(fmt, this->buildingDurabilityPercentageTag, this->INTERNAL_BUILDING_DURABILITY_PERCENTAGE_TAG);
fmt.replace(this->buildingTeamColorTag, this->INTERNAL_BUILDING_TEAM_COLOR_TAG); RenX::replace_tag(fmt, this->buildingTeamColorTag, this->INTERNAL_BUILDING_TEAM_COLOR_TAG);
fmt.replace(this->buildingTeamShortTag, this->INTERNAL_BUILDING_TEAM_SHORT_TAG); RenX::replace_tag(fmt, this->buildingTeamShortTag, this->INTERNAL_BUILDING_TEAM_SHORT_TAG);
fmt.replace(this->buildingTeamLongTag, this->INTERNAL_BUILDING_TEAM_LONG_TAG); RenX::replace_tag(fmt, this->buildingTeamLongTag, this->INTERNAL_BUILDING_TEAM_LONG_TAG);
/** Ladder tags */ /** Ladder tags */
fmt.replace(this->rankTag, this->INTERNAL_RANK_TAG); RenX::replace_tag(fmt, this->rankTag, this->INTERNAL_RANK_TAG);
fmt.replace(this->lastGameTag, this->INTERNAL_LAST_GAME_TAG); RenX::replace_tag(fmt, this->lastGameTag, this->INTERNAL_LAST_GAME_TAG);
fmt.replace(this->GDIScoreTag, this->INTERNAL_GDI_SCORE_TAG); RenX::replace_tag(fmt, this->GDIScoreTag, this->INTERNAL_GDI_SCORE_TAG);
fmt.replace(this->GDISPMTag, this->INTERNAL_GDI_SPM_TAG); RenX::replace_tag(fmt, this->GDISPMTag, this->INTERNAL_GDI_SPM_TAG);
fmt.replace(this->GDIGameTimeTag, this->INTERNAL_GDI_GAME_TIME_TAG); RenX::replace_tag(fmt, this->GDIGameTimeTag, this->INTERNAL_GDI_GAME_TIME_TAG);
fmt.replace(this->GDITiesTag, this->INTERNAL_GDI_TIES_TAG); RenX::replace_tag(fmt, this->GDITiesTag, this->INTERNAL_GDI_TIES_TAG);
fmt.replace(this->GDIBeaconPlacementsTag, this->INTERNAL_GDI_BEACON_PLACEMENTS_TAG); RenX::replace_tag(fmt, this->GDIBeaconPlacementsTag, this->INTERNAL_GDI_BEACON_PLACEMENTS_TAG);
fmt.replace(this->GDIBeaconDisarmsTag, this->INTERNAL_GDI_BEACON_DISARMS_TAG); RenX::replace_tag(fmt, this->GDIBeaconDisarmsTag, this->INTERNAL_GDI_BEACON_DISARMS_TAG);
fmt.replace(this->GDIProxyPlacementsTag, this->INTERNAL_GDI_PROXY_PLACEMENTS_TAG); RenX::replace_tag(fmt, this->GDIProxyPlacementsTag, this->INTERNAL_GDI_PROXY_PLACEMENTS_TAG);
fmt.replace(this->GDIProxyDisarmsTag, this->INTERNAL_GDI_PROXY_DISARMS_TAG); RenX::replace_tag(fmt, this->GDIProxyDisarmsTag, this->INTERNAL_GDI_PROXY_DISARMS_TAG);
fmt.replace(this->GDIKillsTag, this->INTERNAL_GDI_KILLS_TAG); RenX::replace_tag(fmt, this->GDIKillsTag, this->INTERNAL_GDI_KILLS_TAG);
fmt.replace(this->GDIDeathsTag, this->INTERNAL_GDI_DEATHS_TAG); RenX::replace_tag(fmt, this->GDIDeathsTag, this->INTERNAL_GDI_DEATHS_TAG);
fmt.replace(this->GDIVehicleKillsTag, this->INTERNAL_GDI_VEHICLE_KILLS_TAG); RenX::replace_tag(fmt, this->GDIVehicleKillsTag, this->INTERNAL_GDI_VEHICLE_KILLS_TAG);
fmt.replace(this->GDIDefenceKillsTag, this->INTERNAL_GDI_DEFENCE_KILLS_TAG); RenX::replace_tag(fmt, this->GDIDefenceKillsTag, this->INTERNAL_GDI_DEFENCE_KILLS_TAG);
fmt.replace(this->GDIBuildingKillsTag, this->INTERNAL_GDI_BUILDING_KILLS_TAG); RenX::replace_tag(fmt, this->GDIBuildingKillsTag, this->INTERNAL_GDI_BUILDING_KILLS_TAG);
fmt.replace(this->GDIKDRTag, this->INTERNAL_GDI_KDR_TAG); RenX::replace_tag(fmt, this->GDIKDRTag, this->INTERNAL_GDI_KDR_TAG);
fmt.replace(this->GDIHeadshotsTag, this->INTERNAL_GDI_HEADSHOTS_TAG); RenX::replace_tag(fmt, this->GDIHeadshotsTag, this->INTERNAL_GDI_HEADSHOTS_TAG);
fmt.replace(this->GDIHeadshotKillRatioTag, this->INTERNAL_GDI_HEADSHOT_KILL_RATIO_TAG); RenX::replace_tag(fmt, this->GDIHeadshotKillRatioTag, this->INTERNAL_GDI_HEADSHOT_KILL_RATIO_TAG);
fmt.replace(this->NodScoreTag, this->INTERNAL_NOD_SCORE_TAG); RenX::replace_tag(fmt, this->NodScoreTag, this->INTERNAL_NOD_SCORE_TAG);
fmt.replace(this->NodSPMTag, this->INTERNAL_NOD_SPM_TAG); RenX::replace_tag(fmt, this->NodSPMTag, this->INTERNAL_NOD_SPM_TAG);
fmt.replace(this->NodGameTimeTag, this->INTERNAL_NOD_GAME_TIME_TAG); RenX::replace_tag(fmt, this->NodGameTimeTag, this->INTERNAL_NOD_GAME_TIME_TAG);
fmt.replace(this->NodTiesTag, this->INTERNAL_NOD_TIES_TAG); RenX::replace_tag(fmt, this->NodTiesTag, this->INTERNAL_NOD_TIES_TAG);
fmt.replace(this->NodBeaconPlacementsTag, this->INTERNAL_NOD_BEACON_PLACEMENTS_TAG); RenX::replace_tag(fmt, this->NodBeaconPlacementsTag, this->INTERNAL_NOD_BEACON_PLACEMENTS_TAG);
fmt.replace(this->NodBeaconDisarmsTag, this->INTERNAL_NOD_BEACON_DISARMS_TAG); RenX::replace_tag(fmt, this->NodBeaconDisarmsTag, this->INTERNAL_NOD_BEACON_DISARMS_TAG);
fmt.replace(this->NodProxyPlacementsTag, this->INTERNAL_NOD_PROXY_PLACEMENTS_TAG); RenX::replace_tag(fmt, this->NodProxyPlacementsTag, this->INTERNAL_NOD_PROXY_PLACEMENTS_TAG);
fmt.replace(this->NodProxyDisarmsTag, this->INTERNAL_NOD_PROXY_DISARMS_TAG); RenX::replace_tag(fmt, this->NodProxyDisarmsTag, this->INTERNAL_NOD_PROXY_DISARMS_TAG);
fmt.replace(this->NodKillsTag, this->INTERNAL_NOD_KILLS_TAG); RenX::replace_tag(fmt, this->NodKillsTag, this->INTERNAL_NOD_KILLS_TAG);
fmt.replace(this->NodDeathsTag, this->INTERNAL_NOD_DEATHS_TAG); RenX::replace_tag(fmt, this->NodDeathsTag, this->INTERNAL_NOD_DEATHS_TAG);
fmt.replace(this->NodVehicleKillsTag, this->INTERNAL_NOD_VEHICLE_KILLS_TAG); RenX::replace_tag(fmt, this->NodVehicleKillsTag, this->INTERNAL_NOD_VEHICLE_KILLS_TAG);
fmt.replace(this->NodDefenceKillsTag, this->INTERNAL_NOD_DEFENCE_KILLS_TAG); RenX::replace_tag(fmt, this->NodDefenceKillsTag, this->INTERNAL_NOD_DEFENCE_KILLS_TAG);
fmt.replace(this->NodBuildingKillsTag, this->INTERNAL_NOD_BUILDING_KILLS_TAG); RenX::replace_tag(fmt, this->NodBuildingKillsTag, this->INTERNAL_NOD_BUILDING_KILLS_TAG);
fmt.replace(this->NodKDRTag, this->INTERNAL_NOD_KDR_TAG); RenX::replace_tag(fmt, this->NodKDRTag, this->INTERNAL_NOD_KDR_TAG);
fmt.replace(this->NodHeadshotsTag, this->INTERNAL_NOD_HEADSHOTS_TAG); RenX::replace_tag(fmt, this->NodHeadshotsTag, this->INTERNAL_NOD_HEADSHOTS_TAG);
fmt.replace(this->NodHeadshotKillRatioTag, this->INTERNAL_NOD_HEADSHOT_KILL_RATIO_TAG); RenX::replace_tag(fmt, this->NodHeadshotKillRatioTag, this->INTERNAL_NOD_HEADSHOT_KILL_RATIO_TAG);
/** Other tags */ /** Other tags */
fmt.replace(this->weaponTag, this->INTERNAL_WEAPON_TAG); RenX::replace_tag(fmt, this->weaponTag, this->INTERNAL_WEAPON_TAG);
fmt.replace(this->objectTag, this->INTERNAL_OBJECT_TAG); RenX::replace_tag(fmt, this->objectTag, this->INTERNAL_OBJECT_TAG);
fmt.replace(this->messageTag, this->INTERNAL_MESSAGE_TAG); RenX::replace_tag(fmt, this->messageTag, this->INTERNAL_MESSAGE_TAG);
fmt.replace(this->newNameTag, this->INTERNAL_NEW_NAME_TAG); RenX::replace_tag(fmt, this->newNameTag, this->INTERNAL_NEW_NAME_TAG);
fmt.replace(this->winScoreTag, this->INTERNAL_WIN_SCORE_TAG); RenX::replace_tag(fmt, this->winScoreTag, this->INTERNAL_WIN_SCORE_TAG);
fmt.replace(this->loseScoreTag, this->INTERNAL_LOSE_SCORE_TAG); RenX::replace_tag(fmt, this->loseScoreTag, this->INTERNAL_LOSE_SCORE_TAG);
for (const auto& plugin : RenX::getCore()->getPlugins()) { for (const auto& plugin : RenX::getCore()->getPlugins()) {
plugin->RenX_SanitizeTags(fmt); plugin->RenX_SanitizeTags(fmt);
@ -879,24 +879,38 @@ const Jupiter::ReadableString &TagsImp::getUniqueInternalTag()
return this->uniqueTag; return this->uniqueTag;
} }
/** Foward functions */ void RenX::replace_tag(std::string& fmt, std::string_view tag, std::string_view internal_tag) {
// Search for tag
size_t tag_pos = fmt.find(tag);
if (tag_pos == std::string::npos) {
return;
}
// Replace the tag
fmt.replace(tag_pos, tag.size(), internal_tag);
// Recurse for any further instances; less efficient than old replace() but should be rare anyways
replace_tag(fmt, tag, internal_tag);
}
/** Forward functions */
const Jupiter::ReadableString &RenX::getUniqueInternalTag() const Jupiter::ReadableString &RenX::getUniqueInternalTag()
{ {
return _tags.getUniqueInternalTag(); return _tags.getUniqueInternalTag();
} }
void RenX::processTags(Jupiter::StringType &msg, const RenX::Server *server, const RenX::PlayerInfo *player, const RenX::PlayerInfo *victim, const RenX::BuildingInfo *building) void RenX::processTags(std::string& msg, const RenX::Server *server, const RenX::PlayerInfo *player, const RenX::PlayerInfo *victim, const RenX::BuildingInfo *building)
{ {
_tags.processTags(msg, server, player, victim, building); _tags.processTags(msg, server, player, victim, building);
} }
void RenX::processTags(Jupiter::StringType &msg, const RenX::LadderDatabase::Entry &entry) void RenX::processTags(std::string& msg, const RenX::LadderDatabase::Entry &entry)
{ {
_tags.processTags(msg, entry); _tags.processTags(msg, entry);
} }
void RenX::sanitizeTags(Jupiter::StringType &fmt) void RenX::sanitizeTags(std::string& fmt)
{ {
_tags.sanitizeTags(fmt); _tags.sanitizeTags(fmt);
} }

689
src/Plugins/RenX/RenX.Core/RenX_Tags.h

@ -41,9 +41,10 @@ namespace RenX
class Server; class Server;
struct BuildingInfo; struct BuildingInfo;
RENX_API void processTags(Jupiter::StringType &msg, const RenX::Server *server = nullptr, const RenX::PlayerInfo *player = nullptr, const RenX::PlayerInfo *victim = nullptr, const RenX::BuildingInfo *building = nullptr); RENX_API void processTags(std::string& msg, const RenX::Server *server = nullptr, const RenX::PlayerInfo *player = nullptr, const RenX::PlayerInfo *victim = nullptr, const RenX::BuildingInfo *building = nullptr);
RENX_API void processTags(Jupiter::StringType &msg, const RenX::LadderDatabase::Entry &entry); RENX_API void processTags(std::string& msg, const RenX::LadderDatabase::Entry &entry);
RENX_API void sanitizeTags(Jupiter::StringType &fmt); RENX_API void sanitizeTags(std::string& fmt);
RENX_API void replace_tag(std::string& fmt, std::string_view tag, std::string_view internal_tag);
RENX_API const Jupiter::ReadableString &getUniqueInternalTag(); RENX_API const Jupiter::ReadableString &getUniqueInternalTag();
struct RENX_API Tags struct RENX_API Tags
@ -55,374 +56,374 @@ namespace RenX
std::string timeFmt; std::string timeFmt;
/** Global tags */ /** Global tags */
Jupiter::StringS INTERNAL_DATE_TAG; std::string INTERNAL_DATE_TAG;
Jupiter::StringS INTERNAL_TIME_TAG; std::string INTERNAL_TIME_TAG;
/** Server tags */ /** Server tags */
Jupiter::StringS INTERNAL_RCON_VERSION_TAG; std::string INTERNAL_RCON_VERSION_TAG;
Jupiter::StringS INTERNAL_GAME_VERSION_TAG; std::string INTERNAL_GAME_VERSION_TAG;
Jupiter::StringS INTERNAL_RULES_TAG; std::string INTERNAL_RULES_TAG;
Jupiter::StringS INTERNAL_USER_TAG; std::string INTERNAL_USER_TAG;
Jupiter::StringS INTERNAL_SERVER_NAME_TAG; std::string INTERNAL_SERVER_NAME_TAG;
Jupiter::StringS INTERNAL_MAP_TAG; std::string INTERNAL_MAP_TAG;
Jupiter::StringS INTERNAL_MAP_GUID_TAG; std::string INTERNAL_MAP_GUID_TAG;
Jupiter::StringS INTERNAL_SERVER_HOSTNAME_TAG; std::string INTERNAL_SERVER_HOSTNAME_TAG;
Jupiter::StringS INTERNAL_SERVER_PORT_TAG; std::string INTERNAL_SERVER_PORT_TAG;
Jupiter::StringS INTERNAL_SOCKET_HOSTNAME_TAG; std::string INTERNAL_SOCKET_HOSTNAME_TAG;
Jupiter::StringS INTERNAL_SOCKET_PORT_TAG; std::string INTERNAL_SOCKET_PORT_TAG;
Jupiter::StringS INTERNAL_SERVER_PREFIX_TAG; std::string INTERNAL_SERVER_PREFIX_TAG;
/** Player tags */ /** Player tags */
Jupiter::StringS INTERNAL_NAME_TAG; std::string INTERNAL_NAME_TAG;
Jupiter::StringS INTERNAL_RAW_NAME_TAG; std::string INTERNAL_RAW_NAME_TAG;
Jupiter::StringS INTERNAL_IP_TAG; std::string INTERNAL_IP_TAG;
Jupiter::StringS INTERNAL_HWID_TAG; std::string INTERNAL_HWID_TAG;
Jupiter::StringS INTERNAL_RDNS_TAG; std::string INTERNAL_RDNS_TAG;
Jupiter::StringS INTERNAL_STEAM_TAG; std::string INTERNAL_STEAM_TAG;
Jupiter::StringS INTERNAL_UUID_TAG; std::string INTERNAL_UUID_TAG;
Jupiter::StringS INTERNAL_ID_TAG; std::string INTERNAL_ID_TAG;
Jupiter::StringS INTERNAL_CHARACTER_TAG; std::string INTERNAL_CHARACTER_TAG;
Jupiter::StringS INTERNAL_VEHICLE_TAG; std::string INTERNAL_VEHICLE_TAG;
Jupiter::StringS INTERNAL_ADMIN_TAG; std::string INTERNAL_ADMIN_TAG;
Jupiter::StringS INTERNAL_PREFIX_TAG; std::string INTERNAL_PREFIX_TAG;
Jupiter::StringS INTERNAL_GAME_PREFIX_TAG; std::string INTERNAL_GAME_PREFIX_TAG;
Jupiter::StringS INTERNAL_TEAM_COLOR_TAG; std::string INTERNAL_TEAM_COLOR_TAG;
Jupiter::StringS INTERNAL_TEAM_SHORT_TAG; std::string INTERNAL_TEAM_SHORT_TAG;
Jupiter::StringS INTERNAL_TEAM_LONG_TAG; std::string INTERNAL_TEAM_LONG_TAG;
Jupiter::StringS INTERNAL_PING_TAG; std::string INTERNAL_PING_TAG;
Jupiter::StringS INTERNAL_SCORE_TAG; std::string INTERNAL_SCORE_TAG;
Jupiter::StringS INTERNAL_SCORE_PER_MINUTE_TAG; std::string INTERNAL_SCORE_PER_MINUTE_TAG;
Jupiter::StringS INTERNAL_CREDITS_TAG; std::string INTERNAL_CREDITS_TAG;
Jupiter::StringS INTERNAL_KILLS_TAG; std::string INTERNAL_KILLS_TAG;
Jupiter::StringS INTERNAL_DEATHS_TAG; std::string INTERNAL_DEATHS_TAG;
Jupiter::StringS INTERNAL_KDR_TAG; std::string INTERNAL_KDR_TAG;
Jupiter::StringS INTERNAL_SUICIDES_TAG; std::string INTERNAL_SUICIDES_TAG;
Jupiter::StringS INTERNAL_HEADSHOTS_TAG; std::string INTERNAL_HEADSHOTS_TAG;
Jupiter::StringS INTERNAL_HEADSHOT_KILL_RATIO_TAG; std::string INTERNAL_HEADSHOT_KILL_RATIO_TAG;
Jupiter::StringS INTERNAL_VEHICLE_KILLS_TAG; std::string INTERNAL_VEHICLE_KILLS_TAG;
Jupiter::StringS INTERNAL_BUILDING_KILLS_TAG; std::string INTERNAL_BUILDING_KILLS_TAG;
Jupiter::StringS INTERNAL_DEFENCE_KILLS_TAG; std::string INTERNAL_DEFENCE_KILLS_TAG;
Jupiter::StringS INTERNAL_GAME_TIME_TAG; std::string INTERNAL_GAME_TIME_TAG;
Jupiter::StringS INTERNAL_GAMES_TAG; std::string INTERNAL_GAMES_TAG;
Jupiter::StringS INTERNAL_GDI_GAMES_TAG; std::string INTERNAL_GDI_GAMES_TAG;
Jupiter::StringS INTERNAL_NOD_GAMES_TAG; std::string INTERNAL_NOD_GAMES_TAG;
Jupiter::StringS INTERNAL_WINS_TAG; std::string INTERNAL_WINS_TAG;
Jupiter::StringS INTERNAL_GDI_WINS_TAG; std::string INTERNAL_GDI_WINS_TAG;
Jupiter::StringS INTERNAL_NOD_WINS_TAG; std::string INTERNAL_NOD_WINS_TAG;
Jupiter::StringS INTERNAL_TIES_TAG; std::string INTERNAL_TIES_TAG;
Jupiter::StringS INTERNAL_LOSSES_TAG; std::string INTERNAL_LOSSES_TAG;
Jupiter::StringS INTERNAL_GDI_LOSSES_TAG; std::string INTERNAL_GDI_LOSSES_TAG;
Jupiter::StringS INTERNAL_NOD_LOSSES_TAG; std::string INTERNAL_NOD_LOSSES_TAG;
Jupiter::StringS INTERNAL_WIN_LOSS_RATIO_TAG; std::string INTERNAL_WIN_LOSS_RATIO_TAG;
Jupiter::StringS INTERNAL_GDI_WIN_LOSS_RATIO_TAG; std::string INTERNAL_GDI_WIN_LOSS_RATIO_TAG;
Jupiter::StringS INTERNAL_NOD_WIN_LOSS_RATIO_TAG; std::string INTERNAL_NOD_WIN_LOSS_RATIO_TAG;
Jupiter::StringS INTERNAL_BEACON_PLACEMENTS_TAG; std::string INTERNAL_BEACON_PLACEMENTS_TAG;
Jupiter::StringS INTERNAL_BEACON_DISARMS_TAG; std::string INTERNAL_BEACON_DISARMS_TAG;
Jupiter::StringS INTERNAL_PROXY_PLACEMENTS_TAG; std::string INTERNAL_PROXY_PLACEMENTS_TAG;
Jupiter::StringS INTERNAL_PROXY_DISARMS_TAG; std::string INTERNAL_PROXY_DISARMS_TAG;
Jupiter::StringS INTERNAL_CAPTURES_TAG; std::string INTERNAL_CAPTURES_TAG;
Jupiter::StringS INTERNAL_STEALS_TAG; std::string INTERNAL_STEALS_TAG;
Jupiter::StringS INTERNAL_STOLEN_TAG; std::string INTERNAL_STOLEN_TAG;
Jupiter::StringS INTERNAL_ACCESS_TAG; std::string INTERNAL_ACCESS_TAG;
/** Victim tags */ /** Victim tags */
Jupiter::StringS INTERNAL_VICTIM_NAME_TAG; std::string INTERNAL_VICTIM_NAME_TAG;
Jupiter::StringS INTERNAL_VICTIM_RAW_NAME_TAG; std::string INTERNAL_VICTIM_RAW_NAME_TAG;
Jupiter::StringS INTERNAL_VICTIM_IP_TAG; std::string INTERNAL_VICTIM_IP_TAG;
Jupiter::StringS INTERNAL_VICTIM_HWID_TAG; std::string INTERNAL_VICTIM_HWID_TAG;
Jupiter::StringS INTERNAL_VICTIM_RDNS_TAG; std::string INTERNAL_VICTIM_RDNS_TAG;
Jupiter::StringS INTERNAL_VICTIM_STEAM_TAG; std::string INTERNAL_VICTIM_STEAM_TAG;
Jupiter::StringS INTERNAL_VICTIM_UUID_TAG; std::string INTERNAL_VICTIM_UUID_TAG;
Jupiter::StringS INTERNAL_VICTIM_ID_TAG; std::string INTERNAL_VICTIM_ID_TAG;
Jupiter::StringS INTERNAL_VICTIM_CHARACTER_TAG; std::string INTERNAL_VICTIM_CHARACTER_TAG;
Jupiter::StringS INTERNAL_VICTIM_VEHICLE_TAG; std::string INTERNAL_VICTIM_VEHICLE_TAG;
Jupiter::StringS INTERNAL_VICTIM_ADMIN_TAG; std::string INTERNAL_VICTIM_ADMIN_TAG;
Jupiter::StringS INTERNAL_VICTIM_PREFIX_TAG; std::string INTERNAL_VICTIM_PREFIX_TAG;
Jupiter::StringS INTERNAL_VICTIM_GAME_PREFIX_TAG; std::string INTERNAL_VICTIM_GAME_PREFIX_TAG;
Jupiter::StringS INTERNAL_VICTIM_TEAM_COLOR_TAG; std::string INTERNAL_VICTIM_TEAM_COLOR_TAG;
Jupiter::StringS INTERNAL_VICTIM_TEAM_SHORT_TAG; std::string INTERNAL_VICTIM_TEAM_SHORT_TAG;
Jupiter::StringS INTERNAL_VICTIM_TEAM_LONG_TAG; std::string INTERNAL_VICTIM_TEAM_LONG_TAG;
Jupiter::StringS INTERNAL_VICTIM_PING_TAG; std::string INTERNAL_VICTIM_PING_TAG;
Jupiter::StringS INTERNAL_VICTIM_SCORE_TAG; std::string INTERNAL_VICTIM_SCORE_TAG;
Jupiter::StringS INTERNAL_VICTIM_SCORE_PER_MINUTE_TAG; std::string INTERNAL_VICTIM_SCORE_PER_MINUTE_TAG;
Jupiter::StringS INTERNAL_VICTIM_CREDITS_TAG; std::string INTERNAL_VICTIM_CREDITS_TAG;
Jupiter::StringS INTERNAL_VICTIM_KILLS_TAG; std::string INTERNAL_VICTIM_KILLS_TAG;
Jupiter::StringS INTERNAL_VICTIM_DEATHS_TAG; std::string INTERNAL_VICTIM_DEATHS_TAG;
Jupiter::StringS INTERNAL_VICTIM_KDR_TAG; std::string INTERNAL_VICTIM_KDR_TAG;
Jupiter::StringS INTERNAL_VICTIM_SUICIDES_TAG; std::string INTERNAL_VICTIM_SUICIDES_TAG;
Jupiter::StringS INTERNAL_VICTIM_HEADSHOTS_TAG; std::string INTERNAL_VICTIM_HEADSHOTS_TAG;
Jupiter::StringS INTERNAL_VICTIM_HEADSHOT_KILL_RATIO_TAG; std::string INTERNAL_VICTIM_HEADSHOT_KILL_RATIO_TAG;
Jupiter::StringS INTERNAL_VICTIM_VEHICLE_KILLS_TAG; std::string INTERNAL_VICTIM_VEHICLE_KILLS_TAG;
Jupiter::StringS INTERNAL_VICTIM_BUILDING_KILLS_TAG; std::string INTERNAL_VICTIM_BUILDING_KILLS_TAG;
Jupiter::StringS INTERNAL_VICTIM_DEFENCE_KILLS_TAG; std::string INTERNAL_VICTIM_DEFENCE_KILLS_TAG;
Jupiter::StringS INTERNAL_VICTIM_GAME_TIME_TAG; std::string INTERNAL_VICTIM_GAME_TIME_TAG;
Jupiter::StringS INTERNAL_VICTIM_GAMES_TAG; std::string INTERNAL_VICTIM_GAMES_TAG;
Jupiter::StringS INTERNAL_VICTIM_GDI_GAMES_TAG; std::string INTERNAL_VICTIM_GDI_GAMES_TAG;
Jupiter::StringS INTERNAL_VICTIM_NOD_GAMES_TAG; std::string INTERNAL_VICTIM_NOD_GAMES_TAG;
Jupiter::StringS INTERNAL_VICTIM_WINS_TAG; std::string INTERNAL_VICTIM_WINS_TAG;
Jupiter::StringS INTERNAL_VICTIM_GDI_WINS_TAG; std::string INTERNAL_VICTIM_GDI_WINS_TAG;
Jupiter::StringS INTERNAL_VICTIM_NOD_WINS_TAG; std::string INTERNAL_VICTIM_NOD_WINS_TAG;
Jupiter::StringS INTERNAL_VICTIM_TIES_TAG; std::string INTERNAL_VICTIM_TIES_TAG;
Jupiter::StringS INTERNAL_VICTIM_LOSSES_TAG; std::string INTERNAL_VICTIM_LOSSES_TAG;
Jupiter::StringS INTERNAL_VICTIM_GDI_LOSSES_TAG; std::string INTERNAL_VICTIM_GDI_LOSSES_TAG;
Jupiter::StringS INTERNAL_VICTIM_NOD_LOSSES_TAG; std::string INTERNAL_VICTIM_NOD_LOSSES_TAG;
Jupiter::StringS INTERNAL_VICTIM_WIN_LOSS_RATIO_TAG; std::string INTERNAL_VICTIM_WIN_LOSS_RATIO_TAG;
Jupiter::StringS INTERNAL_VICTIM_GDI_WIN_LOSS_RATIO_TAG; std::string INTERNAL_VICTIM_GDI_WIN_LOSS_RATIO_TAG;
Jupiter::StringS INTERNAL_VICTIM_NOD_WIN_LOSS_RATIO_TAG; std::string INTERNAL_VICTIM_NOD_WIN_LOSS_RATIO_TAG;
Jupiter::StringS INTERNAL_VICTIM_BEACON_PLACEMENTS_TAG; std::string INTERNAL_VICTIM_BEACON_PLACEMENTS_TAG;
Jupiter::StringS INTERNAL_VICTIM_BEACON_DISARMS_TAG; std::string INTERNAL_VICTIM_BEACON_DISARMS_TAG;
Jupiter::StringS INTERNAL_VICTIM_PROXY_PLACEMENTS_TAG; std::string INTERNAL_VICTIM_PROXY_PLACEMENTS_TAG;
Jupiter::StringS INTERNAL_VICTIM_PROXY_DISARMS_TAG; std::string INTERNAL_VICTIM_PROXY_DISARMS_TAG;
Jupiter::StringS INTERNAL_VICTIM_CAPTURES_TAG; std::string INTERNAL_VICTIM_CAPTURES_TAG;
Jupiter::StringS INTERNAL_VICTIM_STEALS_TAG; std::string INTERNAL_VICTIM_STEALS_TAG;
Jupiter::StringS INTERNAL_VICTIM_STOLEN_TAG; std::string INTERNAL_VICTIM_STOLEN_TAG;
Jupiter::StringS INTERNAL_VICTIM_ACCESS_TAG; std::string INTERNAL_VICTIM_ACCESS_TAG;
/** Building tags */ /** Building tags */
Jupiter::StringS INTERNAL_BUILDING_NAME_TAG; std::string INTERNAL_BUILDING_NAME_TAG;
Jupiter::StringS INTERNAL_BUILDING_RAW_NAME_TAG; std::string INTERNAL_BUILDING_RAW_NAME_TAG;
Jupiter::StringS INTERNAL_BUILDING_HEALTH_TAG; std::string INTERNAL_BUILDING_HEALTH_TAG;
Jupiter::StringS INTERNAL_BUILDING_MAX_HEALTH_TAG; std::string INTERNAL_BUILDING_MAX_HEALTH_TAG;
Jupiter::StringS INTERNAL_BUILDING_HEALTH_PERCENTAGE_TAG; std::string INTERNAL_BUILDING_HEALTH_PERCENTAGE_TAG;
Jupiter::StringS INTERNAL_BUILDING_ARMOR_TAG; std::string INTERNAL_BUILDING_ARMOR_TAG;
Jupiter::StringS INTERNAL_BUILDING_MAX_ARMOR_TAG; std::string INTERNAL_BUILDING_MAX_ARMOR_TAG;
Jupiter::StringS INTERNAL_BUILDING_ARMOR_PERCENTAGE_TAG; std::string INTERNAL_BUILDING_ARMOR_PERCENTAGE_TAG;
Jupiter::StringS INTERNAL_BUILDING_DURABILITY_TAG; std::string INTERNAL_BUILDING_DURABILITY_TAG;
Jupiter::StringS INTERNAL_BUILDING_MAX_DURABILITY_TAG; std::string INTERNAL_BUILDING_MAX_DURABILITY_TAG;
Jupiter::StringS INTERNAL_BUILDING_DURABILITY_PERCENTAGE_TAG; std::string INTERNAL_BUILDING_DURABILITY_PERCENTAGE_TAG;
Jupiter::StringS INTERNAL_BUILDING_TEAM_COLOR_TAG; std::string INTERNAL_BUILDING_TEAM_COLOR_TAG;
Jupiter::StringS INTERNAL_BUILDING_TEAM_SHORT_TAG; std::string INTERNAL_BUILDING_TEAM_SHORT_TAG;
Jupiter::StringS INTERNAL_BUILDING_TEAM_LONG_TAG; std::string INTERNAL_BUILDING_TEAM_LONG_TAG;
/** Ladder tags */ /** Ladder tags */
Jupiter::StringS INTERNAL_RANK_TAG; std::string INTERNAL_RANK_TAG;
Jupiter::StringS INTERNAL_LAST_GAME_TAG; std::string INTERNAL_LAST_GAME_TAG;
Jupiter::StringS INTERNAL_GDI_SCORE_TAG; std::string INTERNAL_GDI_SCORE_TAG;
Jupiter::StringS INTERNAL_GDI_SPM_TAG; std::string INTERNAL_GDI_SPM_TAG;
Jupiter::StringS INTERNAL_GDI_GAME_TIME_TAG; std::string INTERNAL_GDI_GAME_TIME_TAG;
Jupiter::StringS INTERNAL_GDI_TIES_TAG; std::string INTERNAL_GDI_TIES_TAG;
Jupiter::StringS INTERNAL_GDI_BEACON_PLACEMENTS_TAG; std::string INTERNAL_GDI_BEACON_PLACEMENTS_TAG;
Jupiter::StringS INTERNAL_GDI_BEACON_DISARMS_TAG; std::string INTERNAL_GDI_BEACON_DISARMS_TAG;
Jupiter::StringS INTERNAL_GDI_PROXY_PLACEMENTS_TAG; std::string INTERNAL_GDI_PROXY_PLACEMENTS_TAG;
Jupiter::StringS INTERNAL_GDI_PROXY_DISARMS_TAG; std::string INTERNAL_GDI_PROXY_DISARMS_TAG;
Jupiter::StringS INTERNAL_GDI_KILLS_TAG; std::string INTERNAL_GDI_KILLS_TAG;
Jupiter::StringS INTERNAL_GDI_DEATHS_TAG; std::string INTERNAL_GDI_DEATHS_TAG;
Jupiter::StringS INTERNAL_GDI_VEHICLE_KILLS_TAG; std::string INTERNAL_GDI_VEHICLE_KILLS_TAG;
Jupiter::StringS INTERNAL_GDI_DEFENCE_KILLS_TAG; std::string INTERNAL_GDI_DEFENCE_KILLS_TAG;
Jupiter::StringS INTERNAL_GDI_BUILDING_KILLS_TAG; std::string INTERNAL_GDI_BUILDING_KILLS_TAG;
Jupiter::StringS INTERNAL_GDI_KDR_TAG; std::string INTERNAL_GDI_KDR_TAG;
Jupiter::StringS INTERNAL_GDI_HEADSHOTS_TAG; std::string INTERNAL_GDI_HEADSHOTS_TAG;
Jupiter::StringS INTERNAL_GDI_HEADSHOT_KILL_RATIO_TAG; std::string INTERNAL_GDI_HEADSHOT_KILL_RATIO_TAG;
Jupiter::StringS INTERNAL_NOD_SCORE_TAG; std::string INTERNAL_NOD_SCORE_TAG;
Jupiter::StringS INTERNAL_NOD_SPM_TAG; std::string INTERNAL_NOD_SPM_TAG;
Jupiter::StringS INTERNAL_NOD_GAME_TIME_TAG; std::string INTERNAL_NOD_GAME_TIME_TAG;
Jupiter::StringS INTERNAL_NOD_TIES_TAG; std::string INTERNAL_NOD_TIES_TAG;
Jupiter::StringS INTERNAL_NOD_BEACON_PLACEMENTS_TAG; std::string INTERNAL_NOD_BEACON_PLACEMENTS_TAG;
Jupiter::StringS INTERNAL_NOD_BEACON_DISARMS_TAG; std::string INTERNAL_NOD_BEACON_DISARMS_TAG;
Jupiter::StringS INTERNAL_NOD_PROXY_PLACEMENTS_TAG; std::string INTERNAL_NOD_PROXY_PLACEMENTS_TAG;
Jupiter::StringS INTERNAL_NOD_PROXY_DISARMS_TAG; std::string INTERNAL_NOD_PROXY_DISARMS_TAG;
Jupiter::StringS INTERNAL_NOD_KILLS_TAG; std::string INTERNAL_NOD_KILLS_TAG;
Jupiter::StringS INTERNAL_NOD_DEATHS_TAG; std::string INTERNAL_NOD_DEATHS_TAG;
Jupiter::StringS INTERNAL_NOD_VEHICLE_KILLS_TAG; std::string INTERNAL_NOD_VEHICLE_KILLS_TAG;
Jupiter::StringS INTERNAL_NOD_DEFENCE_KILLS_TAG; std::string INTERNAL_NOD_DEFENCE_KILLS_TAG;
Jupiter::StringS INTERNAL_NOD_BUILDING_KILLS_TAG; std::string INTERNAL_NOD_BUILDING_KILLS_TAG;
Jupiter::StringS INTERNAL_NOD_KDR_TAG; std::string INTERNAL_NOD_KDR_TAG;
Jupiter::StringS INTERNAL_NOD_HEADSHOTS_TAG; std::string INTERNAL_NOD_HEADSHOTS_TAG;
Jupiter::StringS INTERNAL_NOD_HEADSHOT_KILL_RATIO_TAG; std::string INTERNAL_NOD_HEADSHOT_KILL_RATIO_TAG;
/** Other tags */ /** Other tags */
Jupiter::StringS INTERNAL_WEAPON_TAG; std::string INTERNAL_WEAPON_TAG;
Jupiter::StringS INTERNAL_OBJECT_TAG; std::string INTERNAL_OBJECT_TAG;
Jupiter::StringS INTERNAL_MESSAGE_TAG; std::string INTERNAL_MESSAGE_TAG;
Jupiter::StringS INTERNAL_NEW_NAME_TAG; std::string INTERNAL_NEW_NAME_TAG;
Jupiter::StringS INTERNAL_WIN_SCORE_TAG; std::string INTERNAL_WIN_SCORE_TAG;
Jupiter::StringS INTERNAL_LOSE_SCORE_TAG; std::string INTERNAL_LOSE_SCORE_TAG;
/** External message tags */ /** External message tags */
/** Global tags */ /** Global tags */
Jupiter::StringS dateTag; std::string dateTag;
Jupiter::StringS timeTag; std::string timeTag;
/** Server tags */ /** Server tags */
Jupiter::StringS rconVersionTag; std::string rconVersionTag;
Jupiter::StringS gameVersionTag; std::string gameVersionTag;
Jupiter::StringS rulesTag; std::string rulesTag;
Jupiter::StringS userTag; std::string userTag;
Jupiter::StringS serverNameTag; std::string serverNameTag;
Jupiter::StringS mapTag; std::string mapTag;
Jupiter::StringS mapGUIDTag; std::string mapGUIDTag;
Jupiter::StringS serverHostnameTag; std::string serverHostnameTag;
Jupiter::StringS serverPortTag; std::string serverPortTag;
Jupiter::StringS socketHostnameTag; std::string socketHostnameTag;
Jupiter::StringS socketPortTag; std::string socketPortTag;
Jupiter::StringS serverPrefixTag; std::string serverPrefixTag;
/** Player tags */ /** Player tags */
Jupiter::StringS nameTag; std::string nameTag;
Jupiter::StringS rawNameTag; std::string rawNameTag;
Jupiter::StringS ipTag; std::string ipTag;
Jupiter::StringS hwidTag; std::string hwidTag;
Jupiter::StringS rdnsTag; std::string rdnsTag;
Jupiter::StringS steamTag; std::string steamTag;
Jupiter::StringS uuidTag; std::string uuidTag;
Jupiter::StringS idTag; std::string idTag;
Jupiter::StringS characterTag; std::string characterTag;
Jupiter::StringS vehicleTag; std::string vehicleTag;
Jupiter::StringS adminTag; std::string adminTag;
Jupiter::StringS prefixTag; std::string prefixTag;
Jupiter::StringS gamePrefixTag; std::string gamePrefixTag;
Jupiter::StringS teamColorTag; std::string teamColorTag;
Jupiter::StringS teamShortTag; std::string teamShortTag;
Jupiter::StringS teamLongTag; std::string teamLongTag;
Jupiter::StringS pingTag; std::string pingTag;
Jupiter::StringS scoreTag; std::string scoreTag;
Jupiter::StringS scorePerMinuteTag; std::string scorePerMinuteTag;
Jupiter::StringS creditsTag; std::string creditsTag;
Jupiter::StringS killsTag; std::string killsTag;
Jupiter::StringS deathsTag; std::string deathsTag;
Jupiter::StringS kdrTag; std::string kdrTag;
Jupiter::StringS suicidesTag; std::string suicidesTag;
Jupiter::StringS headshotsTag; std::string headshotsTag;
Jupiter::StringS headshotKillRatioTag; std::string headshotKillRatioTag;
Jupiter::StringS vehicleKillsTag; std::string vehicleKillsTag;
Jupiter::StringS buildingKillsTag; std::string buildingKillsTag;
Jupiter::StringS defenceKillsTag; std::string defenceKillsTag;
Jupiter::StringS gameTimeTag; std::string gameTimeTag;
Jupiter::StringS gamesTag; std::string gamesTag;
Jupiter::StringS GDIGamesTag; std::string GDIGamesTag;
Jupiter::StringS NodGamesTag; std::string NodGamesTag;
Jupiter::StringS winsTag; std::string winsTag;
Jupiter::StringS GDIWinsTag; std::string GDIWinsTag;
Jupiter::StringS NodWinsTag; std::string NodWinsTag;
Jupiter::StringS tiesTag; std::string tiesTag;
Jupiter::StringS lossesTag; std::string lossesTag;
Jupiter::StringS GDILossesTag; std::string GDILossesTag;
Jupiter::StringS NodLossesTag; std::string NodLossesTag;
Jupiter::StringS winLossRatioTag; std::string winLossRatioTag;
Jupiter::StringS GDIWinLossRatioTag; std::string GDIWinLossRatioTag;
Jupiter::StringS NodWinLossRatioTag; std::string NodWinLossRatioTag;
Jupiter::StringS beaconPlacementsTag; std::string beaconPlacementsTag;
Jupiter::StringS beaconDisarmsTag; std::string beaconDisarmsTag;
Jupiter::StringS proxyPlacementsTag; std::string proxyPlacementsTag;
Jupiter::StringS proxyDisarmsTag; std::string proxyDisarmsTag;
Jupiter::StringS capturesTag; std::string capturesTag;
Jupiter::StringS stealsTag; std::string stealsTag;
Jupiter::StringS stolenTag; std::string stolenTag;
Jupiter::StringS accessTag; std::string accessTag;
/** Victim tags */ /** Victim tags */
Jupiter::StringS victimNameTag; std::string victimNameTag;
Jupiter::StringS victimRawNameTag; std::string victimRawNameTag;
Jupiter::StringS victimIPTag; std::string victimIPTag;
Jupiter::StringS victimHWIDTag; std::string victimHWIDTag;
Jupiter::StringS victimRDNSTag; std::string victimRDNSTag;
Jupiter::StringS victimSteamTag; std::string victimSteamTag;
Jupiter::StringS victimUUIDTag; std::string victimUUIDTag;
Jupiter::StringS victimIDTag; std::string victimIDTag;
Jupiter::StringS victimCharacterTag; std::string victimCharacterTag;
Jupiter::StringS victimVehicleTag; std::string victimVehicleTag;
Jupiter::StringS victimAdminTag; std::string victimAdminTag;
Jupiter::StringS victimPrefixTag; std::string victimPrefixTag;
Jupiter::StringS victimGamePrefixTag; std::string victimGamePrefixTag;
Jupiter::StringS victimTeamColorTag; std::string victimTeamColorTag;
Jupiter::StringS victimTeamShortTag; std::string victimTeamShortTag;
Jupiter::StringS victimTeamLongTag; std::string victimTeamLongTag;
Jupiter::StringS victimPingTag; std::string victimPingTag;
Jupiter::StringS victimScoreTag; std::string victimScoreTag;
Jupiter::StringS victimScorePerMinuteTag; std::string victimScorePerMinuteTag;
Jupiter::StringS victimCreditsTag; std::string victimCreditsTag;
Jupiter::StringS victimKillsTag; std::string victimKillsTag;
Jupiter::StringS victimDeathsTag; std::string victimDeathsTag;
Jupiter::StringS victimKDRTag; std::string victimKDRTag;
Jupiter::StringS victimSuicidesTag; std::string victimSuicidesTag;
Jupiter::StringS victimHeadshotsTag; std::string victimHeadshotsTag;
Jupiter::StringS victimHeadshotKillRatioTag; std::string victimHeadshotKillRatioTag;
Jupiter::StringS victimVehicleKillsTag; std::string victimVehicleKillsTag;
Jupiter::StringS victimBuildingKillsTag; std::string victimBuildingKillsTag;
Jupiter::StringS victimDefenceKillsTag; std::string victimDefenceKillsTag;
Jupiter::StringS victimGameTimeTag; std::string victimGameTimeTag;
Jupiter::StringS victimGamesTag; std::string victimGamesTag;
Jupiter::StringS victimGDIGamesTag; std::string victimGDIGamesTag;
Jupiter::StringS victimNodGamesTag; std::string victimNodGamesTag;
Jupiter::StringS victimWinsTag; std::string victimWinsTag;
Jupiter::StringS victimGDIWinsTag; std::string victimGDIWinsTag;
Jupiter::StringS victimNodWinsTag; std::string victimNodWinsTag;
Jupiter::StringS victimTiesTag; std::string victimTiesTag;
Jupiter::StringS victimLossesTag; std::string victimLossesTag;
Jupiter::StringS victimGDILossesTag; std::string victimGDILossesTag;
Jupiter::StringS victimNodLossesTag; std::string victimNodLossesTag;
Jupiter::StringS victimWinLossRatioTag; std::string victimWinLossRatioTag;
Jupiter::StringS victimGDIWinLossRatioTag; std::string victimGDIWinLossRatioTag;
Jupiter::StringS victimNodWinLossRatioTag; std::string victimNodWinLossRatioTag;
Jupiter::StringS victimBeaconPlacementsTag; std::string victimBeaconPlacementsTag;
Jupiter::StringS victimBeaconDisarmsTag; std::string victimBeaconDisarmsTag;
Jupiter::StringS victimProxyPlacementsTag; std::string victimProxyPlacementsTag;
Jupiter::StringS victimProxyDisarmsTag; std::string victimProxyDisarmsTag;
Jupiter::StringS victimCapturesTag; std::string victimCapturesTag;
Jupiter::StringS victimStealsTag; std::string victimStealsTag;
Jupiter::StringS victimStolenTag; std::string victimStolenTag;
Jupiter::StringS victimAccessTag; std::string victimAccessTag;
/** Building tags */ /** Building tags */
Jupiter::StringS buildingNameTag; std::string buildingNameTag;
Jupiter::StringS buildingRawNameTag; std::string buildingRawNameTag;
Jupiter::StringS buildingHealthTag; std::string buildingHealthTag;
Jupiter::StringS buildingMaxHealthTag; std::string buildingMaxHealthTag;
Jupiter::StringS buildingHealthPercentageTag; std::string buildingHealthPercentageTag;
Jupiter::StringS buildingArmorTag; std::string buildingArmorTag;
Jupiter::StringS buildingMaxArmorTag; std::string buildingMaxArmorTag;
Jupiter::StringS buildingArmorPercentageTag; std::string buildingArmorPercentageTag;
Jupiter::StringS buildingDurabilityTag; std::string buildingDurabilityTag;
Jupiter::StringS buildingMaxDurabilityTag; std::string buildingMaxDurabilityTag;
Jupiter::StringS buildingDurabilityPercentageTag; std::string buildingDurabilityPercentageTag;
Jupiter::StringS buildingTeamColorTag; std::string buildingTeamColorTag;
Jupiter::StringS buildingTeamShortTag; std::string buildingTeamShortTag;
Jupiter::StringS buildingTeamLongTag; std::string buildingTeamLongTag;
/** Ladder tags */ /** Ladder tags */
Jupiter::StringS rankTag; std::string rankTag;
Jupiter::StringS lastGameTag; std::string lastGameTag;
Jupiter::StringS GDIScoreTag; std::string GDIScoreTag;
Jupiter::StringS GDISPMTag; std::string GDISPMTag;
Jupiter::StringS GDIGameTimeTag; std::string GDIGameTimeTag;
Jupiter::StringS GDITiesTag; std::string GDITiesTag;
Jupiter::StringS GDIBeaconPlacementsTag; std::string GDIBeaconPlacementsTag;
Jupiter::StringS GDIBeaconDisarmsTag; std::string GDIBeaconDisarmsTag;
Jupiter::StringS GDIProxyPlacementsTag; std::string GDIProxyPlacementsTag;
Jupiter::StringS GDIProxyDisarmsTag; std::string GDIProxyDisarmsTag;
Jupiter::StringS GDIKillsTag; std::string GDIKillsTag;
Jupiter::StringS GDIDeathsTag; std::string GDIDeathsTag;
Jupiter::StringS GDIVehicleKillsTag; std::string GDIVehicleKillsTag;
Jupiter::StringS GDIDefenceKillsTag; std::string GDIDefenceKillsTag;
Jupiter::StringS GDIBuildingKillsTag; std::string GDIBuildingKillsTag;
Jupiter::StringS GDIKDRTag; std::string GDIKDRTag;
Jupiter::StringS GDIHeadshotsTag; std::string GDIHeadshotsTag;
Jupiter::StringS GDIHeadshotKillRatioTag; std::string GDIHeadshotKillRatioTag;
Jupiter::StringS NodScoreTag; std::string NodScoreTag;
Jupiter::StringS NodSPMTag; std::string NodSPMTag;
Jupiter::StringS NodGameTimeTag; std::string NodGameTimeTag;
Jupiter::StringS NodTiesTag; std::string NodTiesTag;
Jupiter::StringS NodBeaconPlacementsTag; std::string NodBeaconPlacementsTag;
Jupiter::StringS NodBeaconDisarmsTag; std::string NodBeaconDisarmsTag;
Jupiter::StringS NodProxyPlacementsTag; std::string NodProxyPlacementsTag;
Jupiter::StringS NodProxyDisarmsTag; std::string NodProxyDisarmsTag;
Jupiter::StringS NodKillsTag; std::string NodKillsTag;
Jupiter::StringS NodDeathsTag; std::string NodDeathsTag;
Jupiter::StringS NodVehicleKillsTag; std::string NodVehicleKillsTag;
Jupiter::StringS NodDefenceKillsTag; std::string NodDefenceKillsTag;
Jupiter::StringS NodBuildingKillsTag; std::string NodBuildingKillsTag;
Jupiter::StringS NodKDRTag; std::string NodKDRTag;
Jupiter::StringS NodHeadshotsTag; std::string NodHeadshotsTag;
Jupiter::StringS NodHeadshotKillRatioTag; std::string NodHeadshotKillRatioTag;
/** Other tags */ /** Other tags */
Jupiter::StringS weaponTag; std::string weaponTag;
Jupiter::StringS objectTag; std::string objectTag;
Jupiter::StringS messageTag; std::string messageTag;
Jupiter::StringS newNameTag; std::string newNameTag;
Jupiter::StringS winScoreTag; std::string winScoreTag;
Jupiter::StringS loseScoreTag; std::string loseScoreTag;
}; };
RENX_API extern Tags *tags; RENX_API extern Tags *tags;
@ -432,7 +433,7 @@ namespace RenX
#define PROCESS_TAG(tag, value) \ #define PROCESS_TAG(tag, value) \
while(true) { \ while(true) { \
index = msg.find(tag); \ index = msg.find(tag); \
if (index == Jupiter::INVALID_INDEX) break; \ if (index == std::string::npos) break; \
msg.replace(index, tag.size(), value); } msg.replace(index, tag.size(), value); }
/** Re-enable warnings */ /** Re-enable warnings */

8
src/Plugins/RenX/RenX.ExtraLogging/RenX_ExtraLogging.cpp

@ -63,7 +63,7 @@ bool RenX_ExtraLoggingPlugin::initialize() {
if (!logFile.empty()) { if (!logFile.empty()) {
RenX_ExtraLoggingPlugin::file = fopen(logFile.c_str(), "a+b"); RenX_ExtraLoggingPlugin::file = fopen(logFile.c_str(), "a+b");
if (RenX_ExtraLoggingPlugin::file != nullptr && !RenX_ExtraLoggingPlugin::newDayFmt.empty()) { if (RenX_ExtraLoggingPlugin::file != nullptr && !RenX_ExtraLoggingPlugin::newDayFmt.empty()) {
Jupiter::String line = RenX_ExtraLoggingPlugin::newDayFmt; std::string line = RenX_ExtraLoggingPlugin::newDayFmt;
RenX::processTags(line); RenX::processTags(line);
fwrite(line.data(), sizeof(char), line.size(), file); fwrite(line.data(), sizeof(char), line.size(), file);
fputs("\r\n", file); fputs("\r\n", file);
@ -82,7 +82,7 @@ int RenX_ExtraLoggingPlugin::think() {
if (currentDay != RenX_ExtraLoggingPlugin::day) if (currentDay != RenX_ExtraLoggingPlugin::day)
{ {
RenX_ExtraLoggingPlugin::day = currentDay; RenX_ExtraLoggingPlugin::day = currentDay;
Jupiter::String line = RenX_ExtraLoggingPlugin::newDayFmt; std::string line = RenX_ExtraLoggingPlugin::newDayFmt;
RenX::processTags(line); RenX::processTags(line);
fwrite(line.data(), sizeof(char), line.size(), file); fwrite(line.data(), sizeof(char), line.size(), file);
fputs("\r\n", file); fputs("\r\n", file);
@ -94,7 +94,7 @@ int RenX_ExtraLoggingPlugin::think() {
void RenX_ExtraLoggingPlugin::RenX_OnRaw(RenX::Server &server, const Jupiter::ReadableString &raw) { void RenX_ExtraLoggingPlugin::RenX_OnRaw(RenX::Server &server, const Jupiter::ReadableString &raw) {
if (RenX_ExtraLoggingPlugin::printToConsole) { if (RenX_ExtraLoggingPlugin::printToConsole) {
if (!RenX_ExtraLoggingPlugin::consolePrefix.empty()) { if (!RenX_ExtraLoggingPlugin::consolePrefix.empty()) {
Jupiter::StringS cPrefix = RenX_ExtraLoggingPlugin::consolePrefix; std::string cPrefix = RenX_ExtraLoggingPlugin::consolePrefix;
RenX::processTags(cPrefix, &server); RenX::processTags(cPrefix, &server);
fwrite(cPrefix.data(), sizeof(char), cPrefix.size(), stdout); fwrite(cPrefix.data(), sizeof(char), cPrefix.size(), stdout);
fputc(' ', stdout); fputc(' ', stdout);
@ -105,7 +105,7 @@ void RenX_ExtraLoggingPlugin::RenX_OnRaw(RenX::Server &server, const Jupiter::Re
if (RenX_ExtraLoggingPlugin::file != nullptr) { if (RenX_ExtraLoggingPlugin::file != nullptr) {
if (!RenX_ExtraLoggingPlugin::filePrefix.empty()) { if (!RenX_ExtraLoggingPlugin::filePrefix.empty()) {
Jupiter::StringS fPrefix = RenX_ExtraLoggingPlugin::filePrefix; std::string fPrefix = RenX_ExtraLoggingPlugin::filePrefix;
RenX::processTags(fPrefix, &server); RenX::processTags(fPrefix, &server);
fwrite(fPrefix.data(), sizeof(char), fPrefix.size(), file); fwrite(fPrefix.data(), sizeof(char), fPrefix.size(), file);
fputc(' ', RenX_ExtraLoggingPlugin::file); fputc(' ', RenX_ExtraLoggingPlugin::file);

6
src/Plugins/RenX/RenX.ExtraLogging/RenX_ExtraLogging.h

@ -38,9 +38,9 @@ public: // RenX_ExtraLoggingPlugin
~RenX_ExtraLoggingPlugin(); ~RenX_ExtraLoggingPlugin();
private: private:
Jupiter::StringS filePrefix; std::string filePrefix;
Jupiter::StringS consolePrefix; std::string consolePrefix;
Jupiter::StringS newDayFmt; std::string newDayFmt;
bool printToConsole; bool printToConsole;
FILE *file; FILE *file;

2
src/Plugins/RenX/RenX.Greetings/RenX_Greetings.cpp

@ -27,7 +27,7 @@ using namespace std::literals;
void RenX_GreetingsPlugin::RenX_OnJoin(RenX::Server &server, const RenX::PlayerInfo &player) { void RenX_GreetingsPlugin::RenX_OnJoin(RenX::Server &server, const RenX::PlayerInfo &player) {
auto sendMessage = [&](const std::string& raw_message) { auto sendMessage = [&](const std::string& raw_message) {
Jupiter::String msg = raw_message; std::string msg = raw_message;
RenX::sanitizeTags(msg); RenX::sanitizeTags(msg);
RenX::processTags(msg, &server, &player); RenX::processTags(msg, &server, &player);

3
src/Plugins/RenX/RenX.HybridUUID/RenX_HybridUUID.cpp

@ -24,12 +24,13 @@
#include "RenX_HybridUUID.h" #include "RenX_HybridUUID.h"
using namespace Jupiter::literals; using namespace Jupiter::literals;
using namespace std::literals;
Jupiter::StringS calc_uuid(RenX::PlayerInfo &player) Jupiter::StringS calc_uuid(RenX::PlayerInfo &player)
{ {
if (player.steamid != 0U) if (player.steamid != 0U)
return Jupiter::StringS::Format("S%.16llX", player.steamid); return Jupiter::StringS::Format("S%.16llX", player.steamid);
return "N"_jrs + player.name; return "N"s + player.name;
} }
RenX_HybridUUIDPlugin::RenX_HybridUUIDPlugin() RenX_HybridUUIDPlugin::RenX_HybridUUIDPlugin()

108
src/Plugins/RenX/RenX.Ladder.Web/RenX_Ladder_Web.cpp

@ -266,10 +266,11 @@ Jupiter::String RenX_Ladder_WebPlugin::generate_entry_table(RenX::LadderDatabase
} }
// append rows // append rows
Jupiter::String row(256); std::string row;
row.reserve(256);
while (count != 0) { while (count != 0) {
row = RenX_Ladder_WebPlugin::entry_table_row; row = RenX_Ladder_WebPlugin::entry_table_row;
row.replace(RenX::tags->INTERNAL_OBJECT_TAG, db->getName()); RenX::replace_tag(row, RenX::tags->INTERNAL_OBJECT_TAG, db->getName());
RenX::processTags(row, *node); RenX::processTags(row, *node);
result += row; result += row;
node = node->next; node = node->next;
@ -286,22 +287,23 @@ Jupiter::String RenX_Ladder_WebPlugin::generate_entry_table(RenX::LadderDatabase
return result; return result;
} }
Jupiter::String *RenX_Ladder_WebPlugin::generate_ladder_page(RenX::LadderDatabase *db, uint8_t format, size_t index, size_t count, const Jupiter::HTTP::HTMLFormResponse& query_params) { std::string* RenX_Ladder_WebPlugin::generate_ladder_page(RenX::LadderDatabase *db, uint8_t format, size_t index, size_t count, const Jupiter::HTTP::HTMLFormResponse& query_params) {
Jupiter::String *result = new Jupiter::String(2048); std::string* result = new std::string();
result->reserve(2048);
if ((format & this->FLAG_INCLUDE_PAGE_HEADER) != 0) // Header if ((format & this->FLAG_INCLUDE_PAGE_HEADER) != 0) // Header
result->concat(RenX_Ladder_WebPlugin::header); result->append(RenX_Ladder_WebPlugin::header);
if ((format & this->FLAG_INCLUDE_SEARCH) != 0) // Search if ((format & this->FLAG_INCLUDE_SEARCH) != 0) // Search
result->concat(generate_search(db)); result->append(generate_search(db));
if ((format & this->FLAG_INCLUDE_SELECTOR) != 0) // Selector if ((format & this->FLAG_INCLUDE_SELECTOR) != 0) // Selector
result->concat(generate_database_selector(db, query_params)); result->append(generate_database_selector(db, query_params));
result->concat(this->generate_entry_table(db, format, index, count)); result->append(this->generate_entry_table(db, format, index, count));
if ((format & this->FLAG_INCLUDE_PAGE_FOOTER) != 0) // Footer if ((format & this->FLAG_INCLUDE_PAGE_FOOTER) != 0) // Footer
result->concat(RenX_Ladder_WebPlugin::footer); result->append(RenX_Ladder_WebPlugin::footer);
return result; return result;
} }
@ -310,70 +312,73 @@ Jupiter::String *RenX_Ladder_WebPlugin::generate_ladder_page(RenX::LadderDatabas
// include_header | include_footer | include_any_headers | include_any_footers // include_header | include_footer | include_any_headers | include_any_footers
/** Search page */ /** Search page */
Jupiter::String *RenX_Ladder_WebPlugin::generate_search_page(RenX::LadderDatabase *db, uint8_t format, size_t start_index, size_t count, std::string_view name, const Jupiter::HTTP::HTMLFormResponse& query_params) { std::string* RenX_Ladder_WebPlugin::generate_search_page(RenX::LadderDatabase *db, uint8_t format, size_t start_index, size_t count, std::string_view name, const Jupiter::HTTP::HTMLFormResponse& query_params) {
Jupiter::String *result = new Jupiter::String(2048); std::string* result = new std::string();
result->reserve(2048);
if ((format & this->FLAG_INCLUDE_PAGE_HEADER) != 0) // Header if ((format & this->FLAG_INCLUDE_PAGE_HEADER) != 0) // Header
result->concat(RenX_Ladder_WebPlugin::header); result->append(RenX_Ladder_WebPlugin::header);
if ((format & this->FLAG_INCLUDE_SEARCH) != 0) // Search if ((format & this->FLAG_INCLUDE_SEARCH) != 0) // Search
result->concat(generate_search(db)); result->append(generate_search(db));
if ((format & this->FLAG_INCLUDE_SELECTOR) != 0) // Selector if ((format & this->FLAG_INCLUDE_SELECTOR) != 0) // Selector
result->concat(generate_database_selector(db, query_params)); result->append(generate_database_selector(db, query_params));
if (db->getEntries() == 0) { // No ladder data if (db->getEntries() == 0) { // No ladder data
result->concat("Error: No ladder data"_jrs); result->append("Error: No ladder data"_jrs);
if ((format & this->FLAG_INCLUDE_PAGE_FOOTER) != 0) // Footer if ((format & this->FLAG_INCLUDE_PAGE_FOOTER) != 0) // Footer
result->concat(RenX_Ladder_WebPlugin::footer); result->append(RenX_Ladder_WebPlugin::footer);
return result; return result;
} }
if ((format & this->FLAG_INCLUDE_DATA_HEADER) != 0) // Data header if ((format & this->FLAG_INCLUDE_DATA_HEADER) != 0) // Data header
result->concat(RenX_Ladder_WebPlugin::ladder_table_header); result->append(RenX_Ladder_WebPlugin::ladder_table_header);
// append rows // append rows
Jupiter::String row(256); std::string row;
row.reserve(256);
RenX::LadderDatabase::Entry *node = db->getHead(); RenX::LadderDatabase::Entry *node = db->getHead();
while (node != nullptr) { while (node != nullptr) {
if (jessilib::findi(node->most_recent_name, name) != std::string::npos) { // match found if (jessilib::findi(node->most_recent_name, name) != std::string::npos) { // match found
row = RenX_Ladder_WebPlugin::entry_table_row; row = RenX_Ladder_WebPlugin::entry_table_row;
row.replace(RenX::tags->INTERNAL_OBJECT_TAG, db->getName()); RenX::replace_tag(row, RenX::tags->INTERNAL_OBJECT_TAG, db->getName());
RenX::processTags(row, *node); RenX::processTags(row, *node);
result->concat(row); result->append(row);
} }
node = node->next; node = node->next;
} }
if ((format & this->FLAG_INCLUDE_DATA_FOOTER) != 0) // Data footer if ((format & this->FLAG_INCLUDE_DATA_FOOTER) != 0) // Data footer
result->concat(RenX_Ladder_WebPlugin::ladder_table_footer); result->append(RenX_Ladder_WebPlugin::ladder_table_footer);
if ((format & this->FLAG_INCLUDE_PAGE_FOOTER) != 0) // Footer if ((format & this->FLAG_INCLUDE_PAGE_FOOTER) != 0) // Footer
result->concat(RenX_Ladder_WebPlugin::footer); result->append(RenX_Ladder_WebPlugin::footer);
return result; return result;
} }
/** Profile page */ /** Profile page */
Jupiter::String *RenX_Ladder_WebPlugin::generate_profile_page(RenX::LadderDatabase *db, uint8_t format, uint64_t steam_id, const Jupiter::HTTP::HTMLFormResponse& query_params) { std::string* RenX_Ladder_WebPlugin::generate_profile_page(RenX::LadderDatabase *db, uint8_t format, uint64_t steam_id, const Jupiter::HTTP::HTMLFormResponse& query_params) {
Jupiter::String *result = new Jupiter::String(2048); std::string* result = new std::string();
result->reserve(2048);
if ((format & this->FLAG_INCLUDE_PAGE_HEADER) != 0) if ((format & this->FLAG_INCLUDE_PAGE_HEADER) != 0)
result->concat(RenX_Ladder_WebPlugin::header); result->append(RenX_Ladder_WebPlugin::header);
if ((format & this->FLAG_INCLUDE_SEARCH) != 0) // Search if ((format & this->FLAG_INCLUDE_SEARCH) != 0) // Search
result->concat(generate_search(db)); result->append(generate_search(db));
if ((format & this->FLAG_INCLUDE_SELECTOR) != 0) // Selector if ((format & this->FLAG_INCLUDE_SELECTOR) != 0) // Selector
result->concat(generate_database_selector(db, query_params)); result->append(generate_database_selector(db, query_params));
if (db->getEntries() == 0) { // No ladder data if (db->getEntries() == 0) { // No ladder data
result->concat("Error: No ladder data"_jrs); result->append("Error: No ladder data"_jrs);
if ((format & this->FLAG_INCLUDE_PAGE_FOOTER) != 0) // Footer if ((format & this->FLAG_INCLUDE_PAGE_FOOTER) != 0) // Footer
result->concat(RenX_Ladder_WebPlugin::footer); result->append(RenX_Ladder_WebPlugin::footer);
return result; return result;
} }
@ -386,56 +391,56 @@ Jupiter::String *RenX_Ladder_WebPlugin::generate_profile_page(RenX::LadderDataba
} }
if (entry == nullptr) { if (entry == nullptr) {
result->concat("Error: Player not found"_jrs); result->append("Error: Player not found"_jrs);
} }
else { else {
Jupiter::String profile_data(RenX_Ladder_WebPlugin::entry_profile); std::string profile_data(RenX_Ladder_WebPlugin::entry_profile);
RenX::processTags(profile_data, *entry); RenX::processTags(profile_data, *entry);
result->concat(profile_data); result->append(profile_data);
result->concat("<div class=\"profile-navigation\">"_jrs); result->append("<div class=\"profile-navigation\">"_jrs);
if (entry->prev != nullptr) if (entry->prev != nullptr)
{ {
profile_data = RenX_Ladder_WebPlugin::entry_profile_previous; profile_data = RenX_Ladder_WebPlugin::entry_profile_previous;
profile_data.replace(RenX::tags->INTERNAL_OBJECT_TAG, db->getName()); RenX::replace_tag(profile_data, RenX::tags->INTERNAL_OBJECT_TAG, db->getName());
profile_data.replace(RenX::tags->INTERNAL_WEAPON_TAG, Jupiter::StringS::Format("%llu", entry->prev->steam_id)); RenX::replace_tag(profile_data, RenX::tags->INTERNAL_WEAPON_TAG, Jupiter::StringS::Format("%llu", entry->prev->steam_id));
RenX::processTags(profile_data, *entry->prev); RenX::processTags(profile_data, *entry->prev);
result->concat(profile_data); result->append(profile_data);
} }
if (entry->next != nullptr) if (entry->next != nullptr)
{ {
profile_data = RenX_Ladder_WebPlugin::entry_profile_next; profile_data = RenX_Ladder_WebPlugin::entry_profile_next;
profile_data.replace(RenX::tags->INTERNAL_OBJECT_TAG, db->getName()); RenX::replace_tag(profile_data, RenX::tags->INTERNAL_OBJECT_TAG, db->getName());
profile_data.replace(RenX::tags->INTERNAL_VICTIM_STEAM_TAG, Jupiter::StringS::Format("%llu", entry->next->steam_id)); RenX::replace_tag(profile_data, RenX::tags->INTERNAL_VICTIM_STEAM_TAG, Jupiter::StringS::Format("%llu", entry->next->steam_id));
RenX::processTags(profile_data, *entry->next); RenX::processTags(profile_data, *entry->next);
result->concat(profile_data); result->append(profile_data);
} }
result->concat("</div>"_jrs); result->append("</div>"_jrs);
} }
if ((format & this->FLAG_INCLUDE_PAGE_FOOTER) != 0) // Footer if ((format & this->FLAG_INCLUDE_PAGE_FOOTER) != 0) // Footer
result->concat(RenX_Ladder_WebPlugin::footer); result->append(RenX_Ladder_WebPlugin::footer);
return result; return result;
} }
/** Content functions */ /** Content functions */
Jupiter::ReadableString *generate_no_db_page(const Jupiter::HTTP::HTMLFormResponse& query_params) { std::string* generate_no_db_page(const Jupiter::HTTP::HTMLFormResponse& query_params) {
Jupiter::String *result = new Jupiter::String(pluginInstance.header); std::string* result = new std::string(pluginInstance.header);
if (RenX::ladder_databases.size() != 0) { if (RenX::ladder_databases.size() != 0) {
result->concat(generate_search(nullptr)); result->append(generate_search(nullptr));
result->concat(generate_database_selector(nullptr, query_params)); result->append(generate_database_selector(nullptr, query_params));
result->concat("Error: No such database exists"_jrs); result->append("Error: No such database exists"_jrs);
} }
else { else {
result->concat("Error: No ladder databases loaded"_jrs); result->append("Error: No ladder databases loaded"_jrs);
} }
result->concat(pluginInstance.footer); result->append(pluginInstance.footer);
return result; return result;
} }
Jupiter::ReadableString *handle_ladder_page(std::string_view query_string) { std::string* handle_ladder_page(std::string_view query_string) {
Jupiter::HTTP::HTMLFormResponse html_form_response(query_string); Jupiter::HTTP::HTMLFormResponse html_form_response(query_string);
RenX::LadderDatabase *db = RenX::default_ladder_database; RenX::LadderDatabase *db = RenX::default_ladder_database;
size_t start_index = 0, count = pluginInstance.getEntriesPerPage(); size_t start_index = 0, count = pluginInstance.getEntriesPerPage();
@ -464,7 +469,7 @@ Jupiter::ReadableString *handle_ladder_page(std::string_view query_string) {
return pluginInstance.generate_ladder_page(db, format, start_index, count, html_form_response); return pluginInstance.generate_ladder_page(db, format, start_index, count, html_form_response);
} }
Jupiter::ReadableString *handle_search_page(std::string_view query_string) { std::string* handle_search_page(std::string_view query_string) {
Jupiter::HTTP::HTMLFormResponse html_form_response(query_string); Jupiter::HTTP::HTMLFormResponse html_form_response(query_string);
RenX::LadderDatabase *db = RenX::default_ladder_database; RenX::LadderDatabase *db = RenX::default_ladder_database;
uint8_t format = 0xFF; uint8_t format = 0xFF;
@ -498,8 +503,7 @@ Jupiter::ReadableString *handle_search_page(std::string_view query_string) {
return pluginInstance.generate_search_page(db, format, start_index, count, name, html_form_response); return pluginInstance.generate_search_page(db, format, start_index, count, name, html_form_response);
} }
Jupiter::ReadableString *handle_profile_page(std::string_view query_string) std::string* handle_profile_page(std::string_view query_string) {
{
Jupiter::HTTP::HTMLFormResponse html_form_response(query_string); Jupiter::HTTP::HTMLFormResponse html_form_response(query_string);
RenX::LadderDatabase *db = RenX::default_ladder_database; RenX::LadderDatabase *db = RenX::default_ladder_database;
uint64_t steam_id = 0; uint64_t steam_id = 0;

14
src/Plugins/RenX/RenX.Ladder.Web/RenX_Ladder_Web.h

@ -39,9 +39,9 @@ public:
Jupiter::StringS header; Jupiter::StringS header;
Jupiter::StringS footer; Jupiter::StringS footer;
Jupiter::String *generate_ladder_page(RenX::LadderDatabase *db, uint8_t format, size_t start_index, size_t count, const Jupiter::HTTP::HTMLFormResponse& query_params); std::string* generate_ladder_page(RenX::LadderDatabase *db, uint8_t format, size_t start_index, size_t count, const Jupiter::HTTP::HTMLFormResponse& query_params);
Jupiter::String *generate_search_page(RenX::LadderDatabase *db, uint8_t format, size_t start_index, size_t count, std::string_view name, const Jupiter::HTTP::HTMLFormResponse& query_params); std::string* generate_search_page(RenX::LadderDatabase *db, uint8_t format, size_t start_index, size_t count, std::string_view name, const Jupiter::HTTP::HTMLFormResponse& query_params);
Jupiter::String *generate_profile_page(RenX::LadderDatabase *db, uint8_t format, uint64_t steam_id, const Jupiter::HTTP::HTMLFormResponse& query_params); std::string* generate_profile_page(RenX::LadderDatabase *db, uint8_t format, uint64_t steam_id, const Jupiter::HTTP::HTMLFormResponse& query_params);
inline size_t getEntriesPerPage() const { return this->entries_per_page; } inline size_t getEntriesPerPage() const { return this->entries_per_page; }
inline size_t getMinSearchNameLength() const { return this->min_search_name_length; }; inline size_t getMinSearchNameLength() const { return this->min_search_name_length; };
@ -66,11 +66,11 @@ private:
std::string web_ladder_table_header_filename; std::string web_ladder_table_header_filename;
std::string web_ladder_table_footer_filename; std::string web_ladder_table_footer_filename;
Jupiter::StringS entry_table_row, entry_profile, entry_profile_previous, entry_profile_next; std::string entry_table_row, entry_profile, entry_profile_previous, entry_profile_next;
}; };
Jupiter::ReadableString *handle_ladder_page(std::string_view query_string); std::string* handle_ladder_page(std::string_view query_string);
Jupiter::ReadableString *handle_search_page(std::string_view query_string); std::string* handle_search_page(std::string_view query_string);
Jupiter::ReadableString *handle_profile_page(std::string_view query_string); std::string* handle_profile_page(std::string_view query_string);
#endif // _RENX_LADDER_WEB_H #endif // _RENX_LADDER_WEB_H

562
src/Plugins/RenX/RenX.Logging/RenX_Logging.cpp

File diff suppressed because it is too large

210
src/Plugins/RenX/RenX.Logging/RenX_Logging.h

@ -224,111 +224,111 @@ private:
unsigned int otherPublic : 1; unsigned int otherPublic : 1;
/** Event formats */ /** Event formats */
Jupiter::StringS playerRDNSFmt; std::string playerRDNSFmt;
Jupiter::StringS playerIdentifyFmt; std::string playerIdentifyFmt;
Jupiter::StringS joinPublicFmt, joinAdminFmt, joinNoSteamAdminFmt; std::string joinPublicFmt, joinAdminFmt, joinNoSteamAdminFmt;
Jupiter::StringS partFmt; std::string partFmt;
Jupiter::StringS kickFmt; std::string kickFmt;
Jupiter::StringS nameChangeFmt; std::string nameChangeFmt;
Jupiter::StringS teamChangeFmt; std::string teamChangeFmt;
Jupiter::StringS speedHackFmt; std::string speedHackFmt;
Jupiter::StringS playerFmt; std::string playerFmt;
Jupiter::StringS chatFmt; std::string chatFmt;
Jupiter::StringS teamChatFmt; std::string teamChatFmt;
Jupiter::StringS radioChatFmt; std::string radioChatFmt;
Jupiter::StringS hostChatFmt; std::string hostChatFmt;
Jupiter::StringS hostPageFmt; std::string hostPageFmt;
Jupiter::StringS adminMsgFmt; std::string adminMsgFmt;
Jupiter::StringS warnMsgFmt; std::string warnMsgFmt;
Jupiter::StringS pAdminMsgFmt; std::string pAdminMsgFmt;
Jupiter::StringS pWarnMsgFmt; std::string pWarnMsgFmt;
Jupiter::StringS otherChatFmt; std::string otherChatFmt;
Jupiter::StringS deployFmt; std::string deployFmt;
Jupiter::StringS mineDeployFmt; std::string mineDeployFmt;
Jupiter::StringS overMineFmt; std::string overMineFmt;
Jupiter::StringS disarmFmt; std::string disarmFmt;
Jupiter::StringS mineDisarmFmt; std::string mineDisarmFmt;
Jupiter::StringS disarmNoOwnerFmt; std::string disarmNoOwnerFmt;
Jupiter::StringS mineDisarmNoOwnerFmt; std::string mineDisarmNoOwnerFmt;
Jupiter::StringS explodeFmt; std::string explodeFmt;
Jupiter::StringS explodeNoOwnerFmt; std::string explodeNoOwnerFmt;
Jupiter::StringS suicideFmt; std::string suicideFmt;
Jupiter::StringS dieFmt; std::string dieFmt;
Jupiter::StringS dieFmt2; std::string dieFmt2;
Jupiter::StringS killFmt; std::string killFmt;
Jupiter::StringS killFmt2; std::string killFmt2;
Jupiter::StringS destroyBuildingFmt; std::string destroyBuildingFmt;
Jupiter::StringS destroyBuildingFmt2; std::string destroyBuildingFmt2;
Jupiter::StringS destroyDefenceFmt; std::string destroyDefenceFmt;
Jupiter::StringS destroyDefenceFmt2; std::string destroyDefenceFmt2;
Jupiter::StringS destroyVehicleFmt; std::string destroyVehicleFmt;
Jupiter::StringS destroyVehicleFmt2; std::string destroyVehicleFmt2;
Jupiter::StringS captureFmt; std::string captureFmt;
Jupiter::StringS neutralizeFmt; std::string neutralizeFmt;
Jupiter::StringS characterPurchaseFmt; std::string characterPurchaseFmt;
Jupiter::StringS itemPurchaseFmt; std::string itemPurchaseFmt;
Jupiter::StringS weaponPurchaseFmt; std::string weaponPurchaseFmt;
Jupiter::StringS refillPurchaseFmt; std::string refillPurchaseFmt;
Jupiter::StringS vehiclePurchaseFmt; std::string vehiclePurchaseFmt;
Jupiter::StringS vehicleSpawnFmt; std::string vehicleSpawnFmt;
Jupiter::StringS spawnFmt; std::string spawnFmt;
Jupiter::StringS botJoinFmt; std::string botJoinFmt;
Jupiter::StringS vehicleCrateFmt; std::string vehicleCrateFmt;
Jupiter::StringS TSVehicleCrateFmt; std::string TSVehicleCrateFmt;
Jupiter::StringS RAVehicleCrateFmt; std::string RAVehicleCrateFmt;
Jupiter::StringS deathCrateFmt; std::string deathCrateFmt;
Jupiter::StringS moneyCrateFmt; std::string moneyCrateFmt;
Jupiter::StringS characterCrateFmt; std::string characterCrateFmt;
Jupiter::StringS spyCrateFmt; std::string spyCrateFmt;
Jupiter::StringS refillCrateFmt; std::string refillCrateFmt;
Jupiter::StringS timeBombCrateFmt; std::string timeBombCrateFmt;
Jupiter::StringS speedCrateFmt; std::string speedCrateFmt;
Jupiter::StringS nukeCrateFmt; std::string nukeCrateFmt;
Jupiter::StringS abductionCrateFmt; std::string abductionCrateFmt;
Jupiter::StringS unspecifiedCrateFmt; std::string unspecifiedCrateFmt;
Jupiter::StringS otherCrateFmt; std::string otherCrateFmt;
Jupiter::StringS stealFmt; std::string stealFmt;
Jupiter::StringS stealNoOwnerFmt; std::string stealNoOwnerFmt;
Jupiter::StringS donateFmt; std::string donateFmt;
Jupiter::StringS gameOverFmt; std::string gameOverFmt;
Jupiter::StringS gameOverTieFmt; std::string gameOverTieFmt;
Jupiter::StringS gameOverTieNoWinFmt; std::string gameOverTieNoWinFmt;
Jupiter::StringS gameOverScoreFmt; std::string gameOverScoreFmt;
Jupiter::StringS gameFmt; std::string gameFmt;
Jupiter::StringS executeFmt, playerExecuteFmt, devBotExecuteFmt; std::string executeFmt, playerExecuteFmt, devBotExecuteFmt;
Jupiter::StringS playerCommandSuccessFmt, playerCommandFailFmt; std::string playerCommandSuccessFmt, playerCommandFailFmt;
Jupiter::StringS subscribeFmt; std::string subscribeFmt;
Jupiter::StringS rconFmt; std::string rconFmt;
Jupiter::StringS adminLoginFmt; std::string adminLoginFmt;
Jupiter::StringS adminGrantFmt; std::string adminGrantFmt;
Jupiter::StringS adminLogoutFmt; std::string adminLogoutFmt;
Jupiter::StringS adminFmt; std::string adminFmt;
Jupiter::StringS voteAddBotsFmt; std::string voteAddBotsFmt;
Jupiter::StringS voteChangeMapFmt; std::string voteChangeMapFmt;
Jupiter::StringS voteKickFmt; std::string voteKickFmt;
Jupiter::StringS voteMineBanFmt; std::string voteMineBanFmt;
Jupiter::StringS voteRemoveBotsFmt; std::string voteRemoveBotsFmt;
Jupiter::StringS voteRestartMapFmt; std::string voteRestartMapFmt;
Jupiter::StringS voteSurrenderFmt; std::string voteSurrenderFmt;
Jupiter::StringS voteSurveyFmt; std::string voteSurveyFmt;
Jupiter::StringS voteOtherFmt; std::string voteOtherFmt;
Jupiter::StringS voteOverSuccessFmt; std::string voteOverSuccessFmt;
Jupiter::StringS voteOverFailFmt; std::string voteOverFailFmt;
Jupiter::StringS voteCancelFmt; std::string voteCancelFmt;
Jupiter::StringS voteFmt; std::string voteFmt;
Jupiter::StringS mapChangeFmt; std::string mapChangeFmt;
Jupiter::StringS mapLoadFmt; std::string mapLoadFmt;
Jupiter::StringS mapStartFmt; std::string mapStartFmt;
Jupiter::StringS mapFmt; std::string mapFmt;
Jupiter::StringS demoRecordFmt, rconDemoRecordFmt; std::string demoRecordFmt, rconDemoRecordFmt;
Jupiter::StringS demoRecordStopFmt; std::string demoRecordStopFmt;
Jupiter::StringS demoFmt; std::string demoFmt;
Jupiter::StringS logFmt; std::string logFmt;
Jupiter::StringS commandFmt; std::string commandFmt;
Jupiter::StringS errorFmt; std::string errorFmt;
Jupiter::StringS versionFmt; std::string versionFmt;
Jupiter::StringS authorizedFmt; std::string authorizedFmt;
Jupiter::StringS otherFmt; std::string otherFmt;
}; };
#endif // _RENX_LOGGING_H_HEADER #endif // _RENX_LOGGING_H_HEADER

18
src/Plugins/RenX/RenX.Medals/RenX_Medals.cpp

@ -96,20 +96,20 @@ void congratPlayer(unsigned int, void *params)
delete congratPlayerData; delete congratPlayerData;
} }
void RenX_MedalsPlugin::RenX_SanitizeTags(Jupiter::StringType &fmt) { void RenX_MedalsPlugin::RenX_SanitizeTags(std::string& fmt) {
fmt.replace(RenX_MedalsPlugin::recsTag, this->INTERNAL_RECS_TAG); RenX::replace_tag(fmt, RenX_MedalsPlugin::recsTag, this->INTERNAL_RECS_TAG);
fmt.replace(RenX_MedalsPlugin::noobTag, this->INTERNAL_NOOB_TAG); RenX::replace_tag(fmt, RenX_MedalsPlugin::noobTag, this->INTERNAL_NOOB_TAG);
fmt.replace(RenX_MedalsPlugin::worthTag, this->INTERNAL_WORTH_TAG); RenX::replace_tag(fmt, RenX_MedalsPlugin::worthTag, this->INTERNAL_WORTH_TAG);
} }
void RenX_MedalsPlugin::RenX_ProcessTags(Jupiter::StringType &msg, const RenX::Server *server, const RenX::PlayerInfo *player, const RenX::PlayerInfo *, const RenX::BuildingInfo *) { void RenX_MedalsPlugin::RenX_ProcessTags(std::string& msg, const RenX::Server *server, const RenX::PlayerInfo *player, const RenX::PlayerInfo *, const RenX::BuildingInfo *) {
if (player != nullptr) { if (player != nullptr) {
const Jupiter::ReadableString &recs = RenX_MedalsPlugin::medalsFile.get(player->uuid, "Recs"_jrs); const Jupiter::ReadableString &recs = RenX_MedalsPlugin::medalsFile.get(player->uuid, "Recs"_jrs);
const Jupiter::ReadableString &noobs = RenX_MedalsPlugin::medalsFile.get(player->uuid, "Noobs"_jrs); const Jupiter::ReadableString &noobs = RenX_MedalsPlugin::medalsFile.get(player->uuid, "Noobs"_jrs);
msg.replace(this->INTERNAL_RECS_TAG, recs); RenX::replace_tag(msg, this->INTERNAL_RECS_TAG, recs);
msg.replace(this->INTERNAL_NOOB_TAG, noobs); RenX::replace_tag(msg, this->INTERNAL_NOOB_TAG, noobs);
msg.replace(this->INTERNAL_WORTH_TAG, Jupiter::StringS::Format("%d", Jupiter::from_string<int>(recs) - Jupiter::from_string<int>(noobs))); RenX::replace_tag(msg, this->INTERNAL_WORTH_TAG, Jupiter::StringS::Format("%d", Jupiter::from_string<int>(recs) - Jupiter::from_string<int>(noobs)));
} }
} }
@ -142,7 +142,7 @@ void RenX_MedalsPlugin::RenX_OnJoin(RenX::Server &server, const RenX::PlayerInfo
std::string_view msg = section->get(Jupiter::StringS::Format("%u", (rand() % table_size) + 1)); std::string_view msg = section->get(Jupiter::StringS::Format("%u", (rand() % table_size) + 1));
if (!msg.empty()) { if (!msg.empty()) {
Jupiter::StringS tagged_msg = static_cast<Jupiter::ReferenceString>(msg); std::string tagged_msg = static_cast<std::string>(msg);
RenX::sanitizeTags(tagged_msg); RenX::sanitizeTags(tagged_msg);
RenX::processTags(tagged_msg, &server, &player); RenX::processTags(tagged_msg, &server, &player);
server.sendMessage(tagged_msg); server.sendMessage(tagged_msg);

4
src/Plugins/RenX/RenX.Medals/RenX_Medals.h

@ -43,8 +43,8 @@ int getWorth(const RenX::PlayerInfo &player);
class RenX_MedalsPlugin : public RenX::Plugin class RenX_MedalsPlugin : public RenX::Plugin
{ {
public: // RenX::Plugin public: // RenX::Plugin
void RenX_SanitizeTags(Jupiter::StringType &fmt) override; void RenX_SanitizeTags(std::string& fmt) override;
void RenX_ProcessTags(Jupiter::StringType &msg, const RenX::Server *server, const RenX::PlayerInfo *player, const RenX::PlayerInfo *victim, const RenX::BuildingInfo *building) override; void RenX_ProcessTags(std::string& msg, const RenX::Server *server, const RenX::PlayerInfo *player, const RenX::PlayerInfo *victim, const RenX::BuildingInfo *building) override;
void RenX_OnPlayerCreate(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnPlayerCreate(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnPlayerDelete(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnPlayerDelete(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnJoin(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnJoin(RenX::Server &server, const RenX::PlayerInfo &player) override;

48
src/Plugins/RenX/RenX.ServerList/RenX_ServerList.cpp

@ -150,15 +150,15 @@ size_t RenX_ServerListPlugin::getListedPlayerCount(const RenX::Server& server) {
return std::min(server.activePlayers(false).size(), player_limit); return std::min(server.activePlayers(false).size(), player_limit);
} }
Jupiter::ReadableString *RenX_ServerListPlugin::getServerListJSON() { std::string* RenX_ServerListPlugin::getServerListJSON() {
return &m_server_list_json; return &m_server_list_json;
} }
Jupiter::ReadableString *RenX_ServerListPlugin::getMetadataJSON() { std::string* RenX_ServerListPlugin::getMetadataJSON() {
return &m_metadata_json; return &m_metadata_json;
} }
Jupiter::ReadableString *RenX_ServerListPlugin::getMetadataPrometheus() { std::string* RenX_ServerListPlugin::getMetadataPrometheus() {
return &m_metadata_prometheus; return &m_metadata_prometheus;
} }
@ -166,13 +166,13 @@ constexpr const char *json_bool_as_cstring(bool in) {
return in ? "true" : "false"; return in ? "true" : "false";
} }
Jupiter::StringS RenX_ServerListPlugin::server_as_json(const RenX::Server &server) { std::string RenX_ServerListPlugin::server_as_json(const RenX::Server &server) {
Jupiter::String server_json_block(128); Jupiter::String server_json_block(128); // TODO: use std::string
ListServerInfo serverInfo = getListServerInfo(server); ListServerInfo serverInfo = getListServerInfo(server);
if (serverInfo.hostname.empty()) { if (serverInfo.hostname.empty()) {
server_json_block = "null"; server_json_block = "null";
return server_json_block; return static_cast<std::string>(server_json_block);
} }
Jupiter::String server_name = jsonify(server.getName()); Jupiter::String server_name = jsonify(server.getName());
@ -184,7 +184,7 @@ Jupiter::StringS RenX_ServerListPlugin::server_as_json(const RenX::Server &serve
// Some members we only include if they're populated // Some members we only include if they're populated
if (!server_prefix.empty()) { if (!server_prefix.empty()) {
server_prefix = R"json("NamePrefix":")json"_jrs + server_prefix + "\","_jrs; server_prefix = R"json("NamePrefix":")json"s + server_prefix + "\","_jrs;
} }
std::string server_attributes; std::string server_attributes;
@ -230,7 +230,7 @@ Jupiter::StringS RenX_ServerListPlugin::server_as_json(const RenX::Server &serve
server_json_block += '}'; server_json_block += '}';
return server_json_block; return static_cast<std::string>(server_json_block);
} }
std::string RenX_ServerListPlugin::server_as_server_details_json(const RenX::Server& server) { std::string RenX_ServerListPlugin::server_as_server_details_json(const RenX::Server& server) {
@ -315,8 +315,8 @@ std::string RenX_ServerListPlugin::server_as_server_details_json(const RenX::Ser
return server_json_block; return server_json_block;
} }
Jupiter::StringS RenX_ServerListPlugin::server_as_long_json(const RenX::Server &server) { std::string RenX_ServerListPlugin::server_as_long_json(const RenX::Server &server) {
Jupiter::String server_json_block(128); Jupiter::String server_json_block(128); // TODO: use std::string
ListServerInfo serverInfo = getListServerInfo(server); ListServerInfo serverInfo = getListServerInfo(server);
Jupiter::String server_name = jsonify(server.getName()); Jupiter::String server_name = jsonify(server.getName());
@ -456,7 +456,7 @@ Jupiter::StringS RenX_ServerListPlugin::server_as_long_json(const RenX::Server &
server_json_block += "\n\t}"_jrs; server_json_block += "\n\t}"_jrs;
return server_json_block; return static_cast<std::string>(server_json_block);
} }
void RenX_ServerListPlugin::addServerToServerList(RenX::Server &server) { void RenX_ServerListPlugin::addServerToServerList(RenX::Server &server) {
@ -468,7 +468,7 @@ void RenX_ServerListPlugin::addServerToServerList(RenX::Server &server) {
m_server_list_json = '['; m_server_list_json = '[';
} }
else { else {
m_server_list_json.truncate(1); // remove trailing ']'. m_server_list_json.pop_back(); // remove trailing ']'.
m_server_list_json += ','; m_server_list_json += ',';
} }
m_server_list_json += server_json_block; m_server_list_json += server_json_block;
@ -526,10 +526,11 @@ void RenX_ServerListPlugin::updateMetadata() {
} }
} }
m_metadata_json.format(R"json({"player_count":%zu,"server_count":%u})json", // TODO: not rely on StringS
m_metadata_json = Jupiter::StringS::Format(R"json({"player_count":%zu,"server_count":%u})json",
player_count, server_count); player_count, server_count);
m_metadata_prometheus.format("player_count %zu\nserver_count %u\n", m_metadata_prometheus = Jupiter::StringS::Format("player_count %zu\nserver_count %u\n",
player_count, server_count); player_count, server_count);
} }
@ -619,15 +620,16 @@ void RenX_ServerListPlugin::RenX_OnMapLoad(RenX::Server &server, const Jupiter::
// Plugin instantiation and entry point. // Plugin instantiation and entry point.
RenX_ServerListPlugin pluginInstance; RenX_ServerListPlugin pluginInstance;
Jupiter::ReadableString *handle_server_list_page(std::string_view) { std::string* handle_server_list_page(std::string_view) {
return pluginInstance.getServerListJSON(); return pluginInstance.getServerListJSON();
} }
Jupiter::ReadableString *handle_server_list_long_page(std::string_view) { std::string* handle_server_list_long_page(std::string_view) {
const auto& servers = RenX::getCore()->getServers(); const auto& servers = RenX::getCore()->getServers();
size_t index = 0; size_t index = 0;
RenX::Server *server; RenX::Server *server;
Jupiter::String *server_list_long_json = new Jupiter::String(256 * servers.size()); std::string *server_list_long_json = new std::string;
server_list_long_json->reserve(256 * servers.size());
// regenerate server_list_json // regenerate server_list_json
@ -657,7 +659,7 @@ Jupiter::ReadableString *handle_server_list_long_page(std::string_view) {
return server_list_long_json; return server_list_long_json;
} }
Jupiter::ReadableString *handle_server_page(std::string_view query_string) { std::string* handle_server_page(std::string_view query_string) {
Jupiter::HTTP::HTMLFormResponse html_form_response(query_string); Jupiter::HTTP::HTMLFormResponse html_form_response(query_string);
Jupiter::ReferenceString address; Jupiter::ReferenceString address;
int port = 0; int port = 0;
@ -666,7 +668,7 @@ Jupiter::ReadableString *handle_server_page(std::string_view query_string) {
// parse form data // parse form data
if (html_form_response.table.size() < 2) if (html_form_response.table.size() < 2)
return new Jupiter::ReferenceString(); return new std::string();
if (html_form_response.table.size() != 0) { if (html_form_response.table.size() != 0) {
address = html_form_response.tableGet("ip"sv, address); address = html_form_response.tableGet("ip"sv, address);
@ -679,7 +681,7 @@ Jupiter::ReadableString *handle_server_page(std::string_view query_string) {
while (true) { while (true) {
if (index == servers.size()) if (index == servers.size())
return new Jupiter::ReferenceString(); return new std::string();
server = servers[index]; server = servers[index];
if (address == pluginInstance.getListServerAddress(*server) && server->getPort() == port) if (address == pluginInstance.getListServerAddress(*server) && server->getPort() == port)
@ -690,14 +692,14 @@ Jupiter::ReadableString *handle_server_page(std::string_view query_string) {
// return server data // return server data
pluginInstance.touchDetails(*server); pluginInstance.touchDetails(*server);
return new Jupiter::ReferenceString(server->varData[pluginInstance.getName()].get("j"_jrs)); return new std::string(server->varData[pluginInstance.getName()].get("j"_jrs));
} }
Jupiter::ReadableString *handle_metadata_page(std::string_view) { std::string* handle_metadata_page(std::string_view) {
return pluginInstance.getMetadataJSON(); return pluginInstance.getMetadataJSON();
} }
Jupiter::ReadableString *handle_metadata_prometheus_page(std::string_view) { std::string* handle_metadata_prometheus_page(std::string_view) {
return pluginInstance.getMetadataPrometheus(); return pluginInstance.getMetadataPrometheus();
} }

22
src/Plugins/RenX/RenX.ServerList/RenX_ServerList.h

@ -35,9 +35,9 @@ public: // RenX_ServerListPlugin
size_t getListedPlayerCount(const RenX::Server& server); size_t getListedPlayerCount(const RenX::Server& server);
Jupiter::ReadableString *getServerListJSON(); std::string* getServerListJSON();
Jupiter::ReadableString* getMetadataJSON(); std::string* getMetadataJSON();
Jupiter::ReadableString* getMetadataPrometheus(); std::string* getMetadataPrometheus();
void addServerToServerList(RenX::Server &server); void addServerToServerList(RenX::Server &server);
void updateServerList(); void updateServerList();
@ -46,9 +46,9 @@ public: // RenX_ServerListPlugin
void touchDetails(RenX::Server& in_server); void touchDetails(RenX::Server& in_server);
std::string_view getListServerAddress(const RenX::Server& server); std::string_view getListServerAddress(const RenX::Server& server);
ListServerInfo getListServerInfo(const RenX::Server& server); ListServerInfo getListServerInfo(const RenX::Server& server);
Jupiter::StringS server_as_json(const RenX::Server &server); std::string server_as_json(const RenX::Server &server);
std::string server_as_server_details_json(const RenX::Server& server); std::string server_as_server_details_json(const RenX::Server& server);
Jupiter::StringS server_as_long_json(const RenX::Server &server); std::string server_as_long_json(const RenX::Server &server);
virtual bool initialize() override; virtual bool initialize() override;
~RenX_ServerListPlugin(); ~RenX_ServerListPlugin();
@ -61,15 +61,15 @@ public: // RenX::Plugin
void RenX_OnMapLoad(RenX::Server &server, const Jupiter::ReadableString &map) override; void RenX_OnMapLoad(RenX::Server &server, const Jupiter::ReadableString &map) override;
private: private:
Jupiter::StringS m_server_list_json, m_metadata_json, m_metadata_prometheus; std::string m_server_list_json, m_metadata_json, m_metadata_prometheus;
std::string m_web_hostname, m_web_path; std::string m_web_hostname, m_web_path;
std::string m_server_list_page_name, m_server_list_long_page_name, m_server_page_name, m_metadata_page_name, m_metadata_prometheus_page_name; std::string m_server_list_page_name, m_server_list_long_page_name, m_server_page_name, m_metadata_page_name, m_metadata_prometheus_page_name;
}; };
Jupiter::ReadableString *handle_server_list_page(std::string_view); std::string* handle_server_list_page(std::string_view);
Jupiter::ReadableString *handle_server_list_long_page(std::string_view); std::string* handle_server_list_long_page(std::string_view);
Jupiter::ReadableString *handle_server_page(std::string_view); std::string* handle_server_page(std::string_view);
Jupiter::ReadableString *handle_metadata_page(std::string_view); std::string* handle_metadata_page(std::string_view);
Jupiter::ReadableString *handle_metadata_prometheus_page(std::string_view); std::string* handle_metadata_prometheus_page(std::string_view);
#endif // _RENX_SERVERLIST_H_HEADER #endif // _RENX_SERVERLIST_H_HEADER

Loading…
Cancel
Save