Browse Source

Update submodule; fix code as necessary

master
Jessica James 3 years ago
parent
commit
ed94aea97b
  1. 2
      src/Jupiter
  2. 6
      src/Plugins/CoreCommands/CoreCommands.cpp
  3. 13
      src/Plugins/ExtraCommands/ExtraCommands.cpp
  4. 4
      src/Plugins/FunCommands/FunCommands.cpp
  5. 2
      src/Plugins/PluginManager/PluginManager.cpp
  6. 284
      src/Plugins/RenX/RenX.Commands/RenX_Commands.cpp
  7. 4
      src/Plugins/RenX/RenX.Core/RenX_Functions.cpp
  8. 2
      src/Plugins/RenX/RenX.Core/RenX_LadderDatabase.cpp
  9. 169
      src/Plugins/RenX/RenX.Core/RenX_Server.cpp
  10. 270
      src/Plugins/RenX/RenX.Core/RenX_Tags.cpp
  11. 4
      src/Plugins/RenX/RenX.ExtraLogging/RenX_ExtraLogging.cpp
  12. 2
      src/Plugins/RenX/RenX.HybridUUID/RenX_HybridUUID.cpp
  13. 8
      src/Plugins/RenX/RenX.Ladder.Web/RenX_Ladder_Web.cpp
  14. 2
      src/Plugins/RenX/RenX.Ladder/RenX_Ladder.cpp
  15. 224
      src/Plugins/RenX/RenX.Logging/RenX_Logging.cpp
  16. 20
      src/Plugins/RenX/RenX.Medals/RenX_Medals.cpp
  17. 2
      src/Plugins/RenX/RenX.MinPlayers/RenX_MinPlayers.cpp
  18. 35
      src/Plugins/RenX/RenX.ModSystem/RenX_ModSystem.cpp
  19. 34
      src/Plugins/RenX/RenX.ServerList/RenX_ServerList.cpp
  20. 10
      src/Plugins/RenX/RenX.SetJoin/RenX_SetJoin.cpp
  21. 32
      src/Plugins/RenX/RenX.Warn/RenX_Warn.cpp
  22. 6
      src/Plugins/SetJoin/SetJoin.cpp

2
src/Jupiter

@ -1 +1 @@
Subproject commit 0dea1de9e086ee86f31dd6f92a0f35bd46862f5c
Subproject commit eaff7f0548b782203f97623060cd30c1582275ad

6
src/Plugins/CoreCommands/CoreCommands.cpp

@ -77,7 +77,7 @@ void HelpIRCCommand::trigger(IRC_Bot *source, std::string_view in_channel, std::
if (cmds.size() != 0) {
Jupiter::StringL triggers = source->getTriggers(cmds);
if (triggers.size() >= 0) {
source->sendNotice(nick, Jupiter::StringS::Format("Access level %d commands: %.*s", i, triggers.size(),
source->sendNotice(nick, string_printf("Access level %d commands: %.*s", i, triggers.size(),
triggers.data()));
}
}
@ -144,9 +144,9 @@ Jupiter::GenericCommand::ResponseLine *RehashGenericCommand::trigger(std::string
size_t hash_errors = Jupiter::rehash();
if (hash_errors == 0)
return new Jupiter::GenericCommand::ResponseLine(Jupiter::StringS::Format("All %u objects were successfully rehashed.", Jupiter::getRehashableCount()), GenericCommand::DisplayType::PublicSuccess);
return new Jupiter::GenericCommand::ResponseLine(string_printf("All %u objects were successfully rehashed.", Jupiter::getRehashableCount()), GenericCommand::DisplayType::PublicSuccess);
return new Jupiter::GenericCommand::ResponseLine(Jupiter::StringS::Format("%u of %u objects failed to successfully rehash.", hash_errors, Jupiter::getRehashableCount()), GenericCommand::DisplayType::PublicError);
return new Jupiter::GenericCommand::ResponseLine(string_printf("%u of %u objects failed to successfully rehash.", hash_errors, Jupiter::getRehashableCount()), GenericCommand::DisplayType::PublicError);
}
std::string_view RehashGenericCommand::getHelp(std::string_view ) {

13
src/Plugins/ExtraCommands/ExtraCommands.cpp

@ -264,21 +264,22 @@ Jupiter::GenericCommand::ResponseLine *DebugInfoGenericCommand::trigger(std::str
Jupiter::GenericCommand::ResponseLine *ret = new Jupiter::GenericCommand::ResponseLine("Prefixes: "s += server->getPrefixes(), GenericCommand::DisplayType::PublicSuccess);
Jupiter::GenericCommand::ResponseLine *line = new Jupiter::GenericCommand::ResponseLine("Prefix Modes: "s += server->getPrefixModes(), GenericCommand::DisplayType::PublicSuccess);
ret->next = line;
line->next = new Jupiter::GenericCommand::ResponseLine(Jupiter::StringS::Format("Outputting data for %u channels...", server->getChannelCount()), GenericCommand::DisplayType::PublicSuccess);
line->next = new Jupiter::GenericCommand::ResponseLine(string_printf("Outputting data for %u channels...", server->getChannelCount()), GenericCommand::DisplayType::PublicSuccess);
line = line->next;
for (auto& channel_pair : server->getChannels()) {
auto& channel = channel_pair.second;
line->next = new Jupiter::GenericCommand::ResponseLine(Jupiter::StringS::Format("Channel %.*s - Type: %d", channel.getName().size(),
line->next = new Jupiter::GenericCommand::ResponseLine(string_printf("Channel %.*s - Type: %d", channel.getName().size(),
channel.getName().data(), channel.getType()), GenericCommand::DisplayType::PublicSuccess);
line = line->next;
for (auto& user_pair : channel.getUsers()) {
Jupiter::IRC::Client::User *user = user_pair.second->getUser();
line->next = new Jupiter::GenericCommand::ResponseLine(Jupiter::StringS::Format("User %.*s!%.*s@%.*s (prefix: %c) of channel %.*s (of %u shared)", user->getNickname().size(),
user->getNickname().data(), user->getUsername().size(),
user->getUsername().data(), user->getHostname().size(),
user->getHostname().data(), channel.getUserPrefix(*user_pair.second) ? channel.getUserPrefix(*user_pair.second) : ' ', channel.getName().size(),
line->next = new Jupiter::GenericCommand::ResponseLine(string_printf("User %.*s!%.*s@%.*s (prefix: %c) of channel %.*s (of %u shared)",
user->getNickname().size(), user->getNickname().data(),
user->getUsername().size(), user->getUsername().data(),
user->getHostname().size(), user->getHostname().data(),
channel.getUserPrefix(*user_pair.second) ? channel.getUserPrefix(*user_pair.second) : ' ', channel.getName().size(),
channel.getName().data(), user->getChannelCount()), GenericCommand::DisplayType::PublicSuccess);
line = line->next;
};

4
src/Plugins/FunCommands/FunCommands.cpp

@ -72,10 +72,10 @@ void EightBallIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std
msg.set("Good thing I bend that way!"_jrs);
break;
case 10:
msg.format("Hai %.*s ;)", nick.size(), nick.data());
msg = "Hai "s + nick + "!";
break;
case 11:
msg.format("Let's ban %.*s!", nick.size(), nick.data());
msg = "Let's ban "s + nick + "!";
break;
case 12:
msg.set("Fuck your lineage."_jrs);

2
src/Plugins/PluginManager/PluginManager.cpp

@ -38,7 +38,7 @@ Jupiter::GenericCommand::ResponseLine *PluginGenericCommand::trigger(std::string
auto parameters_view = static_cast<std::string_view>(parameters);
Jupiter::GenericCommand::ResponseLine *result = new Jupiter::GenericCommand::ResponseLine();
if (parameters_view.empty() || jessilib::starts_withi(parameters_view, "list"sv)) {
Jupiter::GenericCommand::ResponseLine *line = result->set(Jupiter::String::Format("There are %u plugins loaded:", Jupiter::plugins.size()), GenericCommand::DisplayType::PublicSuccess);
Jupiter::GenericCommand::ResponseLine *line = result->set(string_printf("There are %u plugins loaded:", Jupiter::plugins.size()), GenericCommand::DisplayType::PublicSuccess);
for (auto& plugin : Jupiter::plugins) {
line->next = new Jupiter::GenericCommand::ResponseLine(plugin->getName(), GenericCommand::DisplayType::PublicSuccess);
line = line->next;

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

@ -448,18 +448,14 @@ void PlayersIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::
{
if (server->players.size() == 0)
{
source->sendMessage(channel, Jupiter::StringS::Format("ERROR: NO PLAYERS BUT BOT_COUNT = %u.", server->getBotCount()));
source->sendMessage(channel, string_printf("ERROR: NO PLAYERS BUT BOT_COUNT = %u.", server->getBotCount()));
continue;
}
// End string containers
std::list<Jupiter::String *> gStrings;
std::list<Jupiter::String *> nStrings;
std::list<Jupiter::String *> oStrings;
Jupiter::StringL *gCurrent = nullptr;
Jupiter::StringL *nCurrent = nullptr;
Jupiter::StringL *oCurrent = nullptr;
std::list<std::string> gStrings;
std::list<std::string> nStrings;
std::list<std::string> oStrings;
// Team player counters
unsigned int gTotal = 0;
@ -471,110 +467,99 @@ void PlayersIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::
unsigned int nBots = 0;
unsigned int oBots = 0;
for (auto node = server->players.begin(); node != server->players.end(); ++node)
{
for (auto node = server->players.begin(); node != server->players.end(); ++node) {
Jupiter::String name = RenX::getFormattedPlayerName(*node);
if (name.size() > STRING_LENGTH - 32) continue; // Name will be too long to send.
switch (node->team)
{
switch (node->team) {
case RenX::TeamType::Nod:
if (nCurrent == nullptr || nCurrent->size() + name.size() > STRING_LENGTH)
{
nCurrent = new Jupiter::StringL(STRING_LENGTH);
nCurrent->format(IRCCOLOR "%.*s[%.*s]: " IRCBOLD "%.*s" IRCBOLD, nTeamColor.size(),
nTeamColor.data(), nTeam.size(),
nTeam.data(), name.size(), name.data());
nStrings.push_back(nCurrent);
if (nStrings.empty() || nStrings.back().size() + name.size() > STRING_LENGTH) {
nStrings.push_back(string_printf(IRCCOLOR "%.*s[%.*s]: " IRCBOLD "%.*s" IRCBOLD,
nTeamColor.size(), nTeamColor.data(),
nTeam.size(), nTeam.data(),
name.size(), name.data()));
}
else {
nStrings.back() += string_printf(IRCCOLOR ", " IRCBOLD "%.*s" IRCBOLD, name.size(), name.data());
}
++nTotal;
if (node->isBot) {
++nBots;
}
else nCurrent->aformat(IRCCOLOR ", " IRCBOLD "%.*s" IRCBOLD, name.size(), name.data());
nTotal++;
if (node->isBot)
nBots++;
break;
case RenX::TeamType::GDI:
if (gCurrent == nullptr || gCurrent->size() + name.size() > STRING_LENGTH)
if (gStrings.empty() || gStrings.back().size() + name.size() > STRING_LENGTH)
{
gCurrent = new Jupiter::StringL(STRING_LENGTH);
gCurrent->format(IRCCOLOR "%.*s[%.*s]: " IRCBOLD "%.*s" IRCBOLD, gTeamColor.size(),
gTeamColor.data(), gTeam.size(),
gTeam.data(), name.size(), name.data());
gStrings.push_back(gCurrent);
gStrings.push_back(string_printf(IRCCOLOR "%.*s[%.*s]: " IRCBOLD "%.*s" IRCBOLD,
gTeamColor.size(), gTeamColor.data(),
gTeam.size(), gTeam.data(),
name.size(), name.data()));
}
else {
gStrings.back() += string_printf(IRCCOLOR ", " IRCBOLD "%.*s" IRCBOLD, name.size(), name.data());
}
++gTotal;
if (node->isBot) {
++gBots;
}
else gCurrent->aformat(IRCCOLOR ", " IRCBOLD "%.*s" IRCBOLD, name.size(), name.data());
gTotal++;
if (node->isBot)
gBots++;
break;
default:
if (oCurrent == nullptr || oCurrent->size() + name.size() > STRING_LENGTH)
{
oCurrent = new Jupiter::StringL(STRING_LENGTH);
oCurrent->format(IRCCOLOR "%.*s[%.*s]: " IRCBOLD "%.*s" IRCBOLD, oTeamColor.size(),
oTeamColor.data(), oTeam.size(),
oTeam.data(), name.size(), name.data());
oStrings.push_back(oCurrent);
if (oStrings.empty() || oStrings.back().size() + name.size() > STRING_LENGTH) {
oStrings.push_back(string_printf(IRCCOLOR "%.*s[%.*s]: " IRCBOLD "%.*s" IRCBOLD,
oTeamColor.size(), oTeamColor.data(),
oTeam.size(), oTeam.data(),
name.size(), name.data()));
}
else {
oStrings.back() += string_printf(IRCCOLOR ", " IRCBOLD "%.*s" IRCBOLD, name.size(), name.data());
}
++oTotal;
if (node->isBot) {
++oBots;
}
else oCurrent->aformat(IRCCOLOR ", " IRCBOLD "%.*s" IRCBOLD, name.size(), name.data());
oTotal++;
if (node->isBot)
oBots++;
break;
}
}
Jupiter::StringL *outString;
while (gStrings.size() != 0)
{
outString = gStrings.front();
source->sendMessage(channel, *outString);
delete outString;
while (gStrings.size() != 0) {
source->sendMessage(channel, gStrings.front());
gStrings.pop_front();
}
while (nStrings.size() != 0)
{
outString = nStrings.front();
source->sendMessage(channel, *outString);
delete outString;
while (nStrings.size() != 0) {
source->sendMessage(channel, nStrings.front());
nStrings.pop_front();
}
while (oStrings.size() != 0)
{
outString = oStrings.front();
source->sendMessage(channel, *outString);
delete outString;
while (oStrings.size() != 0) {
source->sendMessage(channel, oStrings.front());
oStrings.pop_front();
}
Jupiter::StringL out;
out.format(IRCCOLOR "03Total Players" IRCCOLOR ": %u", server->players.size());
if (gBots + nBots + oBots > 0)
out.aformat(" (%u bots)", gBots + nBots + oBots);
if (gTotal > 0)
{
out.aformat(IRCCOLOR "02 | " IRCCOLOR "%.*s%.*s" IRCCOLOR ": %u", gTeamColor.size(),
std::string out = string_printf(IRCCOLOR "03Total Players" IRCCOLOR ": %u", server->players.size());
if (gBots + nBots + oBots > 0) {
out += string_printf(" (%u bots)", gBots + nBots + oBots);
}
if (gTotal > 0) {
out += string_printf(IRCCOLOR "02 | " IRCCOLOR "%.*s%.*s" IRCCOLOR ": %u", gTeamColor.size(),
gTeamColor.data(), gTeam.size(),
gTeam.data(), gTotal);
if (gBots > 0)
out.aformat(" (%u bots)", gBots);
out += string_printf(" (%u bots)", gBots);
}
if (nTotal > 0)
{
out.aformat(IRCCOLOR "02 | " IRCCOLOR "%.*s%.*s" IRCCOLOR ": %u", nTeamColor.size(),
if (nTotal > 0) {
out += string_printf(IRCCOLOR "02 | " IRCCOLOR "%.*s%.*s" IRCCOLOR ": %u", nTeamColor.size(),
nTeamColor.data(), nTeam.size(),
nTeam.data(), nTotal);
if (nBots > 0)
out.aformat(" (%u bots)", nBots);
out += string_printf(" (%u bots)", nBots);
}
if (oTotal > 0)
{
out.aformat(IRCCOLOR "02 | " IRCCOLOR "%.*s%.*s" IRCCOLOR ": %u", oTeamColor.size(),
if (oTotal > 0) {
out += string_printf(IRCCOLOR "02 | " IRCCOLOR "%.*s%.*s" IRCCOLOR ": %u", oTeamColor.size(),
oTeamColor.data(), oTeam.size(),
oTeam.data(), oTotal);
if (oBots > 0)
out.aformat(" (%u bots)", oBots);
out += string_printf(" (%u bots)", oBots);
}
source->sendMessage(channel, out);
}
@ -679,17 +664,17 @@ void PlayerTableIRCCommand::trigger(IRC_Bot *source, std::string_view channel, s
++creditColLen;
if (server->isAdminLogChanType(type))
source->sendMessage(channel, Jupiter::StringS::Format(IRCUNDERLINE IRCCOLOR "03%*.*s | %*s | %*s | %*s | IP Address", maxNickLen, NICK_COL_HEADER.size(), NICK_COL_HEADER.data(), idColLen, "ID", scoreColLen, "Score", creditColLen, "Credits"));
source->sendMessage(channel, string_printf(IRCUNDERLINE IRCCOLOR "03%*.*s | %*s | %*s | %*s | IP Address", maxNickLen, NICK_COL_HEADER.size(), NICK_COL_HEADER.data(), idColLen, "ID", scoreColLen, "Score", creditColLen, "Credits"));
else
source->sendMessage(channel, Jupiter::StringS::Format(IRCUNDERLINE IRCCOLOR "03%*.*s | %*s | %*s | %*s", maxNickLen, NICK_COL_HEADER.size(), NICK_COL_HEADER.data(), idColLen, "ID", scoreColLen, "Score", creditColLen, "Credits"));
source->sendMessage(channel, string_printf(IRCUNDERLINE IRCCOLOR "03%*.*s | %*s | %*s | %*s", maxNickLen, NICK_COL_HEADER.size(), NICK_COL_HEADER.data(), idColLen, "ID", scoreColLen, "Score", creditColLen, "Credits"));
auto output_player = [server, type, source, &channel, maxNickLen, idColLen, scoreColLen, creditColLen](RenX::PlayerInfo *player, std::string_view color)
{
if (server->isAdminLogChanType(type))
source->sendMessage(channel, Jupiter::StringS::Format(IRCCOLOR "%.*s%*.*s" IRCCOLOR " " IRCCOLOR "03|" IRCCOLOR " %*d " IRCCOLOR "03|" IRCCOLOR " %*.0f " IRCCOLOR "03|" IRCCOLOR " %*.0f " IRCCOLOR "03|" IRCNORMAL " %.*s", color.size(),
source->sendMessage(channel, string_printf(IRCCOLOR "%.*s%*.*s" IRCCOLOR " " IRCCOLOR "03|" IRCCOLOR " %*d " IRCCOLOR "03|" IRCCOLOR " %*.0f " IRCCOLOR "03|" IRCCOLOR " %*.0f " IRCCOLOR "03|" IRCNORMAL " %.*s", color.size(),
color.data(), maxNickLen, player->name.size(), player->name.data(), idColLen, player->id, scoreColLen, player->score, creditColLen, player->credits, player->ip.size(), player->ip.data()));
else
source->sendMessage(channel, Jupiter::StringS::Format(IRCCOLOR "%.*s%*.*s" IRCCOLOR " " IRCCOLOR "03|" IRCCOLOR " %*d " IRCCOLOR "03|" IRCCOLOR " %*.0f " IRCCOLOR "03|" IRCCOLOR " %*.0f", color.size(),
source->sendMessage(channel, string_printf(IRCCOLOR "%.*s%*.*s" IRCCOLOR " " IRCCOLOR "03|" IRCCOLOR " %*d " IRCCOLOR "03|" IRCCOLOR " %*.0f " IRCCOLOR "03|" IRCCOLOR " %*.0f", color.size(),
color.data(), maxNickLen, player->name.size(), player->name.data(), idColLen, player->id, scoreColLen, player->score, creditColLen, player->credits));
};
@ -1004,10 +989,10 @@ void GameInfoIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std:
match = true;
const RenX::Map &map = server->getMap();
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, string_printf(IRCCOLOR "03[GameInfo] " IRCCOLOR "%.*s", server->getGameVersion().size(), server->getGameVersion().data()));
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 "There are " IRCCOLOR "10%d" IRCCOLOR " players online.", server->players.size()));
source->sendMessage(channel, string_printf(IRCCOLOR "03[GameInfo] " IRCCOLOR "10Elapsed time" IRCCOLOR ": %.2lld:%.2lld:%.2lld", time.count() / 3600, (time.count() % 3600) / 60, time.count() % 60));
source->sendMessage(channel, string_printf(IRCCOLOR "03[GameInfo] " IRCCOLOR "There are " IRCCOLOR "10%d" IRCCOLOR " players online.", server->players.size()));
}
}
if (match == false)
@ -1031,32 +1016,24 @@ void SteamIRCCommand::create()
this->setAccessLevel(1);
}
void SteamIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view parameters)
{
void SteamIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view parameters) {
Jupiter::IRC::Client::Channel *chan = source->getChannel(channel);
if (chan != nullptr)
{
if (chan != nullptr) {
int type = chan->getType();
if (!parameters.empty())
{
Jupiter::StringL msg;
for (unsigned int i = 0; i != RenX::getCore()->getServerCount(); i++)
{
if (!parameters.empty()) {
std::string msg;
for (unsigned int i = 0; i != RenX::getCore()->getServerCount(); i++) {
RenX::Server *server = RenX::getCore()->getServer(i);
if (server->isLogChanType(type))
{
for (auto node = server->players.begin(); node != server->players.end(); ++node)
{
if (jessilib::findi(node->name, parameters) != std::string::npos)
{
if (server->isLogChanType(type)) {
for (auto node = server->players.begin(); node != server->players.end(); ++node) {
if (jessilib::findi(node->name, parameters) != std::string::npos) {
Jupiter::String playerName = RenX::getFormattedPlayerName(*node);
msg.format(IRCCOLOR "03[Steam] " IRCCOLOR "%.*s (ID: %d) ", playerName.size(),
msg = string_printf(IRCCOLOR "03[Steam] " IRCCOLOR "%.*s (ID: %d) ", playerName.size(),
playerName.data(), node->id);
if (node->steamid != 0)
{
if (node->steamid != 0) {
msg += "is using steam ID " IRCBOLD;
msg += server->formatSteamID(*node);
msg.aformat(IRCBOLD "; Steam Profile: " IRCBOLD "https://steamcommunity.com/profiles/%llu" IRCBOLD, node->steamid);
msg += string_printf(IRCBOLD "; Steam Profile: " IRCBOLD "https://steamcommunity.com/profiles/%llu" IRCBOLD, node->steamid);
}
else
msg += "is not using steam.";
@ -1091,7 +1068,7 @@ void SteamIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::st
}
if (realPlayers != 0)
source->sendMessage(channel, Jupiter::StringS::Format("%.2f%% (%u/%u) of players are using Steam.", ((double)total * 100) / ((double)realPlayers), total, realPlayers));
source->sendMessage(channel, string_printf("%.2f%% (%u/%u) of players are using Steam.", ((double)total * 100) / ((double)realPlayers), total, realPlayers));
else
source->sendMessage(channel, STRING_LITERAL_AS_REFERENCE("No players are in-game."));
}
@ -1118,26 +1095,19 @@ void KillDeathRatioIRCCommand::create()
this->addTrigger(STRING_LITERAL_AS_REFERENCE("killdeathraio"));
}
void KillDeathRatioIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view parameters)
{
if (!parameters.empty())
{
void KillDeathRatioIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view parameters) {
if (!parameters.empty()) {
Jupiter::IRC::Client::Channel *chan = source->getChannel(channel);
if (chan != nullptr)
{
if (chan != nullptr) {
int type = chan->getType();
Jupiter::StringL msg;
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);
if (server->isLogChanType(type) && server->players.size() != 0)
{
for (auto node = server->players.begin(); node != server->players.end(); ++node)
{
if (jessilib::findi(node->name, parameters) != std::string::npos)
{
if (server->isLogChanType(type) && server->players.size() != 0) {
for (auto node = server->players.begin(); node != server->players.end(); ++node) {
if (jessilib::findi(node->name, parameters) != std::string::npos) {
Jupiter::String playerName = RenX::getFormattedPlayerName(*node);
msg.format(IRCBOLD "%.*s" IRCBOLD IRCCOLOR ": Kills: %u - Deaths: %u - KDR: %.2f", playerName.size(),
msg = string_printf(IRCBOLD "%.*s" IRCBOLD IRCCOLOR ": Kills: %u - Deaths: %u - KDR: %.2f", playerName.size(),
playerName.data(), node->kills, node->deaths, static_cast<double>(node->kills) / (node->deaths == 0 ? 1.0f : static_cast<double>(node->deaths)));
source->sendMessage(channel, msg);
}
@ -1345,25 +1315,20 @@ void ReconnectIRCCommand::create()
this->setAccessLevel(3);
}
void ReconnectIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view )
{
void ReconnectIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view ) {
Jupiter::IRC::Client::Channel *chan = source->getChannel(channel);
if (chan != nullptr)
{
if (chan != nullptr) {
int type = chan->getType();
Jupiter::StringS msg;
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);
if (server->isLogChanType(type))
{
if (server->isLogChanType(type)) {
if (server->reconnect(RenX::DisconnectReason::Triggered)) msg.set("Connection established");
else msg.format("[RenX] ERROR: Failed to connect to %.*s on port %u." ENDL, server->getHostname().size(), server->getHostname().c_str(), server->getPort());
else msg = string_printf("[RenX] ERROR: Failed to connect to %.*s on port %u." ENDL, server->getHostname().size(), server->getHostname().c_str(), server->getPort());
source->sendMessage(channel, msg);
}
}
if (msg.empty())
{
if (msg.empty()) {
// We didn't connect anywhere!!
msg.set("ERROR: No servers found to connect to.");
source->sendMessage(channel, msg);
@ -1426,7 +1391,7 @@ void GameOverIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std:
else
delay = std::chrono::seconds(Jupiter::from_string<long long>(parameters));
server->sendMessage(Jupiter::StringS::Format("Notice: This server will gameover in %lld seconds.", static_cast<long long>(delay.count())));
server->sendMessage(string_printf("Notice: This server will gameover in %lld seconds.", static_cast<long long>(delay.count())));
server->gameover(delay);
}
}
@ -1883,7 +1848,7 @@ void KickIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::str
}
}
}
source->sendMessage(channel, Jupiter::StringS::Format("%u players kicked.", kicks));
source->sendMessage(channel, string_printf("%u players kicked.", kicks));
}
std::string_view KickIRCCommand::getHelp(std::string_view ) {
@ -2010,7 +1975,7 @@ void BanSearchIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std
types += ";"_jrs;
}
out.format("ID: %lu (" IRCCOLOR "%sactive" IRCCOLOR "); Added: %s; Expires: %s; IP: %.*s/%u; HWID: %.*s; Steam: %llu; Types:%.*s Name: %.*s; Banner: %.*s",
out = string_printf("ID: %lu (" IRCCOLOR "%sactive" IRCCOLOR "); Added: %s; Expires: %s; IP: %.*s/%u; HWID: %.*s; Steam: %llu; Types:%.*s Name: %.*s; Banner: %.*s",
i, entry->is_active() ? "12" : "04in", dateStr, expireStr, ip_str.size(), ip_str.data(), entry->prefix_length, entry->hwid.size(), entry->hwid.data(), entry->steamid,
types.size(), types.data(), entry->name.size(), entry->name.data(), entry->banner.size(), entry->banner.data());
@ -2032,7 +1997,7 @@ void BanSearchIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std
}
}
else
source->sendNotice(nick, Jupiter::StringS::Format("There are a total of %u entries in the ban database.", entries.size()));
source->sendNotice(nick, string_printf("There are a total of %u entries in the ban database.", entries.size()));
}
std::string_view BanSearchIRCCommand::getHelp(std::string_view )
@ -2249,7 +2214,7 @@ void KickBanIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::
source->sendMessage(channel, player_not_found_message(name));
}
else {
source->sendMessage(channel, Jupiter::StringS::Format("%u players kicked.", kicks));
source->sendMessage(channel, string_printf("%u players kicked.", kicks));
RenX::getCore()->banCheck();
}
}
@ -2433,7 +2398,7 @@ void AddBanIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::s
RenX::banDatabase->add(name, ip, prefix_length, steamid, hwid, rdns, banner, reason, duration, flags);
RenX::getCore()->banCheck();
source->sendMessage(channel, Jupiter::StringS::Format("Ban added to the database with ID #%u", RenX::banDatabase->getEntries().size() - 1));
source->sendMessage(channel, string_printf("Ban added to the database with ID #%u", RenX::banDatabase->getEntries().size() - 1));
}
}
}
@ -2576,7 +2541,7 @@ void ExemptionSearchIRCCommand::trigger(IRC_Bot *source, std::string_view channe
types += ";"_jrs;
}
out.format("ID: %lu (%sactive); Date: %s; IP: %.*s/%u; Steam: %llu; Types:%.*s Setter: %.*s",
out = string_printf("ID: %lu (%sactive); Date: %s; IP: %.*s/%u; Steam: %llu; Types:%.*s Setter: %.*s",
i, entry->is_active() ? "" : "in", timeStr, ip_str.size(), ip_str.data(), entry->prefix_length, entry->steamid,
types.size(), types.data(), entry->setter.size(), entry->setter.data());
@ -2588,7 +2553,7 @@ void ExemptionSearchIRCCommand::trigger(IRC_Bot *source, std::string_view channe
}
}
else
source->sendNotice(nick, Jupiter::StringS::Format("There are a total of %u entries in the exemption database.", entries.size()));
source->sendNotice(nick, string_printf("There are a total of %u entries in the exemption database.", entries.size()));
}
std::string_view ExemptionSearchIRCCommand::getHelp(std::string_view ) {
@ -2649,7 +2614,7 @@ void BanExemptIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std
source->sendMessage(channel, player_not_found_message(target_name));
}
else {
source->sendMessage(channel, Jupiter::StringS::Format("%u players added.", exemptions));
source->sendMessage(channel, string_printf("%u players added.", exemptions));
}
}
@ -2710,7 +2675,7 @@ void KickExemptIRCCommand::trigger(IRC_Bot *source, std::string_view channel, st
source->sendMessage(channel, player_not_found_message(target_name));
}
else {
source->sendMessage(channel, Jupiter::StringS::Format("%u players added.", exemptions));
source->sendMessage(channel, string_printf("%u players added.", exemptions));
}
}
@ -2834,7 +2799,7 @@ void AddExemptionIRCCommand::trigger(IRC_Bot *source, std::string_view channel,
else
{
RenX::exemptionDatabase->add(ip, prefix_length, steamid, setter, duration, flags);
source->sendMessage(channel, Jupiter::StringS::Format("Exemption added to the database with ID #%u", RenX::exemptionDatabase->getEntries().size() - 1));
source->sendMessage(channel, string_printf("Exemption added to the database with ID #%u", RenX::exemptionDatabase->getEntries().size() - 1));
}
}
}
@ -2920,7 +2885,7 @@ void AddBotsIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::
}
}
Jupiter::StringL cmd;
std::string cmd;
RenX::TeamType team = RenX::TeamType::None;
if (split_parameters.size() >= 2) {
team = RenX::getTeam(split_parameters[1]);
@ -2940,12 +2905,13 @@ void AddBotsIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::
}
for (const auto& server : servers) {
size_t base_length = cmd.size();
if (server != nullptr) {
size_t extra = cmd.aformat("%u", amount);
cmd += string_printf("%u", amount);
server->send(cmd);
cmd -= extra;
cmd.erase(base_length);
}
server->sendMessage(Jupiter::StringS::Format("%u bots have been added to the server.", amount));
server->sendMessage(string_printf("%u bots have been added to the server.", amount));
}
}
@ -3058,7 +3024,7 @@ void RCONIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::str
size_t server_count = RenX::getCore()->send(chan->getType(), parameters);
if (server_count > 0) {
source->sendMessage(channel, Jupiter::StringS::Format("Command sent to %u servers.", server_count));
source->sendMessage(channel, string_printf("Command sent to %u servers.", server_count));
}
else {
source->sendMessage(channel, STRING_LITERAL_AS_REFERENCE("Error: Channel not attached to any connected Renegade X servers."));
@ -3099,9 +3065,9 @@ void RefundIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::s
player = server->getPlayerByPartName(playerName);
if (player != nullptr) {
if (server->giveCredits(*player, credits)) {
msg.format("You have been refunded %.0f credits by %.*s.", credits, nick.size(), nick.data());
msg = string_printf("You have been refunded %.0f credits by %.*s.", credits, nick.size(), nick.data());
server->sendMessage(*player, msg);
msg.format("%.*s has been refunded %.0f credits.", player->name.size(), player->name.data(), credits);
msg = string_printf("%.*s has been refunded %.0f credits.", player->name.size(), player->name.data(), credits);
}
else {
msg.set("Error: Server does not support refunds.");
@ -3258,7 +3224,7 @@ void NModeIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::st
}
}
source->sendMessage(channel, Jupiter::StringS::Format("%u players nmoded.", nmodes));
source->sendMessage(channel, string_printf("%u players nmoded.", nmodes));
}
std::string_view NModeIRCCommand::getHelp(std::string_view ) {
@ -3303,7 +3269,7 @@ void SModeIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::st
}
}
}
source->sendMessage(channel, Jupiter::StringS::Format("%u players smoded.", smodes));
source->sendMessage(channel, string_printf("%u players smoded.", smodes));
}
std::string_view SModeIRCCommand::getHelp(std::string_view ) {
@ -3479,7 +3445,7 @@ void ModsGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *, std::str
msg += "No "s + staff_word + "s are in-game"_jrs;
RenX::GameCommand *cmd = source->getCommand(STRING_LITERAL_AS_REFERENCE("modrequest"));
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 += string_printf("; please use \"%.*s%.*s\" if you require assistance.", source->getCommandPrefix().size(), source->getCommandPrefix().data(), cmd->getTrigger().size(), cmd->getTrigger().data());
else msg += '.';
}
source->sendMessage(msg);
@ -3502,7 +3468,7 @@ void RulesGameCommand::create() {
}
void RulesGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, std::string_view parameters) {
source->sendMessage(Jupiter::StringS::Format("Rules: %.*s", source->getRules().size(), source->getRules().data()));
source->sendMessage(string_printf("Rules: %.*s", source->getRules().size(), source->getRules().data()));
}
std::string_view RulesGameCommand::getHelp(std::string_view ) {
@ -3528,10 +3494,10 @@ void ModRequestGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *play
std::string_view staff_word = pluginInstance.getStaffTitle();
Jupiter::String fmtName = RenX::getFormattedPlayerName(*player);
Jupiter::StringL user_message = Jupiter::StringL::Format(IRCCOLOR "12[%.*s Request] " IRCCOLOR IRCBOLD "%.*s" IRCBOLD IRCCOLOR "07 has requested assistance in-game for \"%.*s\"; please look in ", staff_word.size(),
Jupiter::StringL user_message = string_printf(IRCCOLOR "12[%.*s Request] " IRCCOLOR IRCBOLD "%.*s" IRCBOLD IRCCOLOR "07 has requested assistance in-game for \"%.*s\"; please look in ", staff_word.size(),
staff_word.data(), fmtName.size(), fmtName.data(), parameters.size(),
parameters.data());
Jupiter::StringS channel_message = Jupiter::StringS::Format(IRCCOLOR "12[%.*s Request] " IRCCOLOR IRCBOLD "%.*s" IRCBOLD IRCCOLOR "07 has requested assistance in-game! Reason: %.*s" IRCCOLOR, staff_word.size(),
Jupiter::StringS channel_message = string_printf(IRCCOLOR "12[%.*s Request] " IRCCOLOR IRCBOLD "%.*s" IRCBOLD IRCCOLOR "07 has requested assistance in-game! Reason: %.*s" IRCCOLOR, staff_word.size(),
staff_word.data(), fmtName.size(), fmtName.data(), parameters.size(),
parameters.data());
@ -3573,7 +3539,7 @@ void ModRequestGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *play
}
// Inform the user of the result
source->sendMessage(*player, Jupiter::StringS::Format("A total of %u %.*ss have been notified of your assistance request.", total_user_alerts, staff_word.size(),
source->sendMessage(*player, string_printf("A total of %u %.*ss have been notified of your assistance request.", total_user_alerts, staff_word.size(),
staff_word.data()));
}
@ -4091,10 +4057,10 @@ void AddBotsGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player,
amount = Jupiter::asUnsignedInt(split_parameters.front());
}
cmd += Jupiter::StringS::Format("%u", amount);
cmd += string_printf("%u", amount);
source->send(cmd);
source->sendMessage(*player, Jupiter::StringS::Format("%u bots have been added to the server.", amount));
source->sendMessage(*player, string_printf("%u bots have been added to the server.", amount));
}
std::string_view AddBotsGameCommand::getHelp(std::string_view ) {

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

@ -875,7 +875,7 @@ Jupiter::String RenX::getFormattedPlayerName(const RenX::PlayerInfo &player)
Jupiter::StringS RenX::formatGUID(const RenX::Map &map)
{
return Jupiter::StringS::Format("%.16llX%.16llX", map.guid[0], map.guid[1]);
return string_printf("%.16llX%.16llX", map.guid[0], map.guid[1]);
}
std::chrono::milliseconds RenX::getServerTime(const RenX::PlayerInfo &player)
@ -886,7 +886,7 @@ std::chrono::milliseconds RenX::getServerTime(const RenX::PlayerInfo &player)
Jupiter::StringS RenX::default_uuid_func(RenX::PlayerInfo &player)
{
if (player.steamid != 0U)
return Jupiter::StringS::Format("0x%.16llX", player.steamid);
return string_printf("0x%.16llX", player.steamid);
return Jupiter::StringS();
}

2
src/Plugins/RenX/RenX.Core/RenX_LadderDatabase.cpp

@ -593,7 +593,7 @@ void RenX::LadderDatabase::updateLadder(RenX::Server &server, const RenX::TeamTy
if (m_output_times)
{
Jupiter::StringS str = Jupiter::StringS::Format("Ladder: %zu entries sorted in %f seconds; Database written in %f seconds." ENDL,
Jupiter::StringS str = string_printf("Ladder: %zu entries sorted in %f seconds; Database written in %f seconds." ENDL,
getEntries(),
static_cast<double>(sort_duration.count()) * (static_cast<double>(std::chrono::steady_clock::duration::period::num) / static_cast<double>(std::chrono::steady_clock::duration::period::den) * static_cast<double>(std::chrono::seconds::duration::period::den / std::chrono::seconds::duration::period::num)),
static_cast<double>(write_duration.count()) * (static_cast<double>(std::chrono::steady_clock::duration::period::num) / static_cast<double>(std::chrono::steady_clock::duration::period::den) * static_cast<double>(std::chrono::seconds::duration::period::den / std::chrono::seconds::duration::period::num)));

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

@ -275,7 +275,7 @@ int RenX::Server::sendMessage(std::string_view message) {
if (this->players.size() != 0) {
for (auto node = this->players.begin(); node != this->players.end(); ++node) {
if (node->isBot == false) {
result += sendSocket(Jupiter::StringS::Format("chostprivatesay pid%d %.*s\n", node->id, msg.size(),
result += sendSocket(string_printf("chostprivatesay pid%d %.*s\n", node->id, msg.size(),
msg.data()));
}
}
@ -287,7 +287,7 @@ int RenX::Server::sendMessage(std::string_view message) {
}
int RenX::Server::sendMessage(const RenX::PlayerInfo &player, std::string_view message) {
return sendSocket("chostprivatesay pid"s + Jupiter::StringS::Format("%d ", player.id) + RenX::escapifyRCON(message) + '\n');
return sendSocket("chostprivatesay pid"s + string_printf("%d ", player.id) + RenX::escapifyRCON(message) + '\n');
}
int RenX::Server::sendAdminMessage(std::string_view message) {
@ -295,11 +295,11 @@ int RenX::Server::sendAdminMessage(std::string_view message) {
}
int RenX::Server::sendAdminMessage(const RenX::PlayerInfo &player, std::string_view message) {
return sendSocket("cpamsg pid"s + Jupiter::StringS::Format("%d ", player.id) + RenX::escapifyRCON(message) + '\n');
return sendSocket("cpamsg pid"s + string_printf("%d ", player.id) + RenX::escapifyRCON(message) + '\n');
}
int RenX::Server::sendWarnMessage(const RenX::PlayerInfo &player, std::string_view message) {
return sendSocket("cwarn pid"s + Jupiter::StringS::Format("%d ", player.id) + RenX::escapifyRCON(message) + '\n');
return sendSocket("cwarn pid"s + string_printf("%d ", player.id) + RenX::escapifyRCON(message) + '\n');
}
int RenX::Server::sendData(std::string_view data) {
@ -454,20 +454,20 @@ Jupiter::StringS RenX::Server::formatSteamID(uint64_t id) const {
{
default:
case 16:
return Jupiter::StringS::Format("0x%.16llX", id);
return string_printf("0x%.16llX", id);
case 10:
return Jupiter::StringS::Format("%llu", id);
return string_printf("%llu", id);
case 8:
return Jupiter::StringS::Format("0%llo", id);
return string_printf("0%llo", id);
case -2:
id -= 0x0110000100000000ULL;
if (id % 2 == 1)
return Jupiter::StringS::Format("STEAM_1:1:%llu", id / 2ULL);
return string_printf("STEAM_1:1:%llu", id / 2ULL);
else
return Jupiter::StringS::Format("STEAM_1:0:%llu", id / 2ULL);
return string_printf("STEAM_1:0:%llu", id / 2ULL);
case -3:
id -= 0x0110000100000000ULL;
return Jupiter::StringS::Format("[U:1:%llu]", id);
return string_printf("[U:1:%llu]", id);
}
}
@ -475,9 +475,9 @@ void RenX::Server::kickPlayer(int id, std::string_view in_reason) {
std::string reason = RenX::escapifyRCON(in_reason);
if (reason.empty())
sendSocket(Jupiter::StringS::Format("ckick pid%d\n", id));
sendSocket(string_printf("ckick pid%d\n", id));
else
sendSocket(Jupiter::StringS::Format("ckick pid%d %.*s\n", id, reason.size(), reason.data()));
sendSocket(string_printf("ckick pid%d %.*s\n", id, reason.size(), reason.data()));
}
void RenX::Server::kickPlayer(const RenX::PlayerInfo &player, std::string_view reason) {
@ -490,11 +490,11 @@ void RenX::Server::forceKickPlayer(int id, std::string_view in_reason) {
std::string reason = RenX::escapifyRCON(in_reason);
if (reason.empty()) {
sendSocket(Jupiter::StringS::Format("cfkick pid%d You were kicked from the server.\n", id));
sendSocket(string_printf("cfkick pid%d You were kicked from the server.\n", id));
return;
}
sendSocket(Jupiter::StringS::Format("cfkick pid%d %.*s\n", id, reason.size(), reason.data()));
sendSocket(string_printf("cfkick pid%d %.*s\n", id, reason.size(), reason.data()));
}
void RenX::Server::forceKickPlayer(const RenX::PlayerInfo &player, std::string_view reason) {
@ -582,11 +582,11 @@ void RenX::Server::banCheck(RenX::PlayerInfo &player) {
time_t current_time = std::chrono::system_clock::to_time_t(last_to_expire[0]->timestamp + last_to_expire[0]->length);
strftime(timeStr, sizeof(timeStr), "%b %d %Y at %H:%M:%S", localtime(&current_time));
if (last_to_expire[0]->length == std::chrono::seconds::zero()) {
forceKickPlayer(player, Jupiter::StringS::Format("You were permanently banned from %.*s on %s for: %.*s", m_ban_from_str.size(),
forceKickPlayer(player, string_printf("You were permanently banned from %.*s on %s for: %.*s", m_ban_from_str.size(),
m_ban_from_str.data(), timeStr, last_to_expire[0]->reason.size(), last_to_expire[0]->reason.data()));
}
else {
forceKickPlayer(player, Jupiter::StringS::Format("You are banned from %.*s until %s for: %.*s", m_ban_from_str.size(),
forceKickPlayer(player, string_printf("You are banned from %.*s until %s for: %.*s", m_ban_from_str.size(),
m_ban_from_str.data(), timeStr, last_to_expire[0]->reason.size(), last_to_expire[0]->reason.data()));
}
@ -598,10 +598,10 @@ void RenX::Server::banCheck(RenX::PlayerInfo &player) {
strftime(timeStr, sizeof(timeStr), "%b %d %Y at %H:%M:%S", localtime(&current_time));
mute(player);
if (last_to_expire[1]->length == std::chrono::seconds::zero())
sendMessage(player, Jupiter::StringS::Format("You were permanently muted from %.*s on %s for: %.*s", m_ban_from_str.size(),
sendMessage(player, string_printf("You were permanently muted from %.*s on %s for: %.*s", m_ban_from_str.size(),
m_ban_from_str.data(), timeStr, last_to_expire[1]->reason.size(), last_to_expire[1]->reason.data()));
else
sendMessage(player, Jupiter::StringS::Format("You are muted from %.*s until %s for: %.*s", m_ban_from_str.size(),
sendMessage(player, string_printf("You are muted from %.*s until %s for: %.*s", m_ban_from_str.size(),
m_ban_from_str.data(), timeStr, last_to_expire[1]->reason.size(), last_to_expire[1]->reason.data()));
player.ban_flags |= RenX::BanDatabase::Entry::FLAG_TYPE_BOT; // implies FLAG_TYPE_BOT
@ -610,20 +610,20 @@ void RenX::Server::banCheck(RenX::PlayerInfo &player) {
time_t current_time = std::chrono::system_clock::to_time_t(last_to_expire[2]->timestamp + last_to_expire[2]->length);
strftime(timeStr, sizeof(timeStr), "%b %d %Y at %H:%M:%S", localtime(&current_time));
if (last_to_expire[2]->length == std::chrono::seconds::zero())
sendMessage(player, Jupiter::StringS::Format("You were permanently bot-muted from %.*s on %s for: %.*s", m_ban_from_str.size(),
sendMessage(player, string_printf("You were permanently bot-muted from %.*s on %s for: %.*s", m_ban_from_str.size(),
m_ban_from_str.data(), timeStr, last_to_expire[2]->reason.size(), last_to_expire[2]->reason.data()));
else
sendMessage(player, Jupiter::StringS::Format("You are bot-muted from %.*s until %s for: %.*s", m_ban_from_str.size(),
sendMessage(player, string_printf("You are bot-muted from %.*s until %s for: %.*s", m_ban_from_str.size(),
m_ban_from_str.data(), timeStr, last_to_expire[2]->reason.size(), last_to_expire[2]->reason.data()));
}
if (last_to_expire[3] != nullptr) { // Vote ban
time_t current_time = std::chrono::system_clock::to_time_t(last_to_expire[3]->timestamp + last_to_expire[3]->length);
strftime(timeStr, sizeof(timeStr), "%b %d %Y at %H:%M:%S", localtime(&current_time));
if (last_to_expire[3]->length == std::chrono::seconds::zero())
sendMessage(player, Jupiter::StringS::Format("You were permanently vote-muted from %.*s on %s for: %.*s", m_ban_from_str.size(),
sendMessage(player, string_printf("You were permanently vote-muted from %.*s on %s for: %.*s", m_ban_from_str.size(),
m_ban_from_str.data(), timeStr, last_to_expire[3]->reason.size(), last_to_expire[3]->reason.data()));
else
sendMessage(player, Jupiter::StringS::Format("You are vote-muted from %.*s until %s for: %.*s", m_ban_from_str.size(),
sendMessage(player, string_printf("You are vote-muted from %.*s until %s for: %.*s", m_ban_from_str.size(),
m_ban_from_str.data(), timeStr, last_to_expire[3]->reason.size(), last_to_expire[3]->reason.data()));
}
if (last_to_expire[4] != nullptr) { // Mine ban
@ -631,28 +631,28 @@ void RenX::Server::banCheck(RenX::PlayerInfo &player) {
mineBan(player);
strftime(timeStr, sizeof(timeStr), "%b %d %Y at %H:%M:%S", localtime(&current_time));
if (last_to_expire[4]->length == std::chrono::seconds::zero())
sendMessage(player, Jupiter::StringS::Format("You were permanently mine-banned from %.*s on %s for: %.*s", m_ban_from_str.size(),
sendMessage(player, string_printf("You were permanently mine-banned from %.*s on %s for: %.*s", m_ban_from_str.size(),
m_ban_from_str.data(), timeStr, last_to_expire[4]->reason.size(), last_to_expire[4]->reason.data()));
else
sendMessage(player, Jupiter::StringS::Format("You are mine-banned from %.*s until %s for: %.*s", m_ban_from_str.size(),
sendMessage(player, string_printf("You are mine-banned from %.*s until %s for: %.*s", m_ban_from_str.size(),
m_ban_from_str.data(), timeStr, last_to_expire[4]->reason.size(), last_to_expire[4]->reason.data()));
}
if (last_to_expire[5] != nullptr) { // Ladder ban
time_t current_time = std::chrono::system_clock::to_time_t(last_to_expire[5]->timestamp + last_to_expire[5]->length);
strftime(timeStr, sizeof(timeStr), "%b %d %Y at %H:%M:%S", localtime(&current_time));
if (last_to_expire[5]->length == std::chrono::seconds::zero())
sendMessage(player, Jupiter::StringS::Format("You were permanently ladder-banned from %.*s on %s for: %.*s", m_ban_from_str.size(),
sendMessage(player, string_printf("You were permanently ladder-banned from %.*s on %s for: %.*s", m_ban_from_str.size(),
m_ban_from_str.data(), timeStr, last_to_expire[5]->reason.size(), last_to_expire[5]->reason.data()));
else
sendMessage(player, Jupiter::StringS::Format("You are ladder-banned from %.*s until %s for: %.*s", m_ban_from_str.size(),
sendMessage(player, string_printf("You are ladder-banned from %.*s until %s for: %.*s", m_ban_from_str.size(),
m_ban_from_str.data(), timeStr, last_to_expire[5]->reason.size(), last_to_expire[5]->reason.data()));
}
if (last_to_expire[6] != nullptr) { // Alert
IRC_Bot *server;
Jupiter::String fmtName = RenX::getFormattedPlayerName(player);
Jupiter::StringL user_message = Jupiter::StringL::Format(IRCCOLOR "04[Alert] " IRCCOLOR IRCBOLD "%.*s" IRCBOLD IRCCOLOR " is marked for monitoring by %.*s for: \"%.*s\". Please keep an eye on them in ", fmtName.size(),
std::string user_message = string_printf(IRCCOLOR "04[Alert] " IRCCOLOR IRCBOLD "%.*s" IRCBOLD IRCCOLOR " is marked for monitoring by %.*s for: \"%.*s\". Please keep an eye on them in ", fmtName.size(),
fmtName.data(), last_to_expire[6]->banner.size(), last_to_expire[6]->banner.data(), last_to_expire[6]->reason.size(), last_to_expire[6]->reason.data());
Jupiter::StringS channel_message = Jupiter::StringS::Format(IRCCOLOR "04[Alert] " IRCCOLOR IRCBOLD "%.*s" IRCBOLD IRCCOLOR " is marked for monitoring by %.*s for: \"%.*s\"." IRCCOLOR, fmtName.size(),
std::string channel_message = string_printf(IRCCOLOR "04[Alert] " IRCCOLOR IRCBOLD "%.*s" IRCBOLD IRCCOLOR " is marked for monitoring by %.*s for: \"%.*s\"." IRCCOLOR, fmtName.size(),
fmtName.data(), last_to_expire[6]->banner.size(), last_to_expire[6]->banner.data(), last_to_expire[6]->reason.size(), last_to_expire[6]->reason.data());
for (size_t server_index = 0; server_index < serverManager->size(); ++server_index) {
@ -661,12 +661,13 @@ void RenX::Server::banCheck(RenX::PlayerInfo &player) {
if (isAdminLogChanType(channel.second.getType())) {
server->sendMessage(channel.second.getName(), channel_message);
size_t base_length = user_message.size();
user_message += channel.second.getName();
for (auto& user : channel.second.getUsers()) {
if (channel.second.getUserPrefix(*user.second) != 0 && user.second->getNickname() != server->getNickname())
server->sendMessage(user.second->getUser()->getNickname(), user_message);
}
user_message -= channel.second.getName().size();
user_message.erase(base_length);
}
}
}
@ -677,7 +678,7 @@ void RenX::Server::banCheck(RenX::PlayerInfo &player) {
void RenX::Server::banPlayer(int id, std::string_view banner, std::string_view reason) {
if (m_rconBan) {
Jupiter::String out_reason = RenX::escapifyRCON(reason);
sendSocket(Jupiter::StringS::Format("ckickban pid%d %.*s\n", id, out_reason.size(), out_reason.data()));
sendSocket(string_printf("ckickban pid%d %.*s\n", id, out_reason.size(), out_reason.data()));
}
else {
RenX::PlayerInfo *player = getPlayer(id);
@ -696,25 +697,25 @@ void RenX::Server::banPlayer(const RenX::PlayerInfo &player, std::string_view ba
if (length == std::chrono::seconds::zero()) {
if (m_rconBan) {
Jupiter::String out_reason = RenX::escapifyRCON(reason);
sendSocket(Jupiter::StringS::Format("ckickban pid%d %.*s\n", player.id, out_reason.size(),
sendSocket(string_printf("ckickban pid%d %.*s\n", player.id, out_reason.size(),
out_reason.data()));
}
else if (!banner.empty()) {
forceKickPlayer(player, Jupiter::StringS::Format("You are permanently banned from %.*s by %.*s for: %.*s", m_ban_from_str.size(),
forceKickPlayer(player, string_printf("You are permanently banned from %.*s by %.*s for: %.*s", m_ban_from_str.size(),
m_ban_from_str.data(), banner.size(), banner.data(), reason.size(), reason.data()));
}
else {
forceKickPlayer(player, Jupiter::StringS::Format("You are permanently banned from %.*s for: %.*s", m_ban_from_str.size(),
forceKickPlayer(player, string_printf("You are permanently banned from %.*s for: %.*s", m_ban_from_str.size(),
m_ban_from_str.data(), reason.size(), reason.data()));
}
}
else if (!banner.empty()) {
// TODO: make the time formatting not complete nonsense
forceKickPlayer(player, Jupiter::StringS::Format("You are banned from %.*s by %.*s for the next %lld days, %.2d:%.2d:%.2d for: %.*s", m_ban_from_str.size(),
forceKickPlayer(player, string_printf("You are banned from %.*s by %.*s for the next %lld days, %.2d:%.2d:%.2d for: %.*s", m_ban_from_str.size(),
m_ban_from_str.data(), banner.size(), banner.data(), static_cast<long long>(length.count() / 86400), static_cast<int>(length.count() % 3600), static_cast<int>((length.count() % 3600) / 60), static_cast<int>(length.count() % 60), reason.size(), reason.data()));
}
else {
forceKickPlayer(player, Jupiter::StringS::Format("You are banned from %.*s for the next %lld days, %.2d:%.2d:%.2d for: %.*s", m_ban_from_str.size(),
forceKickPlayer(player, string_printf("You are banned from %.*s for the next %lld days, %.2d:%.2d:%.2d for: %.*s", m_ban_from_str.size(),
m_ban_from_str.data(), static_cast<long long>(length.count() / 86400), static_cast<int>(length.count() % 3600), static_cast<int>((length.count() % 3600) / 60), static_cast<int>(length.count() % 60), reason.size(), reason.data()));
}
}
@ -823,15 +824,15 @@ void RenX::Server::gameoverWhenEmpty() {
}
bool RenX::Server::setMap(std::string_view map) {
return send(Jupiter::StringS::Format("changemap %.*s", map.size(), map.data())) > 0;
return send(string_printf("changemap %.*s", map.size(), map.data())) > 0;
}
bool RenX::Server::loadMutator(std::string_view mutator) {
return send(Jupiter::StringS::Format("loadmutator %.*s", mutator.size(), mutator.data())) > 0;
return send(string_printf("loadmutator %.*s", mutator.size(), mutator.data())) > 0;
}
bool RenX::Server::unloadMutator(std::string_view mutator) {
return send(Jupiter::StringS::Format("unloadmutator %.*s", mutator.size(), mutator.data())) > 0;
return send(string_printf("unloadmutator %.*s", mutator.size(), mutator.data())) > 0;
}
bool RenX::Server::cancelVote(const RenX::TeamType team) {
@ -854,15 +855,15 @@ bool RenX::Server::recordDemo() {
}
bool RenX::Server::mute(const RenX::PlayerInfo &player) {
return send(Jupiter::StringS::Format("textmute pid%u", player.id)) > 0;
return send(string_printf("textmute pid%u", player.id)) > 0;
}
bool RenX::Server::unmute(const RenX::PlayerInfo &player) {
return send(Jupiter::StringS::Format("textunmute pid%u", player.id)) > 0;
return send(string_printf("textunmute pid%u", player.id)) > 0;
}
bool RenX::Server::giveCredits(int id, double credits) {
return m_competitive == false && send(Jupiter::StringS::Format("givecredits pid%d %f", id, credits)) > 0;
return m_competitive == false && send(string_printf("givecredits pid%d %f", id, credits)) > 0;
}
bool RenX::Server::giveCredits(RenX::PlayerInfo &player, double credits) {
@ -870,7 +871,7 @@ bool RenX::Server::giveCredits(RenX::PlayerInfo &player, double credits) {
}
bool RenX::Server::kill(int id) {
return m_competitive == false && send(Jupiter::StringS::Format("kill pid%d", id)) > 0;
return m_competitive == false && send(string_printf("kill pid%d", id)) > 0;
}
bool RenX::Server::kill(RenX::PlayerInfo &player) {
@ -878,7 +879,7 @@ bool RenX::Server::kill(RenX::PlayerInfo &player) {
}
bool RenX::Server::disarm(int id) {
return m_competitive == false && send(Jupiter::StringS::Format("disarm pid%d", id)) > 0;
return m_competitive == false && send(string_printf("disarm pid%d", id)) > 0;
}
bool RenX::Server::disarm(RenX::PlayerInfo &player) {
@ -886,7 +887,7 @@ bool RenX::Server::disarm(RenX::PlayerInfo &player) {
}
bool RenX::Server::disarmC4(int id) {
return m_competitive == false && send(Jupiter::StringS::Format("disarmc4 pid%d", id)) > 0;
return m_competitive == false && send(string_printf("disarmc4 pid%d", id)) > 0;
}
bool RenX::Server::disarmC4(RenX::PlayerInfo &player) {
@ -894,7 +895,7 @@ bool RenX::Server::disarmC4(RenX::PlayerInfo &player) {
}
bool RenX::Server::disarmBeacon(int id) {
return m_competitive == false && send(Jupiter::StringS::Format("disarmb pid%d", id)) > 0;
return m_competitive == false && send(string_printf("disarmb pid%d", id)) > 0;
}
bool RenX::Server::disarmBeacon(RenX::PlayerInfo &player) {
@ -902,7 +903,7 @@ bool RenX::Server::disarmBeacon(RenX::PlayerInfo &player) {
}
bool RenX::Server::mineBan(int id) {
return send(Jupiter::StringS::Format("mineban pid%d", id)) > 0;
return send(string_printf("mineban pid%d", id)) > 0;
}
bool RenX::Server::mineBan(RenX::PlayerInfo &player) {
@ -910,7 +911,7 @@ bool RenX::Server::mineBan(RenX::PlayerInfo &player) {
}
bool RenX::Server::changeTeam(int id, bool resetCredits) {
return send(Jupiter::StringS::Format(resetCredits ? "team pid%d" : "team2 pid%d", id)) > 0;
return send(string_printf(resetCredits ? "team pid%d" : "team2 pid%d", id)) > 0;
}
bool RenX::Server::changeTeam(RenX::PlayerInfo &player, bool resetCredits) {
@ -918,11 +919,11 @@ bool RenX::Server::changeTeam(RenX::PlayerInfo &player, bool resetCredits) {
}
bool RenX::Server::nmodePlayer(const RenX::PlayerInfo &player) {
return send(Jupiter::StringS::Format("nmode pid%d", player.id));
return send(string_printf("nmode pid%d", player.id));
}
bool RenX::Server::smodePlayer(const RenX::PlayerInfo &player) {
return send(Jupiter::StringS::Format("smode pid%d", player.id));
return send(string_printf("smode pid%d", player.id));
}
std::string_view RenX::Server::getPrefix() const {
@ -1181,19 +1182,15 @@ bool RenX::Server::resolvesRDNS() {
void RenX::Server::sendPubChan(const char *fmt, ...) const {
va_list args;
va_start(args, fmt);
Jupiter::StringL msg;
std::string_view serverPrefix = getPrefix();
if (!serverPrefix.empty()) {
msg += serverPrefix;
msg += ' ';
msg.avformat(fmt, args);
}
else {
msg.vformat(fmt, args);
std::string message{ getPrefix() };
if (!message.empty()) {
message += ' ';
}
va_end(args);
message += vstring_printf(fmt, args);
for (size_t i = 0; i != serverManager->size(); i++) {
serverManager->getServer(i)->messageChannels(m_logChanType, msg);
serverManager->getServer(i)->messageChannels(m_logChanType, message);
}
}
@ -1219,19 +1216,15 @@ void RenX::Server::sendPubChan(std::string_view msg) const {
void RenX::Server::sendAdmChan(const char *fmt, ...) const {
va_list args;
va_start(args, fmt);
Jupiter::StringL msg;
std::string_view serverPrefix = getPrefix();
if (!serverPrefix.empty()) {
msg += serverPrefix;
msg += ' ';
msg.avformat(fmt, args);
}
else {
msg.vformat(fmt, args);
std::string message{ getPrefix() };
if (!message.empty()) {
message += ' ';
}
va_end(args);
message += vstring_printf(fmt, args);
for (size_t i = 0; i != serverManager->size(); i++) {
serverManager->getServer(i)->messageChannels(m_adminLogChanType, msg);
serverManager->getServer(i)->messageChannels(m_adminLogChanType, message);
}
}
@ -1255,24 +1248,20 @@ void RenX::Server::sendAdmChan(std::string_view msg) const {
}
void RenX::Server::sendLogChan(const char *fmt, ...) const {
IRC_Bot *server;
va_list args;
va_start(args, fmt);
Jupiter::StringL msg;
std::string_view serverPrefix = getPrefix();
if (!serverPrefix.empty()) {
msg += serverPrefix;
msg += ' ';
msg.avformat(fmt, args);
}
else {
msg.vformat(fmt, args);
std::string message{ getPrefix() };
if (!message.empty()) {
message += ' ';
}
va_end(args);
message += vstring_printf(fmt, args);
IRC_Bot* server;
for (size_t i = 0; i != serverManager->size(); i++) {
server = serverManager->getServer(i);
server->messageChannels(m_logChanType, msg);
server->messageChannels(m_adminLogChanType, msg);
server->messageChannels(m_logChanType, message);
server->messageChannels(m_adminLogChanType, message);
}
}
@ -2820,7 +2809,7 @@ void RenX::Server::processLine(std::string_view line) {
{
player->global_rank = itr->rank;
if (m_rconVersion >= 4)
sendData(Jupiter::StringS::Format("dset_rank %d %d\n", player->id, player->global_rank));
sendData(string_printf("dset_rank %d %d\n", player->id, player->global_rank));
}
break;
}
@ -2923,7 +2912,7 @@ void RenX::Server::processLine(std::string_view line) {
if (m_devBot && player->global_rank != 0U)
{
if (m_rconVersion >= 4)
sendData(Jupiter::StringS::Format("dset_rank %d %d\n", player->id, player->global_rank));
sendData(string_printf("dset_rank %d %d\n", player->id, player->global_rank));
}
for (const auto& plugin : xPlugins) {
@ -3208,7 +3197,7 @@ void RenX::Server::processLine(std::string_view line) {
RenX::PlayerInfo *player = parseGetPlayerOrAdd(getToken(tokens.size() - 1));
if ((player->ban_flags & RenX::BanDatabase::Entry::FLAG_TYPE_VOTE) != 0)
sendData(Jupiter::StringS::Format("ccancelvote %.*s\n", teamToken.size(), teamToken.data()));
sendData(string_printf("ccancelvote %.*s\n", teamToken.size(), teamToken.data()));
for (const auto& plugin : xPlugins) {
plugin->RenX_OnVoteOther(*this, team, voteType, *player);
@ -3219,7 +3208,7 @@ void RenX::Server::processLine(std::string_view line) {
RenX::PlayerInfo *player = parseGetPlayerOrAdd(getToken(5));
if ((player->ban_flags & RenX::BanDatabase::Entry::FLAG_TYPE_VOTE) != 0)
sendData(Jupiter::StringS::Format("ccancelvote %.*s\n", teamToken.size(), teamToken.data()));
sendData(string_printf("ccancelvote %.*s\n", teamToken.size(), teamToken.data()));
// PARSE PARAMETERS HERE
@ -3613,7 +3602,7 @@ bool RenX::Server::connect() {
if (m_sock.connect(m_hostname.c_str(), m_port, m_clientHostname.empty() ? nullptr : m_clientHostname.c_str()))
{
m_sock.setBlocking(false);
sendSocket(Jupiter::StringS::Format("a%.*s\n", m_pass.size(), m_pass.data()));
sendSocket(string_printf("a%.*s\n", m_pass.size(), m_pass.data()));
m_connected = true;
m_attempts = 0;
return true;
@ -3684,7 +3673,7 @@ std::string_view RenX::Server::getRCONUsername() const {
RenX::Server::Server(Jupiter::Socket &&socket, std::string_view configurationSection) : Server(configurationSection) {
m_sock = std::move(socket);
m_hostname = m_sock.getRemoteHostname();
sendSocket(Jupiter::StringS::Format("a%.*s\n", m_pass.size(), m_pass.data()));
sendSocket(string_printf("a%.*s\n", m_pass.size(), m_pass.data()));
m_connected = true;
}

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

@ -450,7 +450,7 @@ void TagsImp::processTags(std::string& msg, const RenX::Server *server, const Re
PROCESS_TAG(this->INTERNAL_TIME_TAG, std::string_view(getTimeFormat(this->timeFmt.c_str())));
if (server != nullptr)
{
PROCESS_TAG(this->INTERNAL_RCON_VERSION_TAG, Jupiter::StringS::Format("%u", server->getVersion()));
PROCESS_TAG(this->INTERNAL_RCON_VERSION_TAG, string_printf("%u", server->getVersion()));
PROCESS_TAG(this->INTERNAL_GAME_VERSION_TAG, server->getGameVersion());
PROCESS_TAG(this->INTERNAL_RULES_TAG, server->getRules());
PROCESS_TAG(this->INTERNAL_USER_TAG, server->getUser());
@ -458,9 +458,9 @@ void TagsImp::processTags(std::string& msg, const RenX::Server *server, const Re
PROCESS_TAG(this->INTERNAL_MAP_TAG, server->getMap().name);
PROCESS_TAG(this->INTERNAL_MAP_GUID_TAG, RenX::formatGUID(server->getMap()));
PROCESS_TAG(this->INTERNAL_SERVER_HOSTNAME_TAG, server->getHostname());
PROCESS_TAG(this->INTERNAL_SERVER_PORT_TAG, Jupiter::StringS::Format("%u", server->getPort()));
PROCESS_TAG(this->INTERNAL_SERVER_PORT_TAG, string_printf("%u", server->getPort()));
PROCESS_TAG(this->INTERNAL_SOCKET_HOSTNAME_TAG, server->getSocketHostname());
PROCESS_TAG(this->INTERNAL_SOCKET_PORT_TAG, Jupiter::StringS::Format("%u", server->getSocketPort()));
PROCESS_TAG(this->INTERNAL_SOCKET_PORT_TAG, string_printf("%u", server->getSocketPort()));
PROCESS_TAG(this->INTERNAL_SERVER_PREFIX_TAG, server->getPrefix());
if (player != nullptr)
{
@ -484,7 +484,7 @@ void TagsImp::processTags(std::string& msg, const RenX::Server *server, const Re
PROCESS_TAG(this->INTERNAL_RDNS_TAG, player->get_rdns());
}
PROCESS_TAG(this->INTERNAL_UUID_TAG, player->uuid);
PROCESS_TAG(this->INTERNAL_ID_TAG, Jupiter::StringS::Format("%d", player->id));
PROCESS_TAG(this->INTERNAL_ID_TAG, string_printf("%d", player->id));
PROCESS_TAG(this->INTERNAL_CHARACTER_TAG, RenX::translateName(player->character));
PROCESS_TAG(this->INTERNAL_VEHICLE_TAG, RenX::translateName(player->vehicle));
PROCESS_TAG(this->INTERNAL_ADMIN_TAG, player->adminType);
@ -493,27 +493,27 @@ void TagsImp::processTags(std::string& msg, const RenX::Server *server, const Re
PROCESS_TAG(this->INTERNAL_TEAM_COLOR_TAG, RenX::getTeamColor(player->team));
PROCESS_TAG(this->INTERNAL_TEAM_SHORT_TAG, RenX::getTeamName(player->team));
PROCESS_TAG(this->INTERNAL_TEAM_LONG_TAG, RenX::getFullTeamName(player->team));
PROCESS_TAG(this->INTERNAL_PING_TAG, Jupiter::StringS::Format("%hu", player->ping));
PROCESS_TAG(this->INTERNAL_SCORE_TAG, Jupiter::StringS::Format("%.0f", player->score));
PROCESS_TAG(this->INTERNAL_SCORE_PER_MINUTE_TAG, Jupiter::StringS::Format("%.2f", get_ratio(static_cast<double>(player->score), static_cast<double>((std::chrono::steady_clock::now() - player->joinTime).count()) / 60.0)));
PROCESS_TAG(this->INTERNAL_CREDITS_TAG, Jupiter::StringS::Format("%.0f", player->credits));
PROCESS_TAG(this->INTERNAL_KILLS_TAG, Jupiter::StringS::Format("%u", player->kills));
PROCESS_TAG(this->INTERNAL_DEATHS_TAG, Jupiter::StringS::Format("%u", player->deaths));
PROCESS_TAG(this->INTERNAL_KDR_TAG, Jupiter::StringS::Format("%.2f", get_ratio(static_cast<double>(player->kills), static_cast<double>(player->deaths))));
PROCESS_TAG(this->INTERNAL_SUICIDES_TAG, Jupiter::StringS::Format("%u", player->suicides));
PROCESS_TAG(this->INTERNAL_HEADSHOTS_TAG, Jupiter::StringS::Format("%u", player->headshots));
PROCESS_TAG(this->INTERNAL_HEADSHOT_KILL_RATIO_TAG, Jupiter::StringS::Format("%.2f", get_ratio(player->headshots, player->kills)));
PROCESS_TAG(this->INTERNAL_VEHICLE_KILLS_TAG, Jupiter::StringS::Format("%u", player->vehicleKills));
PROCESS_TAG(this->INTERNAL_BUILDING_KILLS_TAG, Jupiter::StringS::Format("%u", player->buildingKills));
PROCESS_TAG(this->INTERNAL_DEFENCE_KILLS_TAG, Jupiter::StringS::Format("%u", player->defenceKills));
PROCESS_TAG(this->INTERNAL_WINS_TAG, Jupiter::StringS::Format("%u", player->wins));
PROCESS_TAG(this->INTERNAL_LOSSES_TAG, Jupiter::StringS::Format("%u", player->loses));
PROCESS_TAG(this->INTERNAL_BEACON_PLACEMENTS_TAG, Jupiter::StringS::Format("%u", player->beaconPlacements));
PROCESS_TAG(this->INTERNAL_BEACON_DISARMS_TAG, Jupiter::StringS::Format("%u", player->beaconDisarms));
PROCESS_TAG(this->INTERNAL_CAPTURES_TAG, Jupiter::StringS::Format("%u", player->captures));
PROCESS_TAG(this->INTERNAL_STEALS_TAG, Jupiter::StringS::Format("%u", player->steals));
PROCESS_TAG(this->INTERNAL_STOLEN_TAG, Jupiter::StringS::Format("%u", player->stolen));
PROCESS_TAG(this->INTERNAL_ACCESS_TAG, Jupiter::StringS::Format("%d", player->access));
PROCESS_TAG(this->INTERNAL_PING_TAG, string_printf("%hu", player->ping));
PROCESS_TAG(this->INTERNAL_SCORE_TAG, string_printf("%.0f", player->score));
PROCESS_TAG(this->INTERNAL_SCORE_PER_MINUTE_TAG, string_printf("%.2f", get_ratio(static_cast<double>(player->score), static_cast<double>((std::chrono::steady_clock::now() - player->joinTime).count()) / 60.0)));
PROCESS_TAG(this->INTERNAL_CREDITS_TAG, string_printf("%.0f", player->credits));
PROCESS_TAG(this->INTERNAL_KILLS_TAG, string_printf("%u", player->kills));
PROCESS_TAG(this->INTERNAL_DEATHS_TAG, string_printf("%u", player->deaths));
PROCESS_TAG(this->INTERNAL_KDR_TAG, string_printf("%.2f", get_ratio(static_cast<double>(player->kills), static_cast<double>(player->deaths))));
PROCESS_TAG(this->INTERNAL_SUICIDES_TAG, string_printf("%u", player->suicides));
PROCESS_TAG(this->INTERNAL_HEADSHOTS_TAG, string_printf("%u", player->headshots));
PROCESS_TAG(this->INTERNAL_HEADSHOT_KILL_RATIO_TAG, string_printf("%.2f", get_ratio(player->headshots, player->kills)));
PROCESS_TAG(this->INTERNAL_VEHICLE_KILLS_TAG, string_printf("%u", player->vehicleKills));
PROCESS_TAG(this->INTERNAL_BUILDING_KILLS_TAG, string_printf("%u", player->buildingKills));
PROCESS_TAG(this->INTERNAL_DEFENCE_KILLS_TAG, string_printf("%u", player->defenceKills));
PROCESS_TAG(this->INTERNAL_WINS_TAG, string_printf("%u", player->wins));
PROCESS_TAG(this->INTERNAL_LOSSES_TAG, string_printf("%u", player->loses));
PROCESS_TAG(this->INTERNAL_BEACON_PLACEMENTS_TAG, string_printf("%u", player->beaconPlacements));
PROCESS_TAG(this->INTERNAL_BEACON_DISARMS_TAG, string_printf("%u", player->beaconDisarms));
PROCESS_TAG(this->INTERNAL_CAPTURES_TAG, string_printf("%u", player->captures));
PROCESS_TAG(this->INTERNAL_STEALS_TAG, string_printf("%u", player->steals));
PROCESS_TAG(this->INTERNAL_STOLEN_TAG, string_printf("%u", player->stolen));
PROCESS_TAG(this->INTERNAL_ACCESS_TAG, string_printf("%d", player->access));
}
if (victim != nullptr)
{
@ -528,7 +528,7 @@ void TagsImp::processTags(std::string& msg, const RenX::Server *server, const Re
PROCESS_TAG(this->INTERNAL_VICTIM_RDNS_TAG, victim->get_rdns());
}
PROCESS_TAG(this->INTERNAL_VICTIM_UUID_TAG, victim->uuid);
PROCESS_TAG(this->INTERNAL_VICTIM_ID_TAG, Jupiter::StringS::Format("%d", victim->id));
PROCESS_TAG(this->INTERNAL_VICTIM_ID_TAG, string_printf("%d", victim->id));
PROCESS_TAG(this->INTERNAL_VICTIM_CHARACTER_TAG, RenX::translateName(victim->character));
PROCESS_TAG(this->INTERNAL_VICTIM_VEHICLE_TAG, RenX::translateName(victim->vehicle));
PROCESS_TAG(this->INTERNAL_VICTIM_ADMIN_TAG, victim->adminType);
@ -537,41 +537,41 @@ void TagsImp::processTags(std::string& msg, const RenX::Server *server, const Re
PROCESS_TAG(this->INTERNAL_VICTIM_TEAM_COLOR_TAG, RenX::getTeamColor(victim->team));
PROCESS_TAG(this->INTERNAL_VICTIM_TEAM_SHORT_TAG, RenX::getTeamName(victim->team));
PROCESS_TAG(this->INTERNAL_VICTIM_TEAM_LONG_TAG, RenX::getFullTeamName(victim->team));
PROCESS_TAG(this->INTERNAL_VICTIM_PING_TAG, Jupiter::StringS::Format("%hu", victim->ping));
PROCESS_TAG(this->INTERNAL_VICTIM_SCORE_TAG, Jupiter::StringS::Format("%.0f", victim->score));
PROCESS_TAG(this->INTERNAL_VICTIM_SCORE_PER_MINUTE_TAG, Jupiter::StringS::Format("%.2f", get_ratio(static_cast<double>(victim->score), static_cast<double>((std::chrono::steady_clock::now() - victim->joinTime).count()) / 60.0)));
PROCESS_TAG(this->INTERNAL_VICTIM_CREDITS_TAG, Jupiter::StringS::Format("%.0f", victim->credits));
PROCESS_TAG(this->INTERNAL_VICTIM_KILLS_TAG, Jupiter::StringS::Format("%u", victim->kills));
PROCESS_TAG(this->INTERNAL_VICTIM_DEATHS_TAG, Jupiter::StringS::Format("%u", victim->deaths));
PROCESS_TAG(this->INTERNAL_VICTIM_KDR_TAG, Jupiter::StringS::Format("%.2f", get_ratio(static_cast<double>(victim->kills), static_cast<double>(victim->deaths))));
PROCESS_TAG(this->INTERNAL_VICTIM_SUICIDES_TAG, Jupiter::StringS::Format("%u", victim->suicides));
PROCESS_TAG(this->INTERNAL_VICTIM_HEADSHOTS_TAG, Jupiter::StringS::Format("%u", victim->headshots));
PROCESS_TAG(this->INTERNAL_VICTIM_HEADSHOT_KILL_RATIO_TAG, Jupiter::StringS::Format("%.2f", get_ratio(victim->headshots, victim->kills)));
PROCESS_TAG(this->INTERNAL_VICTIM_VEHICLE_KILLS_TAG, Jupiter::StringS::Format("%u", victim->vehicleKills));
PROCESS_TAG(this->INTERNAL_VICTIM_BUILDING_KILLS_TAG, Jupiter::StringS::Format("%u", victim->buildingKills));
PROCESS_TAG(this->INTERNAL_VICTIM_DEFENCE_KILLS_TAG, Jupiter::StringS::Format("%u", victim->defenceKills));
PROCESS_TAG(this->INTERNAL_VICTIM_WINS_TAG, Jupiter::StringS::Format("%u", victim->wins));
PROCESS_TAG(this->INTERNAL_VICTIM_LOSSES_TAG, Jupiter::StringS::Format("%u", victim->loses));
PROCESS_TAG(this->INTERNAL_VICTIM_BEACON_PLACEMENTS_TAG, Jupiter::StringS::Format("%u", victim->beaconPlacements));
PROCESS_TAG(this->INTERNAL_VICTIM_BEACON_DISARMS_TAG, Jupiter::StringS::Format("%u", victim->beaconDisarms));
PROCESS_TAG(this->INTERNAL_VICTIM_CAPTURES_TAG, Jupiter::StringS::Format("%u", victim->captures));
PROCESS_TAG(this->INTERNAL_VICTIM_STEALS_TAG, Jupiter::StringS::Format("%u", victim->steals));
PROCESS_TAG(this->INTERNAL_VICTIM_STOLEN_TAG, Jupiter::StringS::Format("%u", victim->stolen));
PROCESS_TAG(this->INTERNAL_VICTIM_ACCESS_TAG, Jupiter::StringS::Format("%d", victim->access));
PROCESS_TAG(this->INTERNAL_VICTIM_PING_TAG, string_printf("%hu", victim->ping));
PROCESS_TAG(this->INTERNAL_VICTIM_SCORE_TAG, string_printf("%.0f", victim->score));
PROCESS_TAG(this->INTERNAL_VICTIM_SCORE_PER_MINUTE_TAG, string_printf("%.2f", get_ratio(static_cast<double>(victim->score), static_cast<double>((std::chrono::steady_clock::now() - victim->joinTime).count()) / 60.0)));
PROCESS_TAG(this->INTERNAL_VICTIM_CREDITS_TAG, string_printf("%.0f", victim->credits));
PROCESS_TAG(this->INTERNAL_VICTIM_KILLS_TAG, string_printf("%u", victim->kills));
PROCESS_TAG(this->INTERNAL_VICTIM_DEATHS_TAG, string_printf("%u", victim->deaths));
PROCESS_TAG(this->INTERNAL_VICTIM_KDR_TAG, string_printf("%.2f", get_ratio(static_cast<double>(victim->kills), static_cast<double>(victim->deaths))));
PROCESS_TAG(this->INTERNAL_VICTIM_SUICIDES_TAG, string_printf("%u", victim->suicides));
PROCESS_TAG(this->INTERNAL_VICTIM_HEADSHOTS_TAG, string_printf("%u", victim->headshots));
PROCESS_TAG(this->INTERNAL_VICTIM_HEADSHOT_KILL_RATIO_TAG, string_printf("%.2f", get_ratio(victim->headshots, victim->kills)));
PROCESS_TAG(this->INTERNAL_VICTIM_VEHICLE_KILLS_TAG, string_printf("%u", victim->vehicleKills));
PROCESS_TAG(this->INTERNAL_VICTIM_BUILDING_KILLS_TAG, string_printf("%u", victim->buildingKills));
PROCESS_TAG(this->INTERNAL_VICTIM_DEFENCE_KILLS_TAG, string_printf("%u", victim->defenceKills));
PROCESS_TAG(this->INTERNAL_VICTIM_WINS_TAG, string_printf("%u", victim->wins));
PROCESS_TAG(this->INTERNAL_VICTIM_LOSSES_TAG, string_printf("%u", victim->loses));
PROCESS_TAG(this->INTERNAL_VICTIM_BEACON_PLACEMENTS_TAG, string_printf("%u", victim->beaconPlacements));
PROCESS_TAG(this->INTERNAL_VICTIM_BEACON_DISARMS_TAG, string_printf("%u", victim->beaconDisarms));
PROCESS_TAG(this->INTERNAL_VICTIM_CAPTURES_TAG, string_printf("%u", victim->captures));
PROCESS_TAG(this->INTERNAL_VICTIM_STEALS_TAG, string_printf("%u", victim->steals));
PROCESS_TAG(this->INTERNAL_VICTIM_STOLEN_TAG, string_printf("%u", victim->stolen));
PROCESS_TAG(this->INTERNAL_VICTIM_ACCESS_TAG, string_printf("%d", victim->access));
}
if (building != nullptr)
{
PROCESS_TAG(this->INTERNAL_BUILDING_NAME_TAG, RenX::translateName(building->name));
PROCESS_TAG(this->INTERNAL_BUILDING_RAW_NAME_TAG, building->name);
PROCESS_TAG(this->INTERNAL_BUILDING_HEALTH_TAG, Jupiter::StringS::Format("%d", building->health));
PROCESS_TAG(this->INTERNAL_BUILDING_MAX_HEALTH_TAG, Jupiter::StringS::Format("%d", building->max_health));
PROCESS_TAG(this->INTERNAL_BUILDING_HEALTH_PERCENTAGE_TAG, Jupiter::StringS::Format("%.0f", (building->health / building->max_health) * 100.0));
PROCESS_TAG(this->INTERNAL_BUILDING_ARMOR_TAG, Jupiter::StringS::Format("%d", building->armor));
PROCESS_TAG(this->INTERNAL_BUILDING_MAX_ARMOR_TAG, Jupiter::StringS::Format("%d", building->max_armor));
PROCESS_TAG(this->INTERNAL_BUILDING_ARMOR_PERCENTAGE_TAG, Jupiter::StringS::Format("%.0f", (static_cast<double>(building->armor) / static_cast<double>(building->max_armor)) * 100.0));
PROCESS_TAG(this->INTERNAL_BUILDING_DURABILITY_TAG, Jupiter::StringS::Format("%d", building->health + building->armor));
PROCESS_TAG(this->INTERNAL_BUILDING_MAX_DURABILITY_TAG, Jupiter::StringS::Format("%d", building->max_health + building->max_armor));
PROCESS_TAG(this->INTERNAL_BUILDING_DURABILITY_PERCENTAGE_TAG, Jupiter::StringS::Format("%.0f", (static_cast<double>(building->health + building->armor) / static_cast<double>(building->max_health + building->max_armor)) * 100.0));
PROCESS_TAG(this->INTERNAL_BUILDING_HEALTH_TAG, string_printf("%d", building->health));
PROCESS_TAG(this->INTERNAL_BUILDING_MAX_HEALTH_TAG, string_printf("%d", building->max_health));
PROCESS_TAG(this->INTERNAL_BUILDING_HEALTH_PERCENTAGE_TAG, string_printf("%.0f", (building->health / building->max_health) * 100.0));
PROCESS_TAG(this->INTERNAL_BUILDING_ARMOR_TAG, string_printf("%d", building->armor));
PROCESS_TAG(this->INTERNAL_BUILDING_MAX_ARMOR_TAG, string_printf("%d", building->max_armor));
PROCESS_TAG(this->INTERNAL_BUILDING_ARMOR_PERCENTAGE_TAG, string_printf("%.0f", (static_cast<double>(building->armor) / static_cast<double>(building->max_armor)) * 100.0));
PROCESS_TAG(this->INTERNAL_BUILDING_DURABILITY_TAG, string_printf("%d", building->health + building->armor));
PROCESS_TAG(this->INTERNAL_BUILDING_MAX_DURABILITY_TAG, string_printf("%d", building->max_health + building->max_armor));
PROCESS_TAG(this->INTERNAL_BUILDING_DURABILITY_PERCENTAGE_TAG, string_printf("%.0f", (static_cast<double>(building->health + building->armor) / static_cast<double>(building->max_health + building->max_armor)) * 100.0));
PROCESS_TAG(this->INTERNAL_BUILDING_TEAM_COLOR_TAG, RenX::getTeamColor(building->team));
PROCESS_TAG(this->INTERNAL_BUILDING_TEAM_SHORT_TAG, RenX::getTeamName(building->team));
PROCESS_TAG(this->INTERNAL_BUILDING_TEAM_LONG_TAG, RenX::getFullTeamName(building->team));
@ -588,93 +588,93 @@ void TagsImp::processTags(std::string& msg, const RenX::LadderDatabase::Entry &e
uint32_t total_tied_games = entry.total_wins - entry.total_gdi_wins - entry.total_nod_wins;
PROCESS_TAG(this->INTERNAL_NAME_TAG, entry.most_recent_name);
PROCESS_TAG(this->INTERNAL_STEAM_TAG, Jupiter::StringS::Format("%llu", entry.steam_id));
PROCESS_TAG(this->INTERNAL_RANK_TAG, Jupiter::StringS::Format("%u", entry.rank));
PROCESS_TAG(this->INTERNAL_LAST_GAME_TAG, Jupiter::StringS::Format("XX Xuary 20XX at 00:00:00")); // TODO: format this!
PROCESS_TAG(this->INTERNAL_STEAM_TAG, string_printf("%llu", entry.steam_id));
PROCESS_TAG(this->INTERNAL_RANK_TAG, string_printf("%u", entry.rank));
PROCESS_TAG(this->INTERNAL_LAST_GAME_TAG, string_printf("XX Xuary 20XX at 00:00:00")); // TODO: format this!
/** Totals */
PROCESS_TAG(this->INTERNAL_SCORE_TAG, Jupiter::StringS::Format("%llu", entry.total_score));
PROCESS_TAG(this->INTERNAL_KILLS_TAG, Jupiter::StringS::Format("%u", entry.total_kills));
PROCESS_TAG(this->INTERNAL_DEATHS_TAG, Jupiter::StringS::Format("%u", entry.total_deaths));
PROCESS_TAG(this->INTERNAL_KDR_TAG, Jupiter::StringS::Format("%.2f", get_ratio(static_cast<double>(entry.total_kills), static_cast<double>(entry.total_deaths))));
PROCESS_TAG(this->INTERNAL_SCORE_PER_MINUTE_TAG, Jupiter::StringS::Format("%.2f", get_ratio(static_cast<double>(entry.total_score), static_cast<double>(entry.total_game_time) / 60.0)));
PROCESS_TAG(this->INTERNAL_HEADSHOTS_TAG, Jupiter::StringS::Format("%u", entry.total_headshot_kills));
PROCESS_TAG(this->INTERNAL_HEADSHOT_KILL_RATIO_TAG, Jupiter::StringS::Format("%.2f", get_ratio(entry.total_headshot_kills, entry.total_kills)));
PROCESS_TAG(this->INTERNAL_VEHICLE_KILLS_TAG, Jupiter::StringS::Format("%u", entry.total_vehicle_kills));
PROCESS_TAG(this->INTERNAL_BUILDING_KILLS_TAG, Jupiter::StringS::Format("%u", entry.total_building_kills));
PROCESS_TAG(this->INTERNAL_DEFENCE_KILLS_TAG, Jupiter::StringS::Format("%u", entry.total_defence_kills));
PROCESS_TAG(this->INTERNAL_CAPTURES_TAG, Jupiter::StringS::Format("%u", entry.total_captures));
PROCESS_TAG(this->INTERNAL_GAME_TIME_TAG, Jupiter::StringS::Format("%u", entry.total_game_time));
PROCESS_TAG(this->INTERNAL_GAMES_TAG, Jupiter::StringS::Format("%u", entry.total_games));
PROCESS_TAG(this->INTERNAL_WINS_TAG, Jupiter::StringS::Format("%u", entry.total_wins));
PROCESS_TAG(this->INTERNAL_TIES_TAG, Jupiter::StringS::Format("%u", total_tied_games));
PROCESS_TAG(this->INTERNAL_LOSSES_TAG, Jupiter::StringS::Format("%u", entry.total_games - total_tied_games - entry.total_wins));
PROCESS_TAG(this->INTERNAL_WIN_LOSS_RATIO_TAG, Jupiter::StringS::Format("%.2f", get_ratio(static_cast<double>(entry.total_wins), static_cast<double>(entry.total_games - entry.total_wins))));
PROCESS_TAG(this->INTERNAL_BEACON_PLACEMENTS_TAG, Jupiter::StringS::Format("%u", entry.total_beacon_placements));
PROCESS_TAG(this->INTERNAL_BEACON_DISARMS_TAG, Jupiter::StringS::Format("%u", entry.total_beacon_disarms));
PROCESS_TAG(this->INTERNAL_PROXY_PLACEMENTS_TAG, Jupiter::StringS::Format("%u", entry.total_proxy_placements));
PROCESS_TAG(this->INTERNAL_PROXY_DISARMS_TAG, Jupiter::StringS::Format("%u", entry.total_proxy_disarms));
PROCESS_TAG(this->INTERNAL_SCORE_TAG, string_printf("%llu", entry.total_score));
PROCESS_TAG(this->INTERNAL_KILLS_TAG, string_printf("%u", entry.total_kills));
PROCESS_TAG(this->INTERNAL_DEATHS_TAG, string_printf("%u", entry.total_deaths));
PROCESS_TAG(this->INTERNAL_KDR_TAG, string_printf("%.2f", get_ratio(static_cast<double>(entry.total_kills), static_cast<double>(entry.total_deaths))));
PROCESS_TAG(this->INTERNAL_SCORE_PER_MINUTE_TAG, string_printf("%.2f", get_ratio(static_cast<double>(entry.total_score), static_cast<double>(entry.total_game_time) / 60.0)));
PROCESS_TAG(this->INTERNAL_HEADSHOTS_TAG, string_printf("%u", entry.total_headshot_kills));
PROCESS_TAG(this->INTERNAL_HEADSHOT_KILL_RATIO_TAG, string_printf("%.2f", get_ratio(entry.total_headshot_kills, entry.total_kills)));
PROCESS_TAG(this->INTERNAL_VEHICLE_KILLS_TAG, string_printf("%u", entry.total_vehicle_kills));
PROCESS_TAG(this->INTERNAL_BUILDING_KILLS_TAG, string_printf("%u", entry.total_building_kills));
PROCESS_TAG(this->INTERNAL_DEFENCE_KILLS_TAG, string_printf("%u", entry.total_defence_kills));
PROCESS_TAG(this->INTERNAL_CAPTURES_TAG, string_printf("%u", entry.total_captures));
PROCESS_TAG(this->INTERNAL_GAME_TIME_TAG, string_printf("%u", entry.total_game_time));
PROCESS_TAG(this->INTERNAL_GAMES_TAG, string_printf("%u", entry.total_games));
PROCESS_TAG(this->INTERNAL_WINS_TAG, string_printf("%u", entry.total_wins));
PROCESS_TAG(this->INTERNAL_TIES_TAG, string_printf("%u", total_tied_games));
PROCESS_TAG(this->INTERNAL_LOSSES_TAG, string_printf("%u", entry.total_games - total_tied_games - entry.total_wins));
PROCESS_TAG(this->INTERNAL_WIN_LOSS_RATIO_TAG, string_printf("%.2f", get_ratio(static_cast<double>(entry.total_wins), static_cast<double>(entry.total_games - entry.total_wins))));
PROCESS_TAG(this->INTERNAL_BEACON_PLACEMENTS_TAG, string_printf("%u", entry.total_beacon_placements));
PROCESS_TAG(this->INTERNAL_BEACON_DISARMS_TAG, string_printf("%u", entry.total_beacon_disarms));
PROCESS_TAG(this->INTERNAL_PROXY_PLACEMENTS_TAG, string_printf("%u", entry.total_proxy_placements));
PROCESS_TAG(this->INTERNAL_PROXY_DISARMS_TAG, string_printf("%u", entry.total_proxy_disarms));
/** GDI Totals */
PROCESS_TAG(this->INTERNAL_GDI_GAMES_TAG, Jupiter::StringS::Format("%u", entry.total_gdi_games));
PROCESS_TAG(this->INTERNAL_GDI_WINS_TAG, Jupiter::StringS::Format("%u", entry.total_gdi_wins));
PROCESS_TAG(this->INTERNAL_GDI_TIES_TAG, Jupiter::StringS::Format("%u", entry.total_gdi_ties));
PROCESS_TAG(this->INTERNAL_GDI_LOSSES_TAG, Jupiter::StringS::Format("%u", entry.total_gdi_games - entry.total_gdi_wins - entry.total_gdi_ties));
PROCESS_TAG(this->INTERNAL_GDI_WIN_LOSS_RATIO_TAG, Jupiter::StringS::Format("%.2f", get_ratio(static_cast<double>(entry.total_gdi_wins), static_cast<double>(entry.total_gdi_games - entry.total_gdi_wins - entry.total_gdi_ties))));
PROCESS_TAG(this->INTERNAL_GDI_SCORE_TAG, Jupiter::StringS::Format("%llu", entry.total_gdi_score));
PROCESS_TAG(this->INTERNAL_GDI_SPM_TAG, Jupiter::StringS::Format("%.2f", get_ratio(static_cast<double>(entry.total_gdi_score), static_cast<double>(entry.total_gdi_game_time) / 60.0)));
PROCESS_TAG(this->INTERNAL_GDI_GAME_TIME_TAG, Jupiter::StringS::Format("%u", entry.total_gdi_game_time));
PROCESS_TAG(this->INTERNAL_GDI_TIES_TAG, Jupiter::StringS::Format("%u", entry.total_gdi_ties));
PROCESS_TAG(this->INTERNAL_GDI_BEACON_PLACEMENTS_TAG, Jupiter::StringS::Format("%u", entry.total_gdi_beacon_placements));
PROCESS_TAG(this->INTERNAL_GDI_BEACON_DISARMS_TAG, Jupiter::StringS::Format("%u", entry.total_gdi_beacon_disarms));
PROCESS_TAG(this->INTERNAL_GDI_PROXY_PLACEMENTS_TAG, Jupiter::StringS::Format("%u", entry.total_gdi_proxy_placements));
PROCESS_TAG(this->INTERNAL_GDI_PROXY_DISARMS_TAG, Jupiter::StringS::Format("%u", entry.total_gdi_proxy_disarms));
PROCESS_TAG(this->INTERNAL_GDI_KILLS_TAG, Jupiter::StringS::Format("%u", entry.total_gdi_kills));
PROCESS_TAG(this->INTERNAL_GDI_DEATHS_TAG, Jupiter::StringS::Format("%u", entry.total_gdi_deaths));
PROCESS_TAG(this->INTERNAL_GDI_VEHICLE_KILLS_TAG, Jupiter::StringS::Format("%u", entry.total_gdi_vehicle_kills));
PROCESS_TAG(this->INTERNAL_GDI_DEFENCE_KILLS_TAG, Jupiter::StringS::Format("%u", entry.total_gdi_defence_kills));
PROCESS_TAG(this->INTERNAL_GDI_BUILDING_KILLS_TAG, Jupiter::StringS::Format("%u", entry.total_gdi_building_kills));
PROCESS_TAG(this->INTERNAL_GDI_KDR_TAG, Jupiter::StringS::Format("%.2f", get_ratio(static_cast<double>(entry.total_gdi_kills), static_cast<double>(entry.total_gdi_deaths))));
PROCESS_TAG(this->INTERNAL_GDI_HEADSHOTS_TAG, Jupiter::StringS::Format("%u", entry.total_gdi_headshots));
PROCESS_TAG(this->INTERNAL_GDI_HEADSHOT_KILL_RATIO_TAG, Jupiter::StringS::Format("%.2f", get_ratio(static_cast<double>(entry.total_gdi_headshots), static_cast<double>(entry.total_gdi_kills))));
PROCESS_TAG(this->INTERNAL_GDI_GAMES_TAG, string_printf("%u", entry.total_gdi_games));
PROCESS_TAG(this->INTERNAL_GDI_WINS_TAG, string_printf("%u", entry.total_gdi_wins));
PROCESS_TAG(this->INTERNAL_GDI_TIES_TAG, string_printf("%u", entry.total_gdi_ties));
PROCESS_TAG(this->INTERNAL_GDI_LOSSES_TAG, string_printf("%u", entry.total_gdi_games - entry.total_gdi_wins - entry.total_gdi_ties));
PROCESS_TAG(this->INTERNAL_GDI_WIN_LOSS_RATIO_TAG, string_printf("%.2f", get_ratio(static_cast<double>(entry.total_gdi_wins), static_cast<double>(entry.total_gdi_games - entry.total_gdi_wins - entry.total_gdi_ties))));
PROCESS_TAG(this->INTERNAL_GDI_SCORE_TAG, string_printf("%llu", entry.total_gdi_score));
PROCESS_TAG(this->INTERNAL_GDI_SPM_TAG, string_printf("%.2f", get_ratio(static_cast<double>(entry.total_gdi_score), static_cast<double>(entry.total_gdi_game_time) / 60.0)));
PROCESS_TAG(this->INTERNAL_GDI_GAME_TIME_TAG, string_printf("%u", entry.total_gdi_game_time));
PROCESS_TAG(this->INTERNAL_GDI_TIES_TAG, string_printf("%u", entry.total_gdi_ties));
PROCESS_TAG(this->INTERNAL_GDI_BEACON_PLACEMENTS_TAG, string_printf("%u", entry.total_gdi_beacon_placements));
PROCESS_TAG(this->INTERNAL_GDI_BEACON_DISARMS_TAG, string_printf("%u", entry.total_gdi_beacon_disarms));
PROCESS_TAG(this->INTERNAL_GDI_PROXY_PLACEMENTS_TAG, string_printf("%u", entry.total_gdi_proxy_placements));
PROCESS_TAG(this->INTERNAL_GDI_PROXY_DISARMS_TAG, string_printf("%u", entry.total_gdi_proxy_disarms));
PROCESS_TAG(this->INTERNAL_GDI_KILLS_TAG, string_printf("%u", entry.total_gdi_kills));
PROCESS_TAG(this->INTERNAL_GDI_DEATHS_TAG, string_printf("%u", entry.total_gdi_deaths));
PROCESS_TAG(this->INTERNAL_GDI_VEHICLE_KILLS_TAG, string_printf("%u", entry.total_gdi_vehicle_kills));
PROCESS_TAG(this->INTERNAL_GDI_DEFENCE_KILLS_TAG, string_printf("%u", entry.total_gdi_defence_kills));
PROCESS_TAG(this->INTERNAL_GDI_BUILDING_KILLS_TAG, string_printf("%u", entry.total_gdi_building_kills));
PROCESS_TAG(this->INTERNAL_GDI_KDR_TAG, string_printf("%.2f", get_ratio(static_cast<double>(entry.total_gdi_kills), static_cast<double>(entry.total_gdi_deaths))));
PROCESS_TAG(this->INTERNAL_GDI_HEADSHOTS_TAG, string_printf("%u", entry.total_gdi_headshots));
PROCESS_TAG(this->INTERNAL_GDI_HEADSHOT_KILL_RATIO_TAG, string_printf("%.2f", get_ratio(static_cast<double>(entry.total_gdi_headshots), static_cast<double>(entry.total_gdi_kills))));
/** Nod Totals */
PROCESS_TAG(this->INTERNAL_NOD_GAMES_TAG, Jupiter::StringS::Format("%u", entry.total_nod_games));
PROCESS_TAG(this->INTERNAL_NOD_WINS_TAG, Jupiter::StringS::Format("%u", entry.total_nod_wins));
PROCESS_TAG(this->INTERNAL_NOD_TIES_TAG, Jupiter::StringS::Format("%u", entry.total_nod_ties));
PROCESS_TAG(this->INTERNAL_NOD_LOSSES_TAG, Jupiter::StringS::Format("%u", entry.total_nod_games - entry.total_nod_wins - entry.total_nod_ties));
PROCESS_TAG(this->INTERNAL_NOD_WIN_LOSS_RATIO_TAG, Jupiter::StringS::Format("%.2f", get_ratio(static_cast<double>(entry.total_nod_wins), static_cast<double>(entry.total_nod_games - entry.total_nod_wins - entry.total_nod_ties))));
PROCESS_TAG(this->INTERNAL_NOD_SCORE_TAG, Jupiter::StringS::Format("%llu", entry.total_nod_score));
PROCESS_TAG(this->INTERNAL_NOD_SPM_TAG, Jupiter::StringS::Format("%.2f", get_ratio(static_cast<double>(entry.total_nod_score), static_cast<double>(entry.total_nod_game_time) / 60.0)));
PROCESS_TAG(this->INTERNAL_NOD_GAME_TIME_TAG, Jupiter::StringS::Format("%u", entry.total_nod_game_time));
PROCESS_TAG(this->INTERNAL_NOD_TIES_TAG, Jupiter::StringS::Format("%u", entry.total_nod_ties));
PROCESS_TAG(this->INTERNAL_NOD_BEACON_PLACEMENTS_TAG, Jupiter::StringS::Format("%u", entry.total_nod_beacon_placements));
PROCESS_TAG(this->INTERNAL_NOD_BEACON_DISARMS_TAG, Jupiter::StringS::Format("%u", entry.total_nod_beacon_disarms));
PROCESS_TAG(this->INTERNAL_NOD_PROXY_PLACEMENTS_TAG, Jupiter::StringS::Format("%u", entry.total_nod_proxy_placements));
PROCESS_TAG(this->INTERNAL_NOD_PROXY_DISARMS_TAG, Jupiter::StringS::Format("%u", entry.total_nod_proxy_disarms));
PROCESS_TAG(this->INTERNAL_NOD_KILLS_TAG, Jupiter::StringS::Format("%u", entry.total_nod_kills));
PROCESS_TAG(this->INTERNAL_NOD_DEATHS_TAG, Jupiter::StringS::Format("%u", entry.total_nod_deaths));
PROCESS_TAG(this->INTERNAL_NOD_VEHICLE_KILLS_TAG, Jupiter::StringS::Format("%u", entry.total_nod_vehicle_kills));
PROCESS_TAG(this->INTERNAL_NOD_DEFENCE_KILLS_TAG, Jupiter::StringS::Format("%u", entry.total_nod_defence_kills));
PROCESS_TAG(this->INTERNAL_NOD_BUILDING_KILLS_TAG, Jupiter::StringS::Format("%u", entry.total_nod_building_kills));
PROCESS_TAG(this->INTERNAL_NOD_KDR_TAG, Jupiter::StringS::Format("%.2f", get_ratio(static_cast<double>(entry.total_nod_kills), static_cast<double>(entry.total_nod_deaths))));
PROCESS_TAG(this->INTERNAL_NOD_HEADSHOTS_TAG, Jupiter::StringS::Format("%u", entry.total_nod_headshots));
PROCESS_TAG(this->INTERNAL_NOD_HEADSHOT_KILL_RATIO_TAG, Jupiter::StringS::Format("%.2f", get_ratio(static_cast<double>(entry.total_nod_headshots), static_cast<double>(entry.total_nod_kills))));
PROCESS_TAG(this->INTERNAL_NOD_GAMES_TAG, string_printf("%u", entry.total_nod_games));
PROCESS_TAG(this->INTERNAL_NOD_WINS_TAG, string_printf("%u", entry.total_nod_wins));
PROCESS_TAG(this->INTERNAL_NOD_TIES_TAG, string_printf("%u", entry.total_nod_ties));
PROCESS_TAG(this->INTERNAL_NOD_LOSSES_TAG, string_printf("%u", entry.total_nod_games - entry.total_nod_wins - entry.total_nod_ties));
PROCESS_TAG(this->INTERNAL_NOD_WIN_LOSS_RATIO_TAG, string_printf("%.2f", get_ratio(static_cast<double>(entry.total_nod_wins), static_cast<double>(entry.total_nod_games - entry.total_nod_wins - entry.total_nod_ties))));
PROCESS_TAG(this->INTERNAL_NOD_SCORE_TAG, string_printf("%llu", entry.total_nod_score));
PROCESS_TAG(this->INTERNAL_NOD_SPM_TAG, string_printf("%.2f", get_ratio(static_cast<double>(entry.total_nod_score), static_cast<double>(entry.total_nod_game_time) / 60.0)));
PROCESS_TAG(this->INTERNAL_NOD_GAME_TIME_TAG, string_printf("%u", entry.total_nod_game_time));
PROCESS_TAG(this->INTERNAL_NOD_TIES_TAG, string_printf("%u", entry.total_nod_ties));
PROCESS_TAG(this->INTERNAL_NOD_BEACON_PLACEMENTS_TAG, string_printf("%u", entry.total_nod_beacon_placements));
PROCESS_TAG(this->INTERNAL_NOD_BEACON_DISARMS_TAG, string_printf("%u", entry.total_nod_beacon_disarms));
PROCESS_TAG(this->INTERNAL_NOD_PROXY_PLACEMENTS_TAG, string_printf("%u", entry.total_nod_proxy_placements));
PROCESS_TAG(this->INTERNAL_NOD_PROXY_DISARMS_TAG, string_printf("%u", entry.total_nod_proxy_disarms));
PROCESS_TAG(this->INTERNAL_NOD_KILLS_TAG, string_printf("%u", entry.total_nod_kills));
PROCESS_TAG(this->INTERNAL_NOD_DEATHS_TAG, string_printf("%u", entry.total_nod_deaths));
PROCESS_TAG(this->INTERNAL_NOD_VEHICLE_KILLS_TAG, string_printf("%u", entry.total_nod_vehicle_kills));
PROCESS_TAG(this->INTERNAL_NOD_DEFENCE_KILLS_TAG, string_printf("%u", entry.total_nod_defence_kills));
PROCESS_TAG(this->INTERNAL_NOD_BUILDING_KILLS_TAG, string_printf("%u", entry.total_nod_building_kills));
PROCESS_TAG(this->INTERNAL_NOD_KDR_TAG, string_printf("%.2f", get_ratio(static_cast<double>(entry.total_nod_kills), static_cast<double>(entry.total_nod_deaths))));
PROCESS_TAG(this->INTERNAL_NOD_HEADSHOTS_TAG, string_printf("%u", entry.total_nod_headshots));
PROCESS_TAG(this->INTERNAL_NOD_HEADSHOT_KILL_RATIO_TAG, string_printf("%.2f", get_ratio(static_cast<double>(entry.total_nod_headshots), static_cast<double>(entry.total_nod_kills))));
/** Tops */
PROCESS_TAG(this->INTERNAL_VICTIM_SCORE_TAG, Jupiter::StringS::Format("%u", entry.top_score));
PROCESS_TAG(this->INTERNAL_VICTIM_KILLS_TAG, Jupiter::StringS::Format("%u", entry.top_kills));
PROCESS_TAG(this->INTERNAL_VICTIM_DEATHS_TAG, Jupiter::StringS::Format("%u", entry.most_deaths));
PROCESS_TAG(this->INTERNAL_VICTIM_HEADSHOTS_TAG, Jupiter::StringS::Format("%u", entry.top_headshot_kills));
PROCESS_TAG(this->INTERNAL_VICTIM_VEHICLE_KILLS_TAG, Jupiter::StringS::Format("%u", entry.top_vehicle_kills));
PROCESS_TAG(this->INTERNAL_VICTIM_BUILDING_KILLS_TAG, Jupiter::StringS::Format("%u", entry.top_building_kills));
PROCESS_TAG(this->INTERNAL_VICTIM_DEFENCE_KILLS_TAG, Jupiter::StringS::Format("%u", entry.top_defence_kills));
PROCESS_TAG(this->INTERNAL_VICTIM_CAPTURES_TAG, Jupiter::StringS::Format("%u", entry.top_captures));
PROCESS_TAG(this->INTERNAL_VICTIM_GAME_TIME_TAG, Jupiter::StringS::Format("%u", entry.top_game_time));
PROCESS_TAG(this->INTERNAL_VICTIM_BEACON_PLACEMENTS_TAG, Jupiter::StringS::Format("%u", entry.top_beacon_placements));
PROCESS_TAG(this->INTERNAL_VICTIM_BEACON_DISARMS_TAG, Jupiter::StringS::Format("%u", entry.top_beacon_disarms));
PROCESS_TAG(this->INTERNAL_VICTIM_PROXY_PLACEMENTS_TAG, Jupiter::StringS::Format("%u", entry.top_proxy_placements));
PROCESS_TAG(this->INTERNAL_VICTIM_PROXY_DISARMS_TAG, Jupiter::StringS::Format("%u", entry.top_proxy_disarms));
PROCESS_TAG(this->INTERNAL_VICTIM_SCORE_TAG, string_printf("%u", entry.top_score));
PROCESS_TAG(this->INTERNAL_VICTIM_KILLS_TAG, string_printf("%u", entry.top_kills));
PROCESS_TAG(this->INTERNAL_VICTIM_DEATHS_TAG, string_printf("%u", entry.most_deaths));
PROCESS_TAG(this->INTERNAL_VICTIM_HEADSHOTS_TAG, string_printf("%u", entry.top_headshot_kills));
PROCESS_TAG(this->INTERNAL_VICTIM_VEHICLE_KILLS_TAG, string_printf("%u", entry.top_vehicle_kills));
PROCESS_TAG(this->INTERNAL_VICTIM_BUILDING_KILLS_TAG, string_printf("%u", entry.top_building_kills));
PROCESS_TAG(this->INTERNAL_VICTIM_DEFENCE_KILLS_TAG, string_printf("%u", entry.top_defence_kills));
PROCESS_TAG(this->INTERNAL_VICTIM_CAPTURES_TAG, string_printf("%u", entry.top_captures));
PROCESS_TAG(this->INTERNAL_VICTIM_GAME_TIME_TAG, string_printf("%u", entry.top_game_time));
PROCESS_TAG(this->INTERNAL_VICTIM_BEACON_PLACEMENTS_TAG, string_printf("%u", entry.top_beacon_placements));
PROCESS_TAG(this->INTERNAL_VICTIM_BEACON_DISARMS_TAG, string_printf("%u", entry.top_beacon_disarms));
PROCESS_TAG(this->INTERNAL_VICTIM_PROXY_PLACEMENTS_TAG, string_printf("%u", entry.top_proxy_placements));
PROCESS_TAG(this->INTERNAL_VICTIM_PROXY_DISARMS_TAG, string_printf("%u", entry.top_proxy_disarms));
}
void TagsImp::sanitizeTags(std::string& fmt)

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

@ -46,11 +46,11 @@ int RenX_ExtraLoggingPlugin::OnRehash()
}
bool RenX_ExtraLoggingPlugin::initialize() {
RenX_ExtraLoggingPlugin::filePrefix = this->config.get("FilePrefix"_jrs, Jupiter::StringS::Format("[%.*s] %.*s", RenX::tags->timeTag.size(),
RenX_ExtraLoggingPlugin::filePrefix = this->config.get("FilePrefix"_jrs, string_printf("[%.*s] %.*s", RenX::tags->timeTag.size(),
RenX::tags->timeTag.data(), RenX::tags->serverPrefixTag.size(),
RenX::tags->serverPrefixTag.data()));
RenX_ExtraLoggingPlugin::consolePrefix = this->config.get("ConsolePrefix"_jrs, RenX_ExtraLoggingPlugin::filePrefix);
RenX_ExtraLoggingPlugin::newDayFmt = this->config.get("NewDayFormat"_jrs, Jupiter::StringS::Format("Time: %.*s %.*s", RenX::tags->timeTag.size(),
RenX_ExtraLoggingPlugin::newDayFmt = this->config.get("NewDayFormat"_jrs, string_printf("Time: %.*s %.*s", RenX::tags->timeTag.size(),
RenX::tags->timeTag.data(), RenX::tags->dateTag.size(),
RenX::tags->dateTag.data()));
RenX_ExtraLoggingPlugin::printToConsole = this->config.get<bool>("PrintToConsole"_jrs, true);

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

@ -29,7 +29,7 @@ using namespace std::literals;
Jupiter::StringS calc_uuid(RenX::PlayerInfo &player)
{
if (player.steamid != 0U)
return Jupiter::StringS::Format("S%.16llX", player.steamid);
return string_printf("S%.16llX", player.steamid);
return "N"s + player.name;
}

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

@ -217,13 +217,13 @@ Jupiter::String generate_page_buttons(RenX::LadderDatabase *db) {
while (entry_index < entry_count) {
// Add page
result += R"html(<span class="leaderboard-page"><a href="?start=)html"_jrs;
result += Jupiter::StringS::Format("%u", entry_index);
result += string_printf("%u", entry_index);
if (db != RenX::default_ladder_database) {
result += "&database="_jrs;
result += db->getName();
}
result += R"html(">)html"_jrs;
result += Jupiter::StringS::Format("%u", page_index);
result += string_printf("%u", page_index);
result += R"html(</a></span>)html"_jrs;
// Increment indexes
@ -403,7 +403,7 @@ std::string* RenX_Ladder_WebPlugin::generate_profile_page(RenX::LadderDatabase *
{
profile_data = RenX_Ladder_WebPlugin::entry_profile_previous;
RenX::replace_tag(profile_data, RenX::tags->INTERNAL_OBJECT_TAG, db->getName());
RenX::replace_tag(profile_data, RenX::tags->INTERNAL_WEAPON_TAG, Jupiter::StringS::Format("%llu", entry->prev->steam_id));
RenX::replace_tag(profile_data, RenX::tags->INTERNAL_WEAPON_TAG, string_printf("%llu", entry->prev->steam_id));
RenX::processTags(profile_data, *entry->prev);
result->append(profile_data);
}
@ -411,7 +411,7 @@ std::string* RenX_Ladder_WebPlugin::generate_profile_page(RenX::LadderDatabase *
{
profile_data = RenX_Ladder_WebPlugin::entry_profile_next;
RenX::replace_tag(profile_data, RenX::tags->INTERNAL_OBJECT_TAG, db->getName());
RenX::replace_tag(profile_data, 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, string_printf("%llu", entry->next->steam_id));
RenX::processTags(profile_data, *entry->next);
result->append(profile_data);
}

2
src/Plugins/RenX/RenX.Ladder/RenX_Ladder.cpp

@ -85,7 +85,7 @@ RenX_LadderPlugin pluginInstance;
/** Ladder Commands */
Jupiter::StringS FormatLadderResponse(RenX::LadderDatabase::Entry *entry, size_t rank) {
return Jupiter::StringS::Format("#%" PRIuPTR ": \"%.*s\" - Score: %" PRIu64 " - Kills: %" PRIu32 " - Deaths: %" PRIu32 " - KDR: %.2f - SPM: %.2f",
return string_printf("#%" PRIuPTR ": \"%.*s\" - Score: %" PRIu64 " - Kills: %" PRIu32 " - Deaths: %" PRIu32 " - KDR: %.2f - SPM: %.2f",
rank, entry->most_recent_name.size(), entry->most_recent_name.data(), entry->total_score, entry->total_kills, entry->total_deaths,
static_cast<double>(entry->total_kills) / (entry->total_deaths == 0 ? 1 : static_cast<double>(entry->total_deaths)),
static_cast<double>(entry->total_score) / (entry->total_game_time == 0 ? 1.0 : static_cast<double>(entry->total_game_time)) * 60.0);

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

@ -115,7 +115,7 @@ bool RenX_LoggingPlugin::initialize()
""_jrs);
RenX_LoggingPlugin::playerIdentifyFmt = this->config.get("PlayerIdentifyFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "12[Join] " IRCBOLD "%.*s" IRCBOLD " (" IRCBOLD "%.*s" IRCBOLD ") joined the game fighting for the %.*s from " IRCBOLD "%.*s" IRCBOLD " (" IRCBOLD "%.*s" IRCBOLD ") with HWID " IRCBOLD "%.*s" IRCBOLD ".", RenX::tags->nameTag.size(),
string_printf(IRCCOLOR "12[Join] " IRCBOLD "%.*s" IRCBOLD " (" IRCBOLD "%.*s" IRCBOLD ") joined the game fighting for the %.*s from " IRCBOLD "%.*s" IRCBOLD " (" IRCBOLD "%.*s" IRCBOLD ") with HWID " IRCBOLD "%.*s" IRCBOLD ".", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->steamTag.size(),
RenX::tags->steamTag.data(), RenX::tags->teamLongTag.size(),
RenX::tags->teamLongTag.data(), RenX::tags->ipTag.size(),
@ -124,7 +124,7 @@ bool RenX_LoggingPlugin::initialize()
RenX::tags->hwidTag.data()));
RenX_LoggingPlugin::joinPublicFmt = this->config.get("JoinPublicFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "12[Join] " IRCBOLD "%.*s" IRCBOLD " joined the game fighting for the %.*s!", RenX::tags->nameTag.size(),
string_printf(IRCCOLOR "12[Join] " IRCBOLD "%.*s" IRCBOLD " joined the game fighting for the %.*s!", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->teamLongTag.size(),
RenX::tags->teamLongTag.data()));
@ -135,93 +135,93 @@ bool RenX_LoggingPlugin::initialize()
""_jrs);
RenX_LoggingPlugin::partFmt = this->config.get("PartFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "12[Part] " IRCBOLD "%.*s" IRCBOLD " left the %.*s.", RenX::tags->nameTag.size(),
string_printf(IRCCOLOR "12[Part] " IRCBOLD "%.*s" IRCBOLD " left the %.*s.", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->teamLongTag.size(),
RenX::tags->teamLongTag.data()));
RenX_LoggingPlugin::kickFmt = this->config.get("KickFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "04[Kick] " IRCBOLD "%.*s" IRCCOLOR IRCBOLD " was " IRCBOLD IRCCOLOR "04kicked" IRCCOLOR IRCBOLD " (" IRCCOLOR "04%.*s" IRCCOLOR ")", RenX::tags->nameTag.size(),
string_printf(IRCCOLOR "04[Kick] " IRCBOLD "%.*s" IRCCOLOR IRCBOLD " was " IRCBOLD IRCCOLOR "04kicked" IRCCOLOR IRCBOLD " (" IRCCOLOR "04%.*s" IRCCOLOR ")", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::playerExecuteFmt = this->config.get("PlayerExecuteFormat"_jrs,
Jupiter::StringS::Format("%.*s" IRCCOLOR "07 executed: %.*s", RenX::tags->nameTag.size(),
string_printf("%.*s" IRCCOLOR "07 executed: %.*s", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::playerCommandSuccessFmt = this->config.get("PlayerCommandSuccessFormat"_jrs,
Jupiter::StringS::Format("%.*s" IRCCOLOR ": " IRCCOLOR "10%.*s", RenX::tags->nameTag.size(),
string_printf("%.*s" IRCCOLOR ": " IRCCOLOR "10%.*s", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::playerCommandFailFmt = this->config.get("PlayerCommandFailFormat"_jrs, ""_jss);
RenX_LoggingPlugin::playerFmt = this->config.get("PlayerFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "12[Player]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(),
string_printf(IRCCOLOR "12[Player]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::nameChangeFmt = this->config.get("NameChangeFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCBOLD " changed their name to " IRCBOLD "%.*s" IRCBOLD ".", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCBOLD " changed their name to " IRCBOLD "%.*s" IRCBOLD ".", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->newNameTag.size(),
RenX::tags->newNameTag.data()));
RenX_LoggingPlugin::teamChangeFmt = this->config.get("TeamChangeFormat"_jrs,
Jupiter::StringS::Format("%.*s" IRCCOLOR " switched teams!", RenX::tags->nameTag.size(),
string_printf("%.*s" IRCCOLOR " switched teams!", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data()));
RenX_LoggingPlugin::speedHackFmt = this->config.get("SpeedHackFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "04[SpeedHack] " IRCBOLD "%.*s" IRCBOLD " has thrown a Speed Hack warning!", RenX::tags->nameTag.size(),
string_printf(IRCCOLOR "04[SpeedHack] " IRCBOLD "%.*s" IRCBOLD " has thrown a Speed Hack warning!", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data()));
RenX_LoggingPlugin::chatFmt = this->config.get("ChatFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD ": %.*s", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD ": %.*s", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::teamChatFmt = this->config.get("TeamChatFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCBOLD ": %.*s", RenX::tags->nameTag.size(), RenX::tags->nameTag.data(), RenX::tags->messageTag.size(),
string_printf(IRCBOLD "%.*s" IRCBOLD ": %.*s", RenX::tags->nameTag.size(), RenX::tags->nameTag.data(), RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::radioChatFmt = this->config.get("RadioChatFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCBOLD ": \x1D%.*s", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCBOLD ": \x1D%.*s", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::hostChatFmt = this->config.get("HostChatFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "12Host" IRCCOLOR "0: %.*s", RenX::tags->messageTag.size(),
string_printf(IRCCOLOR "12Host" IRCCOLOR "0: %.*s", RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::hostPageFmt = this->config.get("HostPageFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "12(Host -> %.*s): %.*s", RenX::tags->rawNameTag.size(),
string_printf(IRCCOLOR "12(Host -> %.*s): %.*s", RenX::tags->rawNameTag.size(),
RenX::tags->rawNameTag.data(), RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::adminMsgFmt = this->config.get("AdminMsgFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "10%.*s: %.*s", RenX::tags->rawNameTag.size(), RenX::tags->rawNameTag.data(), RenX::tags->messageTag.size(),
string_printf(IRCCOLOR "10%.*s: %.*s", RenX::tags->rawNameTag.size(), RenX::tags->rawNameTag.data(), RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::warnMsgFmt = this->config.get("WarnMsgFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "07%.*s: %.*s", RenX::tags->rawNameTag.size(), RenX::tags->rawNameTag.data(), RenX::tags->messageTag.size(),
string_printf(IRCCOLOR "07%.*s: %.*s", RenX::tags->rawNameTag.size(), RenX::tags->rawNameTag.data(), RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::pAdminMsgFmt = this->config.get("PAdminMsgFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "10(%.*s -> %.*s): %.*s", RenX::tags->rawNameTag.size(),
string_printf(IRCCOLOR "10(%.*s -> %.*s): %.*s", RenX::tags->rawNameTag.size(),
RenX::tags->rawNameTag.data(), RenX::tags->victimRawNameTag.size(),
RenX::tags->victimRawNameTag.data(), RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::pWarnMsgFmt = this->config.get("PWarnMsgFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "07(%.*s -> %.*s): %.*s", RenX::tags->rawNameTag.size(),
string_printf(IRCCOLOR "07(%.*s -> %.*s): %.*s", RenX::tags->rawNameTag.size(),
RenX::tags->rawNameTag.data(), RenX::tags->victimRawNameTag.size(),
RenX::tags->victimRawNameTag.data(), RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::otherChatFmt = this->config.get("OtherChatFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "06[Other Chat]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(),
string_printf(IRCCOLOR "06[Other Chat]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::deployFmt = this->config.get("DeployFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " deployed a " IRCBOLD IRCCOLOR "12%.*s" IRCBOLD, RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " deployed a " IRCBOLD IRCCOLOR "12%.*s" IRCBOLD, RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->objectTag.size(),
RenX::tags->objectTag.data()));
@ -229,12 +229,12 @@ bool RenX_LoggingPlugin::initialize()
RenX_LoggingPlugin::deployFmt);
RenX_LoggingPlugin::overMineFmt = this->config.get("OverMineFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " is " IRCCOLOR "04over-mining" IRCCOLOR ": " IRCBOLD IRCCOLOR "12%.*s" IRCBOLD, RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " is " IRCCOLOR "04over-mining" IRCCOLOR ": " IRCBOLD IRCCOLOR "12%.*s" IRCBOLD, RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->objectTag.size(),
RenX::tags->objectTag.data()));
RenX_LoggingPlugin::disarmFmt = this->config.get("DisarmFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " disarmed %.*s" IRCBOLD IRCCOLOR "'s " IRCCOLOR "12%.*s" IRCBOLD, RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " disarmed %.*s" IRCBOLD IRCCOLOR "'s " IRCCOLOR "12%.*s" IRCBOLD, RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->victimNameTag.size(),
RenX::tags->victimNameTag.data(), RenX::tags->objectTag.size(),
RenX::tags->objectTag.data()));
@ -243,7 +243,7 @@ bool RenX_LoggingPlugin::initialize()
RenX_LoggingPlugin::disarmFmt);
RenX_LoggingPlugin::disarmNoOwnerFmt = this->config.get("DisarmNoOwnerFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCBOLD " disarmed a " IRCBOLD "%.*s" IRCBOLD, RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCBOLD " disarmed a " IRCBOLD "%.*s" IRCBOLD, RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->objectTag.size(),
RenX::tags->objectTag.data()));
@ -251,21 +251,21 @@ bool RenX_LoggingPlugin::initialize()
RenX_LoggingPlugin::disarmNoOwnerFmt);
RenX_LoggingPlugin::explodeFmt = this->config.get("ExplodeFormat"_jrs,
Jupiter::StringS::Format("%.*s" IRCCOLOR " detonated a " IRCCOLOR "07%.*s" IRCCOLOR ".", RenX::tags->nameTag.size(),
string_printf("%.*s" IRCCOLOR " detonated a " IRCCOLOR "07%.*s" IRCCOLOR ".", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->weaponTag.size(),
RenX::tags->weaponTag.data()));
RenX_LoggingPlugin::explodeNoOwnerFmt = this->config.get("ExplodeNoOwnerFormat"_jrs,
Jupiter::StringS::Format("A " IRCCOLOR "07%.*s" IRCCOLOR " detonated.", RenX::tags->weaponTag.size(),
string_printf("A " IRCCOLOR "07%.*s" IRCCOLOR " detonated.", RenX::tags->weaponTag.size(),
RenX::tags->weaponTag.data()));
RenX_LoggingPlugin::suicideFmt = this->config.get("SuicideFormat"_jrs,
Jupiter::StringS::Format("%.*s" IRCCOLOR " suicided (" IRCCOLOR "12%.*s" IRCCOLOR ").", RenX::tags->nameTag.size(),
string_printf("%.*s" IRCCOLOR " suicided (" IRCCOLOR "12%.*s" IRCCOLOR ").", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->weaponTag.size(),
RenX::tags->weaponTag.data()));
RenX_LoggingPlugin::killFmt = this->config.get("KillFormat"_jrs,
Jupiter::StringS::Format("%.*s" IRCCOLOR " killed %.*s" IRCCOLOR " (" IRCCOLOR "%.*s%.*s/%.*s" IRCCOLOR " vs " IRCCOLOR "%.*s%.*s" IRCCOLOR ").", RenX::tags->nameTag.size(),
string_printf("%.*s" IRCCOLOR " killed %.*s" IRCCOLOR " (" IRCCOLOR "%.*s%.*s/%.*s" IRCCOLOR " vs " IRCCOLOR "%.*s%.*s" IRCCOLOR ").", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->victimNameTag.size(),
RenX::tags->victimNameTag.data(), RenX::tags->teamColorTag.size(),
RenX::tags->teamColorTag.data(), RenX::tags->characterTag.size(),
@ -275,32 +275,32 @@ bool RenX_LoggingPlugin::initialize()
RenX::tags->victimCharacterTag.data()));
RenX_LoggingPlugin::killFmt2 = this->config.get("KillFormat2"_jrs,
Jupiter::StringS::Format(IRCCOLOR "%.*s%.*s" IRCCOLOR " killed %.*s" IRCCOLOR " (" IRCCOLOR "12%.*s" IRCCOLOR ").", RenX::tags->teamColorTag.size(),
string_printf(IRCCOLOR "%.*s%.*s" IRCCOLOR " killed %.*s" IRCCOLOR " (" IRCCOLOR "12%.*s" IRCCOLOR ").", RenX::tags->teamColorTag.size(),
RenX::tags->teamColorTag.data(), RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->victimNameTag.size(),
RenX::tags->victimNameTag.data(), RenX::tags->weaponTag.size(),
RenX::tags->weaponTag.data()));
RenX_LoggingPlugin::dieFmt = this->config.get("DieFormat"_jrs,
Jupiter::StringS::Format("%.*s" IRCCOLOR " died (" IRCCOLOR "12%.*s" IRCCOLOR ").", RenX::tags->nameTag.size(),
string_printf("%.*s" IRCCOLOR " died (" IRCCOLOR "12%.*s" IRCCOLOR ").", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->weaponTag.size(),
RenX::tags->weaponTag.data()));
RenX_LoggingPlugin::dieFmt2 = this->config.get("DieFormat2"_jrs,
Jupiter::StringS::Format(IRCCOLOR "%.*s%.*s" IRCCOLOR " died (" IRCCOLOR "12%.*s" IRCCOLOR ").", RenX::tags->teamColorTag.size(),
string_printf(IRCCOLOR "%.*s%.*s" IRCCOLOR " died (" IRCCOLOR "12%.*s" IRCCOLOR ").", RenX::tags->teamColorTag.size(),
RenX::tags->teamColorTag.data(), RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->weaponTag.size(),
RenX::tags->weaponTag.data()));
RenX_LoggingPlugin::destroyBuildingFmt = this->config.get("DestroyBuildingFormat"_jrs,
Jupiter::StringS::Format("%.*s" IRCCOLOR " destroyed the " IRCCOLOR "%.*s%.*s" IRCCOLOR " (" IRCCOLOR "12%.*s" IRCCOLOR ").", RenX::tags->nameTag.size(),
string_printf("%.*s" IRCCOLOR " destroyed the " IRCCOLOR "%.*s%.*s" IRCCOLOR " (" IRCCOLOR "12%.*s" IRCCOLOR ").", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->victimTeamColorTag.size(),
RenX::tags->victimTeamColorTag.data(), RenX::tags->objectTag.size(),
RenX::tags->objectTag.data(), RenX::tags->weaponTag.size(),
RenX::tags->weaponTag.data()));
RenX_LoggingPlugin::destroyBuildingFmt2 = this->config.get("DestroyBuildingFormat2"_jrs,
Jupiter::StringS::Format(IRCCOLOR "%.*s%.*s" IRCCOLOR " destroyed the " IRCCOLOR "%.*s%.*s" IRCCOLOR " (" IRCCOLOR "12%.*s" IRCCOLOR ").", RenX::tags->teamColorTag.size(),
string_printf(IRCCOLOR "%.*s%.*s" IRCCOLOR " destroyed the " IRCCOLOR "%.*s%.*s" IRCCOLOR " (" IRCCOLOR "12%.*s" IRCCOLOR ").", RenX::tags->teamColorTag.size(),
RenX::tags->teamColorTag.data(), RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->victimTeamColorTag.size(),
RenX::tags->victimTeamColorTag.data(), RenX::tags->objectTag.size(),
@ -308,14 +308,14 @@ bool RenX_LoggingPlugin::initialize()
RenX::tags->weaponTag.data()));
RenX_LoggingPlugin::destroyDefenceFmt = this->config.get("DestroyDefenceFormat"_jrs,
Jupiter::StringS::Format("%.*s" IRCCOLOR " destroyed a " IRCCOLOR "%.*s%.*s" IRCCOLOR " (" IRCCOLOR "12%.*s" IRCCOLOR ").", RenX::tags->nameTag.size(),
string_printf("%.*s" IRCCOLOR " destroyed a " IRCCOLOR "%.*s%.*s" IRCCOLOR " (" IRCCOLOR "12%.*s" IRCCOLOR ").", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->victimTeamColorTag.size(),
RenX::tags->victimTeamColorTag.data(), RenX::tags->objectTag.size(),
RenX::tags->objectTag.data(), RenX::tags->weaponTag.size(),
RenX::tags->weaponTag.data()));
RenX_LoggingPlugin::destroyDefenceFmt2 = this->config.get("DestroyDefenceFormat2"_jrs,
Jupiter::StringS::Format(IRCCOLOR "%.*s%.*s" IRCCOLOR " destroyed a " IRCCOLOR "%.*s%.*s" IRCCOLOR " (" IRCCOLOR "12%.*s" IRCCOLOR ").", RenX::tags->teamColorTag.size(),
string_printf(IRCCOLOR "%.*s%.*s" IRCCOLOR " destroyed a " IRCCOLOR "%.*s%.*s" IRCCOLOR " (" IRCCOLOR "12%.*s" IRCCOLOR ").", RenX::tags->teamColorTag.size(),
RenX::tags->teamColorTag.data(), RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->victimTeamColorTag.size(),
RenX::tags->victimTeamColorTag.data(), RenX::tags->objectTag.size(),
@ -323,14 +323,14 @@ bool RenX_LoggingPlugin::initialize()
RenX::tags->weaponTag.data()));
RenX_LoggingPlugin::destroyVehicleFmt = this->config.get("DestroyVehicleFormat"_jrs,
Jupiter::StringS::Format("%.*s" IRCCOLOR " destroyed a " IRCCOLOR "%.*s%.*s" IRCCOLOR " (" IRCCOLOR "12%.*s" IRCCOLOR ").", RenX::tags->nameTag.size(),
string_printf("%.*s" IRCCOLOR " destroyed a " IRCCOLOR "%.*s%.*s" IRCCOLOR " (" IRCCOLOR "12%.*s" IRCCOLOR ").", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->victimTeamColorTag.size(),
RenX::tags->victimTeamColorTag.data(), RenX::tags->objectTag.size(),
RenX::tags->objectTag.data(), RenX::tags->weaponTag.size(),
RenX::tags->weaponTag.data()));
RenX_LoggingPlugin::destroyVehicleFmt2 = this->config.get("DestroyVehicleFormat2"_jrs,
Jupiter::StringS::Format(IRCCOLOR "%.*s%.*s" IRCCOLOR " destroyed a " IRCCOLOR "%.*s%.*s" IRCCOLOR " (" IRCCOLOR "12%.*s" IRCCOLOR ").", RenX::tags->teamColorTag.size(),
string_printf(IRCCOLOR "%.*s%.*s" IRCCOLOR " destroyed a " IRCCOLOR "%.*s%.*s" IRCCOLOR " (" IRCCOLOR "12%.*s" IRCCOLOR ").", RenX::tags->teamColorTag.size(),
RenX::tags->teamColorTag.data(), RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->victimTeamColorTag.size(),
RenX::tags->victimTeamColorTag.data(), RenX::tags->objectTag.size(),
@ -338,63 +338,63 @@ bool RenX_LoggingPlugin::initialize()
RenX::tags->weaponTag.data()));
RenX_LoggingPlugin::captureFmt = this->config.get("CaptureFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " captured the " IRCBOLD IRCCOLOR "%.*s%.*s" IRCCOLOR IRCBOLD ".", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " captured the " IRCBOLD IRCCOLOR "%.*s%.*s" IRCCOLOR IRCBOLD ".", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->victimTeamColorTag.size(),
RenX::tags->victimTeamColorTag.data(), RenX::tags->objectTag.size(),
RenX::tags->objectTag.data()));
RenX_LoggingPlugin::neutralizeFmt = this->config.get("NeutralizeFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " neutralized the " IRCBOLD IRCCOLOR "%.*s%.*s" IRCCOLOR IRCBOLD ".", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " neutralized the " IRCBOLD IRCCOLOR "%.*s%.*s" IRCCOLOR IRCBOLD ".", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->victimTeamColorTag.size(),
RenX::tags->victimTeamColorTag.data(), RenX::tags->objectTag.size(),
RenX::tags->objectTag.data()));
RenX_LoggingPlugin::characterPurchaseFmt = this->config.get("CharacterPurchaseFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " purchased a " IRCBOLD IRCCOLOR "%.*s%.*s" IRCCOLOR IRCBOLD ".", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " purchased a " IRCBOLD IRCCOLOR "%.*s%.*s" IRCCOLOR IRCBOLD ".", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->teamColorTag.size(),
RenX::tags->teamColorTag.data(), RenX::tags->victimCharacterTag.size(),
RenX::tags->victimCharacterTag.data()));
RenX_LoggingPlugin::itemPurchaseFmt = this->config.get("ItemPurchaseFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " purchased a " IRCBOLD IRCCOLOR "%.*s%.*s" IRCCOLOR IRCBOLD ".", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " purchased a " IRCBOLD IRCCOLOR "%.*s%.*s" IRCCOLOR IRCBOLD ".", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->teamColorTag.size(),
RenX::tags->teamColorTag.data(), RenX::tags->objectTag.size(),
RenX::tags->objectTag.data()));
RenX_LoggingPlugin::weaponPurchaseFmt = this->config.get("WeaponPurchaseFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " purchased a " IRCBOLD IRCCOLOR "%.*s%.*s" IRCCOLOR IRCBOLD ".", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " purchased a " IRCBOLD IRCCOLOR "%.*s%.*s" IRCCOLOR IRCBOLD ".", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->teamColorTag.size(),
RenX::tags->teamColorTag.data(), RenX::tags->weaponTag.size(),
RenX::tags->weaponTag.data()));
RenX_LoggingPlugin::refillPurchaseFmt = this->config.get("RefillPurchaseFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " purchased a " IRCBOLD IRCCOLOR "%.*srefill" IRCCOLOR IRCBOLD ".", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " purchased a " IRCBOLD IRCCOLOR "%.*srefill" IRCCOLOR IRCBOLD ".", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->teamColorTag.size(),
RenX::tags->teamColorTag.data()));
RenX_LoggingPlugin::vehiclePurchaseFmt = this->config.get("VehiclePurchaseFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " purchased a " IRCBOLD IRCCOLOR "%.*s%.*s" IRCCOLOR IRCBOLD ".", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " purchased a " IRCBOLD IRCCOLOR "%.*s%.*s" IRCCOLOR IRCBOLD ".", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->teamColorTag.size(),
RenX::tags->teamColorTag.data(), RenX::tags->victimVehicleTag.size(),
RenX::tags->victimVehicleTag.data()));
RenX_LoggingPlugin::vehicleSpawnFmt = this->config.get("VehicleSpawnFormat"_jrs,
Jupiter::StringS::Format("A " IRCBOLD IRCCOLOR "%.*s%.*s" IRCCOLOR IRCBOLD " has spawned.", RenX::tags->teamColorTag.size(),
string_printf("A " IRCBOLD IRCCOLOR "%.*s%.*s" IRCCOLOR IRCBOLD " has spawned.", RenX::tags->teamColorTag.size(),
RenX::tags->teamColorTag.data(), RenX::tags->vehicleTag.size(),
RenX::tags->vehicleTag.data()));
RenX_LoggingPlugin::spawnFmt = this->config.get("SpawnFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " spawned as a " IRCCOLOR "%.*s%.*s.", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " spawned as a " IRCCOLOR "%.*s%.*s.", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->teamColorTag.size(),
RenX::tags->teamColorTag.data(), RenX::tags->victimCharacterTag.size(),
RenX::tags->victimCharacterTag.data()));
RenX_LoggingPlugin::botJoinFmt = this->config.get("BotJoinFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " online.", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " online.", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data()));
RenX_LoggingPlugin::vehicleCrateFmt = this->config.get("VehicleCrateFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " picked up a " IRCCOLOR "12%.*s" IRCCOLOR " vehicle crate.", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " picked up a " IRCCOLOR "12%.*s" IRCCOLOR " vehicle crate.", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->objectTag.size(),
RenX::tags->objectTag.data()));
@ -405,91 +405,91 @@ bool RenX_LoggingPlugin::initialize()
RenX_LoggingPlugin::vehicleCrateFmt);
RenX_LoggingPlugin::deathCrateFmt = this->config.get("DeathCrateFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " picked up a " IRCCOLOR "12death" IRCCOLOR " crate.", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " picked up a " IRCCOLOR "12death" IRCCOLOR " crate.", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data()));
RenX_LoggingPlugin::moneyCrateFmt = this->config.get("MoneyCrateFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " picked up " IRCCOLOR "09%.*s credits" IRCCOLOR " from a " IRCCOLOR "12money" IRCCOLOR " crate.", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " picked up " IRCCOLOR "09%.*s credits" IRCCOLOR " from a " IRCCOLOR "12money" IRCCOLOR " crate.", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->objectTag.size(),
RenX::tags->objectTag.data()));
RenX_LoggingPlugin::characterCrateFmt = this->config.get("CharacterCrateFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " picked up a " IRCCOLOR "%.*s%.*s" IRCCOLOR " " IRCCOLOR "12character" IRCCOLOR " crate.", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " picked up a " IRCCOLOR "%.*s%.*s" IRCCOLOR " " IRCCOLOR "12character" IRCCOLOR " crate.", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->teamColorTag.size(),
RenX::tags->teamColorTag.data(), RenX::tags->victimCharacterTag.size(),
RenX::tags->victimCharacterTag.data()));
RenX_LoggingPlugin::spyCrateFmt = this->config.get("SpyCrateFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " picked up a " IRCCOLOR "%.*s%.*s" IRCCOLOR " " IRCCOLOR "12spy" IRCCOLOR " crate.", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " picked up a " IRCCOLOR "%.*s%.*s" IRCCOLOR " " IRCCOLOR "12spy" IRCCOLOR " crate.", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->victimTeamColorTag.size(),
RenX::tags->victimTeamColorTag.data(), RenX::tags->victimCharacterTag.size(),
RenX::tags->victimCharacterTag.data()));
RenX_LoggingPlugin::refillCrateFmt = this->config.get("RefillCrateFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " picked up a " IRCCOLOR "%.*srefill" IRCCOLOR " crate.", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " picked up a " IRCCOLOR "%.*srefill" IRCCOLOR " crate.", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->teamColorTag.size(),
RenX::tags->teamColorTag.data()));
RenX_LoggingPlugin::timeBombCrateFmt = this->config.get("TimeBombCrateFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " picked up a " IRCCOLOR "11time-bomb" IRCCOLOR " crate.", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " picked up a " IRCCOLOR "11time-bomb" IRCCOLOR " crate.", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data()));
RenX_LoggingPlugin::speedCrateFmt = this->config.get("SpeedCrateFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " picked up a " IRCCOLOR "11speed" IRCCOLOR " crate.", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " picked up a " IRCCOLOR "11speed" IRCCOLOR " crate.", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data()));
RenX_LoggingPlugin::nukeCrateFmt = this->config.get("NukeCrateFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " picked up a " IRCCOLOR "04nuke" IRCCOLOR " crate.", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " picked up a " IRCCOLOR "04nuke" IRCCOLOR " crate.", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data()));
RenX_LoggingPlugin::abductionCrateFmt = this->config.get("AbductionCrateFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " has been " IRCBOLD IRCCOLOR "06abducted" IRCCOLOR IRCBOLD " by the " IRCBOLD IRCCOLOR "06Scrin" IRCCOLOR IRCBOLD "!", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " has been " IRCBOLD IRCCOLOR "06abducted" IRCCOLOR IRCBOLD " by the " IRCBOLD IRCCOLOR "06Scrin" IRCCOLOR IRCBOLD "!", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data()));
RenX_LoggingPlugin::unspecifiedCrateFmt = this->config.get("UnspecifiedCrateFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " picked up an " IRCCOLOR "13unspecified" IRCCOLOR " crate.", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " picked up an " IRCCOLOR "13unspecified" IRCCOLOR " crate.", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data()));
RenX_LoggingPlugin::otherCrateFmt = this->config.get("OtherCrateFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " picked up a " IRCCOLOR "13%.*s" IRCCOLOR " crate.", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " picked up a " IRCCOLOR "13%.*s" IRCCOLOR " crate.", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->objectTag.size(),
RenX::tags->objectTag.data()));
RenX_LoggingPlugin::stealFmt = this->config.get("StealFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " stole " IRCBOLD "%.*s" IRCBOLD "'s " IRCBOLD "%.*s" IRCBOLD "!", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " stole " IRCBOLD "%.*s" IRCBOLD "'s " IRCBOLD "%.*s" IRCBOLD "!", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->victimNameTag.size(),
RenX::tags->victimNameTag.data(), RenX::tags->objectTag.size(),
RenX::tags->objectTag.data()));
RenX_LoggingPlugin::stealNoOwnerFmt = this->config.get("StealNoOwnerFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " stole a " IRCBOLD IRCCOLOR "12%.*s" IRCBOLD "!", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " stole a " IRCBOLD IRCCOLOR "12%.*s" IRCBOLD "!", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->objectTag.size(),
RenX::tags->objectTag.data()));
RenX_LoggingPlugin::donateFmt = this->config.get("DonateFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " donated " IRCCOLOR "09%.*s credits" IRCCOLOR " to " IRCBOLD "%.*s" IRCBOLD ".", RenX::tags->nameTag.size(),
string_printf(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " donated " IRCCOLOR "09%.*s credits" IRCCOLOR " to " IRCBOLD "%.*s" IRCBOLD ".", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->objectTag.size(),
RenX::tags->objectTag.data(), RenX::tags->victimNameTag.size(),
RenX::tags->victimNameTag.data()));
RenX_LoggingPlugin::gameOverFmt = this->config.get("GameOverFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "03[Game]" IRCCOLOR "%.*s The " IRCBOLD "%.*s" IRCBOLD " won by " IRCBOLD "%.*s" IRCBOLD, RenX::tags->teamColorTag.size(),
string_printf(IRCCOLOR "03[Game]" IRCCOLOR "%.*s The " IRCBOLD "%.*s" IRCBOLD " won by " IRCBOLD "%.*s" IRCBOLD, RenX::tags->teamColorTag.size(),
RenX::tags->teamColorTag.data(), RenX::tags->teamLongTag.size(),
RenX::tags->teamLongTag.data(), RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::gameOverTieFmt = this->config.get("GameOverTieNoWinFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "03[Game]" IRCCOLOR "10 The battle ended in a " IRCBOLD "%.*s" IRCBOLD " - Victory handed to " IRCBOLD IRCCOLOR "%.*s%.*s" IRCBOLD, RenX::tags->messageTag.size(),
string_printf(IRCCOLOR "03[Game]" IRCCOLOR "10 The battle ended in a " IRCBOLD "%.*s" IRCBOLD " - Victory handed to " IRCBOLD IRCCOLOR "%.*s%.*s" IRCBOLD, RenX::tags->messageTag.size(),
RenX::tags->messageTag.data(), RenX::tags->teamColorTag.size(),
RenX::tags->teamColorTag.data(), RenX::tags->teamLongTag.size(),
RenX::tags->teamLongTag.data()));
RenX_LoggingPlugin::gameOverTieNoWinFmt = this->config.get("GameOverTieFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "03[Game]" IRCCOLOR "10 The battle ended in a " IRCBOLD "%.*s" IRCBOLD, RenX::tags->messageTag.size(),
string_printf(IRCCOLOR "03[Game]" IRCCOLOR "10 The battle ended in a " IRCBOLD "%.*s" IRCBOLD, RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::gameOverScoreFmt = this->config.get("GameOverScoreFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "03[Game]" IRCCOLOR "%.*s %.*s" IRCCOLOR ": %.*s | " IRCCOLOR "%.*s%.*s" IRCCOLOR ": %.*s", RenX::tags->teamColorTag.size(),
string_printf(IRCCOLOR "03[Game]" IRCCOLOR "%.*s %.*s" IRCCOLOR ": %.*s | " IRCCOLOR "%.*s%.*s" IRCCOLOR ": %.*s", RenX::tags->teamColorTag.size(),
RenX::tags->teamColorTag.data(), RenX::tags->teamLongTag.size(),
RenX::tags->teamLongTag.data(), RenX::tags->winScoreTag.size(),
RenX::tags->winScoreTag.data(), RenX::tags->victimTeamColorTag.size(),
@ -498,97 +498,97 @@ bool RenX_LoggingPlugin::initialize()
RenX::tags->loseScoreTag.data()));
RenX_LoggingPlugin::gameFmt = this->config.get("GameFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "03[Game]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(),
string_printf(IRCCOLOR "03[Game]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::executeFmt = this->config.get("ExecuteFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "07%.*s executed: %.*s", RenX::tags->nameTag.size(),
string_printf(IRCCOLOR "07%.*s executed: %.*s", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::devBotExecuteFmt = this->config.get("DevBotExecuteFormat"_jrs, ""_jss);
RenX_LoggingPlugin::subscribeFmt = this->config.get("SubscribeFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "03%.*s subscribed to the RCON data stream.", RenX::tags->nameTag.size(),
string_printf(IRCCOLOR "03%.*s subscribed to the RCON data stream.", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data()));
RenX_LoggingPlugin::rconFmt = this->config.get("RCONFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "05[RCON]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(),
string_printf(IRCCOLOR "05[RCON]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::adminLoginFmt = this->config.get("AdminLoginFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "07[Admin] " IRCBOLD "%.*s" IRCBOLD IRCCOLOR " logged in with " IRCCOLOR "07" IRCBOLD "%.*s" IRCBOLD IRCNORMAL " privledges.", RenX::tags->nameTag.size(),
string_printf(IRCCOLOR "07[Admin] " IRCBOLD "%.*s" IRCBOLD IRCCOLOR " logged in with " IRCCOLOR "07" IRCBOLD "%.*s" IRCBOLD IRCNORMAL " privledges.", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->adminTag.size(),
RenX::tags->adminTag.data()));
RenX_LoggingPlugin::adminGrantFmt = this->config.get("AdminGrantFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "07[Admin] " IRCBOLD "%.*s" IRCBOLD IRCCOLOR " was granted " IRCCOLOR "07" IRCBOLD "%.*s" IRCBOLD IRCNORMAL " privledges.", RenX::tags->nameTag.size(),
string_printf(IRCCOLOR "07[Admin] " IRCBOLD "%.*s" IRCBOLD IRCCOLOR " was granted " IRCCOLOR "07" IRCBOLD "%.*s" IRCBOLD IRCNORMAL " privledges.", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->adminTag.size(),
RenX::tags->adminTag.data()));
RenX_LoggingPlugin::adminLogoutFmt = this->config.get("AdminLogoutFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "07[Admin] " IRCBOLD "%.*s" IRCBOLD IRCCOLOR " logged out of their " IRCCOLOR "07" IRCBOLD "%.*s" IRCBOLD IRCNORMAL " privledges.", RenX::tags->nameTag.size(),
string_printf(IRCCOLOR "07[Admin] " IRCBOLD "%.*s" IRCBOLD IRCCOLOR " logged out of their " IRCCOLOR "07" IRCBOLD "%.*s" IRCBOLD IRCNORMAL " privledges.", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->adminTag.size(),
RenX::tags->adminTag.data()));
RenX_LoggingPlugin::adminFmt = this->config.get("AdminFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "07[Admin]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(),
string_printf(IRCCOLOR "07[Admin]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::voteAddBotsFmt = this->config.get("VoteAddBotsFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "[Vote] " IRCBOLD "%.*s" IRCNORMAL " has called for adding " IRCCOLOR "12%.*s" IRCCOLOR " bots to %.*s, with skill level " IRCCOLOR "07%.*s" IRCCOLOR ".", RenX::tags->nameTag.size(),
string_printf(IRCCOLOR "[Vote] " IRCBOLD "%.*s" IRCNORMAL " has called for adding " IRCCOLOR "12%.*s" IRCCOLOR " bots to %.*s, with skill level " IRCCOLOR "07%.*s" IRCCOLOR ".", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->objectTag.size(),
RenX::tags->objectTag.data(), RenX::tags->victimTeamShortTag.size(),
RenX::tags->victimTeamShortTag.data(), RenX::tags->weaponTag.size(),
RenX::tags->weaponTag.data()));
RenX_LoggingPlugin::voteChangeMapFmt = this->config.get("VoteChangeMapFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "[Vote] " IRCBOLD "%.*s" IRCNORMAL " has called for a Map Change.", RenX::tags->nameTag.size(),
string_printf(IRCCOLOR "[Vote] " IRCBOLD "%.*s" IRCNORMAL " has called for a Map Change.", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data()));
RenX_LoggingPlugin::voteKickFmt = this->config.get("VoteKickFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "[Vote] " IRCBOLD "%.*s" IRCNORMAL " has called for a kick against %.*s" IRCNORMAL ".", RenX::tags->nameTag.size(),
string_printf(IRCCOLOR "[Vote] " IRCBOLD "%.*s" IRCNORMAL " has called for a kick against %.*s" IRCNORMAL ".", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->victimNameTag.size(),
RenX::tags->victimNameTag.data()));
RenX_LoggingPlugin::voteMineBanFmt = this->config.get("VoteMineBanFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "%.*s[Vote] " IRCBOLD "%.*s" IRCBOLD " has called for a Mine Ban against %.*s" IRCNORMAL ".", RenX::tags->victimTeamColorTag.size(),
string_printf(IRCCOLOR "%.*s[Vote] " IRCBOLD "%.*s" IRCBOLD " has called for a Mine Ban against %.*s" IRCNORMAL ".", RenX::tags->victimTeamColorTag.size(),
RenX::tags->victimTeamColorTag.data(), RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->nameTag.size(),
RenX::tags->nameTag.data()));
RenX_LoggingPlugin::voteRemoveBotsFmt = this->config.get("VoteRemoveBotsFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "[Vote] " IRCBOLD "%.*s" IRCNORMAL " has called a vote to remove " IRCCOLOR "12%.*s" IRCCOLOR " bots from " IRCCOLOR "%.*s%.*s" IRCNORMAL ".", RenX::tags->nameTag.size(),
string_printf(IRCCOLOR "[Vote] " IRCBOLD "%.*s" IRCNORMAL " has called a vote to remove " IRCCOLOR "12%.*s" IRCCOLOR " bots from " IRCCOLOR "%.*s%.*s" IRCNORMAL ".", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->objectTag.size(),
RenX::tags->objectTag.data(), RenX::tags->victimTeamColorTag.size(),
RenX::tags->victimTeamColorTag.data(), RenX::tags->victimTeamShortTag.size(),
RenX::tags->victimTeamShortTag.data()));
RenX_LoggingPlugin::voteRestartMapFmt = this->config.get("VoteRestartMapFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "[Vote] " IRCBOLD "%.*s" IRCNORMAL " has called for a Map Restart.", RenX::tags->nameTag.size(),
string_printf(IRCCOLOR "[Vote] " IRCBOLD "%.*s" IRCNORMAL " has called for a Map Restart.", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data()));
RenX_LoggingPlugin::voteSurrenderFmt = this->config.get("VoteSurrenderFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "%.*s[Vote] " IRCBOLD "%.*s" IRCBOLD " has called for a Surrender.", RenX::tags->victimTeamColorTag.size(),
string_printf(IRCCOLOR "%.*s[Vote] " IRCBOLD "%.*s" IRCBOLD " has called for a Surrender.", RenX::tags->victimTeamColorTag.size(),
RenX::tags->victimTeamColorTag.data(), RenX::tags->nameTag.size(),
RenX::tags->nameTag.data()));
RenX_LoggingPlugin::voteSurveyFmt = this->config.get("VoteSurveyFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "%.*s[Vote] " IRCBOLD "%.*s" IRCBOLD IRCCOLOR "%.*s has started a Survey: " IRCCOLOR "12%.*s", RenX::tags->victimTeamColorTag.size(),
string_printf(IRCCOLOR "%.*s[Vote] " IRCBOLD "%.*s" IRCBOLD IRCCOLOR "%.*s has started a Survey: " IRCCOLOR "12%.*s", RenX::tags->victimTeamColorTag.size(),
RenX::tags->victimTeamColorTag.data(), RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->victimTeamColorTag.size(),
RenX::tags->victimTeamColorTag.data(), RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::voteOtherFmt = this->config.get("VoteOtherFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "%.*s[Vote] " IRCBOLD "%.*s" IRCBOLD IRCCOLOR "%.*s has called a \"%.*s\" vote.", RenX::tags->victimTeamColorTag.size(),
string_printf(IRCCOLOR "%.*s[Vote] " IRCBOLD "%.*s" IRCBOLD IRCCOLOR "%.*s has called a \"%.*s\" vote.", RenX::tags->victimTeamColorTag.size(),
RenX::tags->victimTeamColorTag.data(), RenX::tags->nameTag.size(),
RenX::tags->nameTag.data(), RenX::tags->victimTeamColorTag.size(),
RenX::tags->victimTeamColorTag.data(), RenX::tags->objectTag.size(),
RenX::tags->objectTag.data()));
RenX_LoggingPlugin::voteOverSuccessFmt = this->config.get("VoteOverSuccessFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "%.*s[Vote] A vote for \"%.*s\" " IRCBOLD IRCCOLOR "09passed" IRCBOLD IRCCOLOR "%.*s (Votes Yes: %.*s | Votes No: %.*s).", RenX::tags->victimTeamColorTag.size(),
string_printf(IRCCOLOR "%.*s[Vote] A vote for \"%.*s\" " IRCBOLD IRCCOLOR "09passed" IRCBOLD IRCCOLOR "%.*s (Votes Yes: %.*s | Votes No: %.*s).", RenX::tags->victimTeamColorTag.size(),
RenX::tags->victimTeamColorTag.data(), RenX::tags->objectTag.size(),
RenX::tags->objectTag.data(), RenX::tags->victimTeamColorTag.size(),
RenX::tags->victimTeamColorTag.data(), RenX::tags->winScoreTag.size(),
@ -596,7 +596,7 @@ bool RenX_LoggingPlugin::initialize()
RenX::tags->loseScoreTag.data()));
RenX_LoggingPlugin::voteOverFailFmt = this->config.get("VoteOverFailFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "%.*s[Vote] A vote for \"%.*s\" " IRCBOLD IRCCOLOR "04failed" IRCBOLD IRCCOLOR "%.*s (Votes Yes: %.*s | Votes No: %.*s).", RenX::tags->victimTeamColorTag.size(),
string_printf(IRCCOLOR "%.*s[Vote] A vote for \"%.*s\" " IRCBOLD IRCCOLOR "04failed" IRCBOLD IRCCOLOR "%.*s (Votes Yes: %.*s | Votes No: %.*s).", RenX::tags->victimTeamColorTag.size(),
RenX::tags->victimTeamColorTag.data(), RenX::tags->objectTag.size(),
RenX::tags->objectTag.data(), RenX::tags->victimTeamColorTag.size(),
RenX::tags->victimTeamColorTag.data(), RenX::tags->winScoreTag.size(),
@ -604,31 +604,31 @@ bool RenX_LoggingPlugin::initialize()
RenX::tags->loseScoreTag.data()));
RenX_LoggingPlugin::voteCancelFmt = this->config.get("VoteCancelFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "%.*s[Vote] A vote for \"%.*s\" was " IRCBOLD IRCCOLOR "07cancelled" IRCCOLOR IRCBOLD ".", RenX::tags->victimTeamColorTag.size(),
string_printf(IRCCOLOR "%.*s[Vote] A vote for \"%.*s\" was " IRCBOLD IRCCOLOR "07cancelled" IRCCOLOR IRCBOLD ".", RenX::tags->victimTeamColorTag.size(),
RenX::tags->victimTeamColorTag.data(), RenX::tags->objectTag.size(),
RenX::tags->objectTag.data()));
RenX_LoggingPlugin::voteFmt = this->config.get("VoteFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "06[Vote]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(),
string_printf(IRCCOLOR "06[Vote]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::mapChangeFmt = this->config.get("MapChangeFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "03Loading %.*s...", RenX::tags->messageTag.size(),
string_printf(IRCCOLOR "03Loading %.*s...", RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::mapLoadFmt = this->config.get("MapLoadFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "03%.*s loaded.", RenX::tags->messageTag.size(), RenX::tags->messageTag.data()));
string_printf(IRCCOLOR "03%.*s loaded.", RenX::tags->messageTag.size(), RenX::tags->messageTag.data()));
RenX_LoggingPlugin::mapStartFmt = this->config.get("MapStartFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "03%.*s started.", RenX::tags->messageTag.size(),
string_printf(IRCCOLOR "03%.*s started.", RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::mapFmt = this->config.get("MapFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "06[Map]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(),
string_printf(IRCCOLOR "06[Map]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::demoRecordFmt = this->config.get("DemoRecordFormat"_jrs,
Jupiter::StringS::Format("%.*s has started a demo recording.", RenX::tags->nameTag.size(),
string_printf("%.*s has started a demo recording.", RenX::tags->nameTag.size(),
RenX::tags->nameTag.data()));
RenX_LoggingPlugin::rconDemoRecordFmt = this->config.get("RCONDemoRecordFormat"_jrs,
@ -638,30 +638,30 @@ bool RenX_LoggingPlugin::initialize()
IRCCOLOR "07The demo recording has stopped."_jrs);
RenX_LoggingPlugin::demoFmt = this->config.get("DemoFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "06[Demo]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(),
string_printf(IRCCOLOR "06[Demo]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::logFmt = this->config.get("LogFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "07[Log]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(),
string_printf(IRCCOLOR "07[Log]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::commandFmt = this->config.get("CommandFormat"_jrs,
Jupiter::StringS::Format("")); // Disabled by default.
string_printf("")); // Disabled by default.
RenX_LoggingPlugin::errorFmt = this->config.get("ErrorFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "04[Error]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(),
string_printf(IRCCOLOR "04[Error]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
RenX_LoggingPlugin::versionFmt = this->config.get("VersionFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "03Renegade X RCON connection established; using RCON verison " IRCBOLD "%.*s" IRCBOLD " for game version " IRCBOLD "%.*s" IRCBOLD, RenX::tags->rconVersionTag.size(),
string_printf(IRCCOLOR "03Renegade X RCON connection established; using RCON verison " IRCBOLD "%.*s" IRCBOLD " for game version " IRCBOLD "%.*s" IRCBOLD, RenX::tags->rconVersionTag.size(),
RenX::tags->rconVersionTag.data(), RenX::tags->gameVersionTag.size(),
RenX::tags->gameVersionTag.data()));
RenX_LoggingPlugin::authorizedFmt = this->config.get("AuthorizedFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "03RCON authorization completed."));
string_printf(IRCCOLOR "03RCON authorization completed."));
RenX_LoggingPlugin::otherFmt = this->config.get("OtherFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "06[Other]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(),
string_printf(IRCCOLOR "06[Other]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(),
RenX::tags->messageTag.data()));
/** Sanitize tags */
@ -1739,7 +1739,7 @@ void RenX_LoggingPlugin::RenX_OnMoneyCrate(RenX::Server &server, const RenX::Pla
if (!msg.empty())
{
RenX::processTags(msg, &server, &player);
RenX::replace_tag(msg, RenX::tags->INTERNAL_OBJECT_TAG, Jupiter::StringS::Format("%d", amount));
RenX::replace_tag(msg, RenX::tags->INTERNAL_OBJECT_TAG, string_printf("%d", amount));
(server.*func)(msg);
}
}
@ -1938,7 +1938,7 @@ void RenX_LoggingPlugin::RenX_OnDonate(RenX::Server &server, const RenX::PlayerI
if (!msg.empty())
{
RenX::processTags(msg, &server, &donor, &player);
RenX::replace_tag(msg, RenX::tags->INTERNAL_OBJECT_TAG, Jupiter::StringS::Format("%.0f", amount));
RenX::replace_tag(msg, RenX::tags->INTERNAL_OBJECT_TAG, string_printf("%.0f", amount));
(server.*func)(msg);
}
}
@ -2020,8 +2020,8 @@ void RenX_LoggingPlugin::RenX_OnGameOver(RenX::Server &server, RenX::WinType win
RenX::replace_tag(msg, RenX::tags->INTERNAL_TEAM_COLOR_TAG, RenX::getTeamColor(team));
RenX::replace_tag(msg, RenX::tags->INTERNAL_TEAM_SHORT_TAG, RenX::getTeamName(team));
RenX::replace_tag(msg, RenX::tags->INTERNAL_TEAM_LONG_TAG, RenX::getFullTeamName(team));
RenX::replace_tag(msg, RenX::tags->INTERNAL_WIN_SCORE_TAG, Jupiter::StringS::Format("%d", winScore));
RenX::replace_tag(msg, RenX::tags->INTERNAL_LOSE_SCORE_TAG, Jupiter::StringS::Format("%d", loseScore));
RenX::replace_tag(msg, RenX::tags->INTERNAL_WIN_SCORE_TAG, string_printf("%d", winScore));
RenX::replace_tag(msg, RenX::tags->INTERNAL_LOSE_SCORE_TAG, string_printf("%d", loseScore));
RenX::replace_tag(msg, RenX::tags->INTERNAL_VICTIM_TEAM_COLOR_TAG, RenX::getTeamColor(loserTeam));
RenX::replace_tag(msg, RenX::tags->INTERNAL_VICTIM_TEAM_SHORT_TAG, RenX::getTeamName(loserTeam));
RenX::replace_tag(msg, RenX::tags->INTERNAL_VICTIM_TEAM_LONG_TAG, RenX::getFullTeamName(loserTeam));
@ -2037,8 +2037,8 @@ void RenX_LoggingPlugin::RenX_OnGameOver(RenX::Server &server, RenX::WinType win
RenX::replace_tag(msg, RenX::tags->INTERNAL_TEAM_COLOR_TAG, RenX::getTeamColor(RenX::TeamType::GDI));
RenX::replace_tag(msg, RenX::tags->INTERNAL_TEAM_SHORT_TAG, RenX::getTeamName(RenX::TeamType::GDI));
RenX::replace_tag(msg, RenX::tags->INTERNAL_TEAM_LONG_TAG, RenX::getFullTeamName(RenX::TeamType::GDI));
RenX::replace_tag(msg, RenX::tags->INTERNAL_WIN_SCORE_TAG, Jupiter::StringS::Format("%d", winScore));
RenX::replace_tag(msg, RenX::tags->INTERNAL_LOSE_SCORE_TAG, Jupiter::StringS::Format("%d", loseScore));
RenX::replace_tag(msg, RenX::tags->INTERNAL_WIN_SCORE_TAG, string_printf("%d", winScore));
RenX::replace_tag(msg, RenX::tags->INTERNAL_LOSE_SCORE_TAG, string_printf("%d", loseScore));
RenX::replace_tag(msg, RenX::tags->INTERNAL_VICTIM_TEAM_COLOR_TAG, RenX::getTeamColor(RenX::TeamType::Nod));
RenX::replace_tag(msg, RenX::tags->INTERNAL_VICTIM_TEAM_SHORT_TAG, RenX::getTeamName(RenX::TeamType::Nod));
RenX::replace_tag(msg, RenX::tags->INTERNAL_VICTIM_TEAM_LONG_TAG, RenX::getFullTeamName(RenX::TeamType::Nod));
@ -2051,8 +2051,8 @@ void RenX_LoggingPlugin::RenX_OnGameOver(RenX::Server &server, RenX::WinType win
RenX::replace_tag(msg, RenX::tags->INTERNAL_TEAM_COLOR_TAG, RenX::getTeamColor(team));
RenX::replace_tag(msg, RenX::tags->INTERNAL_TEAM_SHORT_TAG, RenX::getTeamName(team));
RenX::replace_tag(msg, RenX::tags->INTERNAL_TEAM_LONG_TAG, RenX::getFullTeamName(team));
RenX::replace_tag(msg, RenX::tags->INTERNAL_WIN_SCORE_TAG, Jupiter::StringS::Format("%d", winScore));
RenX::replace_tag(msg, RenX::tags->INTERNAL_LOSE_SCORE_TAG, Jupiter::StringS::Format("%d", loseScore));
RenX::replace_tag(msg, RenX::tags->INTERNAL_WIN_SCORE_TAG, string_printf("%d", winScore));
RenX::replace_tag(msg, RenX::tags->INTERNAL_LOSE_SCORE_TAG, string_printf("%d", loseScore));
RenX::replace_tag(msg, RenX::tags->INTERNAL_VICTIM_TEAM_COLOR_TAG, RenX::getTeamColor(loserTeam));
RenX::replace_tag(msg, RenX::tags->INTERNAL_VICTIM_TEAM_SHORT_TAG, RenX::getTeamName(loserTeam));
RenX::replace_tag(msg, RenX::tags->INTERNAL_VICTIM_TEAM_LONG_TAG, RenX::getFullTeamName(loserTeam));
@ -2216,8 +2216,8 @@ void RenX_LoggingPlugin::RenX_OnVoteAddBots(RenX::Server &server, const RenX::Te
RenX::replace_tag(msg, RenX::tags->INTERNAL_VICTIM_TEAM_COLOR_TAG, RenX::getTeamColor(victim));
RenX::replace_tag(msg, RenX::tags->INTERNAL_VICTIM_TEAM_SHORT_TAG, RenX::getTeamName(victim));
RenX::replace_tag(msg, RenX::tags->INTERNAL_VICTIM_TEAM_LONG_TAG, RenX::getFullTeamName(victim));
RenX::replace_tag(msg, RenX::tags->INTERNAL_OBJECT_TAG, Jupiter::StringS::Format("%d", amount));
RenX::replace_tag(msg, RenX::tags->INTERNAL_WEAPON_TAG, Jupiter::StringS::Format("%d", skill));
RenX::replace_tag(msg, RenX::tags->INTERNAL_OBJECT_TAG, string_printf("%d", amount));
RenX::replace_tag(msg, RenX::tags->INTERNAL_WEAPON_TAG, string_printf("%d", skill));
(server.*func)(msg);
}
}
@ -2288,7 +2288,7 @@ void RenX_LoggingPlugin::RenX_OnVoteRemoveBots(RenX::Server &server, const RenX:
RenX::replace_tag(msg, RenX::tags->INTERNAL_VICTIM_TEAM_COLOR_TAG, RenX::getTeamColor(victim));
RenX::replace_tag(msg, RenX::tags->INTERNAL_VICTIM_TEAM_SHORT_TAG, RenX::getTeamName(victim));
RenX::replace_tag(msg, RenX::tags->INTERNAL_VICTIM_TEAM_LONG_TAG, RenX::getFullTeamName(victim));
RenX::replace_tag(msg, RenX::tags->INTERNAL_OBJECT_TAG, Jupiter::StringS::Format("%d", amount));
RenX::replace_tag(msg, RenX::tags->INTERNAL_OBJECT_TAG, string_printf("%d", amount));
(server.*func)(msg);
}
}
@ -2390,8 +2390,8 @@ void RenX_LoggingPlugin::RenX_OnVoteOver(RenX::Server &server, const RenX::TeamT
RenX::replace_tag(msg, RenX::tags->INTERNAL_VICTIM_TEAM_COLOR_TAG, RenX::getTeamColor(team));
RenX::replace_tag(msg, RenX::tags->INTERNAL_VICTIM_TEAM_SHORT_TAG, RenX::getTeamName(team));
RenX::replace_tag(msg, RenX::tags->INTERNAL_VICTIM_TEAM_LONG_TAG, RenX::getFullTeamName(team));
RenX::replace_tag(msg, RenX::tags->INTERNAL_WIN_SCORE_TAG, Jupiter::StringS::Format("%d", yesVotes));
RenX::replace_tag(msg, RenX::tags->INTERNAL_LOSE_SCORE_TAG, Jupiter::StringS::Format("%d", noVotes));
RenX::replace_tag(msg, RenX::tags->INTERNAL_WIN_SCORE_TAG, string_printf("%d", yesVotes));
RenX::replace_tag(msg, RenX::tags->INTERNAL_LOSE_SCORE_TAG, string_printf("%d", noVotes));
(server.*func)(msg);
}
}

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

@ -109,7 +109,7 @@ void RenX_MedalsPlugin::RenX_ProcessTags(std::string& msg, const RenX::Server *s
RenX::replace_tag(msg, this->INTERNAL_RECS_TAG, recs);
RenX::replace_tag(msg, this->INTERNAL_NOOB_TAG, noobs);
RenX::replace_tag(msg, 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, string_printf("%d", Jupiter::from_string<int>(recs) - Jupiter::from_string<int>(noobs)));
}
}
@ -139,7 +139,7 @@ void RenX_MedalsPlugin::RenX_OnJoin(RenX::Server &server, const RenX::PlayerInfo
size_t table_size = section->getTable().size();
if (table_size != 0) {
std::string_view msg = section->get(Jupiter::StringS::Format("%u", (rand() % table_size) + 1));
std::string_view msg = section->get(string_printf("%u", (rand() % table_size) + 1));
if (!msg.empty()) {
std::string tagged_msg = static_cast<std::string>(msg);
@ -237,7 +237,7 @@ void RenX_MedalsPlugin::RenX_OnDestroy(RenX::Server &server, const RenX::PlayerI
addRec(player);
std::string_view translated = RenX::translateName(objectName);
server.sendMessage(Jupiter::StringS::Format("%.*s has been recommended for destroying the %.*s!", player.name.size(), player.name.data(), translated.size(), translated.data()));
server.sendMessage(string_printf("%.*s has been recommended for destroying the %.*s!", player.name.size(), player.name.data(), translated.size(), translated.data()));
}
}
@ -307,7 +307,7 @@ void RecsGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, st
{
unsigned int recs = section->get<unsigned int>("Recs"_jrs);
unsigned int noobs = section->get<unsigned int>("Noobs"_jrs);
source->sendMessage(*player, Jupiter::StringS::Format("[Archive] %.*s has %u and %u n00bs. Their worth: %d", section->getName().size(), section->getName().c_str(), recs, noobs, recs - noobs));
source->sendMessage(*player, string_printf("[Archive] %.*s has %u and %u n00bs. Their worth: %d", section->getName().size(), section->getName().c_str(), recs, noobs, recs - noobs));
}
}
else if (target->uuid.empty())
@ -317,12 +317,12 @@ void RecsGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, st
else if (target == player)
RecsGameCommand::trigger(source, player, ""_jrs);
else
source->sendMessage(*player, Jupiter::StringS::Format("%.*s has %lu and %lu n00bs. Their worth: %d", target->name.size(), target->name.data(), getRecs(*target), getNoobs(*target), getWorth(*target)));
source->sendMessage(*player, string_printf("%.*s has %lu and %lu n00bs. Their worth: %d", target->name.size(), target->name.data(), getRecs(*target), getNoobs(*target), getWorth(*target)));
}
else if (player->uuid.empty())
source->sendMessage(*player, "Error: You are not using steam."_jrs);
else
source->sendMessage(*player, Jupiter::StringS::Format("%.*s, you have %lu recs and %lu n00bs. Your worth: %d", player->name.size(), player->name.data(), getRecs(*player), getNoobs(*player), getWorth(*player)));
source->sendMessage(*player, string_printf("%.*s, you have %lu recs and %lu n00bs. Your worth: %d", player->name.size(), player->name.data(), getRecs(*player), getNoobs(*player), getWorth(*player)));
}
std::string_view RecsGameCommand::getHelp(std::string_view )
@ -366,7 +366,7 @@ void RecGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, std
}
else {
addRec(*target);
source->sendMessage(Jupiter::StringS::Format("%.*s has recommended %.*s!", player->name.size(), player->name.data(), target->name.size(), target->name.data()));
source->sendMessage(string_printf("%.*s has recommended %.*s!", player->name.size(), player->name.data(), target->name.size(), target->name.data()));
player->varData["RenX.Medals"_jrs].set("gr"_jrs, "1"s);
}
}
@ -410,7 +410,7 @@ void NoobGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, st
}
else {
addNoob(*target);
source->sendMessage(Jupiter::StringS::Format("%.*s has noob'd %.*s!", player->name.size(), player->name.data(), target->name.size(), target->name.data()));
source->sendMessage(string_printf("%.*s has noob'd %.*s!", player->name.size(), player->name.data(), target->name.size(), target->name.data()));
player->varData["RenX.Medals"_jrs].set("gn"_jrs, "1"s);
}
}
@ -427,13 +427,13 @@ GAME_COMMAND_INIT(NoobGameCommand)
void addRec(const RenX::PlayerInfo &player, int amount) {
if (!jessilib::starts_withi(player.uuid, "Player"sv) && !player.isBot) {
player.varData[pluginInstance.getName()].set("Recs"_jrs, static_cast<std::string>(Jupiter::StringS::Format("%u", getRecs(player) + amount)));
player.varData[pluginInstance.getName()].set("Recs"_jrs, static_cast<std::string>(string_printf("%u", getRecs(player) + amount)));
}
}
void addNoob(const RenX::PlayerInfo &player, int amount) {
if (!jessilib::starts_withi(player.uuid, "Player"sv) && !player.isBot) {
player.varData[pluginInstance.getName()].set("Noobs"_jrs,static_cast<std::string>(Jupiter::StringS::Format("%u", getNoobs(player) + amount)));
player.varData[pluginInstance.getName()].set("Noobs"_jrs,static_cast<std::string>(string_printf("%u", getNoobs(player) + amount)));
}
}

2
src/Plugins/RenX/RenX.MinPlayers/RenX_MinPlayers.cpp

@ -32,7 +32,7 @@ bool RenX_MinPlayersPlugin::initialize()
void RenX_MinPlayersPlugin::RenX_OnMapStart(RenX::Server &server, std::string_view map)
{
if (server.players.size() < RenX_MinPlayersPlugin::player_threshold)
server.send(Jupiter::StringS::Format("addbots %d", RenX_MinPlayersPlugin::player_threshold - server.players.size()));
server.send(string_printf("addbots %d", RenX_MinPlayersPlugin::player_threshold - server.players.size()));
}
void RenX_MinPlayersPlugin::RenX_OnJoin(RenX::Server &server, const RenX::PlayerInfo &player)

35
src/Plugins/RenX/RenX.ModSystem/RenX_ModSystem.cpp

@ -188,13 +188,13 @@ int RenX_ModSystemPlugin::auth(RenX::Server &server, const RenX::PlayerInfo &pla
player.access = section->get<int>("Access"_jrs, group->access);
if (player.access != 0)
{
server.sendMessage(player, Jupiter::StringS::Format("You are now authenticated with access level %d; group: %.*s.", player.access, group->name.size(), group->name.data()));
server.sendMessage(player, string_printf("You are now authenticated with access level %d; group: %.*s.", player.access, group->name.size(), group->name.data()));
if (server.isDevBot() && player.access > 1)
{
if (server.getVersion() >= 4)
server.sendData(Jupiter::StringS::Format("dset_dev %d\n", player.id));
server.sendData(string_printf("dset_dev %d\n", player.id));
else
server.sendData(Jupiter::StringS::Format("d%d\n", player.id));
server.sendData(string_printf("d%d\n", player.id));
}
}
Jupiter::String playerName = RenX::getFormattedPlayerName(player);
@ -247,12 +247,12 @@ void RenX_ModSystemPlugin::tempAuth(RenX::Server &server, const RenX::PlayerInfo
player.access = group->access;
if (notify)
server.sendMessage(player, Jupiter::StringS::Format("You have been authorized into group \"%.*s\", with access level %u.", group->name.size(), group->name.data(), player.access));
server.sendMessage(player, string_printf("You have been authorized into group \"%.*s\", with access level %u.", group->name.size(), group->name.data(), player.access));
}
bool RenX_ModSystemPlugin::set(RenX::PlayerInfo &player, ModGroup &group) {
bool r = this->config[player.uuid].set("Group"_jrs, group.name);
this->config[player.uuid].set("SteamID"_jrs, static_cast<std::string>(Jupiter::StringS::Format("%llu", player.steamid)));
this->config[player.uuid].set("SteamID"_jrs, static_cast<std::string>(string_printf("%llu", player.steamid)));
this->config[player.uuid].set("LastIP"_jrs, static_cast<std::string>(player.ip));
this->config[player.uuid].set("Name"_jrs, player.name);
this->config.write();
@ -358,7 +358,7 @@ void RenX_ModSystemPlugin::RenX_OnPlayerDelete(RenX::Server &server, const RenX:
if (RenX_ModSystemPlugin::groups.size() != 0 && !player.isBot && !player.uuid.empty()) {
Jupiter::Config *section = this->config.getSection(player.uuid);
if (section != nullptr) {
section->set("SteamID"_jrs, static_cast<std::string>(Jupiter::StringS::Format("%llu", player.steamid)));
section->set("SteamID"_jrs, static_cast<std::string>(string_printf("%llu", player.steamid)));
section->set("LastIP"_jrs, static_cast<std::string>(player.ip));
section->set("Name"_jrs, player.name);
}
@ -367,7 +367,7 @@ void RenX_ModSystemPlugin::RenX_OnPlayerDelete(RenX::Server &server, const RenX:
void RenX_ModSystemPlugin::RenX_OnIDChange(RenX::Server &server, const RenX::PlayerInfo &player, int oldID) {
if (player.access != 0 && server.isDevBot()) {
server.sendData(Jupiter::StringS::Format("d%d\n", player.id));
server.sendData(string_printf("d%d\n", player.id));
}
}
@ -686,9 +686,9 @@ void AddIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::stri
else {
pluginInstance.resetAccess(*player);
if (pluginInstance.set(*player, *group))
source->sendNotice(nick, Jupiter::StringS::Format("%.*s has been added to group \"%.*s\"", player->name.size(), player->name.data(), group->name.size(), group->name.data()));
source->sendNotice(nick, string_printf("%.*s has been added to group \"%.*s\"", player->name.size(), player->name.data(), group->name.size(), group->name.data()));
else
source->sendNotice(nick, Jupiter::StringS::Format("%.*s has been moved to group \"%.*s\"", player->name.size(), player->name.data(), group->name.size(), group->name.data()));
source->sendNotice(nick, string_printf("%.*s has been moved to group \"%.*s\"", player->name.size(), player->name.data(), group->name.size(), group->name.data()));
pluginInstance.auth(*server, *player, false, true);
}
}
@ -853,22 +853,19 @@ IRC_COMMAND_INIT(ForceAuthIRCCommand)
// ModList IRC Command
void ModListIRCCommand::create()
{
void ModListIRCCommand::create() {
this->addTrigger("modlist"_jrs);
this->addTrigger("mlist"_jrs);
}
void ModListIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view parameters)
{
void ModListIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view parameters) {
Jupiter::String msg;
size_t msgBaseSize;
bool haveMods = false;
for (auto node = pluginInstance.groups.begin(); node != pluginInstance.groups.end(); ++node)
{
for (auto node = pluginInstance.groups.begin(); node != pluginInstance.groups.end(); ++node) {
msg = node->prefix;
msg += node->name;
msg.aformat(IRCNORMAL " (Access: %d): ", node->access);
msg += string_printf(IRCNORMAL " (Access: %d): ", node->access);
msgBaseSize = msg.size();
for (auto& section : pluginInstance.getConfig().getSections()) {
@ -878,8 +875,7 @@ void ModListIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::
}
}
if (msg.size() != msgBaseSize)
{
if (msg.size() != msgBaseSize) {
msg.truncate(2);
source->sendMessage(channel, msg);
haveMods = true;
@ -889,8 +885,7 @@ void ModListIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::
source->sendMessage(channel, "There are no configured moderators."_jrs);
}
std::string_view ModListIRCCommand::getHelp(std::string_view )
{
std::string_view ModListIRCCommand::getHelp(std::string_view ) {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Displays the moderator list. Syntax: modlist");
return defaultHelp;
}

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

@ -36,10 +36,10 @@ constexpr std::string_view server_list_game_header = "<html><body>"sv;
constexpr std::string_view server_list_game_footer = "\n</body></html>"sv;
// TODO: can probably replace with some of the jessilib stuff
Jupiter::String jsonify(std::string_view in_str) {
std::string jsonify(std::string_view in_str) {
const unsigned char *ptr = reinterpret_cast<const unsigned char *>(in_str.data());
const unsigned char *end_ptr = ptr + in_str.size();
Jupiter::String result(in_str.size());
std::string result;
while (ptr < end_ptr) {
if (*ptr == '\\') { // backslash
@ -51,7 +51,18 @@ Jupiter::String jsonify(std::string_view in_str) {
result += '\"';
}
else if (*ptr < 0x20) { // control characters
result.aformat("\\u%04x", *ptr);
char buffer[2]; // control codes are only ever going to be at most 2 characters
if (std::to_chars(buffer, buffer + sizeof(buffer), *ptr, 16).ec == std::errc{}) {
result += "\\u00"sv;
if (*ptr > 0xF) {
result += buffer[0];
result += buffer[1];
}
else {
result += '0';
result += buffer[0];
}
};
}
else if ((*ptr & 0x80) != 0) { // UTF-8 sequence; copy to bypass above processing
result += *ptr;
@ -167,12 +178,10 @@ constexpr const char *json_bool_as_cstring(bool in) {
}
std::string RenX_ServerListPlugin::server_as_json(const RenX::Server &server) {
Jupiter::String server_json_block(128); // TODO: use std::string
ListServerInfo serverInfo = getListServerInfo(server);
if (serverInfo.hostname.empty()) {
server_json_block = "null";
return static_cast<std::string>(server_json_block);
return "null"s;
}
Jupiter::String server_name = jsonify(server.getName());
@ -203,7 +212,7 @@ std::string RenX_ServerListPlugin::server_as_json(const RenX::Server &server) {
}
// Build block
server_json_block.format(R"json({"Name":"%.*s",%.*s"Current Map":"%.*s","Bots":%u,"Players":%u,"Game Version":"%.*s",%.*s"Variables":{"Mine Limit":%d,"bSteamRequired":%s,"bPrivateMessageTeamOnly":%s,"bPassworded":%s,"bAllowPrivateMessaging":%s,"bRanked":%s,"Game Type":%d,"Player Limit":%d,"Vehicle Limit":%d,"bAutoBalanceTeams":%s,"Team Mode":%d,"bSpawnCrates":%s,"CrateRespawnAfterPickup":%f,"Time Limit":%d},"Port":%u,"IP":"%.*s")json",
std::string server_json_block = string_printf(R"json({"Name":"%.*s",%.*s"Current Map":"%.*s","Bots":%u,"Players":%u,"Game Version":"%.*s",%.*s"Variables":{"Mine Limit":%d,"bSteamRequired":%s,"bPrivateMessageTeamOnly":%s,"bPassworded":%s,"bAllowPrivateMessaging":%s,"bRanked":%s,"Game Type":%d,"Player Limit":%d,"Vehicle Limit":%d,"bAutoBalanceTeams":%s,"Team Mode":%d,"bSpawnCrates":%s,"CrateRespawnAfterPickup":%f,"Time Limit":%d},"Port":%u,"IP":"%.*s")json",
server_name.size(), server_name.data(),
server_prefix.size(), server_prefix.data(),
server_map.size(), server_map.data(),
@ -230,7 +239,7 @@ std::string RenX_ServerListPlugin::server_as_json(const RenX::Server &server) {
server_json_block += '}';
return static_cast<std::string>(server_json_block);
return server_json_block;
}
std::string RenX_ServerListPlugin::server_as_server_details_json(const RenX::Server& server) {
@ -316,7 +325,6 @@ std::string RenX_ServerListPlugin::server_as_server_details_json(const RenX::Ser
}
std::string RenX_ServerListPlugin::server_as_long_json(const RenX::Server &server) {
Jupiter::String server_json_block(128); // TODO: use std::string
ListServerInfo serverInfo = getListServerInfo(server);
Jupiter::String server_name = jsonify(server.getName());
@ -345,7 +353,7 @@ std::string RenX_ServerListPlugin::server_as_long_json(const RenX::Server &serve
server_attributes += "\n\t\t],";
}
server_json_block.format(R"json({
std::string server_json_block = string_printf(R"json({
"Name": "%.*s",
"NamePrefix": "%.*s",
"Current Map": "%.*s",
@ -527,10 +535,10 @@ void RenX_ServerListPlugin::updateMetadata() {
}
// TODO: not rely on StringS
m_metadata_json = Jupiter::StringS::Format(R"json({"player_count":%zu,"server_count":%u})json",
m_metadata_json = string_printf(R"json({"player_count":%zu,"server_count":%u})json",
player_count, server_count);
m_metadata_prometheus = Jupiter::StringS::Format("player_count %zu\nserver_count %u\n",
m_metadata_prometheus = string_printf("player_count %zu\nserver_count %u\n",
player_count, server_count);
}
@ -585,7 +593,7 @@ RenX_ServerListPlugin::ListServerInfo RenX_ServerListPlugin::getListServerInfo(c
populate_with_section(section);
// Try overwriting based on Port subsection
populate_with_section(section->getSection(Jupiter::StringS::Format("%u", server.getPort())));
populate_with_section(section->getSection(string_printf("%u", server.getPort())));
}
return result;

10
src/Plugins/RenX/RenX.SetJoin/RenX_SetJoin.cpp

@ -27,7 +27,7 @@ void RenX_SetJoinPlugin::RenX_OnJoin(RenX::Server &server, const RenX::PlayerInf
if (!player.uuid.empty() && server.isMatchInProgress()) {
std::string_view setjoin = RenX_SetJoinPlugin::setjoin_file.get(player.uuid);
if (!setjoin.empty())
server.sendMessage(Jupiter::StringS::Format("[%.*s] %.*s", player.name.size(), player.name.data(), setjoin.size(), setjoin.data()));
server.sendMessage(string_printf("[%.*s] %.*s", player.name.size(), player.name.data(), setjoin.size(), setjoin.data()));
}
}
@ -46,7 +46,7 @@ void ViewJoinGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player
std::string_view setjoin = pluginInstance.setjoin_file.get(player->uuid);
if (!setjoin.empty())
source->sendMessage(*player, Jupiter::StringS::Format("[%.*s] %.*s", player->name.size(), player->name.data(), setjoin.size(), setjoin.data()));
source->sendMessage(*player, string_printf("[%.*s] %.*s", player->name.size(), player->name.data(), setjoin.size(), setjoin.data()));
else
source->sendMessage(*player, "Error: No setjoin found."_jrs);
}
@ -73,7 +73,7 @@ void ShowJoinGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player
std::string_view setjoin = pluginInstance.setjoin_file.get(player->uuid);
if (!setjoin.empty())
source->sendMessage(Jupiter::StringS::Format("[%.*s] %.*s", player->name.size(), player->name.data(), setjoin.size(), setjoin.data()));
source->sendMessage(string_printf("[%.*s] %.*s", player->name.size(), player->name.data(), setjoin.size(), setjoin.data()));
else
source->sendMessage(*player, "Error: No setjoin found."_jrs);
}
@ -101,7 +101,7 @@ void DelJoinGameCommand::create()
void DelJoinGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, std::string_view ) {
if (!player->uuid.empty()) {
if (pluginInstance.setjoin_file.remove(player->uuid))
source->sendMessage(*player, Jupiter::StringS::Format("%.*s, your join message has been removed.", player->name.size(), player->name.data()));
source->sendMessage(*player, string_printf("%.*s, your join message has been removed.", player->name.size(), player->name.data()));
else
source->sendMessage(*player, "Error: Setjoin not found."_jrs);
}
@ -128,7 +128,7 @@ void SetJoinGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player,
if (!parameters.empty()) {
pluginInstance.setjoin_file.set(player->uuid, static_cast<std::string>(parameters));
pluginInstance.setjoin_file.write();
source->sendMessage(*player, Jupiter::StringS::Format("%.*s, your join message is now: %.*s", player->name.size(), player->name.data(), parameters.size(),
source->sendMessage(*player, string_printf("%.*s, your join message is now: %.*s", player->name.size(), player->name.data(), parameters.size(),
parameters.data()));
}
else DelJoinGameCommand_instance.trigger(source, player, parameters);

32
src/Plugins/RenX/RenX.Warn/RenX_Warn.cpp

@ -78,20 +78,20 @@ void WarnIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::str
if (warns > pluginInstance.m_maxWarns) {
switch (pluginInstance.m_warnAction) {
case -1:
server->kickPlayer(*player, Jupiter::StringS::Format("Warning limit reached (%d warnings)", warns));
source->sendNotice(nick, Jupiter::StringS::Format("%.*s has been kicked from the server for exceeding the warning limit (%d warnings).", player->name.size(), player->name.data(), warns));
server->kickPlayer(*player, string_printf("Warning limit reached (%d warnings)", warns));
source->sendNotice(nick, string_printf("%.*s has been kicked from the server for exceeding the warning limit (%d warnings).", player->name.size(), player->name.data(), warns));
break;
default:
server->banPlayer(*player, "Jupiter Bot/RenX.Warn"_jrs, Jupiter::StringS::Format("Warning limit reached (%d warnings)", warns), std::chrono::seconds(pluginInstance.m_warnAction));
source->sendNotice(nick, Jupiter::StringS::Format("%.*s has been banned from the server for exceeding the warning limit (%d warnings).", player->name.size(), player->name.data(), reason.size(), reason.data(), warns));
server->banPlayer(*player, "Jupiter Bot/RenX.Warn"_jrs, string_printf("Warning limit reached (%d warnings)", warns), std::chrono::seconds(pluginInstance.m_warnAction));
source->sendNotice(nick, string_printf("%.*s has been banned from the server for exceeding the warning limit (%d warnings).", player->name.size(), player->name.data(), reason.size(), reason.data(), warns));
break;
}
}
else {
player->varData[pluginInstance.getName()].set(WARNS_KEY, std::to_string(warns));
server->sendWarnMessage(*player, Jupiter::StringS::Format("You have been warned by %.*s@IRC for: %.*s. You have %d warnings.", nick.size(),
server->sendWarnMessage(*player, string_printf("You have been warned by %.*s@IRC for: %.*s. You have %d warnings.", nick.size(),
nick.data(), reason.size(), reason.data(), warns));
source->sendNotice(nick, Jupiter::StringS::Format("%.*s has been warned; they now have %d warnings.", player->name.size(), player->name.data(), warns));
source->sendNotice(nick, string_printf("%.*s has been warned; they now have %d warnings.", player->name.size(), player->name.data(), warns));
}
}
}
@ -137,9 +137,9 @@ void PardonIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::s
player = server->getPlayerByPartName(parameters);
if (player != nullptr) {
player->varData[pluginInstance.getName()].remove(WARNS_KEY);
server->sendMessage(*player, Jupiter::StringS::Format("You have been pardoned by %.*s@IRC; your warnings have been reset.", nick.size(),
server->sendMessage(*player, string_printf("You have been pardoned by %.*s@IRC; your warnings have been reset.", nick.size(),
nick.data()));
source->sendNotice(nick, Jupiter::StringS::Format("%.*s has been pardoned; their warnings have been reset.", player->name.size(), player->name.data()));
source->sendNotice(nick, string_printf("%.*s has been pardoned; their warnings have been reset.", player->name.size(), player->name.data()));
}
}
}
@ -173,19 +173,19 @@ void WarnGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, st
switch (pluginInstance.m_warnAction)
{
case -1:
source->kickPlayer(*target, Jupiter::StringS::Format("Warning limit reached (%d warnings)", warns));
source->sendMessage(*player, Jupiter::StringS::Format("%.*s has been kicked from the server for exceeding the warning limit (%d warnings).", target->name.size(), target->name.data(), warns));
source->kickPlayer(*target, string_printf("Warning limit reached (%d warnings)", warns));
source->sendMessage(*player, string_printf("%.*s has been kicked from the server for exceeding the warning limit (%d warnings).", target->name.size(), target->name.data(), warns));
break;
default:
source->banPlayer(*target, "Jupiter Bot/RenX.Warn"_jrs, Jupiter::StringS::Format("Warning limit reached (%d warnings)", warns), std::chrono::seconds(pluginInstance.m_warnAction));
source->sendMessage(*player, Jupiter::StringS::Format("%.*s has been banned from the server for exceeding the warning limit (%d warnings).", target->name.size(), target->name.data(), warns));
source->banPlayer(*target, "Jupiter Bot/RenX.Warn"_jrs, string_printf("Warning limit reached (%d warnings)", warns), std::chrono::seconds(pluginInstance.m_warnAction));
source->sendMessage(*player, string_printf("%.*s has been banned from the server for exceeding the warning limit (%d warnings).", target->name.size(), target->name.data(), warns));
break;
}
}
else {
target->varData[pluginInstance.getName()].set(WARNS_KEY, std::to_string(warns));
source->sendWarnMessage(*target, Jupiter::StringS::Format("You have been warned by %.*s for: %.*s. You have %d warnings.", player->name.size(), player->name.data(), reason.size(), reason.data(), warns));
source->sendMessage(*player, Jupiter::StringS::Format("%.*s has been warned; they now have %d warnings.", target->name.size(), target->name.data(), warns));
source->sendWarnMessage(*target, string_printf("You have been warned by %.*s for: %.*s. You have %d warnings.", player->name.size(), player->name.data(), reason.size(), reason.data(), warns));
source->sendMessage(*player, string_printf("%.*s has been warned; they now have %d warnings.", target->name.size(), target->name.data(), warns));
}
}
}
@ -214,8 +214,8 @@ void PardonGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player,
RenX::PlayerInfo *target = source->getPlayerByPartName(parameters);
if (target != nullptr) {
target->varData[pluginInstance.getName()].remove(WARNS_KEY);
source->sendMessage(*target, Jupiter::StringS::Format("You have been pardoned by %.*s@IRC; your warnings have been reset.", player->name.size(), player->name.data()));
source->sendMessage(*player, Jupiter::StringS::Format("%.*s has been pardoned; their warnings have been reset.", target->name.size(), target->name.data()));
source->sendMessage(*target, string_printf("You have been pardoned by %.*s@IRC; your warnings have been reset.", player->name.size(), player->name.data()));
source->sendMessage(*player, string_printf("%.*s has been pardoned; their warnings have been reset.", target->name.size(), target->name.data()));
}
}
else {

6
src/Plugins/SetJoin/SetJoin.cpp

@ -29,7 +29,7 @@ void SetJoinPlugin::OnJoin(Jupiter::IRC::Client *server, std::string_view chan,
if (setjoin.empty())
server->sendNotice(nick, "No setjoin has been set for you. To set one, use the !setjoin command"_jrs);
else
server->sendMessage(chan, Jupiter::StringS::Format(IRCBOLD IRCCOLOR "07[%.*s]" IRCCOLOR IRCBOLD ": %.*s", nick.size(), nick.data(), setjoin.size(), setjoin.data()));
server->sendMessage(chan, string_printf(IRCBOLD IRCCOLOR "07[%.*s]" IRCCOLOR IRCBOLD ": %.*s", nick.size(), nick.data(), setjoin.size(), setjoin.data()));
}
SetJoinPlugin pluginInstance;
@ -74,10 +74,10 @@ void ViewJoinIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std:
std::string_view setjoin = pluginInstance.setjoin_file[source->getConfigSection()].get(target);
if (setjoin.empty())
source->sendMessage(channel, Jupiter::StringS::Format("No setjoin has been set for \"%.*s\".", target.size(),
source->sendMessage(channel, string_printf("No setjoin has been set for \"%.*s\".", target.size(),
target.data()));
else
source->sendMessage(channel, Jupiter::StringS::Format(IRCBOLD IRCCOLOR "07[%.*s]" IRCCOLOR IRCBOLD ": %.*s", target.size(),
source->sendMessage(channel, string_printf(IRCBOLD IRCCOLOR "07[%.*s]" IRCCOLOR IRCBOLD ": %.*s", target.size(),
target.data(), setjoin.size(), setjoin.data()));
}

Loading…
Cancel
Save