Browse Source

Update Jupiter submodule & cleanup code accordingly

master
Jessica James 3 years ago
parent
commit
c63611a897
  1. 14
      src/Bot/include/Console_Command.h
  2. 14
      src/Bot/include/IRC_Command.h
  3. 2
      src/Bot/include/ServerManager.h
  4. 2
      src/Bot/src/IRC_Bot.cpp
  5. 8
      src/Bot/src/IRC_Command.cpp
  6. 2
      src/Bot/src/Main.cpp
  7. 2
      src/Bot/src/ServerManager.cpp
  8. 2
      src/Jupiter
  9. 24
      src/Plugins/CoreCommands/CoreCommands.cpp
  10. 42
      src/Plugins/ExtraCommands/ExtraCommands.cpp
  11. 8
      src/Plugins/FunCommands/FunCommands.cpp
  12. 4
      src/Plugins/Plugin.Example/Example.cpp
  13. 4
      src/Plugins/PluginManager/PluginManager.cpp
  14. 2
      src/Plugins/RenX/RenX.AlwaysRecord/RenX_AlwaysRecord.cpp
  15. 2
      src/Plugins/RenX/RenX.AlwaysRecord/RenX_AlwaysRecord.h
  16. 8
      src/Plugins/RenX/RenX.ChatLogging/RenX_ChatLogging.cpp
  17. 6
      src/Plugins/RenX/RenX.ChatLogging/RenX_ChatLogging.h
  18. 6
      src/Plugins/RenX/RenX.CommandLogging/RenX_CommandLogging.cpp
  19. 4
      src/Plugins/RenX/RenX.CommandLogging/RenX_CommandLogging.h
  20. 358
      src/Plugins/RenX/RenX.Commands/RenX_Commands.cpp
  21. 14
      src/Plugins/RenX/RenX.Commands/RenX_Commands.h
  22. 2
      src/Plugins/RenX/RenX.Core/RenX_Core.cpp
  23. 2
      src/Plugins/RenX/RenX.Core/RenX_Core.h
  24. 4
      src/Plugins/RenX/RenX.Core/RenX_ExemptionDatabase.cpp
  25. 4
      src/Plugins/RenX/RenX.Core/RenX_ExemptionDatabase.h
  26. 16
      src/Plugins/RenX/RenX.Core/RenX_Functions.cpp
  27. 12
      src/Plugins/RenX/RenX.Core/RenX_Functions.h
  28. 4
      src/Plugins/RenX/RenX.Core/RenX_GameCommand.cpp
  29. 10
      src/Plugins/RenX/RenX.Core/RenX_GameCommand.h
  30. 4
      src/Plugins/RenX/RenX.Core/RenX_Map.cpp
  31. 4
      src/Plugins/RenX/RenX.Core/RenX_Map.h
  32. 168
      src/Plugins/RenX/RenX.Core/RenX_Plugin.cpp
  33. 168
      src/Plugins/RenX/RenX.Core/RenX_Plugin.h
  34. 90
      src/Plugins/RenX/RenX.Core/RenX_Server.cpp
  35. 28
      src/Plugins/RenX/RenX.Core/RenX_Server.h
  36. 8
      src/Plugins/RenX/RenX.Core/RenX_Tags.cpp
  37. 2
      src/Plugins/RenX/RenX.Core/RenX_Tags.h
  38. 4
      src/Plugins/RenX/RenX.ExcessiveHeadshots/RenX_ExcessiveHeadshots.cpp
  39. 2
      src/Plugins/RenX/RenX.ExcessiveHeadshots/RenX_ExcessiveHeadshots.h
  40. 2
      src/Plugins/RenX/RenX.ExtraLogging/RenX_ExtraLogging.cpp
  41. 2
      src/Plugins/RenX/RenX.ExtraLogging/RenX_ExtraLogging.h
  42. 18
      src/Plugins/RenX/RenX.Ladder.Web/RenX_Ladder_Web.cpp
  43. 10
      src/Plugins/RenX/RenX.Ladder/RenX_Ladder.cpp
  44. 2
      src/Plugins/RenX/RenX.Ladder/RenX_Ladder.h
  45. 4
      src/Plugins/RenX/RenX.Listen/RenX_Listen.cpp
  46. 142
      src/Plugins/RenX/RenX.Logging/RenX_Logging.cpp
  47. 140
      src/Plugins/RenX/RenX.Logging/RenX_Logging.h
  48. 20
      src/Plugins/RenX/RenX.Medals/RenX_Medals.cpp
  49. 2
      src/Plugins/RenX/RenX.Medals/RenX_Medals.h
  50. 10
      src/Plugins/RenX/RenX.MinPlayers/RenX_MinPlayers.cpp
  51. 10
      src/Plugins/RenX/RenX.MinPlayers/RenX_MinPlayers.h
  52. 40
      src/Plugins/RenX/RenX.ModSystem/RenX_ModSystem.cpp
  53. 5
      src/Plugins/RenX/RenX.Relay/RenX_Relay.cpp
  54. 2
      src/Plugins/RenX/RenX.Relay/RenX_Relay.h
  55. 36
      src/Plugins/RenX/RenX.ServerList/RenX_ServerList.cpp
  56. 2
      src/Plugins/RenX/RenX.ServerList/RenX_ServerList.h
  57. 16
      src/Plugins/RenX/RenX.SetJoin/RenX_SetJoin.cpp
  58. 19
      src/Plugins/RenX/RenX.Warn/RenX_Warn.cpp
  59. 14
      src/Plugins/SetJoin/SetJoin.cpp

14
src/Bot/include/Console_Command.h

@ -53,7 +53,7 @@ public:
* *
* @param input Parameters passed to the command by the user. * @param input Parameters passed to the command by the user.
*/ */
virtual void trigger(const Jupiter::ReadableString &input) = 0; virtual void trigger(std::string_view input) = 0;
/** /**
* @brief Default constructor for the console command class. * @brief Default constructor for the console command class.
@ -80,8 +80,8 @@ JUPITER_BOT_API extern ConsoleCommand *getConsoleCommand(std::string_view trigge
#define BASE_CONSOLE_COMMAND(CLASS) \ #define BASE_CONSOLE_COMMAND(CLASS) \
public: \ public: \
CLASS(); \ CLASS(); \
void trigger(const Jupiter::ReadableString &parameters); \ void trigger(std::string_view parameters); \
const Jupiter::ReadableString &getHelp(const Jupiter::ReadableString &parameters); std::string_view getHelp(std::string_view parameters);
/** Expands to become the entire declaration for a console command. In most cases, this will be sufficient. */ /** Expands to become the entire declaration for a console command. In most cases, this will be sufficient. */
#define GENERIC_CONSOLE_COMMAND(CLASS) \ #define GENERIC_CONSOLE_COMMAND(CLASS) \
@ -97,8 +97,8 @@ class CLASS : public ConsoleCommand { \
template<typename T> class Generic_Command_As_Console_Command : public ConsoleCommand template<typename T> class Generic_Command_As_Console_Command : public ConsoleCommand
{ {
public: public:
void trigger(const Jupiter::ReadableString &parameters); void trigger(std::string_view parameters);
const Jupiter::ReadableString &getHelp(const Jupiter::ReadableString &parameters); std::string_view getHelp(std::string_view parameters);
Generic_Command_As_Console_Command(); Generic_Command_As_Console_Command();
}; };
@ -110,7 +110,7 @@ template <typename T> Generic_Command_As_Console_Command<T>::Generic_Command_As_
} }
} }
template<typename T> void Generic_Command_As_Console_Command<T>::trigger(const Jupiter::ReadableString &parameters) { template<typename T> void Generic_Command_As_Console_Command<T>::trigger(std::string_view parameters) {
std::unique_ptr<Jupiter::GenericCommand::ResponseLine> response_line{ T::instance.trigger(parameters) }; std::unique_ptr<Jupiter::GenericCommand::ResponseLine> response_line{ T::instance.trigger(parameters) };
while (response_line != nullptr) { while (response_line != nullptr) {
auto& out_stream = response_line->type == Jupiter::GenericCommand::DisplayType::PublicError auto& out_stream = response_line->type == Jupiter::GenericCommand::DisplayType::PublicError
@ -121,7 +121,7 @@ template<typename T> void Generic_Command_As_Console_Command<T>::trigger(const J
} }
} }
template<typename T> const Jupiter::ReadableString &Generic_Command_As_Console_Command<T>::getHelp(const Jupiter::ReadableString &parameters) template<typename T> std::string_view Generic_Command_As_Console_Command<T>::getHelp(std::string_view parameters)
{ {
return T::instance.getHelp(parameters); return T::instance.getHelp(parameters);
} }

14
src/Bot/include/IRC_Command.h

@ -72,7 +72,7 @@ public:
* *
* @return Access level. * @return Access level.
*/ */
int getAccessLevel(const Jupiter::ReadableString &channel); int getAccessLevel(std::string_view channel);
/** /**
* @brief Fetches a command's access level for a specific channel. * @brief Fetches a command's access level for a specific channel.
@ -102,7 +102,7 @@ public:
* @param channel Specific channel name for which to set access. * @param channel Specific channel name for which to set access.
* @param accessLevel Access level. * @param accessLevel Access level.
*/ */
void setAccessLevel(const Jupiter::ReadableString &channel, int accessLevel); void setAccessLevel(std::string_view channel, int accessLevel);
/** /**
* @brief Called when the command is intially created. Define triggers and access levels here. * @brief Called when the command is intially created. Define triggers and access levels here.
@ -117,7 +117,7 @@ public:
* @param nick Nickname of the user who executed the command. * @param nick Nickname of the user who executed the command.
* @param parameters Parameters specified with the command. * @param parameters Parameters specified with the command.
*/ */
virtual void trigger(IRC_Bot *source, const Jupiter::ReadableString &channel, const Jupiter::ReadableString &nick, const Jupiter::ReadableString &parameters) = 0; virtual void trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view parameters) = 0;
/** /**
* @brief Creates a copy of a command. * @brief Creates a copy of a command.
@ -178,7 +178,7 @@ public:
* @param in_nick Name of the user to deliver result to (if result is 'Private' type) * @param in_nick Name of the user to deliver result to (if result is 'Private' type)
* @param in_parameters Parameters to pass to the GenericCommand's trigger() * @param in_parameters Parameters to pass to the GenericCommand's trigger()
*/ */
void trigger(IRC_Bot *in_server, const Jupiter::ReadableString &in_channel, const Jupiter::ReadableString &in_nick, const Jupiter::ReadableString &in_parameters) override; void trigger(IRC_Bot *in_server, std::string_view in_channel, std::string_view in_nick, std::string_view in_parameters) override;
/** /**
* @brief Forwards the help message from the underlying GenericCommand * @brief Forwards the help message from the underlying GenericCommand
@ -186,7 +186,7 @@ public:
* @param in_parameters Parameters to forward to the GenericCommand's getHelp() * @param in_parameters Parameters to forward to the GenericCommand's getHelp()
* @return Help string from the GenericCommand * @return Help string from the GenericCommand
*/ */
const Jupiter::ReadableString &getHelp(const Jupiter::ReadableString &in_parameters) override; std::string_view getHelp(std::string_view in_parameters) override;
/** /**
* @brief Copies the GenericCommandWrapperIRCCommand * @brief Copies the GenericCommandWrapperIRCCommand
@ -221,8 +221,8 @@ private:
/** Defines the core of an IRC command's declaration. This should be included in every IRC command. */ /** Defines the core of an IRC command's declaration. This should be included in every IRC command. */
#define BASE_IRC_COMMAND(CLASS) \ #define BASE_IRC_COMMAND(CLASS) \
public: \ public: \
void trigger(IRC_Bot *source, const Jupiter::ReadableString &channel, const Jupiter::ReadableString &nick, const Jupiter::ReadableString &parameters) override; \ void trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view parameters) override; \
const Jupiter::ReadableString &getHelp(const Jupiter::ReadableString &parameters) override; \ std::string_view getHelp(std::string_view parameters) override; \
IRCCommand *copy() override; \ IRCCommand *copy() override; \
void create() override; \ void create() override; \
CLASS() { this->create(); if (serverManager != nullptr) serverManager->addCommand(this); } CLASS() { this->create(); if (serverManager != nullptr) serverManager->addCommand(this); }

2
src/Bot/include/ServerManager.h

@ -74,7 +74,7 @@ public:
* @param command Trigger to match against. * @param command Trigger to match against.
* @return Number of servers which had a command removed. * @return Number of servers which had a command removed.
*/ */
size_t removeCommand(const Jupiter::ReadableString &command); size_t removeCommand(std::string_view command);
/** /**
* @brief Called when m_config is rehashed * @brief Called when m_config is rehashed

2
src/Bot/src/IRC_Bot.cpp

@ -180,7 +180,7 @@ void IRC_Bot::OnChat(std::string_view in_channel, std::string_view nick, std::st
this->sendNotice(nick, "Access Denied."_jrs); this->sendNotice(nick, "Access Denied."_jrs);
} }
else { else {
cmd->trigger(this, Jupiter::ReferenceString{in_channel}, Jupiter::ReferenceString{nick}, Jupiter::ReferenceString{message_split.second}); cmd->trigger(this, in_channel, nick, message_split.second);
} }
IRCCommand::active_server = IRCCommand::selected_server; IRCCommand::active_server = IRCCommand::selected_server;

8
src/Bot/src/IRC_Command.cpp

@ -71,7 +71,7 @@ int IRCCommand::getAccessLevel(int type) {
return m_access; return m_access;
} }
int IRCCommand::getAccessLevel(const Jupiter::ReadableString &channel) { int IRCCommand::getAccessLevel(std::string_view channel) {
for (const auto& pair : m_channels) { for (const auto& pair : m_channels) {
if (jessilib::equalsi(pair.channel, channel)) { if (jessilib::equalsi(pair.channel, channel)) {
return pair.access; return pair.access;
@ -105,7 +105,7 @@ void IRCCommand::setAccessLevel(int type, int accessLevel) {
m_types.push_back({type, accessLevel}); m_types.push_back({type, accessLevel});
} }
void IRCCommand::setAccessLevel(const Jupiter::ReadableString &channel, int accessLevel) { void IRCCommand::setAccessLevel(std::string_view channel, int accessLevel) {
m_channels.push_back({ static_cast<std::string>(channel), accessLevel }); m_channels.push_back({ static_cast<std::string>(channel), accessLevel });
} }
@ -140,7 +140,7 @@ GenericCommandWrapperIRCCommand::GenericCommandWrapperIRCCommand(Jupiter::Generi
// GenericCommandWrapperIRCCommand functions // GenericCommandWrapperIRCCommand functions
void GenericCommandWrapperIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &in_channel, const Jupiter::ReadableString &in_nick, const Jupiter::ReadableString &in_parameters) { void GenericCommandWrapperIRCCommand::trigger(IRC_Bot *source, std::string_view in_channel, std::string_view in_nick, std::string_view in_parameters) {
Jupiter::GenericCommand::ResponseLine *del; Jupiter::GenericCommand::ResponseLine *del;
Jupiter::GenericCommand::ResponseLine *result = m_command->trigger(in_parameters); Jupiter::GenericCommand::ResponseLine *result = m_command->trigger(in_parameters);
@ -167,7 +167,7 @@ void GenericCommandWrapperIRCCommand::trigger(IRC_Bot *source, const Jupiter::Re
} }
} }
const Jupiter::ReadableString &GenericCommandWrapperIRCCommand::getHelp(const Jupiter::ReadableString &parameters) { std::string_view GenericCommandWrapperIRCCommand::getHelp(std::string_view parameters) {
return GenericCommandWrapperIRCCommand::m_command->getHelp(parameters); return GenericCommandWrapperIRCCommand::m_command->getHelp(parameters);
} }

2
src/Bot/src/Main.cpp

@ -151,7 +151,7 @@ void reinitialize_plugins() {
ConsoleCommand* command = getConsoleCommand(command_name); ConsoleCommand* command = getConsoleCommand(command_name);
if (command != nullptr) { if (command != nullptr) {
command->trigger(Jupiter::ReferenceString{input_split.second}); command->trigger(input_split.second);
} }
else { else {
printf("Error: Command \"%.*s\" not found." ENDL, static_cast<int>(command_name.size()), command_name.data()); printf("Error: Command \"%.*s\" not found." ENDL, static_cast<int>(command_name.size()), command_name.data());

2
src/Bot/src/ServerManager.cpp

@ -58,7 +58,7 @@ size_t ServerManager::removeCommand(IRCCommand *command) {
return result; return result;
} }
size_t ServerManager::removeCommand(const Jupiter::ReadableString &command) { size_t ServerManager::removeCommand(std::string_view command) {
size_t result = 0; size_t result = 0;
for (const auto& server : m_servers) { for (const auto& server : m_servers) {
if (server->freeCommand(command)) { if (server->freeCommand(command)) {

2
src/Jupiter

@ -1 +1 @@
Subproject commit dbb4d0d147503f3bacdff87a7dd71d8a12665fab Subproject commit 6b693b96a9f77d1ec49e11d991d9c5a75965f4c4

24
src/Plugins/CoreCommands/CoreCommands.cpp

@ -31,7 +31,7 @@ HelpConsoleCommand::HelpConsoleCommand() {
this->addTrigger(STRING_LITERAL_AS_REFERENCE("help")); this->addTrigger(STRING_LITERAL_AS_REFERENCE("help"));
} }
void HelpConsoleCommand::trigger(const Jupiter::ReadableString &parameters) { void HelpConsoleCommand::trigger(std::string_view parameters) {
if (parameters.empty()) { if (parameters.empty()) {
std::cout << "Supported commands:"; std::cout << "Supported commands:";
for (const auto& command : consoleCommands) { for (const auto& command : consoleCommands) {
@ -50,10 +50,10 @@ void HelpConsoleCommand::trigger(const Jupiter::ReadableString &parameters) {
return; return;
} }
std::cout << std::string_view{cmd->getHelp(Jupiter::ReferenceString{command_split.second})} << std::endl; std::cout << std::string_view{cmd->getHelp(command_split.second)} << std::endl;
} }
const Jupiter::ReadableString &HelpConsoleCommand::getHelp(const Jupiter::ReadableString &) { std::string_view HelpConsoleCommand::getHelp(std::string_view ) {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Lists commands, or sends command-specific help. Syntax: help [command]"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Lists commands, or sends command-specific help. Syntax: help [command]");
return defaultHelp; return defaultHelp;
} }
@ -66,7 +66,7 @@ void HelpIRCCommand::create() {
this->addTrigger("help"_jrs); this->addTrigger("help"_jrs);
} }
void HelpIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &in_channel, const Jupiter::ReadableString &nick, const Jupiter::ReadableString &parameters) { void HelpIRCCommand::trigger(IRC_Bot *source, std::string_view in_channel, std::string_view nick, std::string_view parameters) {
Jupiter::IRC::Client::Channel *channel = source->getChannel(in_channel); Jupiter::IRC::Client::Channel *channel = source->getChannel(in_channel);
if (channel != nullptr) if (channel != nullptr)
{ {
@ -95,14 +95,14 @@ void HelpIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &in_
else if (access < command_access) else if (access < command_access)
source->sendNotice(nick, "Access Denied."_jrs); source->sendNotice(nick, "Access Denied."_jrs);
else else
source->sendNotice(nick, cmd->getHelp(Jupiter::ReferenceString{command_split.second})); source->sendNotice(nick, cmd->getHelp(command_split.second));
} }
else source->sendNotice(nick, "Error: Command not found."_jrs); else source->sendNotice(nick, "Error: Command not found."_jrs);
} }
} }
} }
const Jupiter::ReadableString &HelpIRCCommand::getHelp(const Jupiter::ReadableString &) { std::string_view HelpIRCCommand::getHelp(std::string_view ) {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Syntax: help [command]"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Syntax: help [command]");
return defaultHelp; return defaultHelp;
} }
@ -120,13 +120,13 @@ VersionGenericCommand::VersionGenericCommand() {
this->addTrigger(STRING_LITERAL_AS_REFERENCE("clientinfo")); this->addTrigger(STRING_LITERAL_AS_REFERENCE("clientinfo"));
} }
Jupiter::GenericCommand::ResponseLine *VersionGenericCommand::trigger(const Jupiter::ReadableString &parameters) { Jupiter::GenericCommand::ResponseLine *VersionGenericCommand::trigger(std::string_view parameters) {
Jupiter::GenericCommand::ResponseLine *ret = new Jupiter::GenericCommand::ResponseLine("Version: "s + Jupiter::ReferenceString(Jupiter::version), GenericCommand::DisplayType::PublicSuccess); Jupiter::GenericCommand::ResponseLine *ret = new Jupiter::GenericCommand::ResponseLine("Version: "s + Jupiter::version, GenericCommand::DisplayType::PublicSuccess);
ret->next = new Jupiter::GenericCommand::ResponseLine(Jupiter::ReferenceString(Jupiter::copyright), GenericCommand::DisplayType::PublicSuccess); ret->next = new Jupiter::GenericCommand::ResponseLine(std::string_view{ Jupiter::copyright }, GenericCommand::DisplayType::PublicSuccess);
return ret; return ret;
} }
const Jupiter::ReadableString &VersionGenericCommand::getHelp(const Jupiter::ReadableString &) { std::string_view VersionGenericCommand::getHelp(std::string_view ) {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Displays version and copyright information"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Displays version and copyright information");
return defaultHelp; return defaultHelp;
} }
@ -140,7 +140,7 @@ RehashGenericCommand::RehashGenericCommand() {
this->addTrigger(STRING_LITERAL_AS_REFERENCE("rehash")); this->addTrigger(STRING_LITERAL_AS_REFERENCE("rehash"));
} }
Jupiter::GenericCommand::ResponseLine *RehashGenericCommand::trigger(const Jupiter::ReadableString &parameters) { Jupiter::GenericCommand::ResponseLine *RehashGenericCommand::trigger(std::string_view parameters) {
size_t hash_errors = Jupiter::rehash(); size_t hash_errors = Jupiter::rehash();
if (hash_errors == 0) if (hash_errors == 0)
@ -149,7 +149,7 @@ Jupiter::GenericCommand::ResponseLine *RehashGenericCommand::trigger(const Jupit
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(Jupiter::StringS::Format("%u of %u objects failed to successfully rehash.", hash_errors, Jupiter::getRehashableCount()), GenericCommand::DisplayType::PublicError);
} }
const Jupiter::ReadableString &RehashGenericCommand::getHelp(const Jupiter::ReadableString &) { std::string_view RehashGenericCommand::getHelp(std::string_view ) {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Rehashes configuration data from a file. Syntax: rehash [file]"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Rehashes configuration data from a file. Syntax: rehash [file]");
return defaultHelp; return defaultHelp;
} }

42
src/Plugins/ExtraCommands/ExtraCommands.cpp

@ -33,7 +33,7 @@ SelectGenericCommand::SelectGenericCommand()
this->addTrigger("ircselect"_jrs); this->addTrigger("ircselect"_jrs);
} }
Jupiter::GenericCommand::ResponseLine *SelectGenericCommand::trigger(const Jupiter::ReadableString &parameters) Jupiter::GenericCommand::ResponseLine *SelectGenericCommand::trigger(std::string_view parameters)
{ {
if (parameters.empty()) if (parameters.empty())
{ {
@ -53,7 +53,7 @@ Jupiter::GenericCommand::ResponseLine *SelectGenericCommand::trigger(const Jupit
return new Jupiter::GenericCommand::ResponseLine(std::string{IRCCommand::selected_server->getConfigSection()} + " is now selected."s, GenericCommand::DisplayType::PublicSuccess); return new Jupiter::GenericCommand::ResponseLine(std::string{IRCCommand::selected_server->getConfigSection()} + " is now selected."s, GenericCommand::DisplayType::PublicSuccess);
} }
const Jupiter::ReadableString &SelectGenericCommand::getHelp(const Jupiter::ReadableString &) std::string_view SelectGenericCommand::getHelp(std::string_view )
{ {
static Jupiter::ReferenceString defaultHelp = "Selects an IRC server if specified, responds with the currently selected server otherwise. Syntax: select [server]"_jrs; static Jupiter::ReferenceString defaultHelp = "Selects an IRC server if specified, responds with the currently selected server otherwise. Syntax: select [server]"_jrs;
return defaultHelp; return defaultHelp;
@ -74,7 +74,7 @@ DeselectGenericCommand::DeselectGenericCommand()
this->addTrigger("ircunselect"_jrs); this->addTrigger("ircunselect"_jrs);
} }
Jupiter::GenericCommand::ResponseLine *DeselectGenericCommand::trigger(const Jupiter::ReadableString &parameters) Jupiter::GenericCommand::ResponseLine *DeselectGenericCommand::trigger(std::string_view parameters)
{ {
if (IRCCommand::selected_server == nullptr) if (IRCCommand::selected_server == nullptr)
return new Jupiter::GenericCommand::ResponseLine("No IRC server is currently selected."_jrs, GenericCommand::DisplayType::PublicSuccess); return new Jupiter::GenericCommand::ResponseLine("No IRC server is currently selected."_jrs, GenericCommand::DisplayType::PublicSuccess);
@ -85,7 +85,7 @@ Jupiter::GenericCommand::ResponseLine *DeselectGenericCommand::trigger(const Jup
return ret; return ret;
} }
const Jupiter::ReadableString &DeselectGenericCommand::getHelp(const Jupiter::ReadableString &) std::string_view DeselectGenericCommand::getHelp(std::string_view )
{ {
static Jupiter::ReferenceString defaultHelp = "Deselects the currently selected IRC server. Syntax: deselect"_jrs; static Jupiter::ReferenceString defaultHelp = "Deselects the currently selected IRC server. Syntax: deselect"_jrs;
return defaultHelp; return defaultHelp;
@ -102,7 +102,7 @@ RawGenericCommand::RawGenericCommand()
this->addTrigger("sendraw"_jrs); this->addTrigger("sendraw"_jrs);
} }
Jupiter::GenericCommand::ResponseLine *RawGenericCommand::trigger(const Jupiter::ReadableString &parameters) Jupiter::GenericCommand::ResponseLine *RawGenericCommand::trigger(std::string_view parameters)
{ {
IRC_Bot *server; IRC_Bot *server;
if (IRCCommand::selected_server != nullptr) if (IRCCommand::selected_server != nullptr)
@ -119,7 +119,7 @@ Jupiter::GenericCommand::ResponseLine *RawGenericCommand::trigger(const Jupiter:
return new Jupiter::GenericCommand::ResponseLine("Data has been successfully sent to server."_jrs, GenericCommand::DisplayType::PublicSuccess); return new Jupiter::GenericCommand::ResponseLine("Data has been successfully sent to server."_jrs, GenericCommand::DisplayType::PublicSuccess);
} }
const Jupiter::ReadableString &RawGenericCommand::getHelp(const Jupiter::ReadableString &) std::string_view RawGenericCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Sends a line of data to the selected IRC server. Syntax: raw <message>"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Sends a line of data to the selected IRC server. Syntax: raw <message>");
return defaultHelp; return defaultHelp;
@ -137,7 +137,7 @@ IRCMessageGenericCommand::IRCMessageGenericCommand()
this->addTrigger("privmsg"_jrs); this->addTrigger("privmsg"_jrs);
} }
Jupiter::GenericCommand::ResponseLine *IRCMessageGenericCommand::trigger(const Jupiter::ReadableString &parameters) Jupiter::GenericCommand::ResponseLine *IRCMessageGenericCommand::trigger(std::string_view parameters)
{ {
IRC_Bot *server; IRC_Bot *server;
if (IRCCommand::selected_server != nullptr) if (IRCCommand::selected_server != nullptr)
@ -151,11 +151,11 @@ Jupiter::GenericCommand::ResponseLine *IRCMessageGenericCommand::trigger(const J
if (parameters_split.second.empty()) if (parameters_split.second.empty())
return new Jupiter::GenericCommand::ResponseLine("Error: Too few parameters. Syntax: ircmsg <destination> <message>"_jrs, GenericCommand::DisplayType::PrivateError); return new Jupiter::GenericCommand::ResponseLine("Error: Too few parameters. Syntax: ircmsg <destination> <message>"_jrs, GenericCommand::DisplayType::PrivateError);
server->sendMessage(Jupiter::ReferenceString{parameters_split.first}, Jupiter::ReferenceString{parameters_split.second}); server->sendMessage(parameters_split.first, parameters_split.second);
return new Jupiter::GenericCommand::ResponseLine("Message successfully sent."_jrs, GenericCommand::DisplayType::PublicSuccess); return new Jupiter::GenericCommand::ResponseLine("Message successfully sent."_jrs, GenericCommand::DisplayType::PublicSuccess);
} }
const Jupiter::ReadableString &IRCMessageGenericCommand::getHelp(const Jupiter::ReadableString &) std::string_view IRCMessageGenericCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Sends a message to an IRC user or channel on the selected IRC server. Syntax: ircmsg <destination> <message>"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Sends a message to an IRC user or channel on the selected IRC server. Syntax: ircmsg <destination> <message>");
return defaultHelp; return defaultHelp;
@ -171,7 +171,7 @@ JoinGenericCommand::JoinGenericCommand()
this->addTrigger("Join"_jrs); this->addTrigger("Join"_jrs);
} }
Jupiter::GenericCommand::ResponseLine *JoinGenericCommand::trigger(const Jupiter::ReadableString &parameters) Jupiter::GenericCommand::ResponseLine *JoinGenericCommand::trigger(std::string_view parameters)
{ {
IRC_Bot *server; IRC_Bot *server;
if (IRCCommand::selected_server != nullptr) if (IRCCommand::selected_server != nullptr)
@ -195,7 +195,7 @@ Jupiter::GenericCommand::ResponseLine *JoinGenericCommand::trigger(const Jupiter
return new Jupiter::GenericCommand::ResponseLine("Request to join channel has been sent."_jrs, GenericCommand::DisplayType::PublicSuccess); return new Jupiter::GenericCommand::ResponseLine("Request to join channel has been sent."_jrs, GenericCommand::DisplayType::PublicSuccess);
} }
const Jupiter::ReadableString &JoinGenericCommand::getHelp(const Jupiter::ReadableString &) std::string_view JoinGenericCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Joins a channel. Syntax: join <channel> [password]"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Joins a channel. Syntax: join <channel> [password]");
return defaultHelp; return defaultHelp;
@ -211,7 +211,7 @@ PartGenericCommand::PartGenericCommand()
this->addTrigger("Part"_jrs); this->addTrigger("Part"_jrs);
} }
Jupiter::GenericCommand::ResponseLine *PartGenericCommand::trigger(const Jupiter::ReadableString &parameters) Jupiter::GenericCommand::ResponseLine *PartGenericCommand::trigger(std::string_view parameters)
{ {
IRC_Bot *server; IRC_Bot *server;
if (IRCCommand::selected_server != nullptr) if (IRCCommand::selected_server != nullptr)
@ -235,7 +235,7 @@ Jupiter::GenericCommand::ResponseLine *PartGenericCommand::trigger(const Jupiter
return new Jupiter::GenericCommand::ResponseLine("Part command successfuly sent."_jrs, GenericCommand::DisplayType::PublicSuccess); return new Jupiter::GenericCommand::ResponseLine("Part command successfuly sent."_jrs, GenericCommand::DisplayType::PublicSuccess);
} }
const Jupiter::ReadableString &PartGenericCommand::getHelp(const Jupiter::ReadableString &) std::string_view PartGenericCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Parts from a channel. Syntax: part <channel> [message]"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Parts from a channel. Syntax: part <channel> [message]");
return defaultHelp; return defaultHelp;
@ -251,7 +251,7 @@ DebugInfoGenericCommand::DebugInfoGenericCommand()
this->addTrigger("debuginfo"_jrs); this->addTrigger("debuginfo"_jrs);
} }
Jupiter::GenericCommand::ResponseLine *DebugInfoGenericCommand::trigger(const Jupiter::ReadableString &parameters) Jupiter::GenericCommand::ResponseLine *DebugInfoGenericCommand::trigger(std::string_view parameters)
{ {
IRC_Bot *server; IRC_Bot *server;
if (IRCCommand::selected_server != nullptr) if (IRCCommand::selected_server != nullptr)
@ -287,7 +287,7 @@ Jupiter::GenericCommand::ResponseLine *DebugInfoGenericCommand::trigger(const Ju
return ret; return ret;
} }
const Jupiter::ReadableString &DebugInfoGenericCommand::getHelp(const Jupiter::ReadableString &) std::string_view DebugInfoGenericCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "DEBUG COMMAND - Spits out some information about channels. Syntax: debuginfo"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "DEBUG COMMAND - Spits out some information about channels. Syntax: debuginfo");
return defaultHelp; return defaultHelp;
@ -303,12 +303,12 @@ ExitGenericCommand::ExitGenericCommand()
this->addTrigger("exit"_jrs); this->addTrigger("exit"_jrs);
} }
Jupiter::GenericCommand::ResponseLine *ExitGenericCommand::trigger(const Jupiter::ReadableString &parameters) Jupiter::GenericCommand::ResponseLine *ExitGenericCommand::trigger(std::string_view parameters)
{ {
exit(0); exit(0);
} }
const Jupiter::ReadableString &ExitGenericCommand::getHelp(const Jupiter::ReadableString &) std::string_view ExitGenericCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Closes the bot's application process. Syntax: exit"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Closes the bot's application process. Syntax: exit");
return defaultHelp; return defaultHelp;
@ -325,7 +325,7 @@ IRCConnectGenericCommand::IRCConnectGenericCommand()
this->addTrigger("IRCReconnect"_jrs); this->addTrigger("IRCReconnect"_jrs);
} }
Jupiter::GenericCommand::ResponseLine *IRCConnectGenericCommand::trigger(const Jupiter::ReadableString &parameters) Jupiter::GenericCommand::ResponseLine *IRCConnectGenericCommand::trigger(std::string_view parameters)
{ {
if (parameters.empty()) if (parameters.empty())
{ {
@ -351,7 +351,7 @@ Jupiter::GenericCommand::ResponseLine *IRCConnectGenericCommand::trigger(const J
return new Jupiter::GenericCommand::ResponseLine("Error: Unable to find configuration settings for server, or connection refused."_jrs, GenericCommand::DisplayType::PublicError); return new Jupiter::GenericCommand::ResponseLine("Error: Unable to find configuration settings for server, or connection refused."_jrs, GenericCommand::DisplayType::PublicError);
} }
const Jupiter::ReadableString &IRCConnectGenericCommand::getHelp(const Jupiter::ReadableString &) std::string_view IRCConnectGenericCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Connects/reconnects to an IRC server, based on config entry. Syntax: IRCConnect [server=here]"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Connects/reconnects to an IRC server, based on config entry. Syntax: IRCConnect [server=here]");
return defaultHelp; return defaultHelp;
@ -367,7 +367,7 @@ IRCDisconnectGenericCommand::IRCDisconnectGenericCommand()
this->addTrigger("IRCDisconnect"_jrs); this->addTrigger("IRCDisconnect"_jrs);
} }
Jupiter::GenericCommand::ResponseLine *IRCDisconnectGenericCommand::trigger(const Jupiter::ReadableString &parameters) Jupiter::GenericCommand::ResponseLine *IRCDisconnectGenericCommand::trigger(std::string_view parameters)
{ {
IRC_Bot *server; IRC_Bot *server;
if (IRCCommand::selected_server != nullptr) if (IRCCommand::selected_server != nullptr)
@ -381,7 +381,7 @@ Jupiter::GenericCommand::ResponseLine *IRCDisconnectGenericCommand::trigger(cons
return new Jupiter::GenericCommand::ResponseLine("Disconnected from server."_jrs, GenericCommand::DisplayType::PublicSuccess); return new Jupiter::GenericCommand::ResponseLine("Disconnected from server."_jrs, GenericCommand::DisplayType::PublicSuccess);
} }
const Jupiter::ReadableString &IRCDisconnectGenericCommand::getHelp(const Jupiter::ReadableString &) std::string_view IRCDisconnectGenericCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Disconnects from an IRC server, based on config entry. Syntax: IRCDisconnect"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Disconnects from an IRC server, based on config entry. Syntax: IRCDisconnect");
return defaultHelp; return defaultHelp;

8
src/Plugins/FunCommands/FunCommands.cpp

@ -36,7 +36,7 @@ void EightBallIRCCommand::create()
this->addTrigger("eightBall"_jrs); this->addTrigger("eightBall"_jrs);
} }
void EightBallIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &channel, const Jupiter::ReadableString &nick, const Jupiter::ReadableString &parameters) void EightBallIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view parameters)
{ {
Jupiter::StringS msg; Jupiter::StringS msg;
switch (rand() % 31) switch (rand() % 31)
@ -144,7 +144,7 @@ void EightBallIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString
source->sendMessage(channel, msg); source->sendMessage(channel, msg);
} }
const Jupiter::ReadableString &EightBallIRCCommand::getHelp(const Jupiter::ReadableString &) std::string_view EightBallIRCCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Accurately answers your question 60% of the time, EVERY time. Syntax: 8ball [question]"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Accurately answers your question 60% of the time, EVERY time. Syntax: 8ball [question]");
return defaultHelp; return defaultHelp;
@ -159,7 +159,7 @@ ResolveGenericCommand::ResolveGenericCommand()
this->addTrigger("resolve"_jrs); this->addTrigger("resolve"_jrs);
} }
Jupiter::GenericCommand::ResponseLine *ResolveGenericCommand::trigger(const Jupiter::ReadableString &parameters) { Jupiter::GenericCommand::ResponseLine *ResolveGenericCommand::trigger(std::string_view parameters) {
auto command_split = jessilib::word_split_once_view(std::string_view{parameters}, WHITESPACE_SV); auto command_split = jessilib::word_split_once_view(std::string_view{parameters}, WHITESPACE_SV);
if (command_split.second.empty()) { if (command_split.second.empty()) {
return new Jupiter::GenericCommand::ResponseLine("Error: Too few parameters. Syntax: resolve <hostname|ip> <address>"_jrs, GenericCommand::DisplayType::PrivateError); return new Jupiter::GenericCommand::ResponseLine("Error: Too few parameters. Syntax: resolve <hostname|ip> <address>"_jrs, GenericCommand::DisplayType::PrivateError);
@ -184,7 +184,7 @@ Jupiter::GenericCommand::ResponseLine *ResolveGenericCommand::trigger(const Jupi
return new Jupiter::GenericCommand::ResponseLine("Error: Invalid type. You can only resolve hostnames and IP addresses."_jrs, GenericCommand::DisplayType::PrivateError); return new Jupiter::GenericCommand::ResponseLine("Error: Invalid type. You can only resolve hostnames and IP addresses."_jrs, GenericCommand::DisplayType::PrivateError);
} }
const Jupiter::ReadableString &ResolveGenericCommand::getHelp(const Jupiter::ReadableString &parameters) std::string_view ResolveGenericCommand::getHelp(std::string_view parameters)
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Resolves an IP address or hostname. Syntax: resolve <hostname|ip> <address>"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Resolves an IP address or hostname. Syntax: resolve <hostname|ip> <address>");
static STRING_LITERAL_AS_NAMED_REFERENCE(hostHelp, "Resolves a hostname to an IP address. Syntax: resolve hostname <address>"); static STRING_LITERAL_AS_NAMED_REFERENCE(hostHelp, "Resolves a hostname to an IP address. Syntax: resolve hostname <address>");

4
src/Plugins/Plugin.Example/Example.cpp

@ -23,12 +23,12 @@ void ExampleIRCCommand::create()
this->addTrigger("example"_jrs); this->addTrigger("example"_jrs);
} }
void ExampleIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &channel, const Jupiter::ReadableString &nick, const Jupiter::ReadableString &parameters) void ExampleIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view parameters)
{ {
source->sendMessage(channel, "This is an example command!"_jrs); source->sendMessage(channel, "This is an example command!"_jrs);
} }
const Jupiter::ReadableString &ExampleIRCCommand::getHelp(const Jupiter::ReadableString &) std::string_view ExampleIRCCommand::getHelp(std::string_view )
{ {
static auto helpmsg = "This is just an example command. It takes no parameters!"_jrs; static auto helpmsg = "This is just an example command. It takes no parameters!"_jrs;
return helpmsg; return helpmsg;

4
src/Plugins/PluginManager/PluginManager.cpp

@ -34,7 +34,7 @@ PluginGenericCommand::PluginGenericCommand() {
this->addTrigger(STRING_LITERAL_AS_REFERENCE("modules")); this->addTrigger(STRING_LITERAL_AS_REFERENCE("modules"));
} }
Jupiter::GenericCommand::ResponseLine *PluginGenericCommand::trigger(const Jupiter::ReadableString &parameters) { Jupiter::GenericCommand::ResponseLine *PluginGenericCommand::trigger(std::string_view parameters) {
auto parameters_view = static_cast<std::string_view>(parameters); auto parameters_view = static_cast<std::string_view>(parameters);
Jupiter::GenericCommand::ResponseLine *result = new Jupiter::GenericCommand::ResponseLine(); Jupiter::GenericCommand::ResponseLine *result = new Jupiter::GenericCommand::ResponseLine();
if (parameters_view.empty() || jessilib::starts_withi(parameters_view, "list"sv)) { if (parameters_view.empty() || jessilib::starts_withi(parameters_view, "list"sv)) {
@ -112,7 +112,7 @@ Jupiter::GenericCommand::ResponseLine *PluginGenericCommand::trigger(const Jupit
return result->set("Error: Invalid Syntax. Syntax: plugin {[list], <load> <plugin>, <unload> <plugin>, <reload> [all|plugin]}"_jrs, GenericCommand::DisplayType::PrivateError); return result->set("Error: Invalid Syntax. Syntax: plugin {[list], <load> <plugin>, <unload> <plugin>, <reload> [all|plugin]}"_jrs, GenericCommand::DisplayType::PrivateError);
} }
const Jupiter::ReadableString &PluginGenericCommand::getHelp(const Jupiter::ReadableString &parameters) { std::string_view PluginGenericCommand::getHelp(std::string_view parameters) {
static STRING_LITERAL_AS_NAMED_REFERENCE(loadHelp, "Loads a plugin by file name. Do not include a file extension. Syntax: plugin load <plugin>"); static STRING_LITERAL_AS_NAMED_REFERENCE(loadHelp, "Loads a plugin by file name. Do not include a file extension. Syntax: plugin load <plugin>");
static STRING_LITERAL_AS_NAMED_REFERENCE(unloadHelp, "Unloads a plugin by name. Syntax: plugin unload <plugin>"); static STRING_LITERAL_AS_NAMED_REFERENCE(unloadHelp, "Unloads a plugin by name. Syntax: plugin unload <plugin>");
static STRING_LITERAL_AS_NAMED_REFERENCE(listHelp, "Lists all of the plugins currently loaded. Syntax: plugin [list]"); static STRING_LITERAL_AS_NAMED_REFERENCE(listHelp, "Lists all of the plugins currently loaded. Syntax: plugin [list]");

2
src/Plugins/RenX/RenX.AlwaysRecord/RenX_AlwaysRecord.cpp

@ -21,7 +21,7 @@
using namespace Jupiter::literals; using namespace Jupiter::literals;
void RenX_AlwaysRecord::RenX_OnMapStart(RenX::Server &server, const Jupiter::ReadableString &) void RenX_AlwaysRecord::RenX_OnMapStart(RenX::Server &server, std::string_view )
{ {
server.send("demorec"_jrs); server.send("demorec"_jrs);
} }

2
src/Plugins/RenX/RenX.AlwaysRecord/RenX_AlwaysRecord.h

@ -26,7 +26,7 @@
class RenX_AlwaysRecord : public RenX::Plugin class RenX_AlwaysRecord : public RenX::Plugin
{ {
public: // RenX::Plugin public: // RenX::Plugin
void RenX_OnMapStart(RenX::Server &server, const Jupiter::ReadableString &) override; void RenX_OnMapStart(RenX::Server &server, std::string_view ) override;
}; };
#endif // _RENX_ALWAYSRECORD_H_HEADER #endif // _RENX_ALWAYSRECORD_H_HEADER

8
src/Plugins/RenX/RenX.ChatLogging/RenX_ChatLogging.cpp

@ -55,22 +55,22 @@ RenX_ChatLogPlugin::~RenX_ChatLogPlugin()
} }
} }
std::ostream& operator<<(std::ostream& in_stream, const Jupiter::ReadableString& in_string) { std::ostream& operator<<(std::ostream& in_stream, std::string_view in_string) {
in_stream.write(in_string.data(), in_string.size()); in_stream.write(in_string.data(), in_string.size());
return in_stream; return in_stream;
} }
void RenX_ChatLogPlugin::RenX_OnChat(RenX::Server& server, const RenX::PlayerInfo& player, const Jupiter::ReadableString& message) void RenX_ChatLogPlugin::RenX_OnChat(RenX::Server& server, const RenX::PlayerInfo& player, std::string_view message)
{ {
WriteToLog(server, player, message, "ALL"); WriteToLog(server, player, message, "ALL");
} }
void RenX_ChatLogPlugin::RenX_OnTeamChat(RenX::Server& server, const RenX::PlayerInfo& player, const Jupiter::ReadableString& message) void RenX_ChatLogPlugin::RenX_OnTeamChat(RenX::Server& server, const RenX::PlayerInfo& player, std::string_view message)
{ {
WriteToLog(server, player, message, "TEAM"); WriteToLog(server, player, message, "TEAM");
} }
void RenX_ChatLogPlugin::WriteToLog(RenX::Server& server, const RenX::PlayerInfo& player, const Jupiter::ReadableString& message, std::string in_prefix) void RenX_ChatLogPlugin::WriteToLog(RenX::Server& server, const RenX::PlayerInfo& player, std::string_view message, std::string in_prefix)
{ {
// Check if new file needs to be opened // Check if new file needs to be opened
PrepFile(); PrepFile();

6
src/Plugins/RenX/RenX.ChatLogging/RenX_ChatLogging.h

@ -20,12 +20,12 @@ public: // Jupiter::Plugin
~RenX_ChatLogPlugin(); ~RenX_ChatLogPlugin();
public: // RenX::Plugin public: // RenX::Plugin
void RenX_OnTeamChat(RenX::Server& server, const RenX::PlayerInfo& player, const Jupiter::ReadableString& message) override; void RenX_OnTeamChat(RenX::Server& server, const RenX::PlayerInfo& player, std::string_view message) override;
void RenX_OnChat(RenX::Server& server, const RenX::PlayerInfo& player, const Jupiter::ReadableString& message) override; void RenX_OnChat(RenX::Server& server, const RenX::PlayerInfo& player, std::string_view message) override;
public: public:
void PrepFile(); void PrepFile();
void WriteToLog(RenX::Server& server, const RenX::PlayerInfo& player, const Jupiter::ReadableString& message, std::string in_prefix); void WriteToLog(RenX::Server& server, const RenX::PlayerInfo& player, std::string_view message, std::string in_prefix);
std::string last_date; std::string last_date;
std::fstream fs; std::fstream fs;
}; };

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

@ -61,7 +61,7 @@ RenX_CommandLoggingPlugin::~RenX_CommandLoggingPlugin()
} }
} }
void RenX_CommandLoggingPlugin::RenX_OnCommandTriggered(RenX::Server& server, const Jupiter::ReadableString& trigger, RenX::PlayerInfo& player, const Jupiter::ReadableString& parameters, RenX::GameCommand& command) void RenX_CommandLoggingPlugin::RenX_OnCommandTriggered(RenX::Server& server, std::string_view trigger, RenX::PlayerInfo& player, std::string_view parameters, RenX::GameCommand& command)
{ {
if (player.access < min_access || command.getAccessLevel() < min_cmd_access) { if (player.access < min_access || command.getAccessLevel() < min_cmd_access) {
return; return;
@ -70,12 +70,12 @@ void RenX_CommandLoggingPlugin::RenX_OnCommandTriggered(RenX::Server& server, co
WriteToLog(server, player, static_cast<std::string>(trigger) + " " + parameters); WriteToLog(server, player, static_cast<std::string>(trigger) + " " + parameters);
} }
std::ostream& operator<<(std::ostream& in_stream, const Jupiter::ReadableString& in_string) { std::ostream& operator<<(std::ostream& in_stream, std::string_view in_string) {
in_stream.write(in_string.data(), in_string.size()); in_stream.write(in_string.data(), in_string.size());
return in_stream; return in_stream;
} }
void RenX_CommandLoggingPlugin::WriteToLog(RenX::Server& server, const RenX::PlayerInfo& player, const Jupiter::ReadableString& message) void RenX_CommandLoggingPlugin::WriteToLog(RenX::Server& server, const RenX::PlayerInfo& player, std::string_view message)
{ {
// Check if new file needs to be opened // Check if new file needs to be opened
PrepFile(); PrepFile();

4
src/Plugins/RenX/RenX.CommandLogging/RenX_CommandLogging.h

@ -20,11 +20,11 @@ public: // Jupiter::Plugin
~RenX_CommandLoggingPlugin(); ~RenX_CommandLoggingPlugin();
public: // RenX::Plugin public: // RenX::Plugin
void RenX_OnCommandTriggered(RenX::Server& server, const Jupiter::ReadableString& trigger, RenX::PlayerInfo& player, const Jupiter::ReadableString& parameters, RenX::GameCommand& command) override; void RenX_OnCommandTriggered(RenX::Server& server, std::string_view trigger, RenX::PlayerInfo& player, std::string_view parameters, RenX::GameCommand& command) override;
public: public:
void PrepFile(); void PrepFile();
void WriteToLog(RenX::Server& server, const RenX::PlayerInfo& player, const Jupiter::ReadableString& message); void WriteToLog(RenX::Server& server, const RenX::PlayerInfo& player, std::string_view message);
std::string last_date; std::string last_date;
std::fstream fs; std::fstream fs;
int min_access; int min_access;

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

File diff suppressed because it is too large

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

@ -28,9 +28,9 @@
class RenX_CommandsPlugin : public RenX::Plugin class RenX_CommandsPlugin : public RenX::Plugin
{ {
public: // RenX::Plugin public: // RenX::Plugin
void RenX_OnSuicide(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &damageType) override; void RenX_OnSuicide(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view damageType) override;
void RenX_OnKill(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::PlayerInfo &victim, const Jupiter::ReadableString &damageType) override; void RenX_OnKill(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::PlayerInfo &victim, std::string_view damageType) override;
void RenX_OnDie(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &damageType) override; void RenX_OnDie(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view damageType) override;
public: // Jupiter::Plugin public: // Jupiter::Plugin
virtual bool initialize() override; virtual bool initialize() override;
@ -39,10 +39,10 @@ public: // Jupiter::Plugin
public: public:
std::chrono::seconds getDefaultTBanTime() const; std::chrono::seconds getDefaultTBanTime() const;
std::chrono::seconds getMaxTBanTime() const; std::chrono::seconds getMaxTBanTime() const;
const Jupiter::ReadableString &getPlayerInfoFormat() const; std::string_view getPlayerInfoFormat() const;
const Jupiter::ReadableString &getAdminPlayerInfoFormat() const; std::string_view getAdminPlayerInfoFormat() const;
const Jupiter::ReadableString &getBuildingInfoFormat() const; std::string_view getBuildingInfoFormat() const;
const Jupiter::ReadableString &getStaffTitle() const; std::string_view getStaffTitle() const;
private: private:
std::chrono::seconds m_defaultTempBanTime; std::chrono::seconds m_defaultTempBanTime;

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

@ -66,7 +66,7 @@ bool RenX::Core::initialize() {
RenX::Core::~Core() { RenX::Core::~Core() {
} }
size_t RenX::Core::send(int type, const Jupiter::ReadableString &msg) { size_t RenX::Core::send(int type, std::string_view msg) {
size_t result = 0; size_t result = 0;
for (auto& server : m_servers) { for (auto& server : m_servers) {

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

@ -74,7 +74,7 @@ namespace RenX
* @param data Command to send. * @param data Command to send.
* @return Number of servers sent to on success, less than or equal to 0 otherwise. * @return Number of servers sent to on success, less than or equal to 0 otherwise.
*/ */
size_t send(int type, const Jupiter::ReadableString &data); size_t send(int type, std::string_view data);
/** /**
* @brief Adds a server to the server list. * @brief Adds a server to the server list.

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

@ -98,11 +98,11 @@ void RenX::ExemptionDatabase::write(RenX::ExemptionDatabase::Entry *entry, FILE
fgetpos(file, std::addressof(m_eof)); fgetpos(file, std::addressof(m_eof));
} }
void RenX::ExemptionDatabase::add(RenX::Server &, const RenX::PlayerInfo &player, const Jupiter::ReadableString &setter, std::chrono::seconds length, uint8_t flags) { void RenX::ExemptionDatabase::add(RenX::Server &, const RenX::PlayerInfo &player, std::string_view setter, std::chrono::seconds length, uint8_t flags) {
add(player.ip32, 32U, player.steamid, setter, length, flags); add(player.ip32, 32U, player.steamid, setter, length, flags);
} }
void RenX::ExemptionDatabase::add(uint32_t ip, uint8_t prefix_length, uint64_t steamid, const Jupiter::ReadableString &setter, std::chrono::seconds length, uint8_t flags) { void RenX::ExemptionDatabase::add(uint32_t ip, uint8_t prefix_length, uint64_t steamid, std::string_view setter, std::chrono::seconds length, uint8_t flags) {
std::unique_ptr<Entry> entry = std::make_unique<Entry>(); std::unique_ptr<Entry> entry = std::make_unique<Entry>();
entry->set_active(); entry->set_active();
entry->flags |= flags; entry->flags |= flags;

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

@ -111,7 +111,7 @@ namespace RenX
* @param player Data of the player to be exempted * @param player Data of the player to be exempted
* @param length Duration of the exempt * @param length Duration of the exempt
*/ */
void add(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &setter, std::chrono::seconds length, uint8_t flags); void add(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view setter, std::chrono::seconds length, uint8_t flags);
/** /**
* @brief Adds an exemption entry for a set of player information and immediately writes it to the database. * @brief Adds an exemption entry for a set of player information and immediately writes it to the database.
@ -122,7 +122,7 @@ namespace RenX
* @param setter Person implementing the exempt * @param setter Person implementing the exempt
* @param length Duration of the exemption * @param length Duration of the exemption
*/ */
void add(uint32_t ip, uint8_t prefix_length, uint64_t steamid, const Jupiter::ReadableString &setter, std::chrono::seconds length, uint8_t flags); void add(uint32_t ip, uint8_t prefix_length, uint64_t steamid, std::string_view setter, std::chrono::seconds length, uint8_t flags);
/** /**
* @brief Upgrades the exemption database to the current write_version. * @brief Upgrades the exemption database to the current write_version.

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

@ -381,7 +381,7 @@ RenX::TeamType RenX::getTeam(std::string_view team) {
return RenX::TeamType::Other; return RenX::TeamType::Other;
} }
const Jupiter::ReadableString &RenX::getTeamColor(TeamType team) std::string_view RenX::getTeamColor(TeamType team)
{ {
switch (team) switch (team)
{ {
@ -394,7 +394,7 @@ const Jupiter::ReadableString &RenX::getTeamColor(TeamType team)
} }
} }
const Jupiter::ReadableString &RenX::getTeamName(TeamType team) std::string_view RenX::getTeamName(TeamType team)
{ {
switch (team) switch (team)
{ {
@ -407,7 +407,7 @@ const Jupiter::ReadableString &RenX::getTeamName(TeamType team)
} }
} }
const Jupiter::ReadableString &RenX::getFullTeamName(TeamType team) std::string_view RenX::getFullTeamName(TeamType team)
{ {
switch (team) switch (team)
{ {
@ -433,7 +433,7 @@ RenX::TeamType RenX::getEnemy(TeamType team)
} }
} }
const Jupiter::ReadableString &RenX::getCharacter(const Jupiter::ReadableString &chr) std::string_view RenX::getCharacter(std::string_view chr)
{ {
static Jupiter::ReferenceString object; static Jupiter::ReferenceString object;
@ -448,7 +448,7 @@ const Jupiter::ReadableString &RenX::getCharacter(const Jupiter::ReadableString
return object; return object;
} }
const Jupiter::ReferenceString &translateCharacter(Jupiter::ReferenceString &object) std::string_view translateCharacter(std::string_view object)
{ {
if (object.find(STRING_LITERAL_AS_REFERENCE("GDI_")) == 0) if (object.find(STRING_LITERAL_AS_REFERENCE("GDI_")) == 0)
{ {
@ -497,7 +497,7 @@ std::string_view RenX::translateName(std::string_view obj)
if (obj.empty()) if (obj.empty())
return ""_jrs; return ""_jrs;
Jupiter::ReferenceString iniTranslation = RenX::getCore()->getConfig()["Name"_jrs].get(Jupiter::ReferenceString{obj}); Jupiter::ReferenceString iniTranslation = RenX::getCore()->getConfig()["Name"_jrs].get(obj);
if (!iniTranslation.empty()) if (!iniTranslation.empty())
return iniTranslation; return iniTranslation;
@ -790,7 +790,7 @@ std::string_view RenX::translateName(std::string_view obj)
return translateCharacter(object); return translateCharacter(object);
} }
const Jupiter::ReadableString &RenX::translateWinType(RenX::WinType winType) std::string_view RenX::translateWinType(RenX::WinType winType)
{ {
switch (winType) switch (winType)
{ {
@ -812,7 +812,7 @@ const Jupiter::ReadableString &RenX::translateWinType(RenX::WinType winType)
} }
} }
const Jupiter::ReadableString &RenX::translateWinTypePlain(RenX::WinType winType) std::string_view RenX::translateWinTypePlain(RenX::WinType winType)
{ {
switch (winType) switch (winType)
{ {

12
src/Plugins/RenX/RenX.Core/RenX_Functions.h

@ -58,7 +58,7 @@ namespace RenX
* @param team Team to get IRC color code for * @param team Team to get IRC color code for
* @return A team's corresponding IRC color-code. * @return A team's corresponding IRC color-code.
*/ */
RENX_API const Jupiter::ReadableString &getTeamColor(TeamType team); RENX_API std::string_view getTeamColor(TeamType team);
/** /**
* @brief Fetches a team's name. * @brief Fetches a team's name.
@ -67,7 +67,7 @@ namespace RenX
* @param team Team to translate into a name. * @param team Team to translate into a name.
* @return The team's corresponding name. * @return The team's corresponding name.
*/ */
RENX_API const Jupiter::ReadableString &getTeamName(TeamType team); RENX_API std::string_view getTeamName(TeamType team);
/** /**
* @brief Fetches a team's full name. * @brief Fetches a team's full name.
@ -76,7 +76,7 @@ namespace RenX
* @param team Team to translate into a name. * @param team Team to translate into a name.
* @return The team's corresponding name. * @return The team's corresponding name.
*/ */
RENX_API const Jupiter::ReadableString &getFullTeamName(TeamType team); RENX_API std::string_view getFullTeamName(TeamType team);
/** /**
* @brief Fetches a team's enemy. * @brief Fetches a team's enemy.
@ -93,7 +93,7 @@ namespace RenX
* @param preset Preset to simplify. * @param preset Preset to simplify.
* @return Simplified form of preset. * @return Simplified form of preset.
*/ */
RENX_API const Jupiter::ReadableString &getCharacter(const Jupiter::ReadableString &preset); RENX_API std::string_view getCharacter(std::string_view preset);
/** /**
* @brief Translates a preset's name into a real name. * @brief Translates a preset's name into a real name.
@ -110,7 +110,7 @@ namespace RenX
* @param winType WinType to translate. * @param winType WinType to translate.
* @return String containing the human-readable translation of the WinType. * @return String containing the human-readable translation of the WinType.
*/ */
RENX_API const Jupiter::ReadableString &translateWinType(WinType winType); RENX_API std::string_view translateWinType(WinType winType);
/** /**
* @brief Translates a WinType into a human-readable string. * @brief Translates a WinType into a human-readable string.
@ -119,7 +119,7 @@ namespace RenX
* @param winType WinType to translate. * @param winType WinType to translate.
* @return String containing the human-readable translation of the WinType. * @return String containing the human-readable translation of the WinType.
*/ */
RENX_API const Jupiter::ReadableString &translateWinTypePlain(WinType winType); RENX_API std::string_view translateWinTypePlain(WinType winType);
/** /**
* @brief Initializes translation definitions. * @brief Initializes translation definitions.

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

@ -77,11 +77,11 @@ RenX::BasicGameCommand::BasicGameCommand(std::string_view in_trigger, std::strin
m_help_message = in_help_message; m_help_message = in_help_message;
} }
void RenX::BasicGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, const Jupiter::ReadableString &parameters) { void RenX::BasicGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, std::string_view parameters) {
source->sendMessage(m_message); source->sendMessage(m_message);
} }
const Jupiter::ReadableString &RenX::BasicGameCommand::getHelp(const Jupiter::ReadableString &) { std::string_view RenX::BasicGameCommand::getHelp(std::string_view ) {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Returns a basic text string."); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Returns a basic text string.");
if (m_help_message.empty()) { if (m_help_message.empty()) {
return defaultHelp; return defaultHelp;

10
src/Plugins/RenX/RenX.Core/RenX_GameCommand.h

@ -73,7 +73,7 @@ namespace RenX
* @param player Player who executed the command. * @param player Player who executed the command.
* @param parameters Parameters following the command. * @param parameters Parameters following the command.
*/ */
virtual void trigger(RenX::Server *source, RenX::PlayerInfo *player, const Jupiter::ReadableString &parameters) = 0; virtual void trigger(RenX::Server *source, RenX::PlayerInfo *player, std::string_view parameters) = 0;
/** /**
* @brief Called when the command is intially created. Define triggers and access levels here. * @brief Called when the command is intially created. Define triggers and access levels here.
@ -124,8 +124,8 @@ namespace RenX
class RENX_API BasicGameCommand : public RenX::GameCommand class RENX_API BasicGameCommand : public RenX::GameCommand
{ {
public: public:
void trigger(RenX::Server *source, RenX::PlayerInfo *player, const Jupiter::ReadableString &parameters); void trigger(RenX::Server *source, RenX::PlayerInfo *player, std::string_view parameters);
const Jupiter::ReadableString &getHelp(const Jupiter::ReadableString &parameters) override; std::string_view getHelp(std::string_view parameters) override;
BasicGameCommand *copy(); BasicGameCommand *copy();
void create(); void create();
BasicGameCommand(); BasicGameCommand();
@ -142,8 +142,8 @@ namespace RenX
/** Defines the core of a game command's declaration. This should be included in every game command. */ /** Defines the core of a game command's declaration. This should be included in every game command. */
#define BASE_GAME_COMMAND(CLASS) \ #define BASE_GAME_COMMAND(CLASS) \
public: \ public: \
void trigger(RenX::Server *source, RenX::PlayerInfo *player, const Jupiter::ReadableString &parameters); \ void trigger(RenX::Server *source, RenX::PlayerInfo *player, std::string_view parameters); \
const Jupiter::ReadableString &getHelp(const Jupiter::ReadableString &parameters) override; \ std::string_view getHelp(std::string_view parameters) override; \
CLASS *copy(); \ CLASS *copy(); \
void create(); \ void create(); \
CLASS() { this->create(); RenX::getCore()->addCommand(this); } CLASS() { this->create(); RenX::getCore()->addCommand(this); }

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

@ -24,12 +24,12 @@ RenX::Map::Map()
RenX::Map::Map::guid[1] = 0ULL; RenX::Map::Map::guid[1] = 0ULL;
} }
RenX::Map::Map(const Jupiter::ReadableString &in_name) : Map() RenX::Map::Map(std::string_view in_name) : Map()
{ {
name = in_name; name = in_name;
} }
RenX::Map::Map(const Jupiter::ReadableString &in_name, uint64_t in_guid[2]) : Map(in_name) RenX::Map::Map(std::string_view in_name, uint64_t in_guid[2]) : Map(in_name)
{ {
RenX::Map::Map::guid[0] = in_guid[0]; RenX::Map::Map::guid[0] = in_guid[0];
RenX::Map::Map::guid[1] = in_guid[1]; RenX::Map::Map::guid[1] = in_guid[1];

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

@ -43,8 +43,8 @@ namespace RenX
bool equals(const RenX::Map &map) const; bool equals(const RenX::Map &map) const;
Map(); Map();
Map(const Jupiter::ReadableString &in_name); Map(std::string_view in_name);
Map(const Jupiter::ReadableString &in_name, uint64_t in_guid[2]); Map(std::string_view in_name, uint64_t in_guid[2]);
}; };
} }

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

@ -49,7 +49,7 @@ void RenX::Plugin::RenX_OnPlayerDelete(Server &, const PlayerInfo &) {
return; return;
} }
void RenX::Plugin::RenX_OnPlayerUUIDChange(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnPlayerUUIDChange(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
@ -77,7 +77,7 @@ bool RenX::Plugin::RenX_OnBan(Server &, const PlayerInfo &, Jupiter::StringType
return false; return false;
} }
void RenX::Plugin::RenX_OnCommandTriggered(Server& server, const Jupiter::ReadableString& trigger, RenX::PlayerInfo& player, const Jupiter::ReadableString& parameters, GameCommand& command) { void RenX::Plugin::RenX_OnCommandTriggered(Server& server, std::string_view trigger, RenX::PlayerInfo& player, std::string_view parameters, GameCommand& command) {
return; return;
} }
@ -89,11 +89,11 @@ void RenX::Plugin::RenX_OnPart(Server &, const PlayerInfo &) {
return; return;
} }
void RenX::Plugin::RenX_OnKick(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnKick(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnNameChange(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnNameChange(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
@ -117,11 +117,11 @@ void RenX::Plugin::RenX_OnRank(Server &, const PlayerInfo &) {
return; return;
} }
void RenX::Plugin::RenX_OnExecute(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnExecute(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnPlayerCommand(Server &, const PlayerInfo &, const Jupiter::ReadableString &, GameCommand *) { void RenX::Plugin::RenX_OnPlayerCommand(Server &, const PlayerInfo &, std::string_view , GameCommand *) {
return; return;
} }
@ -129,135 +129,135 @@ void RenX::Plugin::RenX_OnSpeedHack(Server &, const PlayerInfo &) {
return; return;
} }
void RenX::Plugin::RenX_OnPlayer(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnPlayer(Server &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnChat(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnChat(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnTeamChat(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnTeamChat(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnRadioChat(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnRadioChat(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnHostChat(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnHostChat(Server &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnHostPage(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnHostPage(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnAdminMessage(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message) { void RenX::Plugin::RenX_OnAdminMessage(Server &server, const PlayerInfo &player, std::string_view message) {
return; return;
} }
void RenX::Plugin::RenX_OnWarnMessage(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message) { void RenX::Plugin::RenX_OnWarnMessage(Server &server, const PlayerInfo &player, std::string_view message) {
return; return;
} }
void RenX::Plugin::RenX_OnAdminPMessage(Server &server, const PlayerInfo &player, const PlayerInfo &target, const Jupiter::ReadableString &message) { void RenX::Plugin::RenX_OnAdminPMessage(Server &server, const PlayerInfo &player, const PlayerInfo &target, std::string_view message) {
return; return;
} }
void RenX::Plugin::RenX_OnWarnPMessage(Server &server, const PlayerInfo &player, const PlayerInfo &target, const Jupiter::ReadableString &message) { void RenX::Plugin::RenX_OnWarnPMessage(Server &server, const PlayerInfo &player, const PlayerInfo &target, std::string_view message) {
return; return;
} }
void RenX::Plugin::RenX_OnHostAdminMessage(Server &server, const Jupiter::ReadableString &message) { void RenX::Plugin::RenX_OnHostAdminMessage(Server &server, std::string_view message) {
return; return;
} }
void RenX::Plugin::RenX_OnHostAdminPMessage(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message) { void RenX::Plugin::RenX_OnHostAdminPMessage(Server &server, const PlayerInfo &player, std::string_view message) {
return; return;
} }
void RenX::Plugin::RenX_OnHostWarnMessage(Server &server, const Jupiter::ReadableString &message) { void RenX::Plugin::RenX_OnHostWarnMessage(Server &server, std::string_view message) {
return; return;
} }
void RenX::Plugin::RenX_OnHostWarnPMessage(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message) { void RenX::Plugin::RenX_OnHostWarnPMessage(Server &server, const PlayerInfo &player, std::string_view message) {
return; return;
} }
void RenX::Plugin::RenX_OnOtherChat(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnOtherChat(Server &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnDeploy(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnDeploy(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnOverMine(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnOverMine(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnDisarm(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnDisarm(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnDisarm(Server &, const PlayerInfo &, const Jupiter::ReadableString &, const PlayerInfo &) { void RenX::Plugin::RenX_OnDisarm(Server &, const PlayerInfo &, std::string_view , const PlayerInfo &) {
return; return;
} }
void RenX::Plugin::RenX_OnExplode(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnExplode(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnExplode(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnExplode(Server &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnSuicide(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnSuicide(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnKill(Server &, const PlayerInfo &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnKill(Server &, const PlayerInfo &, const PlayerInfo &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnKill(Server &, const Jupiter::ReadableString &, const TeamType &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnKill(Server &, std::string_view , const TeamType &, const PlayerInfo &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnDie(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnDie(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnDie(Server &, const Jupiter::ReadableString &, const TeamType &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnDie(Server &, std::string_view , const TeamType &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnDestroy(Server &, const PlayerInfo &, const Jupiter::ReadableString &, const TeamType &, const Jupiter::ReadableString &, ObjectType) { void RenX::Plugin::RenX_OnDestroy(Server &, const PlayerInfo &, std::string_view , const TeamType &, std::string_view , ObjectType) {
return; return;
} }
void RenX::Plugin::RenX_OnDestroy(Server &, const Jupiter::ReadableString &, const TeamType &, const Jupiter::ReadableString &, const TeamType &, const Jupiter::ReadableString &, ObjectType) { void RenX::Plugin::RenX_OnDestroy(Server &, std::string_view , const TeamType &, std::string_view , const TeamType &, std::string_view , ObjectType) {
return; return;
} }
void RenX::Plugin::RenX_OnCapture(Server &, const PlayerInfo &, const Jupiter::ReadableString &, const TeamType &) { void RenX::Plugin::RenX_OnCapture(Server &, const PlayerInfo &, std::string_view , const TeamType &) {
return; return;
} }
void RenX::Plugin::RenX_OnNeutralize(Server &, const PlayerInfo &, const Jupiter::ReadableString &, const TeamType &) { void RenX::Plugin::RenX_OnNeutralize(Server &, const PlayerInfo &, std::string_view , const TeamType &) {
return; return;
} }
void RenX::Plugin::RenX_OnCharacterPurchase(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnCharacterPurchase(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnItemPurchase(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnItemPurchase(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnWeaponPurchase(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnWeaponPurchase(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
@ -265,15 +265,15 @@ void RenX::Plugin::RenX_OnRefillPurchase(Server &, const PlayerInfo &) {
return; return;
} }
void RenX::Plugin::RenX_OnVehiclePurchase(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnVehiclePurchase(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnVehicleSpawn(Server &, const TeamType &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnVehicleSpawn(Server &, const TeamType &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnSpawn(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnSpawn(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
@ -281,15 +281,15 @@ void RenX::Plugin::RenX_OnBotJoin(Server &, const PlayerInfo &) {
return; return;
} }
void RenX::Plugin::RenX_OnVehicleCrate(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnVehicleCrate(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnTSVehicleCrate(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnTSVehicleCrate(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnRAVehicleCrate(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnRAVehicleCrate(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
@ -301,11 +301,11 @@ void RenX::Plugin::RenX_OnMoneyCrate(Server &, const PlayerInfo &, int) {
return; return;
} }
void RenX::Plugin::RenX_OnCharacterCrate(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnCharacterCrate(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnSpyCrate(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnSpyCrate(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
@ -333,15 +333,15 @@ void RenX::Plugin::RenX_OnUnspecifiedCrate(Server &, const PlayerInfo &) {
return; return;
} }
void RenX::Plugin::RenX_OnOtherCrate(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnOtherCrate(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnSteal(Server &, const PlayerInfo &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnSteal(Server &, const PlayerInfo &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnSteal(Server &, const PlayerInfo &, const Jupiter::ReadableString &, const PlayerInfo &) { void RenX::Plugin::RenX_OnSteal(Server &, const PlayerInfo &, std::string_view , const PlayerInfo &) {
return; return;
} }
@ -353,63 +353,63 @@ void RenX::Plugin::RenX_OnGameOver(Server &, RenX::WinType, const TeamType &, in
return; return;
} }
void RenX::Plugin::RenX_OnGame(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnGame(Server &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnExecute(Server &, const Jupiter::ReadableString &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnExecute(Server &, std::string_view , std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnSubscribe(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnSubscribe(Server &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnUnsubscribe(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnUnsubscribe(Server &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnBlock(Server &, const Jupiter::ReadableString &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnBlock(Server &, std::string_view , std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnConnect(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnConnect(Server &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnAuthenticate(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnAuthenticate(Server &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnBan(Server &, const Jupiter::ReadableString &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnBan(Server &, std::string_view , std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnInvalidPassword(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnInvalidPassword(Server &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnDrop(Server &, const Jupiter::ReadableString &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnDrop(Server &, std::string_view , std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnDisconnect(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnDisconnect(Server &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnStopListen(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnStopListen(Server &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnResumeListen(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnResumeListen(Server &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnWarning(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnWarning(Server &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnRCON(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnRCON(Server &, std::string_view ) {
return; return;
} }
@ -425,7 +425,7 @@ void RenX::Plugin::RenX_OnAdminLogout(Server &, const PlayerInfo &) {
return; return;
} }
void RenX::Plugin::RenX_OnAdmin(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnAdmin(Server &, std::string_view ) {
return; return;
} }
@ -457,39 +457,39 @@ void RenX::Plugin::RenX_OnVoteSurrender(Server &, const TeamType &, const Player
return; return;
} }
void RenX::Plugin::RenX_OnVoteSurvey(Server &, const TeamType &, const PlayerInfo &, const Jupiter::ReadableString &text) { void RenX::Plugin::RenX_OnVoteSurvey(Server &, const TeamType &, const PlayerInfo &, std::string_view text) {
return; return;
} }
void RenX::Plugin::RenX_OnVoteOther(Server &, const TeamType &, const Jupiter::ReadableString &, const PlayerInfo &) { void RenX::Plugin::RenX_OnVoteOther(Server &, const TeamType &, std::string_view , const PlayerInfo &) {
return; return;
} }
void RenX::Plugin::RenX_OnVoteOver(Server &, const TeamType &, const Jupiter::ReadableString &, bool, int, int) { void RenX::Plugin::RenX_OnVoteOver(Server &, const TeamType &, std::string_view , bool, int, int) {
return; return;
} }
void RenX::Plugin::RenX_OnVoteCancel(Server &, const TeamType &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnVoteCancel(Server &, const TeamType &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnVote(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnVote(Server &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnMapChange(Server &, const Jupiter::ReadableString &, bool) { void RenX::Plugin::RenX_OnMapChange(Server &, std::string_view , bool) {
return; return;
} }
void RenX::Plugin::RenX_OnMapLoad(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnMapLoad(Server &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnMapStart(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnMapStart(Server &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnMap(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnMap(Server &, std::string_view ) {
return; return;
} }
@ -497,7 +497,7 @@ void RenX::Plugin::RenX_OnDemoRecord(Server &, const PlayerInfo &) {
return; return;
} }
void RenX::Plugin::RenX_OnDemoRecord(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnDemoRecord(Server &, std::string_view ) {
return; return;
} }
@ -505,34 +505,34 @@ void RenX::Plugin::RenX_OnDemoRecordStop(Server &) {
return; return;
} }
void RenX::Plugin::RenX_OnDemo(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnDemo(Server &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnLog(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnLog(Server &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnCommand(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnCommand(Server &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnError(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnError(Server &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnVersion(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnVersion(Server &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnAuthorized(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnAuthorized(Server &, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnOther(Server &, char, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnOther(Server &, char, std::string_view ) {
return; return;
} }
void RenX::Plugin::RenX_OnRaw(Server &, const Jupiter::ReadableString &) { void RenX::Plugin::RenX_OnRaw(Server &, std::string_view ) {
return; return;
} }

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

@ -48,111 +48,111 @@ namespace RenX
/** Non-RCON RenX logs */ /** Non-RCON RenX logs */
virtual void RenX_OnPlayerCreate(Server &server, const PlayerInfo &player); virtual void RenX_OnPlayerCreate(Server &server, const PlayerInfo &player);
virtual void RenX_OnPlayerDelete(Server &server, const PlayerInfo &player); virtual void RenX_OnPlayerDelete(Server &server, const PlayerInfo &player);
virtual void RenX_OnPlayerUUIDChange(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &newUUID); virtual void RenX_OnPlayerUUIDChange(Server &server, const PlayerInfo &player, std::string_view newUUID);
virtual void RenX_OnPlayerRDNS(Server &server, const PlayerInfo &player); virtual void RenX_OnPlayerRDNS(Server &server, const PlayerInfo &player);
virtual void RenX_OnPlayerIdentify(Server &server, const PlayerInfo &player); virtual void RenX_OnPlayerIdentify(Server &server, const PlayerInfo &player);
virtual void RenX_OnServerCreate(Server &server); virtual void RenX_OnServerCreate(Server &server);
virtual void RenX_OnServerFullyConnected(Server &server); virtual void RenX_OnServerFullyConnected(Server &server);
virtual void RenX_OnServerDisconnect(Server &server, RenX::DisconnectReason reason); virtual void RenX_OnServerDisconnect(Server &server, RenX::DisconnectReason reason);
virtual bool RenX_OnBan(Server &server, const PlayerInfo &player, Jupiter::StringType &data); virtual bool RenX_OnBan(Server &server, const PlayerInfo &player, Jupiter::StringType &data);
virtual void RenX_OnCommandTriggered(Server& server, const Jupiter::ReadableString& trigger, RenX::PlayerInfo& player, const Jupiter::ReadableString& parameters, GameCommand& command); virtual void RenX_OnCommandTriggered(Server& server, std::string_view trigger, RenX::PlayerInfo& player, std::string_view parameters, GameCommand& command);
/** Player type logs */ /** Player type logs */
virtual void RenX_OnJoin(Server &server, const PlayerInfo &player); virtual void RenX_OnJoin(Server &server, const PlayerInfo &player);
virtual void RenX_OnPart(Server &server, const PlayerInfo &player); virtual void RenX_OnPart(Server &server, const PlayerInfo &player);
virtual void RenX_OnKick(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &reason); virtual void RenX_OnKick(Server &server, const PlayerInfo &player, std::string_view reason);
virtual void RenX_OnNameChange(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &newPlayerName); virtual void RenX_OnNameChange(Server &server, const PlayerInfo &player, std::string_view newPlayerName);
virtual void RenX_OnTeamChange(Server &server, const PlayerInfo &player, const TeamType &oldTeam); virtual void RenX_OnTeamChange(Server &server, const PlayerInfo &player, const TeamType &oldTeam);
virtual void RenX_OnHWID(Server &server, const PlayerInfo &player); virtual void RenX_OnHWID(Server &server, const PlayerInfo &player);
virtual void RenX_OnIDChange(Server &server, const PlayerInfo &player, int oldID); virtual void RenX_OnIDChange(Server &server, const PlayerInfo &player, int oldID);
virtual void RenX_OnRank(Server &server, const PlayerInfo &player); virtual void RenX_OnRank(Server &server, const PlayerInfo &player);
virtual void RenX_OnDev(Server &server, const PlayerInfo &player); virtual void RenX_OnDev(Server &server, const PlayerInfo &player);
virtual void RenX_OnExecute(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &command); virtual void RenX_OnExecute(Server &server, const PlayerInfo &player, std::string_view command);
virtual void RenX_OnPlayerCommand(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message, GameCommand *command); virtual void RenX_OnPlayerCommand(Server &server, const PlayerInfo &player, std::string_view message, GameCommand *command);
virtual void RenX_OnSpeedHack(Server &server, const PlayerInfo &player); virtual void RenX_OnSpeedHack(Server &server, const PlayerInfo &player);
virtual void RenX_OnPlayer(Server &server, const Jupiter::ReadableString &raw); virtual void RenX_OnPlayer(Server &server, std::string_view raw);
/** Chat type logs */ /** Chat type logs */
virtual void RenX_OnChat(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message); virtual void RenX_OnChat(Server &server, const PlayerInfo &player, std::string_view message);
virtual void RenX_OnTeamChat(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message); virtual void RenX_OnTeamChat(Server &server, const PlayerInfo &player, std::string_view message);
virtual void RenX_OnRadioChat(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message); virtual void RenX_OnRadioChat(Server &server, const PlayerInfo &player, std::string_view message);
virtual void RenX_OnHostChat(Server &server, const Jupiter::ReadableString &message); virtual void RenX_OnHostChat(Server &server, std::string_view message);
virtual void RenX_OnHostPage(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message); virtual void RenX_OnHostPage(Server &server, const PlayerInfo &player, std::string_view message);
virtual void RenX_OnAdminMessage(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message); virtual void RenX_OnAdminMessage(Server &server, const PlayerInfo &player, std::string_view message);
virtual void RenX_OnWarnMessage(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message); virtual void RenX_OnWarnMessage(Server &server, const PlayerInfo &player, std::string_view message);
virtual void RenX_OnAdminPMessage(Server &server, const PlayerInfo &player, const PlayerInfo &target, const Jupiter::ReadableString &message); virtual void RenX_OnAdminPMessage(Server &server, const PlayerInfo &player, const PlayerInfo &target, std::string_view message);
virtual void RenX_OnWarnPMessage(Server &server, const PlayerInfo &player, const PlayerInfo &target, const Jupiter::ReadableString &message); virtual void RenX_OnWarnPMessage(Server &server, const PlayerInfo &player, const PlayerInfo &target, std::string_view message);
virtual void RenX_OnHostAdminMessage(Server &server, const Jupiter::ReadableString &message); virtual void RenX_OnHostAdminMessage(Server &server, std::string_view message);
virtual void RenX_OnHostAdminPMessage(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message); virtual void RenX_OnHostAdminPMessage(Server &server, const PlayerInfo &player, std::string_view message);
virtual void RenX_OnHostWarnMessage(Server &server, const Jupiter::ReadableString &message); virtual void RenX_OnHostWarnMessage(Server &server, std::string_view message);
virtual void RenX_OnHostWarnPMessage(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message); virtual void RenX_OnHostWarnPMessage(Server &server, const PlayerInfo &player, std::string_view message);
virtual void RenX_OnOtherChat(Server &server, const Jupiter::ReadableString &raw); virtual void RenX_OnOtherChat(Server &server, std::string_view raw);
/** Game type logs */ /** Game type logs */
virtual void RenX_OnDeploy(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &object); virtual void RenX_OnDeploy(Server &server, const PlayerInfo &player, std::string_view object);
virtual void RenX_OnOverMine(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &location); virtual void RenX_OnOverMine(Server &server, const PlayerInfo &player, std::string_view location);
virtual void RenX_OnDisarm(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &object); virtual void RenX_OnDisarm(Server &server, const PlayerInfo &player, std::string_view object);
virtual void RenX_OnDisarm(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &object, const PlayerInfo &victim); virtual void RenX_OnDisarm(Server &server, const PlayerInfo &player, std::string_view object, const PlayerInfo &victim);
virtual void RenX_OnExplode(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &object); virtual void RenX_OnExplode(Server &server, const PlayerInfo &player, std::string_view object);
virtual void RenX_OnExplode(Server &server, const Jupiter::ReadableString &object); virtual void RenX_OnExplode(Server &server, std::string_view object);
virtual void RenX_OnSuicide(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &damageType); virtual void RenX_OnSuicide(Server &server, const PlayerInfo &player, std::string_view damageType);
virtual void RenX_OnKill(Server &server, const PlayerInfo &player, const PlayerInfo &victim, const Jupiter::ReadableString &damageType); virtual void RenX_OnKill(Server &server, const PlayerInfo &player, const PlayerInfo &victim, std::string_view damageType);
virtual void RenX_OnKill(Server &server, const Jupiter::ReadableString &killer, const TeamType &killerTeam, const PlayerInfo &victim, const Jupiter::ReadableString &damageType); virtual void RenX_OnKill(Server &server, std::string_view killer, const TeamType &killerTeam, const PlayerInfo &victim, std::string_view damageType);
virtual void RenX_OnDie(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &damageType); virtual void RenX_OnDie(Server &server, const PlayerInfo &player, std::string_view damageType);
virtual void RenX_OnDie(Server &server, const Jupiter::ReadableString &object, const TeamType &objectTeam, const Jupiter::ReadableString &damageType); virtual void RenX_OnDie(Server &server, std::string_view object, const TeamType &objectTeam, std::string_view damageType);
virtual void RenX_OnDestroy(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &objectName, const TeamType &victimTeam, const Jupiter::ReadableString &damageType, ObjectType type); virtual void RenX_OnDestroy(Server &server, const PlayerInfo &player, std::string_view objectName, const TeamType &victimTeam, std::string_view damageType, ObjectType type);
virtual void RenX_OnDestroy(Server &server, const Jupiter::ReadableString &killer, const TeamType &killerTeam, const Jupiter::ReadableString &objectName, const TeamType &objectTeam, const Jupiter::ReadableString &damageType, ObjectType type); virtual void RenX_OnDestroy(Server &server, std::string_view killer, const TeamType &killerTeam, std::string_view objectName, const TeamType &objectTeam, std::string_view damageType, ObjectType type);
virtual void RenX_OnCapture(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &building, const TeamType &oldTeam); virtual void RenX_OnCapture(Server &server, const PlayerInfo &player, std::string_view building, const TeamType &oldTeam);
virtual void RenX_OnNeutralize(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &building, const TeamType &oldTeam); virtual void RenX_OnNeutralize(Server &server, const PlayerInfo &player, std::string_view building, const TeamType &oldTeam);
virtual void RenX_OnCharacterPurchase(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &character); virtual void RenX_OnCharacterPurchase(Server &server, const PlayerInfo &player, std::string_view character);
virtual void RenX_OnItemPurchase(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &item); virtual void RenX_OnItemPurchase(Server &server, const PlayerInfo &player, std::string_view item);
virtual void RenX_OnWeaponPurchase(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &weapon); virtual void RenX_OnWeaponPurchase(Server &server, const PlayerInfo &player, std::string_view weapon);
virtual void RenX_OnRefillPurchase(Server &server, const PlayerInfo &player); virtual void RenX_OnRefillPurchase(Server &server, const PlayerInfo &player);
virtual void RenX_OnVehiclePurchase(Server &server, const PlayerInfo &owner, const Jupiter::ReadableString &vehicle); virtual void RenX_OnVehiclePurchase(Server &server, const PlayerInfo &owner, std::string_view vehicle);
virtual void RenX_OnVehicleSpawn(Server &server, const TeamType &team, const Jupiter::ReadableString &vehicle); virtual void RenX_OnVehicleSpawn(Server &server, const TeamType &team, std::string_view vehicle);
virtual void RenX_OnSpawn(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &character); virtual void RenX_OnSpawn(Server &server, const PlayerInfo &player, std::string_view character);
virtual void RenX_OnBotJoin(Server &server, const PlayerInfo &player); virtual void RenX_OnBotJoin(Server &server, const PlayerInfo &player);
virtual void RenX_OnVehicleCrate(Server &server, const PlayerInfo &owner, const Jupiter::ReadableString &vehicle); virtual void RenX_OnVehicleCrate(Server &server, const PlayerInfo &owner, std::string_view vehicle);
virtual void RenX_OnTSVehicleCrate(Server &server, const PlayerInfo &owner, const Jupiter::ReadableString &vehicle); virtual void RenX_OnTSVehicleCrate(Server &server, const PlayerInfo &owner, std::string_view vehicle);
virtual void RenX_OnRAVehicleCrate(Server &server, const PlayerInfo &owner, const Jupiter::ReadableString &vehicle); virtual void RenX_OnRAVehicleCrate(Server &server, const PlayerInfo &owner, std::string_view vehicle);
virtual void RenX_OnDeathCrate(Server &server, const PlayerInfo &player); virtual void RenX_OnDeathCrate(Server &server, const PlayerInfo &player);
virtual void RenX_OnMoneyCrate(Server &server, const PlayerInfo &player, int amount); virtual void RenX_OnMoneyCrate(Server &server, const PlayerInfo &player, int amount);
virtual void RenX_OnCharacterCrate(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &character); virtual void RenX_OnCharacterCrate(Server &server, const PlayerInfo &player, std::string_view character);
virtual void RenX_OnSpyCrate(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &character); virtual void RenX_OnSpyCrate(Server &server, const PlayerInfo &player, std::string_view character);
virtual void RenX_OnRefillCrate(Server &server, const PlayerInfo &player); virtual void RenX_OnRefillCrate(Server &server, const PlayerInfo &player);
virtual void RenX_OnTimeBombCrate(Server &server, const PlayerInfo &player); virtual void RenX_OnTimeBombCrate(Server &server, const PlayerInfo &player);
virtual void RenX_OnSpeedCrate(Server &server, const PlayerInfo &player); virtual void RenX_OnSpeedCrate(Server &server, const PlayerInfo &player);
virtual void RenX_OnNukeCrate(Server &server, const PlayerInfo &player); virtual void RenX_OnNukeCrate(Server &server, const PlayerInfo &player);
virtual void RenX_OnAbductionCrate(Server &server, const PlayerInfo &player); virtual void RenX_OnAbductionCrate(Server &server, const PlayerInfo &player);
virtual void RenX_OnUnspecifiedCrate(Server &server, const PlayerInfo &player); virtual void RenX_OnUnspecifiedCrate(Server &server, const PlayerInfo &player);
virtual void RenX_OnOtherCrate(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &type); virtual void RenX_OnOtherCrate(Server &server, const PlayerInfo &player, std::string_view type);
virtual void RenX_OnSteal(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &vehicle); virtual void RenX_OnSteal(Server &server, const PlayerInfo &player, std::string_view vehicle);
virtual void RenX_OnSteal(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &vehicle, const PlayerInfo &victim); virtual void RenX_OnSteal(Server &server, const PlayerInfo &player, std::string_view vehicle, const PlayerInfo &victim);
virtual void RenX_OnDonate(Server &server, const PlayerInfo &donor, const PlayerInfo &player, double amount); virtual void RenX_OnDonate(Server &server, const PlayerInfo &donor, const PlayerInfo &player, double amount);
virtual void RenX_OnGameOver(Server &server, WinType winType, const TeamType &team, int gScore, int nScore); virtual void RenX_OnGameOver(Server &server, WinType winType, const TeamType &team, int gScore, int nScore);
virtual void RenX_OnGame(Server &server, const Jupiter::ReadableString &raw); virtual void RenX_OnGame(Server &server, std::string_view raw);
/** RCON type logs */ /** RCON type logs */
virtual void RenX_OnExecute(Server &server, const Jupiter::ReadableString &user, const Jupiter::ReadableString &command); virtual void RenX_OnExecute(Server &server, std::string_view user, std::string_view command);
virtual void RenX_OnSubscribe(Server &server, const Jupiter::ReadableString &user); virtual void RenX_OnSubscribe(Server &server, std::string_view user);
virtual void RenX_OnUnsubscribe(Server &server, const Jupiter::ReadableString &user); virtual void RenX_OnUnsubscribe(Server &server, std::string_view user);
virtual void RenX_OnBlock(Server &server, const Jupiter::ReadableString &user, const Jupiter::ReadableString &message); virtual void RenX_OnBlock(Server &server, std::string_view user, std::string_view message);
virtual void RenX_OnConnect(Server &server, const Jupiter::ReadableString &user); virtual void RenX_OnConnect(Server &server, std::string_view user);
virtual void RenX_OnAuthenticate(Server &server, const Jupiter::ReadableString &user); virtual void RenX_OnAuthenticate(Server &server, std::string_view user);
virtual void RenX_OnBan(Server &server, const Jupiter::ReadableString &user, const Jupiter::ReadableString &message); virtual void RenX_OnBan(Server &server, std::string_view user, std::string_view message);
virtual void RenX_OnInvalidPassword(Server &server, const Jupiter::ReadableString &user); virtual void RenX_OnInvalidPassword(Server &server, std::string_view user);
virtual void RenX_OnDrop(Server &server, const Jupiter::ReadableString &user, const Jupiter::ReadableString &message); virtual void RenX_OnDrop(Server &server, std::string_view user, std::string_view message);
virtual void RenX_OnDisconnect(Server &server, const Jupiter::ReadableString &user); virtual void RenX_OnDisconnect(Server &server, std::string_view user);
virtual void RenX_OnStopListen(Server &server, const Jupiter::ReadableString &message); virtual void RenX_OnStopListen(Server &server, std::string_view message);
virtual void RenX_OnResumeListen(Server &server, const Jupiter::ReadableString &message); virtual void RenX_OnResumeListen(Server &server, std::string_view message);
virtual void RenX_OnWarning(Server &server, const Jupiter::ReadableString &message); virtual void RenX_OnWarning(Server &server, std::string_view message);
virtual void RenX_OnRCON(Server &server, const Jupiter::ReadableString &raw); virtual void RenX_OnRCON(Server &server, std::string_view raw);
/** Admin Type Logs */ /** Admin Type Logs */
virtual void RenX_OnAdminLogin(Server &server, const PlayerInfo &player); virtual void RenX_OnAdminLogin(Server &server, const PlayerInfo &player);
virtual void RenX_OnAdminGrant(Server &server, const PlayerInfo &player); virtual void RenX_OnAdminGrant(Server &server, const PlayerInfo &player);
virtual void RenX_OnAdminLogout(Server &server, const PlayerInfo &player); virtual void RenX_OnAdminLogout(Server &server, const PlayerInfo &player);
virtual void RenX_OnAdmin(Server &server, const Jupiter::ReadableString &raw); virtual void RenX_OnAdmin(Server &server, std::string_view raw);
/** Vote Type Logs */ /** Vote Type Logs */
virtual void RenX_OnVoteAddBots(Server &server, const TeamType &team, const PlayerInfo &player, const TeamType &victim, int amount, int skill); virtual void RenX_OnVoteAddBots(Server &server, const TeamType &team, const PlayerInfo &player, const TeamType &victim, int amount, int skill);
@ -162,44 +162,44 @@ namespace RenX
virtual void RenX_OnVoteRemoveBots(Server &server, const TeamType &team, const PlayerInfo &player, const TeamType &victim, int amount); virtual void RenX_OnVoteRemoveBots(Server &server, const TeamType &team, const PlayerInfo &player, const TeamType &victim, int amount);
virtual void RenX_OnVoteRestartMap(Server &server, const TeamType &team, const PlayerInfo &player); virtual void RenX_OnVoteRestartMap(Server &server, const TeamType &team, const PlayerInfo &player);
virtual void RenX_OnVoteSurrender(Server &server, const TeamType &team, const PlayerInfo &player); virtual void RenX_OnVoteSurrender(Server &server, const TeamType &team, const PlayerInfo &player);
virtual void RenX_OnVoteSurvey(Server &server, const TeamType &team, const PlayerInfo &player, const Jupiter::ReadableString &text); virtual void RenX_OnVoteSurvey(Server &server, const TeamType &team, const PlayerInfo &player, std::string_view text);
virtual void RenX_OnVoteOther(Server &server, const TeamType &team, const Jupiter::ReadableString &type, const PlayerInfo &player); virtual void RenX_OnVoteOther(Server &server, const TeamType &team, std::string_view type, const PlayerInfo &player);
virtual void RenX_OnVoteOver(Server &server, const TeamType &team, const Jupiter::ReadableString &type, bool success, int yesVotes, int noVotes); virtual void RenX_OnVoteOver(Server &server, const TeamType &team, std::string_view type, bool success, int yesVotes, int noVotes);
virtual void RenX_OnVoteCancel(Server &server, const TeamType &team, const Jupiter::ReadableString &type); virtual void RenX_OnVoteCancel(Server &server, const TeamType &team, std::string_view type);
virtual void RenX_OnVote(Server &server, const Jupiter::ReadableString &raw); virtual void RenX_OnVote(Server &server, std::string_view raw);
/** Map Type Logs */ /** Map Type Logs */
virtual void RenX_OnMapChange(Server &server, const Jupiter::ReadableString &map, bool seamless); virtual void RenX_OnMapChange(Server &server, std::string_view map, bool seamless);
virtual void RenX_OnMapLoad(Server &server, const Jupiter::ReadableString &map); virtual void RenX_OnMapLoad(Server &server, std::string_view map);
virtual void RenX_OnMapStart(Server &server, const Jupiter::ReadableString &map); virtual void RenX_OnMapStart(Server &server, std::string_view map);
virtual void RenX_OnMap(Server &server, const Jupiter::ReadableString &raw); virtual void RenX_OnMap(Server &server, std::string_view raw);
/** Demo Type Logs */ /** Demo Type Logs */
virtual void RenX_OnDemoRecord(Server &server, const PlayerInfo &player); virtual void RenX_OnDemoRecord(Server &server, const PlayerInfo &player);
virtual void RenX_OnDemoRecord(Server &server, const Jupiter::ReadableString &user); // Note: user is currently always empty. virtual void RenX_OnDemoRecord(Server &server, std::string_view user); // Note: user is currently always empty.
virtual void RenX_OnDemoRecordStop(Server &server); virtual void RenX_OnDemoRecordStop(Server &server);
virtual void RenX_OnDemo(Server &server, const Jupiter::ReadableString &raw); virtual void RenX_OnDemo(Server &server, std::string_view raw);
/** Other Logs */ /** Other Logs */
virtual void RenX_OnLog(Server &server, const Jupiter::ReadableString &raw); virtual void RenX_OnLog(Server &server, std::string_view raw);
/** Command type */ /** Command type */
virtual void RenX_OnCommand(Server &server, const Jupiter::ReadableString &raw); virtual void RenX_OnCommand(Server &server, std::string_view raw);
/** Error type */ /** Error type */
virtual void RenX_OnError(Server &server, const Jupiter::ReadableString &raw); virtual void RenX_OnError(Server &server, std::string_view raw);
/** Version type */ /** Version type */
virtual void RenX_OnVersion(Server &server, const Jupiter::ReadableString &raw); virtual void RenX_OnVersion(Server &server, std::string_view raw);
/** Authorized type */ /** Authorized type */
virtual void RenX_OnAuthorized(Server &server, const Jupiter::ReadableString &raw); virtual void RenX_OnAuthorized(Server &server, std::string_view raw);
/** Other type - executed if none of the above matched */ /** Other type - executed if none of the above matched */
virtual void RenX_OnOther(Server &server, const char token, const Jupiter::ReadableString &raw); virtual void RenX_OnOther(Server &server, const char token, std::string_view raw);
/** Catch-all - always executes for every line from RCON */ /** Catch-all - always executes for every line from RCON */
virtual void RenX_OnRaw(Server &server, const Jupiter::ReadableString &raw); virtual void RenX_OnRaw(Server &server, std::string_view raw);
/** /**
* @brief Default constructor for the Plugin class. * @brief Default constructor for the Plugin class.

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

@ -103,11 +103,11 @@ int RenX::Server::think() {
m_lastActivity = std::chrono::steady_clock::now(); m_lastActivity = std::chrono::steady_clock::now();
m_lastLine += tokens[0]; m_lastLine += tokens[0];
if (tokens.size() != 1) { if (tokens.size() != 1) {
processLine(Jupiter::ReferenceString{m_lastLine}); processLine(m_lastLine);
m_lastLine = tokens[tokens.size() - 1]; m_lastLine = tokens[tokens.size() - 1];
for (size_t index = 1; index != tokens.size() - 1; ++index) { for (size_t index = 1; index != tokens.size() - 1; ++index) {
processLine(Jupiter::ReferenceString{tokens[index]}); processLine(tokens[index]);
} }
} }
} }
@ -259,11 +259,11 @@ bool RenX::Server::isPure() const {
return m_pure; return m_pure;
} }
int RenX::Server::send(const Jupiter::ReadableString &command) { int RenX::Server::send(std::string_view command) {
return sendSocket("c"s + RenX::escapifyRCON(command) + '\n'); return sendSocket("c"s + RenX::escapifyRCON(command) + '\n');
} }
int RenX::Server::sendSocket(const Jupiter::ReadableString &text) { int RenX::Server::sendSocket(std::string_view text) {
m_lastSendActivity = std::chrono::steady_clock::now(); m_lastSendActivity = std::chrono::steady_clock::now();
return m_sock.send(text); return m_sock.send(text);
} }
@ -290,7 +290,7 @@ int RenX::Server::sendMessage(const RenX::PlayerInfo &player, std::string_view m
return sendSocket("chostprivatesay pid"s + Jupiter::StringS::Format("%d ", player.id) + RenX::escapifyRCON(message) + '\n'); return sendSocket("chostprivatesay pid"s + Jupiter::StringS::Format("%d ", player.id) + RenX::escapifyRCON(message) + '\n');
} }
int RenX::Server::sendAdminMessage(const Jupiter::ReadableString &message) { int RenX::Server::sendAdminMessage(std::string_view message) {
return sendSocket("camsg "s + RenX::escapifyRCON(message) + '\n'); return sendSocket("camsg "s + RenX::escapifyRCON(message) + '\n');
} }
@ -302,7 +302,7 @@ int RenX::Server::sendWarnMessage(const RenX::PlayerInfo &player, std::string_vi
return sendSocket("cwarn pid"s + Jupiter::StringS::Format("%d ", player.id) + RenX::escapifyRCON(message) + '\n'); return sendSocket("cwarn pid"s + Jupiter::StringS::Format("%d ", player.id) + RenX::escapifyRCON(message) + '\n');
} }
int RenX::Server::sendData(const Jupiter::ReadableString &data) { int RenX::Server::sendData(std::string_view data) {
return sendSocket(data); return sendSocket(data);
} }
@ -827,11 +827,11 @@ bool RenX::Server::setMap(std::string_view map) {
return send(Jupiter::StringS::Format("changemap %.*s", map.size(), map.data())) > 0; return send(Jupiter::StringS::Format("changemap %.*s", map.size(), map.data())) > 0;
} }
bool RenX::Server::loadMutator(const Jupiter::ReadableString &mutator) { bool RenX::Server::loadMutator(std::string_view mutator) {
return send(Jupiter::StringS::Format("loadmutator %.*s", mutator.size(), mutator.data())) > 0; return send(Jupiter::StringS::Format("loadmutator %.*s", mutator.size(), mutator.data())) > 0;
} }
bool RenX::Server::unloadMutator(const Jupiter::ReadableString &mutator) { bool RenX::Server::unloadMutator(std::string_view mutator) {
return send(Jupiter::StringS::Format("unloadmutator %.*s", mutator.size(), mutator.data())) > 0; return send(Jupiter::StringS::Format("unloadmutator %.*s", mutator.size(), mutator.data())) > 0;
} }
@ -926,7 +926,7 @@ bool RenX::Server::smodePlayer(const RenX::PlayerInfo &player) {
return send(Jupiter::StringS::Format("smode pid%d", player.id)); return send(Jupiter::StringS::Format("smode pid%d", player.id));
} }
const Jupiter::ReadableString &RenX::Server::getPrefix() const { std::string_view RenX::Server::getPrefix() const {
static std::string parsed; // TODO: What the hell? static std::string parsed; // TODO: What the hell?
RenX::processTags(parsed = m_IRCPrefix, this); RenX::processTags(parsed = m_IRCPrefix, this);
return parsed; return parsed;
@ -951,7 +951,7 @@ void RenX::Server::setRanked(bool in_value) {
m_ranked = in_value; m_ranked = in_value;
} }
const Jupiter::ReadableString &RenX::Server::getRules() const { std::string_view RenX::Server::getRules() const {
return m_rules; return m_rules;
} }
@ -1035,7 +1035,7 @@ bool RenX::Server::isBotsEnabled() const {
return m_botsEnabled; return m_botsEnabled;
} }
const Jupiter::ReadableString &RenX::Server::getPassword() const { std::string_view RenX::Server::getPassword() const {
return m_pass; return m_pass;
} }
@ -1047,7 +1047,7 @@ bool RenX::Server::isDevBot() const {
return m_devBot; return m_devBot;
} }
const Jupiter::ReadableString &RenX::Server::getName() const { std::string_view RenX::Server::getName() const {
return m_serverName; return m_serverName;
} }
@ -1077,7 +1077,7 @@ RenX::GameCommand *RenX::Server::triggerCommand(std::string_view trigger, RenX::
for (const auto& command : m_commands) { for (const auto& command : m_commands) {
if (command->matches(trigger)) { if (command->matches(trigger)) {
if (player.access >= command->getAccessLevel()) { if (player.access >= command->getAccessLevel()) {
command->trigger(this, &player, Jupiter::ReferenceString{parameters}); command->trigger(this, &player, parameters);
} }
else { else {
sendMessage(player, "Access Denied."_jrs); sendMessage(player, "Access Denied."_jrs);
@ -1085,7 +1085,7 @@ RenX::GameCommand *RenX::Server::triggerCommand(std::string_view trigger, RenX::
// TODO: avoiding modifying behavior for now, but this probably doesn't need to be called on access denied // TODO: avoiding modifying behavior for now, but this probably doesn't need to be called on access denied
for (const auto& plugin : getCore()->getPlugins()) { for (const auto& plugin : getCore()->getPlugins()) {
plugin->RenX_OnCommandTriggered(*this, Jupiter::ReferenceString{trigger}, player, Jupiter::ReferenceString{parameters}, *command); plugin->RenX_OnCommandTriggered(*this, trigger, player, parameters, *command);
} }
return command.get(); return command.get();
@ -1160,7 +1160,7 @@ RenX::Server::uuid_func RenX::Server::getUUIDFunction() const {
void RenX::Server::setUUID(RenX::PlayerInfo &player, std::string_view uuid) { void RenX::Server::setUUID(RenX::PlayerInfo &player, std::string_view uuid) {
for (const auto& plugin : getCore()->getPlugins()) { for (const auto& plugin : getCore()->getPlugins()) {
plugin->RenX_OnPlayerUUIDChange(*this, player, Jupiter::ReferenceString{uuid}); plugin->RenX_OnPlayerUUIDChange(*this, player, uuid);
} }
player.uuid = uuid; player.uuid = uuid;
@ -1183,7 +1183,7 @@ void RenX::Server::sendPubChan(const char *fmt, ...) const {
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);
Jupiter::StringL msg; Jupiter::StringL msg;
const Jupiter::ReadableString &serverPrefix = getPrefix(); std::string_view serverPrefix = getPrefix();
if (!serverPrefix.empty()) { if (!serverPrefix.empty()) {
msg += serverPrefix; msg += serverPrefix;
msg += ' '; msg += ' ';
@ -1198,8 +1198,8 @@ void RenX::Server::sendPubChan(const char *fmt, ...) const {
} }
} }
void RenX::Server::sendPubChan(const Jupiter::ReadableString &msg) const { void RenX::Server::sendPubChan(std::string_view msg) const {
const Jupiter::ReadableString &prefix = getPrefix(); std::string_view prefix = getPrefix();
if (!prefix.empty()) { if (!prefix.empty()) {
Jupiter::String m(msg.size() + prefix.size() + 1); Jupiter::String m(msg.size() + prefix.size() + 1);
m.set(prefix); m.set(prefix);
@ -1221,7 +1221,7 @@ void RenX::Server::sendAdmChan(const char *fmt, ...) const {
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);
Jupiter::StringL msg; Jupiter::StringL msg;
const Jupiter::ReadableString &serverPrefix = getPrefix(); std::string_view serverPrefix = getPrefix();
if (!serverPrefix.empty()) { if (!serverPrefix.empty()) {
msg += serverPrefix; msg += serverPrefix;
msg += ' '; msg += ' ';
@ -1236,8 +1236,8 @@ void RenX::Server::sendAdmChan(const char *fmt, ...) const {
} }
} }
void RenX::Server::sendAdmChan(const Jupiter::ReadableString &msg) const { void RenX::Server::sendAdmChan(std::string_view msg) const {
const Jupiter::ReadableString &prefix = getPrefix(); std::string_view prefix = getPrefix();
if (!prefix.empty()) { if (!prefix.empty()) {
Jupiter::String m(msg.size() + prefix.size() + 1); Jupiter::String m(msg.size() + prefix.size() + 1);
m.set(prefix); m.set(prefix);
@ -1260,7 +1260,7 @@ void RenX::Server::sendLogChan(const char *fmt, ...) const {
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);
Jupiter::StringL msg; Jupiter::StringL msg;
const Jupiter::ReadableString &serverPrefix = getPrefix(); std::string_view serverPrefix = getPrefix();
if (!serverPrefix.empty()) { if (!serverPrefix.empty()) {
msg += serverPrefix; msg += serverPrefix;
msg += ' '; msg += ' ';
@ -1277,9 +1277,9 @@ void RenX::Server::sendLogChan(const char *fmt, ...) const {
} }
} }
void RenX::Server::sendLogChan(const Jupiter::ReadableString &msg) const { void RenX::Server::sendLogChan(std::string_view msg) const {
IRC_Bot *server; IRC_Bot *server;
const Jupiter::ReadableString &prefix = getPrefix(); std::string_view prefix = getPrefix();
if (!prefix.empty()) { if (!prefix.empty()) {
Jupiter::String m(msg.size() + prefix.size() + 1); Jupiter::String m(msg.size() + prefix.size() + 1);
m.set(prefix); m.set(prefix);
@ -1327,7 +1327,7 @@ void process_escape_sequences(std::string& out_string) {
out_string = temp; out_string = temp;
} }
void RenX::Server::processLine(const Jupiter::ReadableString &line) { void RenX::Server::processLine(std::string_view line) {
std::string_view in_line = line; std::string_view in_line = line;
if (line.empty()) if (line.empty())
return; return;
@ -1445,7 +1445,7 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
m_firstAction = true; m_firstAction = true;
} }
}; };
auto parsePlayerData = [this](const Jupiter::ReadableString &data) { auto parsePlayerData = [this](std::string_view data) {
parsed_player_token result; parsed_player_token result;
auto player_tokens = jessilib::split_n_view(std::string_view{data}, ',', 2); auto player_tokens = jessilib::split_n_view(std::string_view{data}, ',', 2);
@ -1473,7 +1473,7 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
return result; return result;
}; };
auto get_next_temp_playerinfo = [](const Jupiter::ReadableString &name, RenX::TeamType team, bool isBot) { auto get_next_temp_playerinfo = [](std::string_view name, RenX::TeamType team, bool isBot) {
static RenX::PlayerInfo s_temp_players[4]; static RenX::PlayerInfo s_temp_players[4];
static size_t s_temp_player_index{ 0 }; static size_t s_temp_player_index{ 0 };
@ -1491,7 +1491,7 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
return temp_player; return temp_player;
}; };
auto getPlayerOrAdd = [&](const Jupiter::ReadableString &name, int id, RenX::TeamType team, bool isBot, uint64_t steamid, const Jupiter::ReadableString &ip, const Jupiter::ReadableString &hwid) auto getPlayerOrAdd = [&](std::string_view name, int id, RenX::TeamType team, bool isBot, uint64_t steamid, std::string_view ip, std::string_view hwid)
{ {
if (id == 0) { if (id == 0) {
if (name.empty()) { if (name.empty()) {
@ -1588,7 +1588,7 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
return player; return player;
}; };
auto parseGetPlayerOrAdd = [&parsePlayerData, &getPlayerOrAdd, this](const Jupiter::ReadableString &token) auto parseGetPlayerOrAdd = [&parsePlayerData, &getPlayerOrAdd, this](std::string_view token)
{ {
auto parsed_token = parsePlayerData(token); auto parsed_token = parsePlayerData(token);
if (parsed_token.id == 0 && parsed_token.name.empty()) { if (parsed_token.id == 0 && parsed_token.name.empty()) {
@ -1675,7 +1675,7 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
*/ */
auto table = tokens_as_command_table(); auto table = tokens_as_command_table();
auto table_get = [&table](const Jupiter::ReadableString& in_key) -> std::string_view* { auto table_get = [&table](std::string_view in_key) -> std::string_view* {
auto value = table.find(in_key); auto value = table.find(in_key);
if (value != table.end()) { if (value != table.end()) {
return &value->second; return &value->second;
@ -1684,7 +1684,7 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
return nullptr; return nullptr;
}; };
auto table_get_ref = [&table](const Jupiter::ReadableString& in_key, const Jupiter::ReadableString& in_default_value) -> const Jupiter::ReadableString& { auto table_get_ref = [&table](std::string_view in_key, std::string_view in_default_value) -> std::string_view {
auto value = table.find(in_key); auto value = table.find(in_key);
if (value != table.end()) { if (value != table.end()) {
return value->second; return value->second;
@ -1844,7 +1844,7 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
*/ */
auto table = tokens_as_command_table(); auto table = tokens_as_command_table();
auto table_get = [&table](const Jupiter::ReadableString& in_key) -> std::string_view* { auto table_get = [&table](std::string_view in_key) -> std::string_view* {
auto value = table.find(in_key); auto value = table.find(in_key);
if (value != table.end()) { if (value != table.end()) {
return &value->second; return &value->second;
@ -1853,7 +1853,7 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
return nullptr; return nullptr;
}; };
auto table_get_ref = [&table](const Jupiter::ReadableString& in_key, const Jupiter::ReadableString& in_default_value) -> const Jupiter::ReadableString& { auto table_get_ref = [&table](std::string_view in_key, std::string_view in_default_value) -> std::string_view {
auto value = table.find(in_key); auto value = table.find(in_key);
if (value != table.end()) { if (value != table.end()) {
return value->second; return value->second;
@ -1962,7 +1962,7 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
*/ */
auto table = tokens_as_command_table(); auto table = tokens_as_command_table();
auto table_get = [&table](const Jupiter::ReadableString& in_key) -> std::string_view* { auto table_get = [&table](std::string_view in_key) -> std::string_view* {
auto value = table.find(in_key); auto value = table.find(in_key);
if (value != table.end()) { if (value != table.end()) {
return &value->second; return &value->second;
@ -2026,7 +2026,7 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
{ {
// Map | Guid // Map | Guid
m_map.name = getToken(0); m_map.name = getToken(0);
const Jupiter::ReferenceString guid_token = getToken(1); std::string_view guid_token = getToken(1);
if (guid_token.size() == 32U) { if (guid_token.size() == 32U) {
m_map.guid[0] = Jupiter::asUnsignedLongLong(guid_token.substr(size_t{ 0 }, 16U), 16); m_map.guid[0] = Jupiter::asUnsignedLongLong(guid_token.substr(size_t{ 0 }, 16U), 16);
@ -2042,7 +2042,7 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
m_serverName = getToken(3); m_serverName = getToken(3);
m_map.name = getToken(5); m_map.name = getToken(5);
const Jupiter::ReferenceString guid_token = getToken(11); std::string_view guid_token = getToken(11);
if (guid_token.size() == 32U) if (guid_token.size() == 32U)
{ {
m_map.guid[0] = Jupiter::asUnsignedLongLong(guid_token.substr(size_t{ 0 }, 16U), 16); m_map.guid[0] = Jupiter::asUnsignedLongLong(guid_token.substr(size_t{ 0 }, 16U), 16);
@ -2071,7 +2071,7 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
{ {
m_competitive = Jupiter::from_string<bool>(getToken(23)); m_competitive = Jupiter::from_string<bool>(getToken(23));
const Jupiter::ReadableString &match_state_token = getToken(25); std::string_view match_state_token = getToken(25);
if (jessilib::equalsi(match_state_token, "PendingMatch"_jrs)) if (jessilib::equalsi(match_state_token, "PendingMatch"_jrs))
m_match_state = 0; m_match_state = 0;
else if (jessilib::equalsi(match_state_token, "MatchInProgress"_jrs)) else if (jessilib::equalsi(match_state_token, "MatchInProgress"_jrs))
@ -2105,11 +2105,11 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
} }
else if (jessilib::equalsi(m_lastCommand, "rotation"sv)) { else if (jessilib::equalsi(m_lastCommand, "rotation"sv)) {
// Map | Guid // Map | Guid
const Jupiter::ReadableString &in_map = getToken(0); std::string_view in_map = getToken(0);
if (hasMapInRotation(in_map) == false) { if (hasMapInRotation(in_map) == false) {
this->maps.emplace_back(in_map); this->maps.emplace_back(in_map);
const Jupiter::ReferenceString guid_token = getToken(1); std::string_view guid_token = getToken(1);
if (guid_token.size() == 32U) { if (guid_token.size() == 32U) {
this->maps.back().guid[0] = Jupiter::asUnsignedLongLong(guid_token.substr(size_t{ 0 }, 16U), 16); this->maps.back().guid[0] = Jupiter::asUnsignedLongLong(guid_token.substr(size_t{ 0 }, 16U), 16);
this->maps.back().guid[1] = Jupiter::asUnsignedLongLong(guid_token.substr(16U), 16); this->maps.back().guid[1] = Jupiter::asUnsignedLongLong(guid_token.substr(16U), 16);
@ -2544,7 +2544,7 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
if (!parsed_token.isPlayer || parsed_token.id == 0) { if (!parsed_token.isPlayer || parsed_token.id == 0) {
for (const auto& plugin : xPlugins) { for (const auto& plugin : xPlugins) {
plugin->RenX_OnDestroy(*this, parsed_token.name, parsed_token.team, Jupiter::ReferenceString{objectName}, RenX::getEnemy(parsed_token.team), damageType, type); plugin->RenX_OnDestroy(*this, parsed_token.name, parsed_token.team, objectName, RenX::getEnemy(parsed_token.team), damageType, type);
} }
} }
else { else {
@ -2580,7 +2580,7 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
break; break;
} }
for (const auto& plugin : xPlugins) { for (const auto& plugin : xPlugins) {
plugin->RenX_OnDestroy(*this, *player, Jupiter::ReferenceString{objectName}, RenX::getEnemy(player->team), damageType, type); plugin->RenX_OnDestroy(*this, *player, objectName, RenX::getEnemy(player->team), damageType, type);
} }
} }
} }
@ -2892,7 +2892,7 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
else if (subHeader == "Kick;"sv) else if (subHeader == "Kick;"sv)
{ {
// Player | "for" | Reason // Player | "for" | Reason
const Jupiter::ReadableString &reason = getToken(4); std::string_view reason = getToken(4);
RenX::PlayerInfo *player = parseGetPlayerOrAdd(getToken(2)); RenX::PlayerInfo *player = parseGetPlayerOrAdd(getToken(2));
for (const auto& plugin : xPlugins) { for (const auto& plugin : xPlugins) {
plugin->RenX_OnKick(*this, *player, reason); plugin->RenX_OnKick(*this, *player, reason);
@ -2998,7 +2998,7 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
auto split_command_line = jessilib::word_split_once_view(command_line, ' '); auto split_command_line = jessilib::word_split_once_view(command_line, ' ');
for (const auto& plugin : xPlugins) { for (const auto& plugin : xPlugins) {
plugin->RenX_OnExecute(*this, Jupiter::ReferenceString{user}, command_line); plugin->RenX_OnExecute(*this, user, command_line);
} }
if (m_rconUser == user) if (m_rconUser == user)
@ -3301,7 +3301,7 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
} }
else if (voteType == "Survey"sv) else if (voteType == "Survey"sv)
{ {
const Jupiter::ReadableString &text = getToken(7); std::string_view text = getToken(7);
for (const auto& plugin : xPlugins) { for (const auto& plugin : xPlugins) {
plugin->RenX_OnVoteSurvey(*this, team, *player, text); plugin->RenX_OnVoteSurvey(*this, team, *player, text);
} }
@ -3578,7 +3578,7 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line) {
m_devBot = true; m_devBot = true;
for (const auto& plugin : xPlugins) { for (const auto& plugin : xPlugins) {
plugin->RenX_OnAuthorized(*this, Jupiter::ReferenceString{m_rconUser}); plugin->RenX_OnAuthorized(*this, m_rconUser);
} }
} }
break; break;

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

@ -224,7 +224,7 @@ namespace RenX
* @param commmand Command to send. * @param commmand Command to send.
* @return The number of bytes sent on success, less than or equal to zero otherwise. * @return The number of bytes sent on success, less than or equal to zero otherwise.
*/ */
int send(const Jupiter::ReadableString &command); int send(std::string_view command);
/** /**
* @brief Sends text over the socket * @brief Sends text over the socket
@ -232,7 +232,7 @@ namespace RenX
* @param text Text to send * @param text Text to send
* @return The number of bytes sent on success, less than or equal to zero otherwise. * @return The number of bytes sent on success, less than or equal to zero otherwise.
*/ */
int sendSocket(const Jupiter::ReadableString &text); int sendSocket(std::string_view text);
/** /**
* @brief Sends an in-game message to the server. * @brief Sends an in-game message to the server.
@ -257,7 +257,7 @@ namespace RenX
* @param message Message to send in-game. * @param message Message to send in-game.
* @return The number of bytes sent on success, less than or equal to zero otherwise. * @return The number of bytes sent on success, less than or equal to zero otherwise.
*/ */
int sendAdminMessage(const Jupiter::ReadableString &message); int sendAdminMessage(std::string_view message);
/** /**
* @brief Sends an in-game admin message to a player in the server. * @brief Sends an in-game admin message to a player in the server.
@ -283,7 +283,7 @@ namespace RenX
* @param data String of data to send. * @param data String of data to send.
* @return The number of bytes sent on success, less than or equal to zero otherwise. * @return The number of bytes sent on success, less than or equal to zero otherwise.
*/ */
int sendData(const Jupiter::ReadableString &data); int sendData(std::string_view data);
/** /**
* @brief Fetches a player's data, based on their name. * @brief Fetches a player's data, based on their name.
@ -537,14 +537,14 @@ namespace RenX
* *
* @return True on success, false otherwise. * @return True on success, false otherwise.
*/ */
bool loadMutator(const Jupiter::ReadableString &mutator); bool loadMutator(std::string_view mutator);
/** /**
* @brief Forces the current game to end. * @brief Forces the current game to end.
* *
* @return True on success, false otherwise. * @return True on success, false otherwise.
*/ */
bool unloadMutator(const Jupiter::ReadableString &mutator); bool unloadMutator(std::string_view mutator);
/** /**
* @brief Forcefully ends the current vote. * @brief Forcefully ends the current vote.
@ -718,7 +718,7 @@ namespace RenX
* *
* @return The server's logging prefix. * @return The server's logging prefix.
*/ */
const Jupiter::ReadableString &getPrefix() const; std::string_view getPrefix() const;
/** /**
* @brief Sets a server's IRC logging prefix. * @brief Sets a server's IRC logging prefix.
@ -748,7 +748,7 @@ namespace RenX
* *
* @return String containing the rules of the server. * @return String containing the rules of the server.
*/ */
const Jupiter::ReadableString &getRules() const; std::string_view getRules() const;
/** /**
* @brief Fetches the hostname of a server. * @brief Fetches the hostname of a server.
@ -820,7 +820,7 @@ namespace RenX
* *
* @return String containing the password of the server. * @return String containing the password of the server.
*/ */
const Jupiter::ReadableString &getPassword() const; std::string_view getPassword() const;
/** /**
* @brief Fetches this connection's RCON user name. * @brief Fetches this connection's RCON user name.
@ -841,7 +841,7 @@ namespace RenX
* *
* @return String containing the server name. * @return String containing the server name.
*/ */
const Jupiter::ReadableString &getName() const; std::string_view getName() const;
/** /**
* @brief Fetches the current map. * @brief Fetches the current map.
@ -959,7 +959,7 @@ namespace RenX
* @param fmt String containing the format specifiers indicating what message to send. * @param fmt String containing the format specifiers indicating what message to send.
*/ */
void sendPubChan(const char *fmt, ...) const; void sendPubChan(const char *fmt, ...) const;
void sendPubChan(const Jupiter::ReadableString &msg) const; void sendPubChan(std::string_view msg) const;
/** /**
* @brief Formats and sends a message to a server's corresponding adminstrative channels. * @brief Formats and sends a message to a server's corresponding adminstrative channels.
@ -967,7 +967,7 @@ namespace RenX
* @param fmt String containing the format specifiers indicating what message to send. * @param fmt String containing the format specifiers indicating what message to send.
*/ */
void sendAdmChan(const char *fmt, ...) const; void sendAdmChan(const char *fmt, ...) const;
void sendAdmChan(const Jupiter::ReadableString &msg) const; void sendAdmChan(std::string_view msg) const;
/** /**
* @brief Formats and sends a message to a server's corresponding channels. * @brief Formats and sends a message to a server's corresponding channels.
@ -975,14 +975,14 @@ namespace RenX
* @param fmt String containing the format specifiers indicating what message to send. * @param fmt String containing the format specifiers indicating what message to send.
*/ */
void sendLogChan(const char *fmt, ...) const; void sendLogChan(const char *fmt, ...) const;
void sendLogChan(const Jupiter::ReadableString &msg) const; void sendLogChan(std::string_view msg) const;
/** /**
* @brief Processes a line of RCON input data. Input data SHOULD NOT include a new-line ('\n') terminator. * @brief Processes a line of RCON input data. Input data SHOULD NOT include a new-line ('\n') terminator.
* *
* @param line Line to process * @param line Line to process
*/ */
void processLine(const Jupiter::ReadableString &line); void processLine(std::string_view line);
/** /**
* @brief Disconnects from a server's RCON interface. * @brief Disconnects from a server's RCON interface.

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

@ -34,7 +34,7 @@ struct TagsImp : RenX::Tags
void processTags(std::string& msg, const RenX::Server *server, const RenX::PlayerInfo *player, const RenX::PlayerInfo *victim, const RenX::BuildingInfo *building); void processTags(std::string& msg, const RenX::Server *server, const RenX::PlayerInfo *player, const RenX::PlayerInfo *victim, const RenX::BuildingInfo *building);
void processTags(std::string& msg, const RenX::LadderDatabase::Entry &entry); void processTags(std::string& msg, const RenX::LadderDatabase::Entry &entry);
void sanitizeTags(std::string& fmt); void sanitizeTags(std::string& fmt);
const Jupiter::ReadableString &getUniqueInternalTag(); std::string_view getUniqueInternalTag();
private: private:
Jupiter::StringS uniqueTag; Jupiter::StringS uniqueTag;
uint32_t tagItr; uint32_t tagItr;
@ -53,7 +53,7 @@ bool TagsImp::initialize()
this->uniqueTag = "\0\0\0\0\0\0"_jrs; this->uniqueTag = "\0\0\0\0\0\0"_jrs;
Jupiter::Config &config = RenX::getCore()->getConfig(); Jupiter::Config &config = RenX::getCore()->getConfig();
const Jupiter::ReadableString &configSection = config.get("TagDefinitions"_jrs, "Tags"_jrs); std::string_view configSection = config.get("TagDefinitions"_jrs, "Tags"_jrs);
TagsImp::bar_width = config[configSection].get<int>("BarWidth"_jrs, 19); TagsImp::bar_width = config[configSection].get<int>("BarWidth"_jrs, 19);
@ -872,7 +872,7 @@ void TagsImp::sanitizeTags(std::string& fmt)
} }
} }
const Jupiter::ReadableString &TagsImp::getUniqueInternalTag() std::string_view TagsImp::getUniqueInternalTag()
{ {
this->uniqueTag.set(1, reinterpret_cast<const char *>(&this->tagItr), sizeof(TagsImp::tagItr)); this->uniqueTag.set(1, reinterpret_cast<const char *>(&this->tagItr), sizeof(TagsImp::tagItr));
++TagsImp::tagItr; ++TagsImp::tagItr;
@ -895,7 +895,7 @@ void RenX::replace_tag(std::string& fmt, std::string_view tag, std::string_view
/** Forward functions */ /** Forward functions */
const Jupiter::ReadableString &RenX::getUniqueInternalTag() std::string_view RenX::getUniqueInternalTag()
{ {
return _tags.getUniqueInternalTag(); return _tags.getUniqueInternalTag();
} }

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

@ -45,7 +45,7 @@ namespace RenX
RENX_API void processTags(std::string& msg, const RenX::LadderDatabase::Entry &entry); RENX_API void processTags(std::string& msg, const RenX::LadderDatabase::Entry &entry);
RENX_API void sanitizeTags(std::string& fmt); RENX_API void sanitizeTags(std::string& fmt);
RENX_API void replace_tag(std::string& fmt, std::string_view tag, std::string_view internal_tag); RENX_API void replace_tag(std::string& fmt, std::string_view tag, std::string_view internal_tag);
RENX_API const Jupiter::ReadableString &getUniqueInternalTag(); RENX_API std::string_view getUniqueInternalTag();
struct RENX_API Tags struct RENX_API Tags
{ {

4
src/Plugins/RenX/RenX.ExcessiveHeadshots/RenX_ExcessiveHeadshots.cpp

@ -40,7 +40,7 @@ int RenX_ExcessiveHeadshotsPlugin::OnRehash() {
return this->initialize() ? 0 : -1; return this->initialize() ? 0 : -1;
} }
void RenX_ExcessiveHeadshotsPlugin::RenX_OnKill(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::PlayerInfo &victim, const Jupiter::ReadableString &damageType) { void RenX_ExcessiveHeadshotsPlugin::RenX_OnKill(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::PlayerInfo &victim, std::string_view damageType) {
if (player.kills < 3) if (player.kills < 3)
return; return;
@ -59,7 +59,7 @@ void RenX_ExcessiveHeadshotsPlugin::RenX_OnKill(RenX::Server &server, const RenX
{ {
server.banPlayer(player, "Jupiter Bot"_jrs, "Aimbot detected"_jrs); server.banPlayer(player, "Jupiter Bot"_jrs, "Aimbot detected"_jrs);
server.sendPubChan(IRCCOLOR "13[Aimbot]" IRCCOLOR " %.*s was banned from the server! Kills: %u - Deaths: %u - Headshots: %u", player.name.size(), player.name.data(), player.kills, player.deaths, player.headshots); server.sendPubChan(IRCCOLOR "13[Aimbot]" IRCCOLOR " %.*s was banned from the server! Kills: %u - Deaths: %u - Headshots: %u", player.name.size(), player.name.data(), player.kills, player.deaths, player.headshots);
const Jupiter::ReadableString &steamid = server.formatSteamID(player); std::string_view steamid = server.formatSteamID(player);
server.sendAdmChan(IRCCOLOR "13[Aimbot]" IRCCOLOR " %.*s was banned from the server! Kills: %u - Deaths: %u - Headshots: %u - IP: " IRCBOLD "%.*s" IRCBOLD " - Steam ID: " IRCBOLD "%.*s" IRCBOLD, player.name.size(), player.name.data(), player.kills, player.deaths, player.headshots, player.ip.size(), player.ip.data(), steamid.size(), server.sendAdmChan(IRCCOLOR "13[Aimbot]" IRCCOLOR " %.*s was banned from the server! Kills: %u - Deaths: %u - Headshots: %u - IP: " IRCBOLD "%.*s" IRCBOLD " - Steam ID: " IRCBOLD "%.*s" IRCBOLD, player.name.size(), player.name.data(), player.kills, player.deaths, player.headshots, player.ip.size(), player.ip.data(), steamid.size(),
steamid.data()); steamid.data());
} }

2
src/Plugins/RenX/RenX.ExcessiveHeadshots/RenX_ExcessiveHeadshots.h

@ -26,7 +26,7 @@
class RenX_ExcessiveHeadshotsPlugin : public RenX::Plugin class RenX_ExcessiveHeadshotsPlugin : public RenX::Plugin
{ {
public: // RenX::Plugin public: // RenX::Plugin
void RenX_OnKill(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::PlayerInfo &victim, const Jupiter::ReadableString &damageType) override; void RenX_OnKill(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::PlayerInfo &victim, std::string_view damageType) override;
public: // Jupiter::Plugin public: // Jupiter::Plugin
virtual bool initialize() override; virtual bool initialize() override;

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

@ -91,7 +91,7 @@ int RenX_ExtraLoggingPlugin::think() {
return 0; return 0;
} }
void RenX_ExtraLoggingPlugin::RenX_OnRaw(RenX::Server &server, const Jupiter::ReadableString &raw) { void RenX_ExtraLoggingPlugin::RenX_OnRaw(RenX::Server &server, std::string_view raw) {
if (RenX_ExtraLoggingPlugin::printToConsole) { if (RenX_ExtraLoggingPlugin::printToConsole) {
if (!RenX_ExtraLoggingPlugin::consolePrefix.empty()) { if (!RenX_ExtraLoggingPlugin::consolePrefix.empty()) {
std::string cPrefix = RenX_ExtraLoggingPlugin::consolePrefix; std::string cPrefix = RenX_ExtraLoggingPlugin::consolePrefix;

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

@ -26,7 +26,7 @@
class RenX_ExtraLoggingPlugin : public RenX::Plugin class RenX_ExtraLoggingPlugin : public RenX::Plugin
{ {
public: // RenX::Plugin public: // RenX::Plugin
virtual void RenX_OnRaw(RenX::Server &server, const Jupiter::ReadableString &raw) override; virtual void RenX_OnRaw(RenX::Server &server, std::string_view raw) override;
public: // Jupiter::Plugin public: // Jupiter::Plugin
virtual bool initialize() override; virtual bool initialize() override;

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

@ -40,21 +40,21 @@ bool RenX_Ladder_WebPlugin::initialize() {
Jupiter::HTTP::Server &server = getHTTPServer(); Jupiter::HTTP::Server &server = getHTTPServer();
std::unique_ptr<Jupiter::HTTP::Server::Content> content = std::make_unique<Jupiter::HTTP::Server::Content>(RenX_Ladder_WebPlugin::ladder_page_name, handle_ladder_page); std::unique_ptr<Jupiter::HTTP::Server::Content> content = std::make_unique<Jupiter::HTTP::Server::Content>(RenX_Ladder_WebPlugin::ladder_page_name, handle_ladder_page);
content->language = &Jupiter::HTTP::Content::Language::ENGLISH; content->language = Jupiter::HTTP::Content::Language::ENGLISH;
content->type = &Jupiter::HTTP::Content::Type::Text::HTML; content->type = Jupiter::HTTP::Content::Type::Text::HTML;
content->charset = &Jupiter::HTTP::Content::Type::Text::Charset::UTF8; content->charset = Jupiter::HTTP::Content::Type::Text::Charset::UTF8;
server.hook(RenX_Ladder_WebPlugin::web_hostname, RenX_Ladder_WebPlugin::web_path, std::move(content)); server.hook(RenX_Ladder_WebPlugin::web_hostname, RenX_Ladder_WebPlugin::web_path, std::move(content));
content = std::make_unique<Jupiter::HTTP::Server::Content>(RenX_Ladder_WebPlugin::search_page_name, handle_search_page); content = std::make_unique<Jupiter::HTTP::Server::Content>(RenX_Ladder_WebPlugin::search_page_name, handle_search_page);
content->language = &Jupiter::HTTP::Content::Language::ENGLISH; content->language = Jupiter::HTTP::Content::Language::ENGLISH;
content->type = &Jupiter::HTTP::Content::Type::Text::HTML; content->type = Jupiter::HTTP::Content::Type::Text::HTML;
content->charset = &Jupiter::HTTP::Content::Type::Text::Charset::UTF8; content->charset = Jupiter::HTTP::Content::Type::Text::Charset::UTF8;
server.hook(RenX_Ladder_WebPlugin::web_hostname, RenX_Ladder_WebPlugin::web_path, std::move(content)); server.hook(RenX_Ladder_WebPlugin::web_hostname, RenX_Ladder_WebPlugin::web_path, std::move(content));
content = std::make_unique<Jupiter::HTTP::Server::Content>(RenX_Ladder_WebPlugin::profile_page_name, handle_profile_page); content = std::make_unique<Jupiter::HTTP::Server::Content>(RenX_Ladder_WebPlugin::profile_page_name, handle_profile_page);
content->language = &Jupiter::HTTP::Content::Language::ENGLISH; content->language = Jupiter::HTTP::Content::Language::ENGLISH;
content->type = &Jupiter::HTTP::Content::Type::Text::HTML; content->type = Jupiter::HTTP::Content::Type::Text::HTML;
content->charset = &Jupiter::HTTP::Content::Type::Text::Charset::UTF8; content->charset = Jupiter::HTTP::Content::Type::Text::Charset::UTF8;
server.hook(RenX_Ladder_WebPlugin::web_hostname, RenX_Ladder_WebPlugin::web_path, std::move(content)); server.hook(RenX_Ladder_WebPlugin::web_hostname, RenX_Ladder_WebPlugin::web_path, std::move(content));
return true; return true;

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

@ -63,7 +63,7 @@ void RenX_LadderPlugin::RenX_OnGameOver(RenX::Server &server, RenX::WinType winT
} }
} }
void RenX_LadderPlugin::RenX_OnCommand(RenX::Server &server, const Jupiter::ReadableString &) { void RenX_LadderPlugin::RenX_OnCommand(RenX::Server &server, std::string_view ) {
if (jessilib::equalsi(server.getCurrentRCONCommand(), "clientvarlist"sv)) { if (jessilib::equalsi(server.getCurrentRCONCommand(), "clientvarlist"sv)) {
if (server.varData[this->name].get("w"_jrs, "0"_jrs) == "1"sv) { if (server.varData[this->name].get("w"_jrs, "0"_jrs) == "1"sv) {
server.varData[this->name].set("w"sv, "0"s); server.varData[this->name].set("w"sv, "0"s);
@ -98,7 +98,7 @@ LadderGenericCommand::LadderGenericCommand() {
this->addTrigger("rank"_jrs); this->addTrigger("rank"_jrs);
} }
Jupiter::GenericCommand::ResponseLine *LadderGenericCommand::trigger(const Jupiter::ReadableString &parameters) { Jupiter::GenericCommand::ResponseLine *LadderGenericCommand::trigger(std::string_view parameters) {
if (parameters.empty()) { if (parameters.empty()) {
return new Jupiter::GenericCommand::ResponseLine("Error: Too few parameters. Syntax: ladder <name | rank>"_jrs, GenericCommand::DisplayType::PrivateError); return new Jupiter::GenericCommand::ResponseLine("Error: Too few parameters. Syntax: ladder <name | rank>"_jrs, GenericCommand::DisplayType::PrivateError);
} }
@ -140,7 +140,7 @@ Jupiter::GenericCommand::ResponseLine *LadderGenericCommand::trigger(const Jupit
return response_head; return response_head;
} }
const Jupiter::ReadableString &LadderGenericCommand::getHelp(const Jupiter::ReadableString &) { std::string_view LadderGenericCommand::getHelp(std::string_view ) {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Fetches ladder information about a player. Syntax: ladder <name | rank>"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Fetches ladder information about a player. Syntax: ladder <name | rank>");
return defaultHelp; return defaultHelp;
} }
@ -155,7 +155,7 @@ void LadderGameCommand::create() {
this->addTrigger("rank"_jrs); this->addTrigger("rank"_jrs);
} }
void LadderGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, const Jupiter::ReadableString &parameters) { void LadderGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, std::string_view parameters) {
if (parameters.empty()) { if (parameters.empty()) {
if (player->steamid != 0) { if (player->steamid != 0) {
if (RenX::default_ladder_database != nullptr) { if (RenX::default_ladder_database != nullptr) {
@ -184,7 +184,7 @@ void LadderGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player,
} }
} }
const Jupiter::ReadableString &LadderGameCommand::getHelp(const Jupiter::ReadableString &) { std::string_view LadderGameCommand::getHelp(std::string_view ) {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Displays ladder information about yourself, or another player. Syntax: ladder [name / rank]"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Displays ladder information about yourself, or another player. Syntax: ladder [name / rank]");
return defaultHelp; return defaultHelp;
} }

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

@ -38,7 +38,7 @@ public:
virtual bool initialize() override; virtual bool initialize() override;
void RenX_OnServerFullyConnected(RenX::Server &server) override; void RenX_OnServerFullyConnected(RenX::Server &server) override;
void RenX_OnGameOver(RenX::Server &server, RenX::WinType winType, const RenX::TeamType &team, int gScore, int nScore) override; void RenX_OnGameOver(RenX::Server &server, RenX::WinType winType, const RenX::TeamType &team, int gScore, int nScore) override;
void RenX_OnCommand(RenX::Server &server, const Jupiter::ReadableString &) override; void RenX_OnCommand(RenX::Server &server, std::string_view ) override;
size_t getMaxLadderCommandPartNameOutput() const; size_t getMaxLadderCommandPartNameOutput() const;

4
src/Plugins/RenX/RenX.Listen/RenX_Listen.cpp

@ -29,7 +29,7 @@ RenX_ListenPlugin::~RenX_ListenPlugin() {
bool RenX_ListenPlugin::initialize() { bool RenX_ListenPlugin::initialize() {
uint16_t port = this->config.get<uint16_t>("Port"_jrs, 21337); uint16_t port = this->config.get<uint16_t>("Port"_jrs, 21337);
const Jupiter::ReadableString &address = this->config.get("Address"_jrs, "0.0.0.0"_jrs); std::string_view address = this->config.get("Address"_jrs, "0.0.0.0"_jrs);
RenX_ListenPlugin::serverSection = this->config.get("ServerSection"_jrs, this->getName()); RenX_ListenPlugin::serverSection = this->config.get("ServerSection"_jrs, this->getName());
return RenX_ListenPlugin::socket.bind(static_cast<std::string>(address).c_str(), port, true) && RenX_ListenPlugin::socket.setBlocking(false); return RenX_ListenPlugin::socket.bind(static_cast<std::string>(address).c_str(), port, true) && RenX_ListenPlugin::socket.setBlocking(false);
@ -52,7 +52,7 @@ int RenX_ListenPlugin::OnRehash() {
RenX::Plugin::OnRehash(); RenX::Plugin::OnRehash();
uint16_t port = this->config.get<uint16_t>("Port"_jrs, 21337); uint16_t port = this->config.get<uint16_t>("Port"_jrs, 21337);
const Jupiter::ReadableString &address = this->config.get("Address"_jrs, "0.0.0.0"_jrs); std::string_view address = this->config.get("Address"_jrs, "0.0.0.0"_jrs);
RenX_ListenPlugin::serverSection = this->config.get("ServerSection"_jrs, this->getName()); RenX_ListenPlugin::serverSection = this->config.get("ServerSection"_jrs, this->getName());
if (port != RenX_ListenPlugin::socket.getBoundPort() || address != RenX_ListenPlugin::socket.getBoundHostname()) { if (port != RenX_ListenPlugin::socket.getBoundPort() || address != RenX_ListenPlugin::socket.getBoundHostname()) {

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

@ -780,7 +780,7 @@ bool RenX_LoggingPlugin::initialize()
return true; return true;
} }
typedef void(RenX::Server::*logFuncType)(const Jupiter::ReadableString &msg) const; typedef void(RenX::Server::*logFuncType)(std::string_view msg) const;
void RenX_LoggingPlugin::RenX_OnPlayerRDNS(RenX::Server &server, const RenX::PlayerInfo &player) void RenX_LoggingPlugin::RenX_OnPlayerRDNS(RenX::Server &server, const RenX::PlayerInfo &player)
{ {
@ -854,7 +854,7 @@ void RenX_LoggingPlugin::RenX_OnPart(RenX::Server &server, const RenX::PlayerInf
} }
} }
void RenX_LoggingPlugin::RenX_OnKick(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &reason) void RenX_LoggingPlugin::RenX_OnKick(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view reason)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::kickPublic) if (RenX_LoggingPlugin::kickPublic)
@ -871,7 +871,7 @@ void RenX_LoggingPlugin::RenX_OnKick(RenX::Server &server, const RenX::PlayerInf
} }
} }
void RenX_LoggingPlugin::RenX_OnNameChange(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &newPlayerName) void RenX_LoggingPlugin::RenX_OnNameChange(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view newPlayerName)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::nameChangePublic) if (RenX_LoggingPlugin::nameChangePublic)
@ -920,7 +920,7 @@ void RenX_LoggingPlugin::RenX_OnSpeedHack(RenX::Server &server, const RenX::Play
} }
} }
void RenX_LoggingPlugin::RenX_OnExecute(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &command) void RenX_LoggingPlugin::RenX_OnExecute(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view command)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::executePublic) if (RenX_LoggingPlugin::executePublic)
@ -937,7 +937,7 @@ void RenX_LoggingPlugin::RenX_OnExecute(RenX::Server &server, const RenX::Player
} }
} }
void RenX_LoggingPlugin::RenX_OnPlayerCommand(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &message, RenX::GameCommand *command) void RenX_LoggingPlugin::RenX_OnPlayerCommand(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view message, RenX::GameCommand *command)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::playerCommandPublic) if (RenX_LoggingPlugin::playerCommandPublic)
@ -957,7 +957,7 @@ void RenX_LoggingPlugin::RenX_OnPlayerCommand(RenX::Server &server, const RenX::
} }
} }
void RenX_LoggingPlugin::RenX_OnPlayer(RenX::Server &server, const Jupiter::ReadableString &raw) void RenX_LoggingPlugin::RenX_OnPlayer(RenX::Server &server, std::string_view raw)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::playerPublic) if (RenX_LoggingPlugin::playerPublic)
@ -974,7 +974,7 @@ void RenX_LoggingPlugin::RenX_OnPlayer(RenX::Server &server, const Jupiter::Read
} }
} }
void RenX_LoggingPlugin::RenX_OnChat(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &message) void RenX_LoggingPlugin::RenX_OnChat(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view message)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::chatPublic) if (RenX_LoggingPlugin::chatPublic)
@ -991,7 +991,7 @@ void RenX_LoggingPlugin::RenX_OnChat(RenX::Server &server, const RenX::PlayerInf
} }
} }
void RenX_LoggingPlugin::RenX_OnTeamChat(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &message) void RenX_LoggingPlugin::RenX_OnTeamChat(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view message)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::teamChatPublic) if (RenX_LoggingPlugin::teamChatPublic)
@ -1008,7 +1008,7 @@ void RenX_LoggingPlugin::RenX_OnTeamChat(RenX::Server &server, const RenX::Playe
} }
} }
void RenX_LoggingPlugin::RenX_OnRadioChat(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &message) void RenX_LoggingPlugin::RenX_OnRadioChat(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view message)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::radioChatPublic) if (RenX_LoggingPlugin::radioChatPublic)
@ -1025,7 +1025,7 @@ void RenX_LoggingPlugin::RenX_OnRadioChat(RenX::Server &server, const RenX::Play
} }
} }
void RenX_LoggingPlugin::RenX_OnHostChat(RenX::Server &server, const Jupiter::ReadableString &message) void RenX_LoggingPlugin::RenX_OnHostChat(RenX::Server &server, std::string_view message)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::hostChatPublic) if (RenX_LoggingPlugin::hostChatPublic)
@ -1042,7 +1042,7 @@ void RenX_LoggingPlugin::RenX_OnHostChat(RenX::Server &server, const Jupiter::Re
} }
} }
void RenX_LoggingPlugin::RenX_OnHostPage(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &message) void RenX_LoggingPlugin::RenX_OnHostPage(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view message)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::hostPagePublic) if (RenX_LoggingPlugin::hostPagePublic)
@ -1059,7 +1059,7 @@ void RenX_LoggingPlugin::RenX_OnHostPage(RenX::Server &server, const RenX::Playe
} }
} }
void RenX_LoggingPlugin::RenX_OnAdminMessage(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &message) void RenX_LoggingPlugin::RenX_OnAdminMessage(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view message)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::adminMessagePublic) if (RenX_LoggingPlugin::adminMessagePublic)
@ -1076,7 +1076,7 @@ void RenX_LoggingPlugin::RenX_OnAdminMessage(RenX::Server &server, const RenX::P
} }
} }
void RenX_LoggingPlugin::RenX_OnWarnMessage(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &message) void RenX_LoggingPlugin::RenX_OnWarnMessage(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view message)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::adminMessagePublic) if (RenX_LoggingPlugin::adminMessagePublic)
@ -1093,7 +1093,7 @@ void RenX_LoggingPlugin::RenX_OnWarnMessage(RenX::Server &server, const RenX::Pl
} }
} }
void RenX_LoggingPlugin::RenX_OnAdminPMessage(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::PlayerInfo &target, const Jupiter::ReadableString &message) void RenX_LoggingPlugin::RenX_OnAdminPMessage(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::PlayerInfo &target, std::string_view message)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::adminPMessagePublic) if (RenX_LoggingPlugin::adminPMessagePublic)
@ -1110,7 +1110,7 @@ void RenX_LoggingPlugin::RenX_OnAdminPMessage(RenX::Server &server, const RenX::
} }
} }
void RenX_LoggingPlugin::RenX_OnWarnPMessage(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::PlayerInfo &target, const Jupiter::ReadableString &message) void RenX_LoggingPlugin::RenX_OnWarnPMessage(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::PlayerInfo &target, std::string_view message)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::adminPMessagePublic) if (RenX_LoggingPlugin::adminPMessagePublic)
@ -1127,7 +1127,7 @@ void RenX_LoggingPlugin::RenX_OnWarnPMessage(RenX::Server &server, const RenX::P
} }
} }
void RenX_LoggingPlugin::RenX_OnHostAdminMessage(RenX::Server &server, const Jupiter::ReadableString &message) void RenX_LoggingPlugin::RenX_OnHostAdminMessage(RenX::Server &server, std::string_view message)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::adminMessagePublic) if (RenX_LoggingPlugin::adminMessagePublic)
@ -1146,7 +1146,7 @@ void RenX_LoggingPlugin::RenX_OnHostAdminMessage(RenX::Server &server, const Jup
} }
} }
void RenX_LoggingPlugin::RenX_OnHostAdminPMessage(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &message) void RenX_LoggingPlugin::RenX_OnHostAdminPMessage(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view message)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::adminPMessagePublic) if (RenX_LoggingPlugin::adminPMessagePublic)
@ -1165,7 +1165,7 @@ void RenX_LoggingPlugin::RenX_OnHostAdminPMessage(RenX::Server &server, const Re
} }
} }
void RenX_LoggingPlugin::RenX_OnHostWarnMessage(RenX::Server &server, const Jupiter::ReadableString &message) void RenX_LoggingPlugin::RenX_OnHostWarnMessage(RenX::Server &server, std::string_view message)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::adminMessagePublic) if (RenX_LoggingPlugin::adminMessagePublic)
@ -1184,7 +1184,7 @@ void RenX_LoggingPlugin::RenX_OnHostWarnMessage(RenX::Server &server, const Jupi
} }
} }
void RenX_LoggingPlugin::RenX_OnHostWarnPMessage(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &message) void RenX_LoggingPlugin::RenX_OnHostWarnPMessage(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view message)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::adminPMessagePublic) if (RenX_LoggingPlugin::adminPMessagePublic)
@ -1203,7 +1203,7 @@ void RenX_LoggingPlugin::RenX_OnHostWarnPMessage(RenX::Server &server, const Ren
} }
} }
void RenX_LoggingPlugin::RenX_OnOtherChat(RenX::Server &server, const Jupiter::ReadableString &raw) void RenX_LoggingPlugin::RenX_OnOtherChat(RenX::Server &server, std::string_view raw)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::otherChatPublic) if (RenX_LoggingPlugin::otherChatPublic)
@ -1220,7 +1220,7 @@ void RenX_LoggingPlugin::RenX_OnOtherChat(RenX::Server &server, const Jupiter::R
} }
} }
void RenX_LoggingPlugin::RenX_OnDeploy(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &object) { void RenX_LoggingPlugin::RenX_OnDeploy(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view object) {
logFuncType func; logFuncType func;
std::string msg; std::string msg;
if (std::string_view{object}.ends_with("Beacon")) { if (std::string_view{object}.ends_with("Beacon")) {
@ -1246,7 +1246,7 @@ void RenX_LoggingPlugin::RenX_OnDeploy(RenX::Server &server, const RenX::PlayerI
} }
} }
void RenX_LoggingPlugin::RenX_OnOverMine(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &location) void RenX_LoggingPlugin::RenX_OnOverMine(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view location)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::overMinePublic) if (RenX_LoggingPlugin::overMinePublic)
@ -1263,7 +1263,7 @@ void RenX_LoggingPlugin::RenX_OnOverMine(RenX::Server &server, const RenX::Playe
} }
} }
void RenX_LoggingPlugin::RenX_OnDisarm(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &object, const RenX::PlayerInfo &victim) { void RenX_LoggingPlugin::RenX_OnDisarm(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view object, const RenX::PlayerInfo &victim) {
logFuncType func; logFuncType func;
std::string msg; std::string msg;
@ -1290,7 +1290,7 @@ void RenX_LoggingPlugin::RenX_OnDisarm(RenX::Server &server, const RenX::PlayerI
} }
} }
void RenX_LoggingPlugin::RenX_OnDisarm(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &object) { void RenX_LoggingPlugin::RenX_OnDisarm(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view object) {
logFuncType func; logFuncType func;
std::string msg; std::string msg;
@ -1317,7 +1317,7 @@ void RenX_LoggingPlugin::RenX_OnDisarm(RenX::Server &server, const RenX::PlayerI
} }
} }
void RenX_LoggingPlugin::RenX_OnExplode(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &object) void RenX_LoggingPlugin::RenX_OnExplode(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view object)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::explodePublic) if (RenX_LoggingPlugin::explodePublic)
@ -1335,7 +1335,7 @@ void RenX_LoggingPlugin::RenX_OnExplode(RenX::Server &server, const RenX::Player
} }
} }
void RenX_LoggingPlugin::RenX_OnExplode(RenX::Server &server, const Jupiter::ReadableString &object) void RenX_LoggingPlugin::RenX_OnExplode(RenX::Server &server, std::string_view object)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::explodePublic) if (RenX_LoggingPlugin::explodePublic)
@ -1353,7 +1353,7 @@ void RenX_LoggingPlugin::RenX_OnExplode(RenX::Server &server, const Jupiter::Rea
} }
} }
void RenX_LoggingPlugin::RenX_OnSuicide(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &damageType) void RenX_LoggingPlugin::RenX_OnSuicide(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view damageType)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::suicidePublic) if (RenX_LoggingPlugin::suicidePublic)
@ -1370,7 +1370,7 @@ void RenX_LoggingPlugin::RenX_OnSuicide(RenX::Server &server, const RenX::Player
} }
} }
void RenX_LoggingPlugin::RenX_OnKill(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::PlayerInfo &victim, const Jupiter::ReadableString &damageType) void RenX_LoggingPlugin::RenX_OnKill(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::PlayerInfo &victim, std::string_view damageType)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::killPublic) if (RenX_LoggingPlugin::killPublic)
@ -1387,7 +1387,7 @@ void RenX_LoggingPlugin::RenX_OnKill(RenX::Server &server, const RenX::PlayerInf
} }
} }
void RenX_LoggingPlugin::RenX_OnKill(RenX::Server &server, const Jupiter::ReadableString &killer, const RenX::TeamType &killerTeam, const RenX::PlayerInfo &victim, const Jupiter::ReadableString &damageType) void RenX_LoggingPlugin::RenX_OnKill(RenX::Server &server, std::string_view killer, const RenX::TeamType &killerTeam, const RenX::PlayerInfo &victim, std::string_view damageType)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::killPublic) if (RenX_LoggingPlugin::killPublic)
@ -1408,7 +1408,7 @@ void RenX_LoggingPlugin::RenX_OnKill(RenX::Server &server, const Jupiter::Readab
} }
} }
void RenX_LoggingPlugin::RenX_OnDie(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &damageType) void RenX_LoggingPlugin::RenX_OnDie(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view damageType)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::diePublic) if (RenX_LoggingPlugin::diePublic)
@ -1425,7 +1425,7 @@ void RenX_LoggingPlugin::RenX_OnDie(RenX::Server &server, const RenX::PlayerInfo
} }
} }
void RenX_LoggingPlugin::RenX_OnDie(RenX::Server &server, const Jupiter::ReadableString &object, const RenX::TeamType &objectTeam, const Jupiter::ReadableString &damageType) void RenX_LoggingPlugin::RenX_OnDie(RenX::Server &server, std::string_view object, const RenX::TeamType &objectTeam, std::string_view damageType)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::diePublic) if (RenX_LoggingPlugin::diePublic)
@ -1446,7 +1446,7 @@ void RenX_LoggingPlugin::RenX_OnDie(RenX::Server &server, const Jupiter::Readabl
} }
} }
void RenX_LoggingPlugin::RenX_OnDestroy(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &objectName, const RenX::TeamType &objectTeam, const Jupiter::ReadableString &damageType, RenX::ObjectType type) void RenX_LoggingPlugin::RenX_OnDestroy(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view objectName, const RenX::TeamType &objectTeam, std::string_view damageType, RenX::ObjectType type)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::destroyPublic) if (RenX_LoggingPlugin::destroyPublic)
@ -1479,7 +1479,7 @@ void RenX_LoggingPlugin::RenX_OnDestroy(RenX::Server &server, const RenX::Player
} }
} }
void RenX_LoggingPlugin::RenX_OnCapture(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &building, const RenX::TeamType &oldTeam) void RenX_LoggingPlugin::RenX_OnCapture(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view building, const RenX::TeamType &oldTeam)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::capturePublic) if (RenX_LoggingPlugin::capturePublic)
@ -1499,7 +1499,7 @@ void RenX_LoggingPlugin::RenX_OnCapture(RenX::Server &server, const RenX::Player
} }
} }
void RenX_LoggingPlugin::RenX_OnNeutralize(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &building, const RenX::TeamType &oldTeam) void RenX_LoggingPlugin::RenX_OnNeutralize(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view building, const RenX::TeamType &oldTeam)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::neutralizePublic) if (RenX_LoggingPlugin::neutralizePublic)
@ -1519,7 +1519,7 @@ void RenX_LoggingPlugin::RenX_OnNeutralize(RenX::Server &server, const RenX::Pla
} }
} }
void RenX_LoggingPlugin::RenX_OnCharacterPurchase(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &character) void RenX_LoggingPlugin::RenX_OnCharacterPurchase(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view character)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::characterPurchasePublic) if (RenX_LoggingPlugin::characterPurchasePublic)
@ -1536,7 +1536,7 @@ void RenX_LoggingPlugin::RenX_OnCharacterPurchase(RenX::Server &server, const Re
} }
} }
void RenX_LoggingPlugin::RenX_OnItemPurchase(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &item) void RenX_LoggingPlugin::RenX_OnItemPurchase(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view item)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::itemPurchasePublic) if (RenX_LoggingPlugin::itemPurchasePublic)
@ -1553,7 +1553,7 @@ void RenX_LoggingPlugin::RenX_OnItemPurchase(RenX::Server &server, const RenX::P
} }
} }
void RenX_LoggingPlugin::RenX_OnWeaponPurchase(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &weapon) void RenX_LoggingPlugin::RenX_OnWeaponPurchase(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view weapon)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::weaponPurchasePublic) if (RenX_LoggingPlugin::weaponPurchasePublic)
@ -1586,7 +1586,7 @@ void RenX_LoggingPlugin::RenX_OnRefillPurchase(RenX::Server &server, const RenX:
} }
} }
void RenX_LoggingPlugin::RenX_OnVehiclePurchase(RenX::Server &server, const RenX::PlayerInfo &owner, const Jupiter::ReadableString &vehicle) void RenX_LoggingPlugin::RenX_OnVehiclePurchase(RenX::Server &server, const RenX::PlayerInfo &owner, std::string_view vehicle)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::vehiclePurchasePublic) if (RenX_LoggingPlugin::vehiclePurchasePublic)
@ -1603,7 +1603,7 @@ void RenX_LoggingPlugin::RenX_OnVehiclePurchase(RenX::Server &server, const RenX
} }
} }
void RenX_LoggingPlugin::RenX_OnVehicleSpawn(RenX::Server &server, const RenX::TeamType &team, const Jupiter::ReadableString &vehicle) void RenX_LoggingPlugin::RenX_OnVehicleSpawn(RenX::Server &server, const RenX::TeamType &team, std::string_view vehicle)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::vehicleSpawnPublic) if (RenX_LoggingPlugin::vehicleSpawnPublic)
@ -1627,7 +1627,7 @@ void RenX_LoggingPlugin::RenX_OnVehicleSpawn(RenX::Server &server, const RenX::T
} }
} }
void RenX_LoggingPlugin::RenX_OnSpawn(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &character) void RenX_LoggingPlugin::RenX_OnSpawn(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view character)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::spawnPublic) if (RenX_LoggingPlugin::spawnPublic)
@ -1660,7 +1660,7 @@ void RenX_LoggingPlugin::RenX_OnBotJoin(RenX::Server &server, const RenX::Player
} }
} }
void RenX_LoggingPlugin::RenX_OnVehicleCrate(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &vehicle) void RenX_LoggingPlugin::RenX_OnVehicleCrate(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view vehicle)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::vehicleCratePublic) if (RenX_LoggingPlugin::vehicleCratePublic)
@ -1677,7 +1677,7 @@ void RenX_LoggingPlugin::RenX_OnVehicleCrate(RenX::Server &server, const RenX::P
} }
} }
void RenX_LoggingPlugin::RenX_OnTSVehicleCrate(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &vehicle) void RenX_LoggingPlugin::RenX_OnTSVehicleCrate(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view vehicle)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::TSVehicleCratePublic) if (RenX_LoggingPlugin::TSVehicleCratePublic)
@ -1694,7 +1694,7 @@ void RenX_LoggingPlugin::RenX_OnTSVehicleCrate(RenX::Server &server, const RenX:
} }
} }
void RenX_LoggingPlugin::RenX_OnRAVehicleCrate(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &vehicle) void RenX_LoggingPlugin::RenX_OnRAVehicleCrate(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view vehicle)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::RAVehicleCratePublic) if (RenX_LoggingPlugin::RAVehicleCratePublic)
@ -1744,7 +1744,7 @@ void RenX_LoggingPlugin::RenX_OnMoneyCrate(RenX::Server &server, const RenX::Pla
} }
} }
void RenX_LoggingPlugin::RenX_OnCharacterCrate(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &character) void RenX_LoggingPlugin::RenX_OnCharacterCrate(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view character)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::characterCratePublic) if (RenX_LoggingPlugin::characterCratePublic)
@ -1761,7 +1761,7 @@ void RenX_LoggingPlugin::RenX_OnCharacterCrate(RenX::Server &server, const RenX:
} }
} }
void RenX_LoggingPlugin::RenX_OnSpyCrate(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &character) void RenX_LoggingPlugin::RenX_OnSpyCrate(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view character)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::spyCratePublic) if (RenX_LoggingPlugin::spyCratePublic)
@ -1875,7 +1875,7 @@ void RenX_LoggingPlugin::RenX_OnUnspecifiedCrate(RenX::Server &server, const Ren
} }
} }
void RenX_LoggingPlugin::RenX_OnOtherCrate(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &type) void RenX_LoggingPlugin::RenX_OnOtherCrate(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view type)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::otherCratePublic) if (RenX_LoggingPlugin::otherCratePublic)
@ -1892,7 +1892,7 @@ void RenX_LoggingPlugin::RenX_OnOtherCrate(RenX::Server &server, const RenX::Pla
} }
} }
void RenX_LoggingPlugin::RenX_OnSteal(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &vehicle) void RenX_LoggingPlugin::RenX_OnSteal(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view vehicle)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::stealPublic) if (RenX_LoggingPlugin::stealPublic)
@ -1909,7 +1909,7 @@ void RenX_LoggingPlugin::RenX_OnSteal(RenX::Server &server, const RenX::PlayerIn
} }
} }
void RenX_LoggingPlugin::RenX_OnSteal(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &vehicle, const RenX::PlayerInfo &victim) void RenX_LoggingPlugin::RenX_OnSteal(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view vehicle, const RenX::PlayerInfo &victim)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::stealPublic) if (RenX_LoggingPlugin::stealPublic)
@ -1943,7 +1943,7 @@ void RenX_LoggingPlugin::RenX_OnDonate(RenX::Server &server, const RenX::PlayerI
} }
} }
void RenX_LoggingPlugin::RenX_OnDestroy(RenX::Server &server, const Jupiter::ReadableString &killer, const RenX::TeamType &killerTeam, const Jupiter::ReadableString &objectName, const RenX::TeamType &objectTeam, const Jupiter::ReadableString &damageType, RenX::ObjectType type) void RenX_LoggingPlugin::RenX_OnDestroy(RenX::Server &server, std::string_view killer, const RenX::TeamType &killerTeam, std::string_view objectName, const RenX::TeamType &objectTeam, std::string_view damageType, RenX::ObjectType type)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::destroyPublic) if (RenX_LoggingPlugin::destroyPublic)
@ -2061,7 +2061,7 @@ void RenX_LoggingPlugin::RenX_OnGameOver(RenX::Server &server, RenX::WinType win
} }
} }
void RenX_LoggingPlugin::RenX_OnGame(RenX::Server &server, const Jupiter::ReadableString &raw) void RenX_LoggingPlugin::RenX_OnGame(RenX::Server &server, std::string_view raw)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::gamePublic) if (RenX_LoggingPlugin::gamePublic)
@ -2078,7 +2078,7 @@ void RenX_LoggingPlugin::RenX_OnGame(RenX::Server &server, const Jupiter::Readab
} }
} }
void RenX_LoggingPlugin::RenX_OnExecute(RenX::Server &server, const Jupiter::ReadableString &user, const Jupiter::ReadableString &command) { void RenX_LoggingPlugin::RenX_OnExecute(RenX::Server &server, std::string_view user, std::string_view command) {
if (RenX_LoggingPlugin::muteOwnExecute == false || server.getUser() != user) { if (RenX_LoggingPlugin::muteOwnExecute == false || server.getUser() != user) {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::executePublic) if (RenX_LoggingPlugin::executePublic)
@ -2102,7 +2102,7 @@ void RenX_LoggingPlugin::RenX_OnExecute(RenX::Server &server, const Jupiter::Rea
} }
} }
void RenX_LoggingPlugin::RenX_OnSubscribe(RenX::Server &server, const Jupiter::ReadableString &user) void RenX_LoggingPlugin::RenX_OnSubscribe(RenX::Server &server, std::string_view user)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::subscribePublic) if (RenX_LoggingPlugin::subscribePublic)
@ -2119,7 +2119,7 @@ void RenX_LoggingPlugin::RenX_OnSubscribe(RenX::Server &server, const Jupiter::R
} }
} }
void RenX_LoggingPlugin::RenX_OnRCON(RenX::Server &server, const Jupiter::ReadableString &raw) void RenX_LoggingPlugin::RenX_OnRCON(RenX::Server &server, std::string_view raw)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::RCONPublic) if (RenX_LoggingPlugin::RCONPublic)
@ -2184,7 +2184,7 @@ void RenX_LoggingPlugin::RenX_OnAdminLogout(RenX::Server &server, const RenX::Pl
} }
} }
void RenX_LoggingPlugin::RenX_OnAdmin(RenX::Server &server, const Jupiter::ReadableString &raw) void RenX_LoggingPlugin::RenX_OnAdmin(RenX::Server &server, std::string_view raw)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::adminPublic) if (RenX_LoggingPlugin::adminPublic)
@ -2331,7 +2331,7 @@ void RenX_LoggingPlugin::RenX_OnVoteSurrender(RenX::Server &server, const RenX::
} }
} }
void RenX_LoggingPlugin::RenX_OnVoteSurvey(RenX::Server &server, const RenX::TeamType &team, const RenX::PlayerInfo &player, const Jupiter::ReadableString &text) void RenX_LoggingPlugin::RenX_OnVoteSurvey(RenX::Server &server, const RenX::TeamType &team, const RenX::PlayerInfo &player, std::string_view text)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::voteCallPublic) if (RenX_LoggingPlugin::voteCallPublic)
@ -2351,7 +2351,7 @@ void RenX_LoggingPlugin::RenX_OnVoteSurvey(RenX::Server &server, const RenX::Tea
} }
} }
void RenX_LoggingPlugin::RenX_OnVoteOther(RenX::Server &server, const RenX::TeamType &team, const Jupiter::ReadableString &type, const RenX::PlayerInfo &player) void RenX_LoggingPlugin::RenX_OnVoteOther(RenX::Server &server, const RenX::TeamType &team, std::string_view type, const RenX::PlayerInfo &player)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::voteCallPublic) if (RenX_LoggingPlugin::voteCallPublic)
@ -2371,7 +2371,7 @@ void RenX_LoggingPlugin::RenX_OnVoteOther(RenX::Server &server, const RenX::Team
} }
} }
void RenX_LoggingPlugin::RenX_OnVoteOver(RenX::Server &server, const RenX::TeamType &team, const Jupiter::ReadableString &type, bool success, int yesVotes, int noVotes) void RenX_LoggingPlugin::RenX_OnVoteOver(RenX::Server &server, const RenX::TeamType &team, std::string_view type, bool success, int yesVotes, int noVotes)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::voteOverPublic) if (RenX_LoggingPlugin::voteOverPublic)
@ -2396,7 +2396,7 @@ void RenX_LoggingPlugin::RenX_OnVoteOver(RenX::Server &server, const RenX::TeamT
} }
} }
void RenX_LoggingPlugin::RenX_OnVoteCancel(RenX::Server &server, const RenX::TeamType &team, const Jupiter::ReadableString &type) void RenX_LoggingPlugin::RenX_OnVoteCancel(RenX::Server &server, const RenX::TeamType &team, std::string_view type)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::voteCancelPublic) if (RenX_LoggingPlugin::voteCancelPublic)
@ -2419,7 +2419,7 @@ void RenX_LoggingPlugin::RenX_OnVoteCancel(RenX::Server &server, const RenX::Tea
} }
} }
void RenX_LoggingPlugin::RenX_OnVote(RenX::Server &server, const Jupiter::ReadableString &raw) void RenX_LoggingPlugin::RenX_OnVote(RenX::Server &server, std::string_view raw)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::votePublic) if (RenX_LoggingPlugin::votePublic)
@ -2436,7 +2436,7 @@ void RenX_LoggingPlugin::RenX_OnVote(RenX::Server &server, const Jupiter::Readab
} }
} }
void RenX_LoggingPlugin::RenX_OnMapChange(RenX::Server &server, const Jupiter::ReadableString &map, bool seamless) void RenX_LoggingPlugin::RenX_OnMapChange(RenX::Server &server, std::string_view map, bool seamless)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::mapChangePublic) if (RenX_LoggingPlugin::mapChangePublic)
@ -2453,7 +2453,7 @@ void RenX_LoggingPlugin::RenX_OnMapChange(RenX::Server &server, const Jupiter::R
} }
} }
void RenX_LoggingPlugin::RenX_OnMapLoad(RenX::Server &server, const Jupiter::ReadableString &map) void RenX_LoggingPlugin::RenX_OnMapLoad(RenX::Server &server, std::string_view map)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::mapLoadPublic) if (RenX_LoggingPlugin::mapLoadPublic)
@ -2470,7 +2470,7 @@ void RenX_LoggingPlugin::RenX_OnMapLoad(RenX::Server &server, const Jupiter::Rea
} }
} }
void RenX_LoggingPlugin::RenX_OnMapStart(RenX::Server &server, const Jupiter::ReadableString &map) void RenX_LoggingPlugin::RenX_OnMapStart(RenX::Server &server, std::string_view map)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::mapStartPublic) if (RenX_LoggingPlugin::mapStartPublic)
@ -2487,7 +2487,7 @@ void RenX_LoggingPlugin::RenX_OnMapStart(RenX::Server &server, const Jupiter::Re
} }
} }
void RenX_LoggingPlugin::RenX_OnMap(RenX::Server &server, const Jupiter::ReadableString &raw) void RenX_LoggingPlugin::RenX_OnMap(RenX::Server &server, std::string_view raw)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::mapPublic) if (RenX_LoggingPlugin::mapPublic)
@ -2520,7 +2520,7 @@ void RenX_LoggingPlugin::RenX_OnDemoRecord(RenX::Server &server, const RenX::Pla
} }
} }
void RenX_LoggingPlugin::RenX_OnDemoRecord(RenX::Server &server, const Jupiter::ReadableString &user) void RenX_LoggingPlugin::RenX_OnDemoRecord(RenX::Server &server, std::string_view user)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::demoRecordPublic) if (RenX_LoggingPlugin::demoRecordPublic)
@ -2553,7 +2553,7 @@ void RenX_LoggingPlugin::RenX_OnDemoRecordStop(RenX::Server &server)
} }
} }
void RenX_LoggingPlugin::RenX_OnDemo(RenX::Server &server, const Jupiter::ReadableString &raw) void RenX_LoggingPlugin::RenX_OnDemo(RenX::Server &server, std::string_view raw)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::demoPublic) if (RenX_LoggingPlugin::demoPublic)
@ -2570,7 +2570,7 @@ void RenX_LoggingPlugin::RenX_OnDemo(RenX::Server &server, const Jupiter::Readab
} }
} }
void RenX_LoggingPlugin::RenX_OnLog(RenX::Server &server, const Jupiter::ReadableString &raw) void RenX_LoggingPlugin::RenX_OnLog(RenX::Server &server, std::string_view raw)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::logPublic) if (RenX_LoggingPlugin::logPublic)
@ -2587,7 +2587,7 @@ void RenX_LoggingPlugin::RenX_OnLog(RenX::Server &server, const Jupiter::Readabl
} }
} }
void RenX_LoggingPlugin::RenX_OnCommand(RenX::Server &server, const Jupiter::ReadableString &raw) void RenX_LoggingPlugin::RenX_OnCommand(RenX::Server &server, std::string_view raw)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::commandPublic) if (RenX_LoggingPlugin::commandPublic)
@ -2604,7 +2604,7 @@ void RenX_LoggingPlugin::RenX_OnCommand(RenX::Server &server, const Jupiter::Rea
} }
} }
void RenX_LoggingPlugin::RenX_OnError(RenX::Server &server, const Jupiter::ReadableString &raw) void RenX_LoggingPlugin::RenX_OnError(RenX::Server &server, std::string_view raw)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::errorPublic) if (RenX_LoggingPlugin::errorPublic)
@ -2621,7 +2621,7 @@ void RenX_LoggingPlugin::RenX_OnError(RenX::Server &server, const Jupiter::Reada
} }
} }
void RenX_LoggingPlugin::RenX_OnVersion(RenX::Server &server, const Jupiter::ReadableString &raw) void RenX_LoggingPlugin::RenX_OnVersion(RenX::Server &server, std::string_view raw)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::versionPublic) if (RenX_LoggingPlugin::versionPublic)
@ -2638,7 +2638,7 @@ void RenX_LoggingPlugin::RenX_OnVersion(RenX::Server &server, const Jupiter::Rea
} }
} }
void RenX_LoggingPlugin::RenX_OnAuthorized(RenX::Server &server, const Jupiter::ReadableString &raw) void RenX_LoggingPlugin::RenX_OnAuthorized(RenX::Server &server, std::string_view raw)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::authorizedPublic) if (RenX_LoggingPlugin::authorizedPublic)
@ -2655,7 +2655,7 @@ void RenX_LoggingPlugin::RenX_OnAuthorized(RenX::Server &server, const Jupiter::
} }
} }
void RenX_LoggingPlugin::RenX_OnOther(RenX::Server &server, char token, const Jupiter::ReadableString &raw) void RenX_LoggingPlugin::RenX_OnOther(RenX::Server &server, char token, std::string_view raw)
{ {
logFuncType func; logFuncType func;
if (RenX_LoggingPlugin::otherPublic) if (RenX_LoggingPlugin::otherPublic)

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

@ -30,80 +30,80 @@ public: // RenX::Plugin
void RenX_OnJoin(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnJoin(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnPart(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnPart(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnKick(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &reason) override; void RenX_OnKick(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view reason) override;
void RenX_OnNameChange(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &newPlayerName) override; void RenX_OnNameChange(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view newPlayerName) override;
void RenX_OnTeamChange(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::TeamType &oldTeam) override; void RenX_OnTeamChange(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::TeamType &oldTeam) override;
void RenX_OnExecute(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &command) override; void RenX_OnExecute(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view command) override;
void RenX_OnPlayerCommand(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &message, RenX::GameCommand *command) override; void RenX_OnPlayerCommand(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view message, RenX::GameCommand *command) override;
void RenX_OnSpeedHack(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnSpeedHack(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnPlayer(RenX::Server &server, const Jupiter::ReadableString &raw) override; void RenX_OnPlayer(RenX::Server &server, std::string_view raw) override;
void RenX_OnChat(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &message) override; void RenX_OnChat(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view message) override;
void RenX_OnTeamChat(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &message) override; void RenX_OnTeamChat(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view message) override;
void RenX_OnRadioChat(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &message) override; void RenX_OnRadioChat(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view message) override;
void RenX_OnHostChat(RenX::Server &server, const Jupiter::ReadableString &message) override; void RenX_OnHostChat(RenX::Server &server, std::string_view message) override;
void RenX_OnHostPage(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &message) override; void RenX_OnHostPage(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view message) override;
void RenX_OnAdminMessage(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &message) override; void RenX_OnAdminMessage(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view message) override;
void RenX_OnWarnMessage(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &message) override; void RenX_OnWarnMessage(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view message) override;
void RenX_OnAdminPMessage(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::PlayerInfo &target, const Jupiter::ReadableString &message) override; void RenX_OnAdminPMessage(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::PlayerInfo &target, std::string_view message) override;
void RenX_OnWarnPMessage(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::PlayerInfo &target, const Jupiter::ReadableString &message) override; void RenX_OnWarnPMessage(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::PlayerInfo &target, std::string_view message) override;
void RenX_OnHostAdminMessage(RenX::Server &server, const Jupiter::ReadableString &message) override; void RenX_OnHostAdminMessage(RenX::Server &server, std::string_view message) override;
void RenX_OnHostAdminPMessage(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &message) override; void RenX_OnHostAdminPMessage(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view message) override;
void RenX_OnHostWarnMessage(RenX::Server &server, const Jupiter::ReadableString &message) override; void RenX_OnHostWarnMessage(RenX::Server &server, std::string_view message) override;
void RenX_OnHostWarnPMessage(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &message) override; void RenX_OnHostWarnPMessage(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view message) override;
void RenX_OnOtherChat(RenX::Server &server, const Jupiter::ReadableString &raw) override; void RenX_OnOtherChat(RenX::Server &server, std::string_view raw) override;
void RenX_OnDeploy(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &object) override; void RenX_OnDeploy(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view object) override;
void RenX_OnOverMine(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &location) override; void RenX_OnOverMine(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view location) override;
void RenX_OnDisarm(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &object, const RenX::PlayerInfo &victim) override; void RenX_OnDisarm(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view object, const RenX::PlayerInfo &victim) override;
void RenX_OnDisarm(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &object) override; void RenX_OnDisarm(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view object) override;
void RenX_OnExplode(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &object) override; void RenX_OnExplode(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view object) override;
void RenX_OnExplode(RenX::Server &server, const Jupiter::ReadableString &object) override; void RenX_OnExplode(RenX::Server &server, std::string_view object) override;
void RenX_OnSuicide(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &damageType) override; void RenX_OnSuicide(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view damageType) override;
void RenX_OnKill(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::PlayerInfo &victim, const Jupiter::ReadableString &damageType) override; void RenX_OnKill(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::PlayerInfo &victim, std::string_view damageType) override;
void RenX_OnKill(RenX::Server &server, const Jupiter::ReadableString &killer, const RenX::TeamType &killerTeam, const RenX::PlayerInfo &victim, const Jupiter::ReadableString &damageType) override; void RenX_OnKill(RenX::Server &server, std::string_view killer, const RenX::TeamType &killerTeam, const RenX::PlayerInfo &victim, std::string_view damageType) override;
void RenX_OnDie(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &damageType) override; void RenX_OnDie(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view damageType) override;
void RenX_OnDie(RenX::Server &server, const Jupiter::ReadableString &object, const RenX::TeamType &objectTeam, const Jupiter::ReadableString &damageType) override; void RenX_OnDie(RenX::Server &server, std::string_view object, const RenX::TeamType &objectTeam, std::string_view damageType) override;
void RenX_OnDestroy(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &objectName, const RenX::TeamType &objectTeam, const Jupiter::ReadableString &damageType, RenX::ObjectType type) override; void RenX_OnDestroy(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view objectName, const RenX::TeamType &objectTeam, std::string_view damageType, RenX::ObjectType type) override;
void RenX_OnDestroy(RenX::Server &server, const Jupiter::ReadableString &killer, const RenX::TeamType &killerTeam, const Jupiter::ReadableString &objectName, const RenX::TeamType &objectTeam, const Jupiter::ReadableString &damageType, RenX::ObjectType type) override; void RenX_OnDestroy(RenX::Server &server, std::string_view killer, const RenX::TeamType &killerTeam, std::string_view objectName, const RenX::TeamType &objectTeam, std::string_view damageType, RenX::ObjectType type) override;
void RenX_OnCapture(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &building, const RenX::TeamType &oldTeam) override; void RenX_OnCapture(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view building, const RenX::TeamType &oldTeam) override;
void RenX_OnNeutralize(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &building, const RenX::TeamType &oldTeam) override; void RenX_OnNeutralize(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view building, const RenX::TeamType &oldTeam) override;
void RenX_OnCharacterPurchase(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &character) override; void RenX_OnCharacterPurchase(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view character) override;
void RenX_OnItemPurchase(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &item) override; void RenX_OnItemPurchase(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view item) override;
void RenX_OnWeaponPurchase(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &weapon) override; void RenX_OnWeaponPurchase(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view weapon) override;
void RenX_OnRefillPurchase(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnRefillPurchase(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnVehiclePurchase(RenX::Server &server, const RenX::PlayerInfo &owner, const Jupiter::ReadableString &vehicle) override; void RenX_OnVehiclePurchase(RenX::Server &server, const RenX::PlayerInfo &owner, std::string_view vehicle) override;
void RenX_OnVehicleSpawn(RenX::Server &server, const RenX::TeamType &team, const Jupiter::ReadableString &vehicle) override; void RenX_OnVehicleSpawn(RenX::Server &server, const RenX::TeamType &team, std::string_view vehicle) override;
void RenX_OnSpawn(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &character) override; void RenX_OnSpawn(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view character) override;
void RenX_OnBotJoin(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnBotJoin(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnVehicleCrate(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &vehicle) override; void RenX_OnVehicleCrate(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view vehicle) override;
void RenX_OnTSVehicleCrate(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &vehicle) override; void RenX_OnTSVehicleCrate(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view vehicle) override;
void RenX_OnRAVehicleCrate(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &vehicle) override; void RenX_OnRAVehicleCrate(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view vehicle) override;
void RenX_OnDeathCrate(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnDeathCrate(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnMoneyCrate(RenX::Server &server, const RenX::PlayerInfo &player, int amount) override; void RenX_OnMoneyCrate(RenX::Server &server, const RenX::PlayerInfo &player, int amount) override;
void RenX_OnCharacterCrate(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &character) override; void RenX_OnCharacterCrate(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view character) override;
void RenX_OnSpyCrate(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &character) override; void RenX_OnSpyCrate(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view character) override;
void RenX_OnRefillCrate(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnRefillCrate(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnTimeBombCrate(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnTimeBombCrate(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnSpeedCrate(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnSpeedCrate(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnNukeCrate(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnNukeCrate(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnAbductionCrate(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnAbductionCrate(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnUnspecifiedCrate(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnUnspecifiedCrate(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnOtherCrate(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &type) override; void RenX_OnOtherCrate(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view type) override;
void RenX_OnSteal(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &vehicle) override; void RenX_OnSteal(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view vehicle) override;
void RenX_OnSteal(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &vehicle, const RenX::PlayerInfo &victim) override; void RenX_OnSteal(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view vehicle, const RenX::PlayerInfo &victim) override;
void RenX_OnDonate(RenX::Server &server, const RenX::PlayerInfo &donor, const RenX::PlayerInfo &player, double amount) override; void RenX_OnDonate(RenX::Server &server, const RenX::PlayerInfo &donor, const RenX::PlayerInfo &player, double amount) override;
void RenX_OnGameOver(RenX::Server &server, RenX::WinType winType, const RenX::TeamType &team, int gScore, int nScore) override; void RenX_OnGameOver(RenX::Server &server, RenX::WinType winType, const RenX::TeamType &team, int gScore, int nScore) override;
void RenX_OnGame(RenX::Server &server, const Jupiter::ReadableString &raw) override; void RenX_OnGame(RenX::Server &server, std::string_view raw) override;
void RenX_OnExecute(RenX::Server &server, const Jupiter::ReadableString &user, const Jupiter::ReadableString &command) override; void RenX_OnExecute(RenX::Server &server, std::string_view user, std::string_view command) override;
void RenX_OnSubscribe(RenX::Server &server, const Jupiter::ReadableString &user) override; void RenX_OnSubscribe(RenX::Server &server, std::string_view user) override;
void RenX_OnRCON(RenX::Server &server, const Jupiter::ReadableString &raw) override; void RenX_OnRCON(RenX::Server &server, std::string_view raw) override;
void RenX_OnAdminLogin(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnAdminLogin(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnAdminGrant(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnAdminGrant(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnAdminLogout(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnAdminLogout(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnAdmin(RenX::Server &server, const Jupiter::ReadableString &raw) override; void RenX_OnAdmin(RenX::Server &server, std::string_view raw) override;
void RenX_OnVoteAddBots(RenX::Server &server, const RenX::TeamType &team, const RenX::PlayerInfo &player, const RenX::TeamType &victim, int amount, int skill) override; void RenX_OnVoteAddBots(RenX::Server &server, const RenX::TeamType &team, const RenX::PlayerInfo &player, const RenX::TeamType &victim, int amount, int skill) override;
void RenX_OnVoteChangeMap(RenX::Server &server, const RenX::TeamType &team, const RenX::PlayerInfo &player) override; void RenX_OnVoteChangeMap(RenX::Server &server, const RenX::TeamType &team, const RenX::PlayerInfo &player) override;
@ -112,29 +112,29 @@ public: // RenX::Plugin
void RenX_OnVoteRemoveBots(RenX::Server &server, const RenX::TeamType &team, const RenX::PlayerInfo &player, const RenX::TeamType &victim, int amount) override; void RenX_OnVoteRemoveBots(RenX::Server &server, const RenX::TeamType &team, const RenX::PlayerInfo &player, const RenX::TeamType &victim, int amount) override;
void RenX_OnVoteRestartMap(RenX::Server &server, const RenX::TeamType &team, const RenX::PlayerInfo &player) override; void RenX_OnVoteRestartMap(RenX::Server &server, const RenX::TeamType &team, const RenX::PlayerInfo &player) override;
void RenX_OnVoteSurrender(RenX::Server &server, const RenX::TeamType &team, const RenX::PlayerInfo &player) override; void RenX_OnVoteSurrender(RenX::Server &server, const RenX::TeamType &team, const RenX::PlayerInfo &player) override;
void RenX_OnVoteSurvey(RenX::Server &server, const RenX::TeamType &team, const RenX::PlayerInfo &player, const Jupiter::ReadableString &text) override; void RenX_OnVoteSurvey(RenX::Server &server, const RenX::TeamType &team, const RenX::PlayerInfo &player, std::string_view text) override;
void RenX_OnVoteOther(RenX::Server &server, const RenX::TeamType &team, const Jupiter::ReadableString &type, const RenX::PlayerInfo &player) override; void RenX_OnVoteOther(RenX::Server &server, const RenX::TeamType &team, std::string_view type, const RenX::PlayerInfo &player) override;
void RenX_OnVoteOver(RenX::Server &server, const RenX::TeamType &team, const Jupiter::ReadableString &type, bool success, int yesVotes, int noVotes) override; void RenX_OnVoteOver(RenX::Server &server, const RenX::TeamType &team, std::string_view type, bool success, int yesVotes, int noVotes) override;
void RenX_OnVoteCancel(RenX::Server &server, const RenX::TeamType &team, const Jupiter::ReadableString &type) override; void RenX_OnVoteCancel(RenX::Server &server, const RenX::TeamType &team, std::string_view type) override;
void RenX_OnVote(RenX::Server &server, const Jupiter::ReadableString &raw) override; void RenX_OnVote(RenX::Server &server, std::string_view raw) override;
void RenX_OnMapChange(RenX::Server &server, const Jupiter::ReadableString &map, bool seamless) override; void RenX_OnMapChange(RenX::Server &server, std::string_view map, bool seamless) override;
void RenX_OnMapLoad(RenX::Server &server, const Jupiter::ReadableString &map) override; void RenX_OnMapLoad(RenX::Server &server, std::string_view map) override;
void RenX_OnMapStart(RenX::Server &server, const Jupiter::ReadableString &map) override; void RenX_OnMapStart(RenX::Server &server, std::string_view map) override;
void RenX_OnMap(RenX::Server &server, const Jupiter::ReadableString &raw) override; void RenX_OnMap(RenX::Server &server, std::string_view raw) override;
void RenX_OnDemoRecord(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnDemoRecord(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnDemoRecord(RenX::Server &server, const Jupiter::ReadableString &user) override; void RenX_OnDemoRecord(RenX::Server &server, std::string_view user) override;
void RenX_OnDemoRecordStop(RenX::Server &server) override; void RenX_OnDemoRecordStop(RenX::Server &server) override;
void RenX_OnDemo(RenX::Server &server, const Jupiter::ReadableString &raw) override; void RenX_OnDemo(RenX::Server &server, std::string_view raw) override;
void RenX_OnLog(RenX::Server &server, const Jupiter::ReadableString &raw) override; void RenX_OnLog(RenX::Server &server, std::string_view raw) override;
void RenX_OnCommand(RenX::Server &server, const Jupiter::ReadableString &raw) override; void RenX_OnCommand(RenX::Server &server, std::string_view raw) override;
void RenX_OnError(RenX::Server &server, const Jupiter::ReadableString &raw) override; void RenX_OnError(RenX::Server &server, std::string_view raw) override;
void RenX_OnVersion(RenX::Server &server, const Jupiter::ReadableString &raw) override; void RenX_OnVersion(RenX::Server &server, std::string_view raw) override;
void RenX_OnAuthorized(RenX::Server &server, const Jupiter::ReadableString &raw) override; void RenX_OnAuthorized(RenX::Server &server, std::string_view raw) override;
void RenX_OnOther(RenX::Server &server, const char token, const Jupiter::ReadableString &raw) override; void RenX_OnOther(RenX::Server &server, const char token, std::string_view raw) override;
public: // Jupiter::Plugin public: // Jupiter::Plugin
int OnRehash() override; int OnRehash() override;

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

@ -104,8 +104,8 @@ void RenX_MedalsPlugin::RenX_SanitizeTags(std::string& fmt) {
void RenX_MedalsPlugin::RenX_ProcessTags(std::string& msg, const RenX::Server *server, const RenX::PlayerInfo *player, const RenX::PlayerInfo *, const RenX::BuildingInfo *) { void RenX_MedalsPlugin::RenX_ProcessTags(std::string& msg, const RenX::Server *server, const RenX::PlayerInfo *player, const RenX::PlayerInfo *, const RenX::BuildingInfo *) {
if (player != nullptr) { if (player != nullptr) {
const Jupiter::ReadableString &recs = RenX_MedalsPlugin::medalsFile.get(player->uuid, "Recs"_jrs); std::string_view recs = RenX_MedalsPlugin::medalsFile.get(player->uuid, "Recs"_jrs);
const Jupiter::ReadableString &noobs = RenX_MedalsPlugin::medalsFile.get(player->uuid, "Noobs"_jrs); std::string_view noobs = RenX_MedalsPlugin::medalsFile.get(player->uuid, "Noobs"_jrs);
RenX::replace_tag(msg, this->INTERNAL_RECS_TAG, recs); RenX::replace_tag(msg, this->INTERNAL_RECS_TAG, recs);
RenX::replace_tag(msg, this->INTERNAL_NOOB_TAG, noobs); RenX::replace_tag(msg, this->INTERNAL_NOOB_TAG, noobs);
@ -230,7 +230,7 @@ void RenX_MedalsPlugin::RenX_OnGameOver(RenX::Server &server, RenX::WinType winT
RenX_MedalsPlugin::medalsFile.write(medalsFileName); RenX_MedalsPlugin::medalsFile.write(medalsFileName);
} }
void RenX_MedalsPlugin::RenX_OnDestroy(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &objectName, const RenX::TeamType &objectTeam, const Jupiter::ReadableString &damageType, RenX::ObjectType type) void RenX_MedalsPlugin::RenX_OnDestroy(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view objectName, const RenX::TeamType &objectTeam, std::string_view damageType, RenX::ObjectType type)
{ {
if (type == RenX::ObjectType::Building) if (type == RenX::ObjectType::Building)
{ {
@ -293,7 +293,7 @@ void RecsGameCommand::create()
this->addTrigger("n00bs"_jrs); this->addTrigger("n00bs"_jrs);
} }
void RecsGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, const Jupiter::ReadableString &parameters) void RecsGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, std::string_view parameters)
{ {
if (!parameters.empty()) if (!parameters.empty())
{ {
@ -325,7 +325,7 @@ void RecsGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, co
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, 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)));
} }
const Jupiter::ReadableString &RecsGameCommand::getHelp(const Jupiter::ReadableString &) std::string_view RecsGameCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Gets a count of a player's recommendations and noobs. Syntax: recs [player]"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Gets a count of a player's recommendations and noobs. Syntax: recs [player]");
return defaultHelp; return defaultHelp;
@ -341,7 +341,7 @@ void RecGameCommand::create()
this->addTrigger("recommend"_jrs); this->addTrigger("recommend"_jrs);
} }
void RecGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, const Jupiter::ReadableString &parameters) { void RecGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, std::string_view parameters) {
auto parameters_split = jessilib::word_split_once_view(std::string_view{parameters}, WHITESPACE_SV); auto parameters_split = jessilib::word_split_once_view(std::string_view{parameters}, WHITESPACE_SV);
if (!parameters_split.first.empty()) { if (!parameters_split.first.empty()) {
RenX::PlayerInfo *target = source->getPlayerByPartName(parameters); RenX::PlayerInfo *target = source->getPlayerByPartName(parameters);
@ -373,7 +373,7 @@ void RecGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, con
else RecsGameCommand_instance.trigger(source, player, parameters); else RecsGameCommand_instance.trigger(source, player, parameters);
} }
const Jupiter::ReadableString &RecGameCommand::getHelp(const Jupiter::ReadableString &) std::string_view RecGameCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Recommends a player for their gameplay. Syntax: rec <player> [reason]"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Recommends a player for their gameplay. Syntax: rec <player> [reason]");
return defaultHelp; return defaultHelp;
@ -389,7 +389,7 @@ void NoobGameCommand::create()
this->addTrigger("n00b"_jrs); this->addTrigger("n00b"_jrs);
} }
void NoobGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, const Jupiter::ReadableString &parameters) { void NoobGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, std::string_view parameters) {
auto parameters_split = jessilib::word_split_once_view(std::string_view{parameters}, WHITESPACE_SV); auto parameters_split = jessilib::word_split_once_view(std::string_view{parameters}, WHITESPACE_SV);
if (!parameters_split.first.empty()) { if (!parameters_split.first.empty()) {
RenX::PlayerInfo *target = source->getPlayerByPartName(parameters); RenX::PlayerInfo *target = source->getPlayerByPartName(parameters);
@ -405,7 +405,7 @@ void NoobGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, co
else if (target->isBot) { else if (target->isBot) {
source->sendMessage(*player, "Error: Bots can not receive n00bs."_jrs); source->sendMessage(*player, "Error: Bots can not receive n00bs."_jrs);
} }
else if (player->varData["RenX.Medals"_jrs].get("gn"_jrs) != nullptr && player->adminType.empty()) { else if (!player->varData["RenX.Medals"_jrs].get("gn"_jrs).empty() && player->adminType.empty()) {
source->sendMessage(*player, "You can only give one noob per game."_jrs); source->sendMessage(*player, "You can only give one noob per game."_jrs);
} }
else { else {
@ -417,7 +417,7 @@ void NoobGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, co
else RecsGameCommand_instance.trigger(source, player, parameters); else RecsGameCommand_instance.trigger(source, player, parameters);
} }
const Jupiter::ReadableString &NoobGameCommand::getHelp(const Jupiter::ReadableString &) std::string_view NoobGameCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Tells people that a player is bad. Syntax: noob [player]"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Tells people that a player is bad. Syntax: noob [player]");
return defaultHelp; return defaultHelp;

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

@ -49,7 +49,7 @@ public: // RenX::Plugin
void RenX_OnPlayerDelete(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnPlayerDelete(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnJoin(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnJoin(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnGameOver(RenX::Server &server, RenX::WinType winType, const RenX::TeamType &team, int gScore, int nScore) override; void RenX_OnGameOver(RenX::Server &server, RenX::WinType winType, const RenX::TeamType &team, int gScore, int nScore) override;
void RenX_OnDestroy(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &objectName, const RenX::TeamType &objectTeam, const Jupiter::ReadableString &damageType, RenX::ObjectType type) override; void RenX_OnDestroy(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view objectName, const RenX::TeamType &objectTeam, std::string_view damageType, RenX::ObjectType type) override;
~RenX_MedalsPlugin(); ~RenX_MedalsPlugin();
public: // Jupiter::Plugin public: // Jupiter::Plugin

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

@ -29,7 +29,7 @@ bool RenX_MinPlayersPlugin::initialize()
return true; return true;
} }
void RenX_MinPlayersPlugin::RenX_OnMapStart(RenX::Server &server, const Jupiter::ReadableString &map) void RenX_MinPlayersPlugin::RenX_OnMapStart(RenX::Server &server, std::string_view map)
{ {
if (server.players.size() < RenX_MinPlayersPlugin::player_threshold) if (server.players.size() < RenX_MinPlayersPlugin::player_threshold)
server.send(Jupiter::StringS::Format("addbots %d", RenX_MinPlayersPlugin::player_threshold - server.players.size())); server.send(Jupiter::StringS::Format("addbots %d", RenX_MinPlayersPlugin::player_threshold - server.players.size()));
@ -106,22 +106,22 @@ void RenX_MinPlayersPlugin::AnyDeath(RenX::Server &server, const RenX::PlayerInf
} }
} }
void RenX_MinPlayersPlugin::RenX_OnSuicide(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &damageType) void RenX_MinPlayersPlugin::RenX_OnSuicide(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view damageType)
{ {
this->AnyDeath(server, player); this->AnyDeath(server, player);
} }
void RenX_MinPlayersPlugin::RenX_OnKill(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::PlayerInfo &victim, const Jupiter::ReadableString &damageType) void RenX_MinPlayersPlugin::RenX_OnKill(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::PlayerInfo &victim, std::string_view damageType)
{ {
this->AnyDeath(server, player); this->AnyDeath(server, player);
} }
void RenX_MinPlayersPlugin::RenX_OnKill(RenX::Server &server, const Jupiter::ReadableString &killer, const RenX::TeamType &killerTeam, const RenX::PlayerInfo &victim, const Jupiter::ReadableString &damageType) void RenX_MinPlayersPlugin::RenX_OnKill(RenX::Server &server, std::string_view killer, const RenX::TeamType &killerTeam, const RenX::PlayerInfo &victim, std::string_view damageType)
{ {
this->AnyDeath(server, victim); this->AnyDeath(server, victim);
} }
void RenX_MinPlayersPlugin::RenX_OnDie(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &damageType) void RenX_MinPlayersPlugin::RenX_OnDie(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view damageType)
{ {
this->AnyDeath(server, player); this->AnyDeath(server, player);
} }

10
src/Plugins/RenX/RenX.MinPlayers/RenX_MinPlayers.h

@ -26,14 +26,14 @@
class RenX_MinPlayersPlugin : public RenX::Plugin class RenX_MinPlayersPlugin : public RenX::Plugin
{ {
public: public:
void RenX_OnMapStart(RenX::Server &server, const Jupiter::ReadableString &map) override; void RenX_OnMapStart(RenX::Server &server, std::string_view map) override;
void RenX_OnJoin(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnJoin(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnPart(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnPart(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnSuicide(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &damageType) override; void RenX_OnSuicide(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view damageType) override;
void RenX_OnKill(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::PlayerInfo &victim, const Jupiter::ReadableString &damageType) override; void RenX_OnKill(RenX::Server &server, const RenX::PlayerInfo &player, const RenX::PlayerInfo &victim, std::string_view damageType) override;
void RenX_OnKill(RenX::Server &server, const Jupiter::ReadableString &killer, const RenX::TeamType &killerTeam, const RenX::PlayerInfo &victim, const Jupiter::ReadableString &damageType) override; void RenX_OnKill(RenX::Server &server, std::string_view killer, const RenX::TeamType &killerTeam, const RenX::PlayerInfo &victim, std::string_view damageType) override;
void RenX_OnDie(RenX::Server &server, const RenX::PlayerInfo &player, const Jupiter::ReadableString &damageType) override; void RenX_OnDie(RenX::Server &server, const RenX::PlayerInfo &player, std::string_view damageType) override;
virtual bool initialize() override; virtual bool initialize() override;

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

@ -431,7 +431,7 @@ void AuthIRCCommand::create()
this->setAccessLevel(3); this->setAccessLevel(3);
} }
void AuthIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &channel, const Jupiter::ReadableString &nick, const Jupiter::ReadableString &parameters) void AuthIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view parameters)
{ {
if (!parameters.empty()) if (!parameters.empty())
{ {
@ -482,7 +482,7 @@ void AuthIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &cha
this->trigger(source, channel, nick, nick); this->trigger(source, channel, nick, nick);
} }
const Jupiter::ReadableString &AuthIRCCommand::getHelp(const Jupiter::ReadableString &) std::string_view AuthIRCCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Authenticates a player in-game. Syntax: auth [player=you]"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Authenticates a player in-game. Syntax: auth [player=you]");
return defaultHelp; return defaultHelp;
@ -501,7 +501,7 @@ void DeAuthIRCCommand::create()
this->setAccessLevel(3); this->setAccessLevel(3);
} }
void DeAuthIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &channel, const Jupiter::ReadableString &nick, const Jupiter::ReadableString &parameters) void DeAuthIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view parameters)
{ {
if (!parameters.empty()) if (!parameters.empty())
{ {
@ -542,7 +542,7 @@ void DeAuthIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &c
this->trigger(source, channel, nick, nick); this->trigger(source, channel, nick, nick);
} }
const Jupiter::ReadableString &DeAuthIRCCommand::getHelp(const Jupiter::ReadableString &) std::string_view DeAuthIRCCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Unauthenticates a player in-game. Syntax: deauth [player=you]"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Unauthenticates a player in-game. Syntax: deauth [player=you]");
return defaultHelp; return defaultHelp;
@ -558,7 +558,7 @@ void ATMIRCCommand::create()
this->setAccessLevel(3); this->setAccessLevel(3);
} }
void ATMIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &channel, const Jupiter::ReadableString &nick, const Jupiter::ReadableString &parameters) void ATMIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view parameters)
{ {
if (parameters.empty()) { if (parameters.empty()) {
this->trigger(source, channel, nick, nick); this->trigger(source, channel, nick, nick);
@ -624,7 +624,7 @@ void ATMIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &chan
} }
} }
const Jupiter::ReadableString &ATMIRCCommand::getHelp(const Jupiter::ReadableString &) std::string_view ATMIRCCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Temporarily authenticates a player in-game. Syntax: atm [level] [player=you]"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Temporarily authenticates a player in-game. Syntax: atm [level] [player=you]");
return defaultHelp; return defaultHelp;
@ -642,7 +642,7 @@ void AddIRCCommand::create()
this->setAccessLevel(5); this->setAccessLevel(5);
} }
void AddIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &channel, const Jupiter::ReadableString &nick, const Jupiter::ReadableString &parameters) { void AddIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view parameters) {
auto parameters_split = jessilib::word_split_once_view(std::string_view{parameters}, WHITESPACE_SV); auto parameters_split = jessilib::word_split_once_view(std::string_view{parameters}, WHITESPACE_SV);
if (parameters_split.second.empty()) { if (parameters_split.second.empty()) {
source->sendNotice(nick, "Error: Too few parameters. Syntax: add <level> <player>"_jrs); source->sendNotice(nick, "Error: Too few parameters. Syntax: add <level> <player>"_jrs);
@ -699,7 +699,7 @@ void AddIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &chan
} }
} }
const Jupiter::ReadableString &AddIRCCommand::getHelp(const Jupiter::ReadableString &) std::string_view AddIRCCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Adds a player to the in-game moderator list. Syntax: add <level> <player>"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Adds a player to the in-game moderator list. Syntax: add <level> <player>");
return defaultHelp; return defaultHelp;
@ -718,7 +718,7 @@ void DelIRCCommand::create()
this->setAccessLevel(5); this->setAccessLevel(5);
} }
void DelIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &channel, const Jupiter::ReadableString &nick, const Jupiter::ReadableString &parameters) void DelIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view parameters)
{ {
std::string_view parameters_view = parameters; std::string_view parameters_view = parameters;
if (parameters.empty()) if (parameters.empty())
@ -776,7 +776,7 @@ void DelIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &chan
} }
} }
const Jupiter::ReadableString &DelIRCCommand::getHelp(const Jupiter::ReadableString &) std::string_view DelIRCCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Removes a player from the in-game moderator list. Syntax: del <player>"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Removes a player from the in-game moderator list. Syntax: del <player>");
return defaultHelp; return defaultHelp;
@ -793,7 +793,7 @@ void ForceAuthIRCCommand::create()
this->setAccessLevel(4); this->setAccessLevel(4);
} }
void ForceAuthIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &channel, const Jupiter::ReadableString &nick, const Jupiter::ReadableString &parameters) void ForceAuthIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view parameters)
{ {
if (!parameters.empty()) if (!parameters.empty())
{ {
@ -843,7 +843,7 @@ void ForceAuthIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString
this->trigger(source, channel, nick, nick); this->trigger(source, channel, nick, nick);
} }
const Jupiter::ReadableString &ForceAuthIRCCommand::getHelp(const Jupiter::ReadableString &) std::string_view ForceAuthIRCCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Forcefully authenticates a player in-game. Syntax: auth [player=you]"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Forcefully authenticates a player in-game. Syntax: auth [player=you]");
return defaultHelp; return defaultHelp;
@ -859,7 +859,7 @@ void ModListIRCCommand::create()
this->addTrigger("mlist"_jrs); this->addTrigger("mlist"_jrs);
} }
void ModListIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &channel, const Jupiter::ReadableString &nick, const Jupiter::ReadableString &parameters) void ModListIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view parameters)
{ {
Jupiter::String msg; Jupiter::String msg;
size_t msgBaseSize; size_t msgBaseSize;
@ -889,7 +889,7 @@ void ModListIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &
source->sendMessage(channel, "There are no configured moderators."_jrs); source->sendMessage(channel, "There are no configured moderators."_jrs);
} }
const Jupiter::ReadableString &ModListIRCCommand::getHelp(const Jupiter::ReadableString &) std::string_view ModListIRCCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Displays the moderator list. Syntax: modlist"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Displays the moderator list. Syntax: modlist");
return defaultHelp; return defaultHelp;
@ -907,7 +907,7 @@ void AuthGameCommand::create()
this->setAccessLevel(3); this->setAccessLevel(3);
} }
void AuthGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, const Jupiter::ReadableString &parameters) void AuthGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, std::string_view parameters)
{ {
if (!parameters.empty()) if (!parameters.empty())
{ {
@ -941,7 +941,7 @@ void AuthGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, co
source->sendMessage(*player, "Error: Too few parameters. Syntax: auth <player>"_jrs); source->sendMessage(*player, "Error: Too few parameters. Syntax: auth <player>"_jrs);
} }
const Jupiter::ReadableString &AuthGameCommand::getHelp(const Jupiter::ReadableString &) std::string_view AuthGameCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Authenticates a player. Syntax: auth <player>"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Authenticates a player. Syntax: auth <player>");
return defaultHelp; return defaultHelp;
@ -957,7 +957,7 @@ void ATMGameCommand::create()
this->setAccessLevel(3); this->setAccessLevel(3);
} }
void ATMGameCommand::trigger(RenX::Server *server, RenX::PlayerInfo *player, const Jupiter::ReadableString &parameters) { void ATMGameCommand::trigger(RenX::Server *server, RenX::PlayerInfo *player, std::string_view parameters) {
auto parameters_split = jessilib::word_split_once_view(std::string_view{parameters}, WHITESPACE_SV); auto parameters_split = jessilib::word_split_once_view(std::string_view{parameters}, WHITESPACE_SV);
if (!parameters_split.first.empty()) { if (!parameters_split.first.empty()) {
RenX::PlayerInfo *target; RenX::PlayerInfo *target;
@ -1002,7 +1002,7 @@ void ATMGameCommand::trigger(RenX::Server *server, RenX::PlayerInfo *player, con
server->sendMessage(*player, "Error: Too few parameters. Syntax: auth <player>"_jrs); server->sendMessage(*player, "Error: Too few parameters. Syntax: auth <player>"_jrs);
} }
const Jupiter::ReadableString &ATMGameCommand::getHelp(const Jupiter::ReadableString &) std::string_view ATMGameCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Temporarily authenticates a player. Syntax: atm [level] <player>"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Temporarily authenticates a player. Syntax: atm [level] <player>");
return defaultHelp; return defaultHelp;
@ -1019,7 +1019,7 @@ void ForceAuthGameCommand::create()
this->setAccessLevel(4); this->setAccessLevel(4);
} }
void ForceAuthGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, const Jupiter::ReadableString &parameters) void ForceAuthGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, std::string_view parameters)
{ {
if (!parameters.empty()) if (!parameters.empty())
{ {
@ -1052,7 +1052,7 @@ void ForceAuthGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *playe
source->sendMessage(*player, "Error: Too few parameters. Syntax: fauth <player>"_jrs); source->sendMessage(*player, "Error: Too few parameters. Syntax: fauth <player>"_jrs);
} }
const Jupiter::ReadableString &ForceAuthGameCommand::getHelp(const Jupiter::ReadableString &) std::string_view ForceAuthGameCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Forcefully authenticates a player. Syntax: fauth <player>"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Forcefully authenticates a player. Syntax: fauth <player>");
return defaultHelp; return defaultHelp;

5
src/Plugins/RenX/RenX.Relay/RenX_Relay.cpp

@ -279,7 +279,7 @@ std::string to_hex(T in_integer) {
return result; return result;
} }
void RenX_RelayPlugin::RenX_OnRaw(RenX::Server &server, const Jupiter::ReadableString &line) { void RenX_RelayPlugin::RenX_OnRaw(RenX::Server &server, std::string_view line) {
// Not parsing any escape sequences, so data gets sent upstream exactly as it's received here. Copy tokens where needed to process escape sequences. // Not parsing any escape sequences, so data gets sent upstream exactly as it's received here. Copy tokens where needed to process escape sequences.
auto tokens = jessilib::split(std::string_view{line}, RenX::DelimC); auto tokens = jessilib::split(std::string_view{line}, RenX::DelimC);
@ -627,8 +627,7 @@ int RenX_RelayPlugin::send_downstream(RenX::Server& in_server, std::string_view
} }
} }
// TODO: add a string_view constructor for ReferenceString, also add sendData(string_view) variant return in_server.sendData(in_message);
return in_server.sendData(Jupiter::ReferenceString{ in_message.data(), in_message.size() });
} }
void RenX_RelayPlugin::upstream_connected(RenX::Server& in_server, upstream_server_info& in_server_info) { void RenX_RelayPlugin::upstream_connected(RenX::Server& in_server, upstream_server_info& in_server_info) {

2
src/Plugins/RenX/RenX.Relay/RenX_Relay.h

@ -25,7 +25,7 @@ public: // Jupiter::Plugin
public: // RenX::Plugin public: // RenX::Plugin
void RenX_OnServerFullyConnected(RenX::Server &server) override; void RenX_OnServerFullyConnected(RenX::Server &server) override;
void RenX_OnServerDisconnect(RenX::Server &server, RenX::DisconnectReason reason) override; void RenX_OnServerDisconnect(RenX::Server &server, RenX::DisconnectReason reason) override;
void RenX_OnRaw(RenX::Server &server, const Jupiter::ReadableString &raw) override; void RenX_OnRaw(RenX::Server &server, std::string_view raw) override;
private: private:
using fake_command_handler = std::function<bool(std::string_view in_command_line, RenX::Server& in_server, std::vector<std::string>& out_response)>; using fake_command_handler = std::function<bool(std::string_view in_command_line, RenX::Server& in_server, std::vector<std::string>& out_response)>;

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

@ -32,8 +32,8 @@ using namespace std::literals;
static STRING_LITERAL_AS_NAMED_REFERENCE(CONTENT_TYPE_APPLICATION_JSON, "application/json"); static STRING_LITERAL_AS_NAMED_REFERENCE(CONTENT_TYPE_APPLICATION_JSON, "application/json");
const Jupiter::ReferenceString server_list_game_header = "<html><body>"_jrs; constexpr std::string_view server_list_game_header = "<html><body>"sv;
const Jupiter::ReferenceString server_list_game_footer = "\n</body></html>"_jrs; constexpr std::string_view server_list_game_footer = "\n</body></html>"sv;
// TODO: can probably replace with some of the jessilib stuff // TODO: can probably replace with some of the jessilib stuff
Jupiter::String jsonify(std::string_view in_str) { Jupiter::String jsonify(std::string_view in_str) {
@ -96,41 +96,41 @@ bool RenX_ServerListPlugin::initialize() {
// Server list page // Server list page
std::unique_ptr<Jupiter::HTTP::Server::Content> content = std::make_unique<Jupiter::HTTP::Server::Content>(m_server_list_page_name, handle_server_list_page); std::unique_ptr<Jupiter::HTTP::Server::Content> content = std::make_unique<Jupiter::HTTP::Server::Content>(m_server_list_page_name, handle_server_list_page);
content->language = &Jupiter::HTTP::Content::Language::ENGLISH; content->language = Jupiter::HTTP::Content::Language::ENGLISH;
content->type = &CONTENT_TYPE_APPLICATION_JSON; content->type = CONTENT_TYPE_APPLICATION_JSON;
content->charset = &Jupiter::HTTP::Content::Type::Text::Charset::UTF8; content->charset = Jupiter::HTTP::Content::Type::Text::Charset::UTF8;
content->free_result = false; content->free_result = false;
server.hook(m_web_hostname, m_web_path, std::move(content)); server.hook(m_web_hostname, m_web_path, std::move(content));
// Server list (long) page // Server list (long) page
content = std::make_unique<Jupiter::HTTP::Server::Content>(m_server_list_long_page_name, handle_server_list_long_page); content = std::make_unique<Jupiter::HTTP::Server::Content>(m_server_list_long_page_name, handle_server_list_long_page);
content->language = &Jupiter::HTTP::Content::Language::ENGLISH; content->language = Jupiter::HTTP::Content::Language::ENGLISH;
content->type = &CONTENT_TYPE_APPLICATION_JSON; content->type = CONTENT_TYPE_APPLICATION_JSON;
content->charset = &Jupiter::HTTP::Content::Type::Text::Charset::UTF8; content->charset = Jupiter::HTTP::Content::Type::Text::Charset::UTF8;
content->free_result = true; content->free_result = true;
server.hook(m_web_hostname, m_web_path, std::move(content)); server.hook(m_web_hostname, m_web_path, std::move(content));
// Server page (GUIDs) // Server page (GUIDs)
content = std::make_unique<Jupiter::HTTP::Server::Content>(m_server_page_name, handle_server_page); content = std::make_unique<Jupiter::HTTP::Server::Content>(m_server_page_name, handle_server_page);
content->language = &Jupiter::HTTP::Content::Language::ENGLISH; content->language = Jupiter::HTTP::Content::Language::ENGLISH;
content->type = &CONTENT_TYPE_APPLICATION_JSON; content->type = CONTENT_TYPE_APPLICATION_JSON;
content->charset = &Jupiter::HTTP::Content::Type::Text::Charset::UTF8; content->charset = Jupiter::HTTP::Content::Type::Text::Charset::UTF8;
content->free_result = true; content->free_result = true;
server.hook(m_web_hostname, m_web_path, std::move(content)); server.hook(m_web_hostname, m_web_path, std::move(content));
// Metadata page // Metadata page
content = std::make_unique<Jupiter::HTTP::Server::Content>(m_metadata_page_name, handle_metadata_page); content = std::make_unique<Jupiter::HTTP::Server::Content>(m_metadata_page_name, handle_metadata_page);
content->language = &Jupiter::HTTP::Content::Language::ENGLISH; content->language = Jupiter::HTTP::Content::Language::ENGLISH;
content->type = &CONTENT_TYPE_APPLICATION_JSON; content->type = CONTENT_TYPE_APPLICATION_JSON;
content->charset = &Jupiter::HTTP::Content::Type::Text::Charset::UTF8; content->charset = Jupiter::HTTP::Content::Type::Text::Charset::UTF8;
content->free_result = false; content->free_result = false;
server.hook(m_web_hostname, m_web_path, std::move(content)); server.hook(m_web_hostname, m_web_path, std::move(content));
// Metadata page // Metadata page
content = std::make_unique<Jupiter::HTTP::Server::Content>(m_metadata_prometheus_page_name, handle_metadata_prometheus_page); content = std::make_unique<Jupiter::HTTP::Server::Content>(m_metadata_prometheus_page_name, handle_metadata_prometheus_page);
content->language = &Jupiter::HTTP::Content::Language::ENGLISH; content->language = Jupiter::HTTP::Content::Language::ENGLISH;
content->type = &CONTENT_TYPE_APPLICATION_JSON; content->type = CONTENT_TYPE_APPLICATION_JSON;
content->charset = &Jupiter::HTTP::Content::Type::Text::Charset::UTF8; content->charset = Jupiter::HTTP::Content::Type::Text::Charset::UTF8;
content->free_result = false; content->free_result = false;
server.hook(m_web_hostname, m_web_path, std::move(content)); server.hook(m_web_hostname, m_web_path, std::move(content));
@ -612,7 +612,7 @@ void RenX_ServerListPlugin::RenX_OnPart(RenX::Server &server, const RenX::Player
} }
} }
void RenX_ServerListPlugin::RenX_OnMapLoad(RenX::Server &server, const Jupiter::ReadableString &map) { void RenX_ServerListPlugin::RenX_OnMapLoad(RenX::Server &server, std::string_view map) {
markDetailsStale(server); markDetailsStale(server);
this->updateServerList(); this->updateServerList();
} }

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

@ -58,7 +58,7 @@ public: // RenX::Plugin
void RenX_OnServerDisconnect(RenX::Server &server, RenX::DisconnectReason reason) override; void RenX_OnServerDisconnect(RenX::Server &server, RenX::DisconnectReason reason) override;
void RenX_OnJoin(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnJoin(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnPart(RenX::Server &server, const RenX::PlayerInfo &player) override; void RenX_OnPart(RenX::Server &server, const RenX::PlayerInfo &player) override;
void RenX_OnMapLoad(RenX::Server &server, const Jupiter::ReadableString &map) override; void RenX_OnMapLoad(RenX::Server &server, std::string_view map) override;
private: private:
std::string m_server_list_json, m_metadata_json, m_metadata_prometheus; std::string m_server_list_json, m_metadata_json, m_metadata_prometheus;

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

@ -41,7 +41,7 @@ void ViewJoinGameCommand::create() {
this->addTrigger("vjoin"_jrs); this->addTrigger("vjoin"_jrs);
} }
void ViewJoinGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, const Jupiter::ReadableString &parameters) { void ViewJoinGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, std::string_view parameters) {
if (!player->uuid.empty()) { if (!player->uuid.empty()) {
std::string_view setjoin = pluginInstance.setjoin_file.get(player->uuid); std::string_view setjoin = pluginInstance.setjoin_file.get(player->uuid);
@ -54,7 +54,7 @@ void ViewJoinGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player
source->sendMessage(*player, "Error: A setjoin message requires steam."_jrs); source->sendMessage(*player, "Error: A setjoin message requires steam."_jrs);
} }
const Jupiter::ReadableString &ViewJoinGameCommand::getHelp(const Jupiter::ReadableString &) { std::string_view ViewJoinGameCommand::getHelp(std::string_view ) {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Displays your join message. Syntax: viewjoin"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Displays your join message. Syntax: viewjoin");
return defaultHelp; return defaultHelp;
} }
@ -68,7 +68,7 @@ void ShowJoinGameCommand::create() {
this->addTrigger("shjoin"_jrs); this->addTrigger("shjoin"_jrs);
} }
void ShowJoinGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, const Jupiter::ReadableString &parameters) { void ShowJoinGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, std::string_view parameters) {
if (!player->uuid.empty()) { if (!player->uuid.empty()) {
std::string_view setjoin = pluginInstance.setjoin_file.get(player->uuid); std::string_view setjoin = pluginInstance.setjoin_file.get(player->uuid);
@ -81,7 +81,7 @@ void ShowJoinGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player
source->sendMessage(*player, "Error: A setjoin message requires steam."_jrs); source->sendMessage(*player, "Error: A setjoin message requires steam."_jrs);
} }
const Jupiter::ReadableString &ShowJoinGameCommand::getHelp(const Jupiter::ReadableString &) { std::string_view ShowJoinGameCommand::getHelp(std::string_view ) {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Displays your join message. Syntax: showjoin"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Displays your join message. Syntax: showjoin");
return defaultHelp; return defaultHelp;
} }
@ -98,7 +98,7 @@ void DelJoinGameCommand::create()
this->addTrigger("rjoin"_jrs); this->addTrigger("rjoin"_jrs);
} }
void DelJoinGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, const Jupiter::ReadableString &) { void DelJoinGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, std::string_view ) {
if (!player->uuid.empty()) { if (!player->uuid.empty()) {
if (pluginInstance.setjoin_file.remove(player->uuid)) 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, Jupiter::StringS::Format("%.*s, your join message has been removed.", player->name.size(), player->name.data()));
@ -109,7 +109,7 @@ void DelJoinGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player,
source->sendMessage(*player, "Error: A setjoin message requires steam."_jrs); source->sendMessage(*player, "Error: A setjoin message requires steam."_jrs);
} }
const Jupiter::ReadableString &DelJoinGameCommand::getHelp(const Jupiter::ReadableString &) { std::string_view DelJoinGameCommand::getHelp(std::string_view ) {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Removes your automatic join message. Syntax: deljoin"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Removes your automatic join message. Syntax: deljoin");
return defaultHelp; return defaultHelp;
} }
@ -123,7 +123,7 @@ void SetJoinGameCommand::create() {
this->addTrigger("sjoin"_jrs); this->addTrigger("sjoin"_jrs);
} }
void SetJoinGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, const Jupiter::ReadableString &parameters) { void SetJoinGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, std::string_view parameters) {
if (!player->uuid.empty()) { if (!player->uuid.empty()) {
if (!parameters.empty()) { if (!parameters.empty()) {
pluginInstance.setjoin_file.set(player->uuid, static_cast<std::string>(parameters)); pluginInstance.setjoin_file.set(player->uuid, static_cast<std::string>(parameters));
@ -136,7 +136,7 @@ void SetJoinGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player,
else source->sendMessage(*player, "Error: A setjoin message requires steam."_jrs); else source->sendMessage(*player, "Error: A setjoin message requires steam."_jrs);
} }
const Jupiter::ReadableString &SetJoinGameCommand::getHelp(const Jupiter::ReadableString &) { std::string_view SetJoinGameCommand::getHelp(std::string_view ) {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Sets an automatic join message. Syntax: setjoin [message]"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Sets an automatic join message. Syntax: setjoin [message]");
return defaultHelp; return defaultHelp;
} }

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

@ -48,7 +48,7 @@ void WarnIRCCommand::create() {
this->setAccessLevel(2); this->setAccessLevel(2);
} }
void WarnIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &channel, const Jupiter::ReadableString &nick, const Jupiter::ReadableString &parameters) { void WarnIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view parameters) {
auto parameters_split = jessilib::word_split_once_view(std::string_view{parameters}, WHITESPACE_SV); auto parameters_split = jessilib::word_split_once_view(std::string_view{parameters}, WHITESPACE_SV);
if (parameters_split.second.empty()) { if (parameters_split.second.empty()) {
source->sendNotice(nick, "Error: Too Few Parameters. Syntax: Warn <Player> <Reason>"_jrs); source->sendNotice(nick, "Error: Too Few Parameters. Syntax: Warn <Player> <Reason>"_jrs);
@ -98,7 +98,7 @@ void WarnIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &cha
} }
} }
const Jupiter::ReadableString &WarnIRCCommand::getHelp(const Jupiter::ReadableString &) { std::string_view WarnIRCCommand::getHelp(std::string_view ) {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Warns a player. Syntax: Warn <Player> <Reason>"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Warns a player. Syntax: Warn <Player> <Reason>");
return defaultHelp; return defaultHelp;
} }
@ -114,9 +114,8 @@ void PardonIRCCommand::create() {
this->setAccessLevel(2); this->setAccessLevel(2);
} }
void PardonIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &channel, const Jupiter::ReadableString &nick, const Jupiter::ReadableString &parameters) { void PardonIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view parameters) {
if (parameters.empty()) { if (parameters.empty()) {
// TODO: this doesn't make sense
this->trigger(source, channel, nick, nick); this->trigger(source, channel, nick, nick);
return; return;
} }
@ -146,7 +145,7 @@ void PardonIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &c
} }
} }
const Jupiter::ReadableString &PardonIRCCommand::getHelp(const Jupiter::ReadableString &) { std::string_view PardonIRCCommand::getHelp(std::string_view ) {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Resets a player's warnings. Syntax: Pardon <Player>"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Resets a player's warnings. Syntax: Pardon <Player>");
return defaultHelp; return defaultHelp;
} }
@ -161,7 +160,7 @@ void WarnGameCommand::create() {
this->setAccessLevel(1); this->setAccessLevel(1);
} }
void WarnGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, const Jupiter::ReadableString &parameters) { void WarnGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, std::string_view parameters) {
auto parameters_split = jessilib::word_split_once_view(std::string_view{parameters}, WHITESPACE_SV); auto parameters_split = jessilib::word_split_once_view(std::string_view{parameters}, WHITESPACE_SV);
if (!parameters_split.second.empty()) { if (!parameters_split.second.empty()) {
std::string_view name = parameters_split.first; std::string_view name = parameters_split.first;
@ -194,7 +193,7 @@ void WarnGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, co
source->sendMessage(*player, "Error: Too few parameters. Syntax: Warn <Player> <Reason>"_jrs); source->sendMessage(*player, "Error: Too few parameters. Syntax: Warn <Player> <Reason>"_jrs);
} }
const Jupiter::ReadableString &WarnGameCommand::getHelp(const Jupiter::ReadableString &) { std::string_view WarnGameCommand::getHelp(std::string_view ) {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Warns a player. Syntax: Warn <Player> <Reason>"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Warns a player. Syntax: Warn <Player> <Reason>");
return defaultHelp; return defaultHelp;
} }
@ -210,7 +209,7 @@ void PardonGameCommand::create() {
this->setAccessLevel(1); this->setAccessLevel(1);
} }
void PardonGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, const Jupiter::ReadableString &parameters) { void PardonGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, std::string_view parameters) {
if (!parameters.empty()) { if (!parameters.empty()) {
RenX::PlayerInfo *target = source->getPlayerByPartName(parameters); RenX::PlayerInfo *target = source->getPlayerByPartName(parameters);
if (target != nullptr) { if (target != nullptr) {
@ -220,11 +219,11 @@ void PardonGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player,
} }
} }
else { else {
this->trigger(source, player, Jupiter::ReferenceString{player->name}); this->trigger(source, player, player->name);
} }
} }
const Jupiter::ReadableString &PardonGameCommand::getHelp(const Jupiter::ReadableString &) { std::string_view PardonGameCommand::getHelp(std::string_view ) {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Resets a player's warnings. Syntax: Pardon <Player>"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Resets a player's warnings. Syntax: Pardon <Player>");
return defaultHelp; return defaultHelp;
} }

14
src/Plugins/SetJoin/SetJoin.cpp

@ -41,7 +41,7 @@ void SetJoinIRCCommand::create()
this->addTrigger("setJoin"_jrs); this->addTrigger("setJoin"_jrs);
} }
void SetJoinIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &channel, const Jupiter::ReadableString &nick, const Jupiter::ReadableString &parameters) void SetJoinIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view parameters)
{ {
if (!parameters.empty()) if (!parameters.empty())
{ {
@ -52,7 +52,7 @@ void SetJoinIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &
else source->sendMessage(channel, "Too few parameters! Syntax: setjoin <message>"_jrs); else source->sendMessage(channel, "Too few parameters! Syntax: setjoin <message>"_jrs);
} }
const Jupiter::ReadableString &SetJoinIRCCommand::getHelp(const Jupiter::ReadableString &) std::string_view SetJoinIRCCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Sets your join message. Syntax: setjoin <message>"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Sets your join message. Syntax: setjoin <message>");
return defaultHelp; return defaultHelp;
@ -68,9 +68,9 @@ void ViewJoinIRCCommand::create()
this->addTrigger("vJoin"_jrs); this->addTrigger("vJoin"_jrs);
} }
void ViewJoinIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &channel, const Jupiter::ReadableString &nick, const Jupiter::ReadableString &parameters) void ViewJoinIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view parameters)
{ {
const Jupiter::ReadableString &target = parameters.empty() ? nick : parameters; std::string_view target = parameters.empty() ? nick : parameters;
std::string_view setjoin = pluginInstance.setjoin_file[source->getConfigSection()].get(target); std::string_view setjoin = pluginInstance.setjoin_file[source->getConfigSection()].get(target);
if (setjoin.empty()) if (setjoin.empty())
@ -81,7 +81,7 @@ void ViewJoinIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString
target.data(), setjoin.size(), setjoin.data())); target.data(), setjoin.size(), setjoin.data()));
} }
const Jupiter::ReadableString &ViewJoinIRCCommand::getHelp(const Jupiter::ReadableString &) std::string_view ViewJoinIRCCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Views a user's join message. Syntax: viewjoin [user=you]"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Views a user's join message. Syntax: viewjoin [user=you]");
return defaultHelp; return defaultHelp;
@ -97,14 +97,14 @@ void DelJoinIRCCommand::create()
this->addTrigger("dJoin"_jrs); this->addTrigger("dJoin"_jrs);
} }
void DelJoinIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &channel, const Jupiter::ReadableString &nick, const Jupiter::ReadableString &parameters) void DelJoinIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std::string_view nick, std::string_view parameters)
{ {
if (pluginInstance.setjoin_file[source->getConfigSection()].remove(nick)) if (pluginInstance.setjoin_file[source->getConfigSection()].remove(nick))
source->sendNotice(nick, "Your setjoin has been deleted successfully."_jrs); source->sendNotice(nick, "Your setjoin has been deleted successfully."_jrs);
else source->sendNotice(nick, "No setjoin was found to delete."_jrs); else source->sendNotice(nick, "No setjoin was found to delete."_jrs);
} }
const Jupiter::ReadableString &DelJoinIRCCommand::getHelp(const Jupiter::ReadableString &) std::string_view DelJoinIRCCommand::getHelp(std::string_view )
{ {
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Deletes your join message. Syntax: deljoin"); static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Deletes your join message. Syntax: deljoin");
return defaultHelp; return defaultHelp;

Loading…
Cancel
Save