Browse Source

Updated to support most of RCONv3; updated Jupiter; Map now tracked; Tags added for: RCON User, Server Name, Map; Internal tags are now generated at runtime, and guaranteed to be unique for up to 65k tags; Added events to RenX::Plugin: OnExecute (player), OnPlayer, OnHostChat, OnHostPage, OnOtherChat, OnDisarm, OnCapture, OnNeutralize, OnSteal, OnUnsubscribe, OnVoteCall, OnVoteOver, OnVoteCancel, OnVote, OnMapChange, OnMapLoad, OnMap, OnDemoRecord, OnDemo; various optimizations

pull/3/head
JustinAJ 10 years ago
parent
commit
1887317e97
  1. 2
      Jupiter
  2. BIN
      Release/Bot.lib
  3. BIN
      Release/Plugins/RenX.Core.lib
  4. 24
      RenX.Commands/RenX_Commands.cpp
  5. 14
      RenX.Core/RenX.h
  6. 87
      RenX.Core/RenX_Functions.cpp
  7. 1
      RenX.Core/RenX_Functions.h
  8. 2
      RenX.Core/RenX_PlayerInfo.h
  9. 118
      RenX.Core/RenX_Plugin.cpp
  10. 39
      RenX.Core/RenX_Plugin.h
  11. 1473
      RenX.Core/RenX_Server.cpp
  12. 41
      RenX.Core/RenX_Server.h
  13. 181
      RenX.Core/RenX_Tags.cpp
  14. 146
      RenX.Core/RenX_Tags.h
  15. 541
      RenX.Logging/RenX_Logging.cpp
  16. 77
      RenX.Logging/RenX_Logging.h
  17. 2
      RenX.Medals/RenX_Medals.cpp
  18. 2
      RenX.Medals/RenX_Medals.h

2
Jupiter

@ -1 +1 @@
Subproject commit 62099f36ae435456763be46ded5fc6f858ad709e
Subproject commit 46ce3548d245459aba3f0b14c7fd7fd8528a0c59

BIN
Release/Bot.lib

Binary file not shown.

BIN
Release/Plugins/RenX.Core.lib

Binary file not shown.

24
RenX.Commands/RenX_Commands.cpp

@ -1,5 +1,5 @@
/**
* Copyright (C) 2014 Justin James.
* Copyright (C) 2014-2015 Justin James.
*
* This license must be preserved.
* Any applications, libraries, or code which make any use of any
@ -170,15 +170,27 @@ void MsgIRCCommand::create()
void MsgIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &channel, const Jupiter::ReadableString &nick, const Jupiter::ReadableString &parameters)
{
if (parameters.isEmpty() == false)
{
Jupiter::StringL msg = "say ";
{
int type = source->getChannel(channel)->getType();
Jupiter::StringL msg;
char prefix = source->getChannel(channel)->getUserPrefix(nick);
if (prefix != '\0')
msg += prefix;
msg += nick;
msg += "@IRC: ";
msg += parameters;
if (RenX::getCore()->send(source->getChannel(channel)->getType(), msg) == 0)
prefix = '\0'; // Reusing prefix to check if a match is ever found.
for (unsigned int i = 0; i != RenX::getCore()->getServerCount(); i++)
{
RenX::Server *server = RenX::getCore()->getServer(i);
if (server->isLogChanType(type))
{
server->sendMessage(msg);
prefix = 1;
}
}
if (prefix == '\0')
source->sendMessage(channel, STRING_LITERAL_AS_REFERENCE("Error: Channel not attached to any connected Renegade X servers."));
}
else source->sendNotice(nick, STRING_LITERAL_AS_REFERENCE("Error: Too Few Parameters. Syntax: Msg <Message>"));
@ -1747,7 +1759,7 @@ void ModsGameCommand::create()
void ModsGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *, const Jupiter::ReadableString &)
{
RenX::PlayerInfo *player;
Jupiter::StringL msg = "say ";
Jupiter::StringL msg;
for (Jupiter::DLList<RenX::PlayerInfo>::Node *node = source->players.getNode(0); node != nullptr; node = node->next)
{
player = node->data;
@ -1767,7 +1779,7 @@ void ModsGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *, const Ju
msg.aformat("; please use \"%.*s%.*s\" if you require assistance.", source->getCommandPrefix().size(), source->getCommandPrefix().ptr(), cmd->getTrigger().size(), cmd->getTrigger().ptr());
else msg += '.';
}
source->send(msg);
source->sendMessage(msg);
}
const Jupiter::ReadableString &ModsGameCommand::getHelp(const Jupiter::ReadableString &)

14
RenX.Core/RenX.h

@ -1,5 +1,5 @@
/**
* Copyright (C) 2014 Justin James.
* Copyright (C) 2014-2015 Justin James.
*
* This license must be preserved.
* Any applications, libraries, or code which make any use of any
@ -39,7 +39,7 @@
namespace RenX
{
enum WinType
enum class WinType
{
Score,
Base,
@ -49,19 +49,21 @@ namespace RenX
Unknown
};
enum TeamType
enum class TeamType
{
GDI,
Nod,
Other
Other,
None
};
enum ObjectType
enum class ObjectType
{
Player,
Vehicle,
Building,
Defence
Defence,
None
};
}

87
RenX.Core/RenX_Functions.cpp

@ -61,6 +61,17 @@ Jupiter::ReferenceString tieWinTypePlainTranslation = "Tie";
Jupiter::ReferenceString shutdownWinTypePlainTranslation = "Shutdown";
Jupiter::ReferenceString unknownWinTypePlainTranslation = "Unknown";
/** Vote translations */
Jupiter::ReferenceString translated_VoteMenuChoice_AddBots = STRING_LITERAL_AS_REFERENCE("Add Bots");
Jupiter::ReferenceString translated_VoteMenuChoice_ChangeMap = STRING_LITERAL_AS_REFERENCE("Change Map");
Jupiter::ReferenceString translated_VoteMenuChoice_Donate = STRING_LITERAL_AS_REFERENCE("Donate");
Jupiter::ReferenceString translated_VoteMenuChoice_Kick = STRING_LITERAL_AS_REFERENCE("Kick");
Jupiter::ReferenceString translated_VoteMenuChoice_RemoveBots = STRING_LITERAL_AS_REFERENCE("Remove Bots");
Jupiter::ReferenceString translated_VoteMenuChoice_RestartMatch = STRING_LITERAL_AS_REFERENCE("Restart Match");
Jupiter::ReferenceString translated_VoteMenuChoice_StartMatch = STRING_LITERAL_AS_REFERENCE("Start Match");
Jupiter::ReferenceString translated_VoteMenuChoice_Survey = STRING_LITERAL_AS_REFERENCE("Survey");
/** Object / damage type translations */
/** Nod Vehicles */
@ -203,8 +214,6 @@ Jupiter::ReferenceString translated_DmgType_RocketEmpl_Missile = STRING_LITERAL_
Jupiter::ReferenceString translated_DmgType_Nuke = STRING_LITERAL_AS_REFERENCE("Nuclear Missile Strike");
Jupiter::ReferenceString translated_DmgType_IonCannon = STRING_LITERAL_AS_REFERENCE("Ion Cannon Strike");
// Vehicles copied from above.
/** Nod Vehicles */
Jupiter::ReferenceString translated_DmgType_Harvester_Nod = STRING_LITERAL_AS_REFERENCE("Nod Harvester");
Jupiter::ReferenceString translated_DmgType_Buggy = STRING_LITERAL_AS_REFERENCE("Buggy");
@ -273,12 +282,12 @@ RenX::TeamType RenX::getTeam(char team)
{
case 'g':
case 'G':
return GDI;
return RenX::TeamType::GDI;
case 'n':
case 'N':
return Nod;
return RenX::TeamType::Nod;
default:
return Other;
return RenX::TeamType::Other;
}
}
@ -286,9 +295,9 @@ const Jupiter::ReadableString &RenX::getTeamColor(TeamType team)
{
switch (team)
{
case GDI:
case RenX::TeamType::GDI:
return GDIColor;
case Nod:
case RenX::TeamType::Nod:
return NodColor;
default:
return OtherColor;
@ -299,9 +308,9 @@ const Jupiter::ReadableString &RenX::getTeamName(TeamType team)
{
switch (team)
{
case GDI:
case RenX::TeamType::GDI:
return GDIShortName;
case Nod:
case RenX::TeamType::Nod:
return NodShortName;
default:
return OtherShortName;
@ -312,9 +321,9 @@ const Jupiter::ReadableString &RenX::getFullTeamName(TeamType team)
{
switch (team)
{
case GDI:
case RenX::TeamType::GDI:
return GDILongName;
case Nod:
case RenX::TeamType::Nod:
return NodLongName;
default:
return OtherLongName;
@ -325,12 +334,12 @@ RenX::TeamType RenX::getEnemy(TeamType team)
{
switch (team)
{
case GDI:
return Nod;
case Nod:
return GDI;
case RenX::TeamType::GDI:
return RenX::TeamType::Nod;
case RenX::TeamType::Nod:
return RenX::TeamType::GDI;
default:
return Other;
return RenX::TeamType::Other;
}
}
@ -608,6 +617,18 @@ const Jupiter::ReadableString &RenX::translateName(const Jupiter::ReadableString
if (object.equals(STRING_LITERAL_AS_REFERENCE("VehicleExplosion"))) return translated_UTDmgType_VehicleExplosion;
if (object.equals(STRING_LITERAL_AS_REFERENCE("Drowned"))) return translated_UTDmgType_Drowned;
}
else if (object.find(STRING_LITERAL_AS_REFERENCE("VoteMenuChoice_")) == 0)
{
object.shiftRight(15);
if (object.equals(STRING_LITERAL_AS_REFERENCE("AddBots"))) return translated_VoteMenuChoice_AddBots;
if (object.equals(STRING_LITERAL_AS_REFERENCE("ChangeMap"))) return translated_VoteMenuChoice_ChangeMap;
if (object.equals(STRING_LITERAL_AS_REFERENCE("Donate"))) return translated_VoteMenuChoice_Donate;
if (object.equals(STRING_LITERAL_AS_REFERENCE("Kick"))) return translated_VoteMenuChoice_Kick;
if (object.equals(STRING_LITERAL_AS_REFERENCE("RemoveBots"))) return translated_VoteMenuChoice_RemoveBots;
if (object.equals(STRING_LITERAL_AS_REFERENCE("RestartMatch"))) return translated_VoteMenuChoice_RestartMatch;
if (object.equals(STRING_LITERAL_AS_REFERENCE("StartMatch"))) return translated_VoteMenuChoice_StartMatch;
if (object.equals(STRING_LITERAL_AS_REFERENCE("Survey"))) return translated_VoteMenuChoice_Survey;
}
else if (object.equals(STRING_LITERAL_AS_REFERENCE("IonCannonBeacon"))) return translated_IonCannonBeacon;
else if (object.equals(STRING_LITERAL_AS_REFERENCE("NukeBeacon"))) return translated_NukeBeacon;
else if (object.equals(STRING_LITERAL_AS_REFERENCE("KillZDamageType"))) return translated_KillZDamageType;
@ -618,17 +639,17 @@ const Jupiter::ReadableString &RenX::translateWinType(RenX::WinType winType)
{
switch (winType)
{
case Score:
case RenX::WinType::Score:
return scoreWinTypeTranslation;
case Base:
case RenX::WinType::Base:
return baseWinTypeTranslation;
case Beacon:
case RenX::WinType::Beacon:
return beaconWinTypeTranslation;
case Tie:
case RenX::WinType::Tie:
return tieWinTypeTranslation;
case Shutdown:
case RenX::WinType::Shutdown:
return shutdownWinTypeTranslation;
case Unknown:
case RenX::WinType::Unknown:
default:
return unknownWinTypeTranslation;
}
@ -638,17 +659,17 @@ const Jupiter::ReadableString &RenX::translateWinTypePlain(RenX::WinType winType
{
switch (winType)
{
case Score:
case RenX::WinType::Score:
return scoreWinTypePlainTranslation;
case Base:
case RenX::WinType::Base:
return baseWinTypePlainTranslation;
case Beacon:
case RenX::WinType::Beacon:
return beaconWinTypePlainTranslation;
case Tie:
case RenX::WinType::Tie:
return tieWinTypePlainTranslation;
case Shutdown:
case RenX::WinType::Shutdown:
return shutdownWinTypePlainTranslation;
case Unknown:
case RenX::WinType::Unknown:
default:
return unknownWinTypePlainTranslation;
}
@ -710,6 +731,16 @@ void RenX::sanitizeString(char *str)
}
}
void RenX::sanitizeString(Jupiter::StringType &str)
{
if (str.isEmpty() == false)
{
str.replace('|', '/');
if (str.get(str.size() - 1) == '\\')
str.set(str.size() - 1, '/');
}
}
time_t RenX::getGameTime(const RenX::PlayerInfo *player)
{
time_t currentTime = time(0);

1
RenX.Core/RenX_Functions.h

@ -133,6 +133,7 @@ namespace RenX
* @brief str String to sanitize.
*/
RENX_API void sanitizeString(char *str);
RENX_API void sanitizeString(Jupiter::StringType &str);
/**
* @brief Calculates for how many seconds a player has been in-game.

2
RenX.Core/RenX_PlayerInfo.h

@ -50,7 +50,7 @@ namespace RenX
Jupiter::StringS vehicle;
uint64_t steamid = 0;
uint32_t ip32 = 0;
TeamType team = Other;
TeamType team = TeamType::Other;
int id = 0;
bool isBot = false;
time_t joinTime = 0;

118
RenX.Core/RenX_Plugin.cpp

@ -75,7 +75,17 @@ void RenX::Plugin::RenX_OnNameChange(Server *, const PlayerInfo *, const Jupiter
return;
}
void RenX::Plugin::RenX_OnTeamChange(Server *, const PlayerInfo *)
void RenX::Plugin::RenX_OnTeamChange(Server *, const PlayerInfo *, const TeamType &)
{
return;
}
void RenX::Plugin::RenX_OnExecute(Server *, const PlayerInfo *, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnPlayer(Server *, const Jupiter::ReadableString &)
{
return;
}
@ -90,11 +100,31 @@ void RenX::Plugin::RenX_OnTeamChat(Server *, const RenX::PlayerInfo *, const Jup
return;
}
void RenX::Plugin::RenX_OnHostChat(Server *, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnHostPage(Server *, const RenX::PlayerInfo *, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnOtherChat(Server *, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnDeploy(Server *, const RenX::PlayerInfo *, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnDisarm(Server *, const RenX::PlayerInfo *, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnSuicide(Server *, const RenX::PlayerInfo *, const Jupiter::ReadableString &)
{
return;
@ -105,7 +135,7 @@ void RenX::Plugin::RenX_OnKill(Server *, const RenX::PlayerInfo *, const RenX::P
return;
}
void RenX::Plugin::RenX_OnKill(Server *, const Jupiter::ReadableString &, TeamType, const RenX::PlayerInfo *, const Jupiter::ReadableString &)
void RenX::Plugin::RenX_OnKill(Server *, const Jupiter::ReadableString &, const TeamType &, const RenX::PlayerInfo *, const Jupiter::ReadableString &)
{
return;
}
@ -115,7 +145,7 @@ void RenX::Plugin::RenX_OnDie(Server *, const RenX::PlayerInfo *, const Jupiter:
return;
}
void RenX::Plugin::RenX_OnDie(Server *, const Jupiter::ReadableString &, TeamType, const Jupiter::ReadableString &)
void RenX::Plugin::RenX_OnDie(Server *, const Jupiter::ReadableString &, const TeamType &, const Jupiter::ReadableString &)
{
return;
}
@ -125,12 +155,32 @@ void RenX::Plugin::RenX_OnDestroy(Server *, const RenX::PlayerInfo *, const Jupi
return;
}
void RenX::Plugin::RenX_OnDestroy(Server *, const Jupiter::ReadableString &, TeamType, const Jupiter::ReadableString &, TeamType, const Jupiter::ReadableString &, ObjectType)
void RenX::Plugin::RenX_OnDestroy(Server *, const Jupiter::ReadableString &, const TeamType &, const Jupiter::ReadableString &, const TeamType &, const Jupiter::ReadableString &, ObjectType)
{
return;
}
void RenX::Plugin::RenX_OnCapture(Server *, const PlayerInfo *, const Jupiter::ReadableString &, const TeamType &)
{
return;
}
void RenX::Plugin::RenX_OnGameOver(Server *, RenX::WinType, TeamType, int, int)
void RenX::Plugin::RenX_OnNeutralize(Server *, const PlayerInfo *, const Jupiter::ReadableString &, const TeamType &)
{
return;
}
void RenX::Plugin::RenX_OnSteal(Server *, const PlayerInfo *, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnSteal(Server *, const PlayerInfo *, const Jupiter::ReadableString &, const PlayerInfo *)
{
return;
}
void RenX::Plugin::RenX_OnGameOver(Server *, RenX::WinType, const TeamType &, int, int)
{
return;
}
@ -150,6 +200,11 @@ void RenX::Plugin::RenX_OnSubscribe(Server *, const Jupiter::ReadableString &)
return;
}
void RenX::Plugin::RenX_OnUnsubscribe(Server *, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnRCON(Server *, const Jupiter::ReadableString &)
{
return;
@ -175,6 +230,57 @@ void RenX::Plugin::RenX_OnAdmin(Server *, const Jupiter::ReadableString &)
return;
}
void RenX::Plugin::RenX_OnVoteCall(Server *, const TeamType &, const Jupiter::ReadableString &, const PlayerInfo *, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnVoteOver(Server *server, const TeamType &, const Jupiter::ReadableString &, bool, int, int)
{
return;
}
void RenX::Plugin::RenX_OnVoteCancel(Server *, const TeamType &, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnVote(Server *, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnMapChange(Server *, const Jupiter::ReadableString &, bool)
{
return;
}
void RenX::Plugin::RenX_OnMapLoad(Server *, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnMap(Server *, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnDemoRecord(Server *server, const PlayerInfo *)
{
return;
}
void RenX::Plugin::RenX_OnDemoRecord(Server *server, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnDemo(Server *server, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnLog(Server *, const Jupiter::ReadableString &)
{
return;
@ -200,7 +306,7 @@ void RenX::Plugin::RenX_OnSpawnVehicle(Server *, const PlayerInfo *, const Jupit
return;
}
void RenX::Plugin::RenX_OnSpawnVehicleNoOwner(Server *, const TeamType, const Jupiter::ReadableString &)
void RenX::Plugin::RenX_OnSpawnVehicleNoOwner(Server *, const TeamType &, const Jupiter::ReadableString &)
{
return;
}

39
RenX.Core/RenX_Plugin.h

@ -51,27 +51,38 @@ namespace RenX
virtual void RenX_OnJoin(Server *server, const PlayerInfo *player);
virtual void RenX_OnPart(Server *server, const PlayerInfo *player);
virtual void RenX_OnNameChange(Server *server, const PlayerInfo *player, const Jupiter::ReadableString &newPlayerName);
virtual void RenX_OnTeamChange(Server *server, const PlayerInfo *player);
virtual void RenX_OnTeamChange(Server *server, const PlayerInfo *player, const TeamType &oldTeam);
virtual void RenX_OnExecute(Server *server, const PlayerInfo *player, const Jupiter::ReadableString &command);
virtual void RenX_OnPlayer(Server *server, const Jupiter::ReadableString &raw);
/** Chat type logs */
virtual void RenX_OnChat(Server *server, const PlayerInfo *player, const Jupiter::ReadableString &message);
virtual void RenX_OnTeamChat(Server *server, const PlayerInfo *player, const Jupiter::ReadableString &message);
virtual void RenX_OnHostChat(Server *server, const Jupiter::ReadableString &message);
virtual void RenX_OnHostPage(Server *server, const PlayerInfo *player, const Jupiter::ReadableString &message);
virtual void RenX_OnOtherChat(Server *server, const Jupiter::ReadableString &raw);
/** Game type logs */
virtual void RenX_OnDeploy(Server *server, const PlayerInfo *player, const Jupiter::ReadableString &object);
virtual void RenX_OnDisarm(Server *server, const PlayerInfo *player, const Jupiter::ReadableString &object);
virtual void RenX_OnSuicide(Server *server, const PlayerInfo *player, const Jupiter::ReadableString &damageType);
virtual void RenX_OnKill(Server *server, const PlayerInfo *player, const PlayerInfo *victim, const Jupiter::ReadableString &damageType);
virtual void RenX_OnKill(Server *server, const Jupiter::ReadableString &killer, TeamType killerTeam, const PlayerInfo *victim, const Jupiter::ReadableString &damageType);
virtual void RenX_OnKill(Server *server, const Jupiter::ReadableString &killer, const TeamType &killerTeam, const PlayerInfo *victim, const Jupiter::ReadableString &damageType);
virtual void RenX_OnDie(Server *server, const PlayerInfo *player, const Jupiter::ReadableString &damageType);
virtual void RenX_OnDie(Server *server, const Jupiter::ReadableString &object, TeamType objectTeam, const Jupiter::ReadableString &damageType);
virtual void RenX_OnDie(Server *server, const Jupiter::ReadableString &object, const TeamType &objectTeam, const Jupiter::ReadableString &damageType);
virtual void RenX_OnDestroy(Server *server, const PlayerInfo *player, const Jupiter::ReadableString &objectName, const Jupiter::ReadableString &damageType, ObjectType type);
virtual void RenX_OnDestroy(Server *server, const Jupiter::ReadableString &killer, TeamType killerTeam, const Jupiter::ReadableString &objectName, TeamType objectTeam, const Jupiter::ReadableString &damageType, ObjectType type);
virtual void RenX_OnGameOver(Server *server, WinType winType, TeamType team, int gScore, int nScore);
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_OnCapture(Server *server, const PlayerInfo *player, const Jupiter::ReadableString &building, const TeamType &oldTeam);
virtual void RenX_OnNeutralize(Server *server, const PlayerInfo *player, const Jupiter::ReadableString &building, const TeamType &oldTeam);
virtual void RenX_OnSteal(Server *server, const PlayerInfo *player, const Jupiter::ReadableString &vehicle);
virtual void RenX_OnSteal(Server *server, const PlayerInfo *player, const Jupiter::ReadableString &vehicle, const PlayerInfo *victim);
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);
/** RCON type logs */
virtual void RenX_OnExecute(Server *server, const Jupiter::ReadableString &user, const Jupiter::ReadableString &command);
virtual void RenX_OnSubscribe(Server *server, const Jupiter::ReadableString &user);
virtual void RenX_OnUnsubscribe(Server *server, const Jupiter::ReadableString &user);
virtual void RenX_OnRCON(Server *server, const Jupiter::ReadableString &raw);
/** Admin Type Logs */
@ -80,6 +91,22 @@ namespace RenX
virtual void RenX_OnAdminLogout(Server *server, const PlayerInfo *player);
virtual void RenX_OnAdmin(Server *server, const Jupiter::ReadableString &raw);
/** Vote Type Logs */
virtual void RenX_OnVoteCall(Server *server, const TeamType &team, const Jupiter::ReadableString &type, const PlayerInfo *player, const Jupiter::ReadableString &parameters);
virtual void RenX_OnVoteOver(Server *server, const TeamType &team, const Jupiter::ReadableString &type, bool success, int yesVotes, int noVotes);
virtual void RenX_OnVoteCancel(Server *server, const TeamType &team, const Jupiter::ReadableString &type);
virtual void RenX_OnVote(Server *server, const Jupiter::ReadableString &raw);
/** Map Type Logs */
virtual void RenX_OnMapChange(Server *server, const Jupiter::ReadableString &map, bool seamless);
virtual void RenX_OnMapLoad(Server *server, const Jupiter::ReadableString &map);
virtual void RenX_OnMap(Server *server, const Jupiter::ReadableString &raw);
/** Demo Type Logs */
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_OnDemo(Server *server, const Jupiter::ReadableString &raw);
/** Other Logs */
virtual void RenX_OnLog(Server *server, const Jupiter::ReadableString &raw);
@ -88,7 +115,7 @@ namespace RenX
virtual void RenX_OnGrantCharacter(Server *server, const PlayerInfo *player, const Jupiter::ReadableString &character);
virtual void RenX_OnGrantWeapon(Server *server, const PlayerInfo *player, const Jupiter::ReadableString &weapon);
virtual void RenX_OnSpawnVehicle(Server *server, const PlayerInfo *owner, const Jupiter::ReadableString &vehicle);
virtual void RenX_OnSpawnVehicleNoOwner(Server *server, const TeamType team, const Jupiter::ReadableString &vehicle);
virtual void RenX_OnSpawnVehicleNoOwner(Server *server, const TeamType &team, const Jupiter::ReadableString &vehicle);
virtual void RenX_OnMinePlace(Server *server, const PlayerInfo *player, const Jupiter::ReadableString &mine);
virtual void RenX_XOnOther(Server *server, const Jupiter::ReadableString &raw);

1473
RenX.Core/RenX_Server.cpp

File diff suppressed because it is too large

41
RenX.Core/RenX_Server.h

@ -278,6 +278,13 @@ namespace RenX
*/
bool removePlayer(RenX::PlayerInfo *player);
/**
* @brief Sends a client list request.
*
* @return True on success, false otherwise.
*/
bool updateClientList();
/**
* @brief Gives a player additional credits, if the server supports it.
*
@ -412,6 +419,27 @@ namespace RenX
*/
const Jupiter::ReadableString &getPassword() const;
/**
* @brief Fetches this connection's RCON user name.
*
* @return String containing the RCON user name.
*/
const Jupiter::ReadableString &getUser() const;
/**
* @brief Fetches the name of this server.
*
* @return String containing the server name.
*/
const Jupiter::ReadableString &getName() const;
/**
* @brief Fetches the current map.
*
* @return String containing the current map.
*/
const Jupiter::ReadableString &getMap() const;
/**
* @brief Fetches a command from the list.
*
@ -530,12 +558,19 @@ namespace RenX
unsigned int getVersion() const;
/**
* @brief Fetches the eXtended-RCON version number, or 0 or none has been set.
* @brief Fetches the eXtended-RCON version number, or 0 if none has been set.
*
* @return XRCON version number
*/
unsigned int getXVersion() const;
/**
* @brief Fetches the eXtended-RCON revision number, or 0 if none has been set.
*
* @return XRCON revision number
*/
unsigned int getXRevision() const;
/**
* @brief Fetches the game version string, or an empty string if none has been set.
*
@ -577,6 +612,7 @@ namespace RenX
bool firstAction = false;
unsigned int rconVersion = 0;
unsigned int xRconVersion = 0;
unsigned int xRconRevision = 0;
time_t lastAttempt = 0;
Jupiter::String lastLine;
Jupiter::StringS gameVersion;
@ -604,6 +640,9 @@ namespace RenX
Jupiter::StringS IRCPrefix;
Jupiter::StringS CommandPrefix;
Jupiter::StringS rconUser;
Jupiter::StringS serverName;
Jupiter::StringS lastCommand;
Jupiter::StringS map;
Jupiter::INIFile::Section *commandAccessLevels;
Jupiter::INIFile::Section *commandAliases;
};

181
RenX.Core/RenX_Tags.cpp

@ -30,11 +30,28 @@ struct TagsImp : RenX::Tags
TagsImp();
void processTags(Jupiter::StringType &msg, const RenX::Server *server, const RenX::PlayerInfo *player, const RenX::PlayerInfo *victim);
void sanitizeTags(Jupiter::StringType &fmt);
const Jupiter::ReadableString &getUniqueInternalTag();
private:
Jupiter::StringS uniqueTag;
union
{
uint32_t tagItr;
struct
{
uint8_t tagItrP1;
uint8_t tagItrP2;
uint8_t tagItrP3;
uint8_t tagItrP4;
};
};
} _tags;
RenX::Tags *RenX::tags = &_tags;
TagsImp::TagsImp()
{
this->tagItr = 0;
this->uniqueTag = STRING_LITERAL_AS_REFERENCE("\0\0\0\0\0\0");
const Jupiter::ReadableString &configSection = Jupiter::IRC::Client::Config->get(STRING_LITERAL_AS_REFERENCE("RenX"), STRING_LITERAL_AS_REFERENCE("TagDefinitions"), STRING_LITERAL_AS_REFERENCE("RenX.Tags"));
/** Global formats */
@ -44,84 +61,87 @@ TagsImp::TagsImp()
/** Internal message tags */
/** Global tags */
this->INTERNAL_DATE_TAG = STRING_LITERAL_AS_REFERENCE("\0DAT\0");
this->INTERNAL_TIME_TAG = STRING_LITERAL_AS_REFERENCE("\0TIM\0");
this->INTERNAL_DATE_TAG = this->getUniqueInternalTag();
this->INTERNAL_TIME_TAG = this->getUniqueInternalTag();
/** Server tags */
this->INTERNAL_RCON_VERSION_TAG = STRING_LITERAL_AS_REFERENCE("\0RVER\0");
this->INTERNAL_GAME_VERSION_TAG = STRING_LITERAL_AS_REFERENCE("\0GVER\0");
this->INTERNAL_XRCON_VERSION_TAG = STRING_LITERAL_AS_REFERENCE("\0XVER\0");
this->INTERNAL_RULES_TAG = STRING_LITERAL_AS_REFERENCE("\0RUL\0");
this->INTERNAL_RCON_VERSION_TAG = this->getUniqueInternalTag();
this->INTERNAL_GAME_VERSION_TAG = this->getUniqueInternalTag();
this->INTERNAL_XRCON_VERSION_TAG = this->getUniqueInternalTag();
this->INTERNAL_RULES_TAG = this->getUniqueInternalTag();
this->INTERNAL_USER_TAG = this->getUniqueInternalTag();
this->INTERNAL_SERVER_NAME_TAG = this->getUniqueInternalTag();
this->INTERNAL_MAP_TAG = this->getUniqueInternalTag();
/** Player tags*/
this->INTERNAL_NAME_TAG = STRING_LITERAL_AS_REFERENCE("\0NAME\0");
this->INTERNAL_RAW_NAME_TAG = STRING_LITERAL_AS_REFERENCE("\0RNAME\0");
this->INTERNAL_IP_TAG = STRING_LITERAL_AS_REFERENCE("\0IP\0");
this->INTERNAL_STEAM_TAG = STRING_LITERAL_AS_REFERENCE("\0STEAM\0");
this->INTERNAL_UUID_TAG = STRING_LITERAL_AS_REFERENCE("\0UUID\0");
this->INTERNAL_ID_TAG = STRING_LITERAL_AS_REFERENCE("\0ID\0");
this->INTERNAL_CHARACTER_TAG = STRING_LITERAL_AS_REFERENCE("\0CHR\0");
this->INTERNAL_VEHICLE_TAG = STRING_LITERAL_AS_REFERENCE("\0VEH\0");
this->INTERNAL_ADMIN_TAG = STRING_LITERAL_AS_REFERENCE("\0ADM\0");
this->INTERNAL_PREFIX_TAG = STRING_LITERAL_AS_REFERENCE("\0PFX\0");
this->INTERNAL_GAME_PREFIX_TAG = STRING_LITERAL_AS_REFERENCE("\0GPF\0");
this->INTERNAL_TEAM_COLOR_TAG = STRING_LITERAL_AS_REFERENCE("\0TC\0");
this->INTERNAL_TEAM_SHORT_TAG = STRING_LITERAL_AS_REFERENCE("\0TS\0");
this->INTERNAL_TEAM_LONG_TAG = STRING_LITERAL_AS_REFERENCE("\0TL\0");
this->INTERNAL_PING_TAG = STRING_LITERAL_AS_REFERENCE("\0PNG\0");
this->INTERNAL_SCORE_TAG = STRING_LITERAL_AS_REFERENCE("\0SCR\0");
this->INTERNAL_CREDITS_TAG = STRING_LITERAL_AS_REFERENCE("\0CRD\0");
this->INTERNAL_KILLS_TAG = STRING_LITERAL_AS_REFERENCE("\0KIL\0");
this->INTERNAL_DEATHS_TAG = STRING_LITERAL_AS_REFERENCE("\0DTH\0");
this->INTERNAL_KDR_TAG = STRING_LITERAL_AS_REFERENCE("\0KDR\0");
this->INTERNAL_SUICIDES_TAG = STRING_LITERAL_AS_REFERENCE("\0SCD\0");
this->INTERNAL_HEADSHOTS_TAG = STRING_LITERAL_AS_REFERENCE("\0HDS\0");
this->INTERNAL_VEHICLE_KILLS_TAG = STRING_LITERAL_AS_REFERENCE("\0VKS\0");
this->INTERNAL_BUILDING_KILLS_TAG = STRING_LITERAL_AS_REFERENCE("\0BKS\0");
this->INTERNAL_DEFENCE_KILLS_TAG = STRING_LITERAL_AS_REFERENCE("\0DKS\0");
this->INTERNAL_WINS_TAG = STRING_LITERAL_AS_REFERENCE("\0WIN\0");
this->INTERNAL_LOSES_TAG = STRING_LITERAL_AS_REFERENCE("\0LOS\0");
this->INTERNAL_BEACON_PLACEMENTS_TAG = STRING_LITERAL_AS_REFERENCE("\0BPC\0");
this->INTERNAL_ACCESS_TAG = STRING_LITERAL_AS_REFERENCE("\0ACS\0");
this->INTERNAL_NAME_TAG = this->getUniqueInternalTag();
this->INTERNAL_RAW_NAME_TAG = this->getUniqueInternalTag();
this->INTERNAL_IP_TAG = this->getUniqueInternalTag();
this->INTERNAL_STEAM_TAG = this->getUniqueInternalTag();
this->INTERNAL_UUID_TAG = this->getUniqueInternalTag();
this->INTERNAL_ID_TAG = this->getUniqueInternalTag();
this->INTERNAL_CHARACTER_TAG = this->getUniqueInternalTag();
this->INTERNAL_VEHICLE_TAG = this->getUniqueInternalTag();
this->INTERNAL_ADMIN_TAG = this->getUniqueInternalTag();
this->INTERNAL_PREFIX_TAG = this->getUniqueInternalTag();
this->INTERNAL_GAME_PREFIX_TAG = this->getUniqueInternalTag();
this->INTERNAL_TEAM_COLOR_TAG = this->getUniqueInternalTag();
this->INTERNAL_TEAM_SHORT_TAG = this->getUniqueInternalTag();
this->INTERNAL_TEAM_LONG_TAG = this->getUniqueInternalTag();
this->INTERNAL_PING_TAG = this->getUniqueInternalTag();
this->INTERNAL_SCORE_TAG = this->getUniqueInternalTag();
this->INTERNAL_CREDITS_TAG = this->getUniqueInternalTag();
this->INTERNAL_KILLS_TAG = this->getUniqueInternalTag();
this->INTERNAL_DEATHS_TAG = this->getUniqueInternalTag();
this->INTERNAL_KDR_TAG = this->getUniqueInternalTag();
this->INTERNAL_SUICIDES_TAG = this->getUniqueInternalTag();
this->INTERNAL_HEADSHOTS_TAG = this->getUniqueInternalTag();
this->INTERNAL_VEHICLE_KILLS_TAG = this->getUniqueInternalTag();
this->INTERNAL_BUILDING_KILLS_TAG = this->getUniqueInternalTag();
this->INTERNAL_DEFENCE_KILLS_TAG = this->getUniqueInternalTag();
this->INTERNAL_WINS_TAG = this->getUniqueInternalTag();
this->INTERNAL_LOSES_TAG = this->getUniqueInternalTag();
this->INTERNAL_BEACON_PLACEMENTS_TAG = this->getUniqueInternalTag();
this->INTERNAL_ACCESS_TAG = this->getUniqueInternalTag();
/** Victim tags */
this->INTERNAL_VICTIM_NAME_TAG = STRING_LITERAL_AS_REFERENCE("\0VNAME\0");
this->INTERNAL_VICTIM_RAW_NAME_TAG = STRING_LITERAL_AS_REFERENCE("\0VRNAME\0");
this->INTERNAL_VICTIM_IP_TAG = STRING_LITERAL_AS_REFERENCE("\0VIP\0");
this->INTERNAL_VICTIM_STEAM_TAG = STRING_LITERAL_AS_REFERENCE("\0VSTEAM\0");
this->INTERNAL_VICTIM_UUID_TAG = STRING_LITERAL_AS_REFERENCE("\0VUUID\0");
this->INTERNAL_VICTIM_ID_TAG = STRING_LITERAL_AS_REFERENCE("\0VID\0");
this->INTERNAL_VICTIM_CHARACTER_TAG = STRING_LITERAL_AS_REFERENCE("\0VCHR\0");
this->INTERNAL_VICTIM_VEHICLE_TAG = STRING_LITERAL_AS_REFERENCE("\0VVEH\0");
this->INTERNAL_VICTIM_ADMIN_TAG = STRING_LITERAL_AS_REFERENCE("\0VADM\0");
this->INTERNAL_VICTIM_PREFIX_TAG = STRING_LITERAL_AS_REFERENCE("\0VPFX\0");
this->INTERNAL_VICTIM_GAME_PREFIX_TAG = STRING_LITERAL_AS_REFERENCE("\0VGPF\0");
this->INTERNAL_VICTIM_TEAM_COLOR_TAG = STRING_LITERAL_AS_REFERENCE("\0VTC\0");
this->INTERNAL_VICTIM_TEAM_SHORT_TAG = STRING_LITERAL_AS_REFERENCE("\0VTS\0");
this->INTERNAL_VICTIM_TEAM_LONG_TAG = STRING_LITERAL_AS_REFERENCE("\0VTL\0");
this->INTERNAL_VICTIM_PING_TAG = STRING_LITERAL_AS_REFERENCE("\0VPNG\0");
this->INTERNAL_VICTIM_SCORE_TAG = STRING_LITERAL_AS_REFERENCE("\0VSCR\0");
this->INTERNAL_VICTIM_CREDITS_TAG = STRING_LITERAL_AS_REFERENCE("\0VCRD\0");
this->INTERNAL_VICTIM_KILLS_TAG = STRING_LITERAL_AS_REFERENCE("\0VKIL\0");
this->INTERNAL_VICTIM_DEATHS_TAG = STRING_LITERAL_AS_REFERENCE("\0VDTH\0");
this->INTERNAL_VICTIM_KDR_TAG = STRING_LITERAL_AS_REFERENCE("\0VKDR\0");
this->INTERNAL_VICTIM_SUICIDES_TAG = STRING_LITERAL_AS_REFERENCE("\0VSCD\0");
this->INTERNAL_VICTIM_HEADSHOTS_TAG = STRING_LITERAL_AS_REFERENCE("\0VHDS\0");
this->INTERNAL_VICTIM_VEHICLE_KILLS_TAG = STRING_LITERAL_AS_REFERENCE("\0VVKS\0");
this->INTERNAL_VICTIM_BUILDING_KILLS_TAG = STRING_LITERAL_AS_REFERENCE("\0VBKS\0");
this->INTERNAL_VICTIM_DEFENCE_KILLS_TAG = STRING_LITERAL_AS_REFERENCE("\0VDKS\0");
this->INTERNAL_VICTIM_WINS_TAG = STRING_LITERAL_AS_REFERENCE("\0VWIN\0");
this->INTERNAL_VICTIM_LOSES_TAG = STRING_LITERAL_AS_REFERENCE("\0VLOS\0");
this->INTERNAL_VICTIM_BEACON_PLACEMENTS_TAG = STRING_LITERAL_AS_REFERENCE("\0VBPC\0");
this->INTERNAL_VICTIM_ACCESS_TAG = STRING_LITERAL_AS_REFERENCE("\0VACS\0");
this->INTERNAL_VICTIM_NAME_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_RAW_NAME_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_IP_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_STEAM_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_UUID_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_ID_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_CHARACTER_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_VEHICLE_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_ADMIN_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_PREFIX_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_GAME_PREFIX_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_TEAM_COLOR_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_TEAM_SHORT_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_TEAM_LONG_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_PING_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_SCORE_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_CREDITS_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_KILLS_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_DEATHS_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_KDR_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_SUICIDES_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_HEADSHOTS_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_VEHICLE_KILLS_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_BUILDING_KILLS_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_DEFENCE_KILLS_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_WINS_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_LOSES_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_BEACON_PLACEMENTS_TAG = this->getUniqueInternalTag();
this->INTERNAL_VICTIM_ACCESS_TAG = this->getUniqueInternalTag();
/** Other tags */
this->INTERNAL_WEAPON_TAG = STRING_LITERAL_AS_REFERENCE("\0WEP\0");
this->INTERNAL_OBJECT_TAG = STRING_LITERAL_AS_REFERENCE("\0OBJ\0");
this->INTERNAL_MESSAGE_TAG = STRING_LITERAL_AS_REFERENCE("\0MSG\0");
this->INTERNAL_NEW_NAME_TAG = STRING_LITERAL_AS_REFERENCE("\0NNAME\0");
this->INTERNAL_WIN_SCORE_TAG = STRING_LITERAL_AS_REFERENCE("\0WSC\0");
this->INTERNAL_LOSE_SCORE_TAG = STRING_LITERAL_AS_REFERENCE("\0LSC\0");
this->INTERNAL_WEAPON_TAG = this->getUniqueInternalTag();
this->INTERNAL_OBJECT_TAG = this->getUniqueInternalTag();
this->INTERNAL_MESSAGE_TAG = this->getUniqueInternalTag();
this->INTERNAL_NEW_NAME_TAG = this->getUniqueInternalTag();
this->INTERNAL_WIN_SCORE_TAG = this->getUniqueInternalTag();
this->INTERNAL_LOSE_SCORE_TAG = this->getUniqueInternalTag();
/** External (config) tags */
@ -134,6 +154,9 @@ TagsImp::TagsImp()
this->gameVersionTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("GameVersionTag"), STRING_LITERAL_AS_REFERENCE("{GVER}"));
this->xRconVersionTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("XRCONVersionTag"), STRING_LITERAL_AS_REFERENCE("{XVER}"));
this->rulesTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("RulesTag"), STRING_LITERAL_AS_REFERENCE("{RULES}"));
this->userTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("UserTag"), STRING_LITERAL_AS_REFERENCE("{USER}"));
this->serverNameTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("ServerNameTag"), STRING_LITERAL_AS_REFERENCE("{SERVERNAME}"));
this->mapTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("MapTag"), STRING_LITERAL_AS_REFERENCE("{MAP}"));
/** Player tags */
this->nameTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("NameTag"), STRING_LITERAL_AS_REFERENCE("{NAME}"));
@ -214,8 +237,11 @@ void TagsImp::processTags(Jupiter::StringType &msg, const RenX::Server *server,
{
msg.replace(this->INTERNAL_RCON_VERSION_TAG, Jupiter::StringS::Format("%u", server->getVersion()));
msg.replace(this->INTERNAL_GAME_VERSION_TAG, server->getGameVersion());
msg.replace(this->INTERNAL_XRCON_VERSION_TAG, Jupiter::StringS::Format("%u", server->getXVersion()));
msg.replace(this->INTERNAL_XRCON_VERSION_TAG, Jupiter::StringS::Format("%u.%u", server->getXVersion(), server->getXRevision()));
msg.replace(this->INTERNAL_RULES_TAG, server->getRules());
msg.replace(this->INTERNAL_USER_TAG, server->getUser());
msg.replace(this->INTERNAL_SERVER_NAME_TAG, server->getName());
msg.replace(this->INTERNAL_MAP_TAG, server->getMap());
if (player != nullptr)
{
msg.replace(this->INTERNAL_STEAM_TAG, server->formatSteamID(player));
@ -304,6 +330,9 @@ void TagsImp::sanitizeTags(Jupiter::StringType &fmt)
fmt.replace(this->gameVersionTag, this->INTERNAL_GAME_VERSION_TAG);
fmt.replace(this->xRconVersionTag, this->INTERNAL_XRCON_VERSION_TAG);
fmt.replace(this->rulesTag, this->INTERNAL_RULES_TAG);
fmt.replace(this->userTag, this->INTERNAL_USER_TAG);
fmt.replace(this->serverNameTag, this->INTERNAL_SERVER_NAME_TAG);
fmt.replace(this->mapTag, this->INTERNAL_MAP_TAG);
/** Player tags */
fmt.replace(this->nameTag, this->INTERNAL_NAME_TAG);
@ -380,6 +409,16 @@ void TagsImp::sanitizeTags(Jupiter::StringType &fmt)
xPlugins.get(i)->RenX_SanitizeTags(fmt);
}
const Jupiter::ReadableString &TagsImp::getUniqueInternalTag()
{
this->uniqueTag.set(1, this->tagItrP1);
this->uniqueTag.set(2, this->tagItrP2);
this->uniqueTag.set(3, this->tagItrP3);
this->uniqueTag.set(4, this->tagItrP4);
this->tagItr++;
return this->uniqueTag;
}
/** Foward functions */
void RenX::processTags(Jupiter::StringType &msg, const RenX::Server *server, const RenX::PlayerInfo *player, const RenX::PlayerInfo *victim)

146
RenX.Core/RenX_Tags.h

@ -51,84 +51,87 @@ namespace RenX
/** Internal message tags */
/** Global tags */
Jupiter::ReferenceString INTERNAL_DATE_TAG;
Jupiter::ReferenceString INTERNAL_TIME_TAG;
Jupiter::StringS INTERNAL_DATE_TAG;
Jupiter::StringS INTERNAL_TIME_TAG;
/** Server tags */
Jupiter::ReferenceString INTERNAL_RCON_VERSION_TAG;
Jupiter::ReferenceString INTERNAL_GAME_VERSION_TAG;
Jupiter::ReferenceString INTERNAL_XRCON_VERSION_TAG;
Jupiter::ReferenceString INTERNAL_RULES_TAG;
Jupiter::StringS INTERNAL_RCON_VERSION_TAG;
Jupiter::StringS INTERNAL_GAME_VERSION_TAG;
Jupiter::StringS INTERNAL_XRCON_VERSION_TAG;
Jupiter::StringS INTERNAL_RULES_TAG;
Jupiter::StringS INTERNAL_USER_TAG;
Jupiter::StringS INTERNAL_SERVER_NAME_TAG;
Jupiter::StringS INTERNAL_MAP_TAG;
/** Player tags */
Jupiter::ReferenceString INTERNAL_NAME_TAG;
Jupiter::ReferenceString INTERNAL_RAW_NAME_TAG;
Jupiter::ReferenceString INTERNAL_IP_TAG;
Jupiter::ReferenceString INTERNAL_STEAM_TAG;
Jupiter::ReferenceString INTERNAL_UUID_TAG;
Jupiter::ReferenceString INTERNAL_ID_TAG;
Jupiter::ReferenceString INTERNAL_CHARACTER_TAG;
Jupiter::ReferenceString INTERNAL_VEHICLE_TAG;
Jupiter::ReferenceString INTERNAL_ADMIN_TAG;
Jupiter::ReferenceString INTERNAL_PREFIX_TAG;
Jupiter::ReferenceString INTERNAL_GAME_PREFIX_TAG;
Jupiter::ReferenceString INTERNAL_TEAM_COLOR_TAG;
Jupiter::ReferenceString INTERNAL_TEAM_SHORT_TAG;
Jupiter::ReferenceString INTERNAL_TEAM_LONG_TAG;
Jupiter::ReferenceString INTERNAL_PING_TAG;
Jupiter::ReferenceString INTERNAL_SCORE_TAG;
Jupiter::ReferenceString INTERNAL_CREDITS_TAG;
Jupiter::ReferenceString INTERNAL_KILLS_TAG;
Jupiter::ReferenceString INTERNAL_DEATHS_TAG;
Jupiter::ReferenceString INTERNAL_KDR_TAG;
Jupiter::ReferenceString INTERNAL_SUICIDES_TAG;
Jupiter::ReferenceString INTERNAL_HEADSHOTS_TAG;
Jupiter::ReferenceString INTERNAL_VEHICLE_KILLS_TAG;
Jupiter::ReferenceString INTERNAL_BUILDING_KILLS_TAG;
Jupiter::ReferenceString INTERNAL_DEFENCE_KILLS_TAG;
Jupiter::ReferenceString INTERNAL_WINS_TAG;
Jupiter::ReferenceString INTERNAL_LOSES_TAG;
Jupiter::ReferenceString INTERNAL_BEACON_PLACEMENTS_TAG;
Jupiter::ReferenceString INTERNAL_ACCESS_TAG;
Jupiter::StringS INTERNAL_NAME_TAG;
Jupiter::StringS INTERNAL_RAW_NAME_TAG;
Jupiter::StringS INTERNAL_IP_TAG;
Jupiter::StringS INTERNAL_STEAM_TAG;
Jupiter::StringS INTERNAL_UUID_TAG;
Jupiter::StringS INTERNAL_ID_TAG;
Jupiter::StringS INTERNAL_CHARACTER_TAG;
Jupiter::StringS INTERNAL_VEHICLE_TAG;
Jupiter::StringS INTERNAL_ADMIN_TAG;
Jupiter::StringS INTERNAL_PREFIX_TAG;
Jupiter::StringS INTERNAL_GAME_PREFIX_TAG;
Jupiter::StringS INTERNAL_TEAM_COLOR_TAG;
Jupiter::StringS INTERNAL_TEAM_SHORT_TAG;
Jupiter::StringS INTERNAL_TEAM_LONG_TAG;
Jupiter::StringS INTERNAL_PING_TAG;
Jupiter::StringS INTERNAL_SCORE_TAG;
Jupiter::StringS INTERNAL_CREDITS_TAG;
Jupiter::StringS INTERNAL_KILLS_TAG;
Jupiter::StringS INTERNAL_DEATHS_TAG;
Jupiter::StringS INTERNAL_KDR_TAG;
Jupiter::StringS INTERNAL_SUICIDES_TAG;
Jupiter::StringS INTERNAL_HEADSHOTS_TAG;
Jupiter::StringS INTERNAL_VEHICLE_KILLS_TAG;
Jupiter::StringS INTERNAL_BUILDING_KILLS_TAG;
Jupiter::StringS INTERNAL_DEFENCE_KILLS_TAG;
Jupiter::StringS INTERNAL_WINS_TAG;
Jupiter::StringS INTERNAL_LOSES_TAG;
Jupiter::StringS INTERNAL_BEACON_PLACEMENTS_TAG;
Jupiter::StringS INTERNAL_ACCESS_TAG;
/** Victim tags */
Jupiter::ReferenceString INTERNAL_VICTIM_NAME_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_RAW_NAME_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_IP_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_STEAM_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_UUID_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_ID_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_CHARACTER_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_VEHICLE_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_ADMIN_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_PREFIX_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_GAME_PREFIX_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_TEAM_COLOR_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_TEAM_SHORT_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_TEAM_LONG_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_PING_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_SCORE_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_CREDITS_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_KILLS_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_DEATHS_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_KDR_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_SUICIDES_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_HEADSHOTS_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_VEHICLE_KILLS_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_BUILDING_KILLS_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_DEFENCE_KILLS_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_WINS_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_LOSES_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_BEACON_PLACEMENTS_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_ACCESS_TAG;
Jupiter::StringS INTERNAL_VICTIM_NAME_TAG;
Jupiter::StringS INTERNAL_VICTIM_RAW_NAME_TAG;
Jupiter::StringS INTERNAL_VICTIM_IP_TAG;
Jupiter::StringS INTERNAL_VICTIM_STEAM_TAG;
Jupiter::StringS INTERNAL_VICTIM_UUID_TAG;
Jupiter::StringS INTERNAL_VICTIM_ID_TAG;
Jupiter::StringS INTERNAL_VICTIM_CHARACTER_TAG;
Jupiter::StringS INTERNAL_VICTIM_VEHICLE_TAG;
Jupiter::StringS INTERNAL_VICTIM_ADMIN_TAG;
Jupiter::StringS INTERNAL_VICTIM_PREFIX_TAG;
Jupiter::StringS INTERNAL_VICTIM_GAME_PREFIX_TAG;
Jupiter::StringS INTERNAL_VICTIM_TEAM_COLOR_TAG;
Jupiter::StringS INTERNAL_VICTIM_TEAM_SHORT_TAG;
Jupiter::StringS INTERNAL_VICTIM_TEAM_LONG_TAG;
Jupiter::StringS INTERNAL_VICTIM_PING_TAG;
Jupiter::StringS INTERNAL_VICTIM_SCORE_TAG;
Jupiter::StringS INTERNAL_VICTIM_CREDITS_TAG;
Jupiter::StringS INTERNAL_VICTIM_KILLS_TAG;
Jupiter::StringS INTERNAL_VICTIM_DEATHS_TAG;
Jupiter::StringS INTERNAL_VICTIM_KDR_TAG;
Jupiter::StringS INTERNAL_VICTIM_SUICIDES_TAG;
Jupiter::StringS INTERNAL_VICTIM_HEADSHOTS_TAG;
Jupiter::StringS INTERNAL_VICTIM_VEHICLE_KILLS_TAG;
Jupiter::StringS INTERNAL_VICTIM_BUILDING_KILLS_TAG;
Jupiter::StringS INTERNAL_VICTIM_DEFENCE_KILLS_TAG;
Jupiter::StringS INTERNAL_VICTIM_WINS_TAG;
Jupiter::StringS INTERNAL_VICTIM_LOSES_TAG;
Jupiter::StringS INTERNAL_VICTIM_BEACON_PLACEMENTS_TAG;
Jupiter::StringS INTERNAL_VICTIM_ACCESS_TAG;
/** Other tags */
Jupiter::ReferenceString INTERNAL_WEAPON_TAG;
Jupiter::ReferenceString INTERNAL_OBJECT_TAG;
Jupiter::ReferenceString INTERNAL_MESSAGE_TAG;
Jupiter::ReferenceString INTERNAL_NEW_NAME_TAG;
Jupiter::ReferenceString INTERNAL_WIN_SCORE_TAG;
Jupiter::ReferenceString INTERNAL_LOSE_SCORE_TAG;
Jupiter::StringS INTERNAL_WEAPON_TAG;
Jupiter::StringS INTERNAL_OBJECT_TAG;
Jupiter::StringS INTERNAL_MESSAGE_TAG;
Jupiter::StringS INTERNAL_NEW_NAME_TAG;
Jupiter::StringS INTERNAL_WIN_SCORE_TAG;
Jupiter::StringS INTERNAL_LOSE_SCORE_TAG;
/** External message tags */
@ -141,6 +144,9 @@ namespace RenX
Jupiter::StringS gameVersionTag;
Jupiter::StringS xRconVersionTag;
Jupiter::StringS rulesTag;
Jupiter::StringS userTag;
Jupiter::StringS serverNameTag;
Jupiter::StringS mapTag;
/** Player tags */
Jupiter::StringS nameTag;

541
RenX.Logging/RenX_Logging.cpp

@ -1,5 +1,5 @@
/**
* Copyright (C) 2014 Justin James.
* Copyright (C) 2014-2015 Justin James.
*
* This license must be preserved.
* Any applications, libraries, or code which make any use of any
@ -30,13 +30,21 @@ void RenX_LoggingPlugin::init()
RenX_LoggingPlugin::partPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("PartPublic"), true);
RenX_LoggingPlugin::nameChangePublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("NameChangePublic"), true);
RenX_LoggingPlugin::teamChangePublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("TeamChangePublic"), true);
RenX_LoggingPlugin::playerPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("PlayerPublic"), false);
RenX_LoggingPlugin::chatPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("ChatPublic"), true);
RenX_LoggingPlugin::teamChatPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("TeamChatPublic"), true);
RenX_LoggingPlugin::hostChatPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("HostChatPublic"), true);
RenX_LoggingPlugin::hostPagePublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("HostPagePublic"), false);
RenX_LoggingPlugin::otherChatPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("OtherChatPublic"), false);
RenX_LoggingPlugin::deployPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("DeployPublic"), true);
RenX_LoggingPlugin::disarmPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("DisarmPublic"), true);
RenX_LoggingPlugin::suicidePublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("SuicidePublic"), true);
RenX_LoggingPlugin::killPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("KillPublic"), true);
RenX_LoggingPlugin::diePublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("DiePublic"), true);
RenX_LoggingPlugin::destroyPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("DestroyPublic"), true);
RenX_LoggingPlugin::capturePublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("CapturePublic"), true);
RenX_LoggingPlugin::neutralizePublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("NeutralizePublic"), true);
RenX_LoggingPlugin::stealPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("StealPublic"), true);
RenX_LoggingPlugin::gamePublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("GamePublic"), true);
RenX_LoggingPlugin::gameOverPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("GameOverPublic"), true);
RenX_LoggingPlugin::executePublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("ExecutePublic"), false);
@ -46,6 +54,15 @@ void RenX_LoggingPlugin::init()
RenX_LoggingPlugin::adminGrantPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("AdminGrantPublic"), true);
RenX_LoggingPlugin::adminLogoutPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("AdminLogoutPublic"), true);
RenX_LoggingPlugin::adminPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("AdminPublic"), false);
RenX_LoggingPlugin::voteCallPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("VoteCallPublic"), true);
RenX_LoggingPlugin::voteOverPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("VoteOverPublic"), true);
RenX_LoggingPlugin::voteCancelPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("VoteCancelPublic"), true);
RenX_LoggingPlugin::votePublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("VotePublic"), false);
RenX_LoggingPlugin::mapChangePublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("MapChangePublic"), true);
RenX_LoggingPlugin::mapLoadPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("MapLoadPublic"), true);
RenX_LoggingPlugin::mapPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("MapPublic"), false);
RenX_LoggingPlugin::demoRecordPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("DemoRecordPublic"), true);
RenX_LoggingPlugin::demoPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("DemoPublic"), false);
RenX_LoggingPlugin::logPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("LogPublic"), false);
RenX_LoggingPlugin::xVersionPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("XVersionPublic"), true);
RenX_LoggingPlugin::grantCharacterPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("GrantCharacterPublic"), false);
@ -72,6 +89,12 @@ void RenX_LoggingPlugin::init()
RenX_LoggingPlugin::partFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("PartFormat"),
Jupiter::StringS::Format(IRCCOLOR "12[Part] " IRCBOLD "%.*s" IRCBOLD " left the %.*s.", RenX::tags->nameTag.size(), RenX::tags->nameTag.ptr(), RenX::tags->teamLongTag.size(), RenX::tags->teamLongTag.ptr()));
RenX_LoggingPlugin::playerExecuteFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("PlayerExecuteFormat"),
Jupiter::StringS::Format("%.*s" IRCCOLOR "07 executed: %.*s", RenX::tags->nameTag.size(), RenX::tags->nameTag.ptr(), RenX::tags->messageTag.size(), RenX::tags->messageTag.ptr()));
RenX_LoggingPlugin::playerFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("PlayerFormat"),
Jupiter::StringS::Format(IRCCOLOR "12[Player]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(), RenX::tags->messageTag.ptr()));
RenX_LoggingPlugin::nameChangeFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("NameChangeFormat"),
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCBOLD " changed their name to " IRCBOLD "%.*s" IRCBOLD ".", RenX::tags->nameTag.size(), RenX::tags->nameTag.ptr(), RenX::tags->newNameTag.size(), RenX::tags->newNameTag.ptr()));
@ -84,9 +107,21 @@ void RenX_LoggingPlugin::init()
RenX_LoggingPlugin::teamChatFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("TeamChatFormat"),
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCBOLD ": %.*s", RenX::tags->nameTag.size(), RenX::tags->nameTag.ptr(), RenX::tags->messageTag.size(), RenX::tags->messageTag.ptr()));
RenX_LoggingPlugin::hostChatFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("HostChatFormat"),
Jupiter::StringS::Format(IRCCOLOR "12Host" IRCCOLOR "0: %.*s", RenX::tags->messageTag.size(), RenX::tags->messageTag.ptr()));
RenX_LoggingPlugin::hostPageFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("HostPageFormat"),
Jupiter::StringS::Format(IRCCOLOR "12(Host -> %.*s): %.*s", RenX::tags->rawNameTag.size(), RenX::tags->rawNameTag.ptr(), RenX::tags->messageTag.size(), RenX::tags->messageTag.ptr()));
RenX_LoggingPlugin::otherChatFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("OtherChatFormat"),
Jupiter::StringS::Format(IRCCOLOR "06[Other Chat]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(), RenX::tags->messageTag.ptr()));
RenX_LoggingPlugin::deployFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("DeployFormat"),
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCBOLD " deployed a " IRCBOLD "%.*s" IRCBOLD, RenX::tags->nameTag.size(), RenX::tags->nameTag.ptr(), RenX::tags->objectTag.size(), RenX::tags->objectTag.ptr()));
RenX_LoggingPlugin::disarmFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("DisarmFormat"),
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCBOLD " disarmed a " IRCBOLD "%.*s" IRCBOLD, RenX::tags->nameTag.size(), RenX::tags->nameTag.ptr(), RenX::tags->objectTag.size(), RenX::tags->objectTag.ptr()));
RenX_LoggingPlugin::suicideFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("SuicideFormat"),
Jupiter::StringS::Format("%.*s" IRCCOLOR " suicided (death by " IRCCOLOR "12%.*s" IRCCOLOR ").", RenX::tags->nameTag.size(), RenX::tags->nameTag.ptr(), RenX::tags->weaponTag.size(), RenX::tags->weaponTag.ptr()));
@ -120,6 +155,18 @@ void RenX_LoggingPlugin::init()
RenX_LoggingPlugin::destroyVehicleFmt2 = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("DestroyVehicleFormat2"),
Jupiter::StringS::Format(IRCCOLOR "%.*s%.*s" IRCCOLOR " destroyed a " IRCCOLOR "%.*s%.*s" IRCCOLOR " (" IRCCOLOR "12%.*s" IRCCOLOR ").", RenX::tags->teamColorTag.size(), RenX::tags->teamColorTag.ptr(), RenX::tags->nameTag.size(), RenX::tags->nameTag.ptr(), RenX::tags->victimTeamColorTag.size(), RenX::tags->victimTeamColorTag.ptr(), RenX::tags->objectTag.size(), RenX::tags->objectTag.ptr(), RenX::tags->weaponTag.size(), RenX::tags->weaponTag.ptr()));
RenX_LoggingPlugin::captureFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("CaptureFormat"),
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCBOLD " captured the " IRCBOLD IRCCOLOR "%.*s%.*s" IRCBOLD ".", RenX::tags->nameTag.size(), RenX::tags->nameTag.ptr(), RenX::tags->objectTag.size(), RenX::tags->objectTag.ptr(), RenX::tags->victimTeamColorTag.size(), RenX::tags->victimTeamColorTag.ptr()));
RenX_LoggingPlugin::neutralizeFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("NeutralizeFormat"),
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCBOLD " neutralized the " IRCBOLD IRCCOLOR "%.*s%.*s" IRCBOLD ".", RenX::tags->nameTag.size(), RenX::tags->nameTag.ptr(), RenX::tags->objectTag.size(), RenX::tags->objectTag.ptr(), RenX::tags->victimTeamColorTag.size(), RenX::tags->victimTeamColorTag.ptr()));
RenX_LoggingPlugin::stealFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("StealFormat"),
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCBOLD IRCCOLOR " stole " IRCBOLD "%.*s" IRCBOLD "'s " IRCBOLD "%.*s" IRCBOLD "!", RenX::tags->nameTag.size(), RenX::tags->nameTag.ptr(), RenX::tags->victimNameTag.size(), RenX::tags->victimNameTag.ptr(), RenX::tags->objectTag.size(), RenX::tags->objectTag.ptr()));
RenX_LoggingPlugin::stealNoOwnerFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("StealNoOwnerFormat"),
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCBOLD IRCCOLOR " stole a " IRCBOLD IRCCOLOR "12%.*s" IRCBOLD "!", RenX::tags->nameTag.size(), RenX::tags->nameTag.ptr(), RenX::tags->objectTag.size(), RenX::tags->objectTag.ptr()));
RenX_LoggingPlugin::gameOverFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("GameOverFormat"),
Jupiter::StringS::Format(IRCCOLOR "03[Game]" IRCCOLOR "%.*s The " IRCBOLD "%.*s" IRCBOLD " won by " IRCBOLD "%.*s" IRCBOLD, RenX::tags->teamColorTag.size(), RenX::tags->teamColorTag.ptr(), RenX::tags->teamLongTag.size(), RenX::tags->teamLongTag.ptr(), RenX::tags->messageTag.size(), RenX::tags->messageTag.ptr()));
@ -138,12 +185,6 @@ void RenX_LoggingPlugin::init()
RenX_LoggingPlugin::executeFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("ExecuteFormat"),
Jupiter::StringS::Format(IRCCOLOR "07%.*s executed: %.*s", RenX::tags->nameTag.size(), RenX::tags->nameTag.ptr(), RenX::tags->messageTag.size(), RenX::tags->messageTag.ptr()));
RenX_LoggingPlugin::evaFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("EVAFormat"),
Jupiter::StringS::Format(IRCCOLOR "09EVA: %.*s", RenX::tags->messageTag.size(), RenX::tags->messageTag.ptr()));
RenX_LoggingPlugin::evaPrivateFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("EVAPrivateFormat"),
Jupiter::StringS::Format(IRCCOLOR "12(EVA -> %.*s): %.*s", RenX::tags->rawNameTag.size(), RenX::tags->rawNameTag.ptr(), RenX::tags->messageTag.size(), RenX::tags->messageTag.ptr()));
RenX_LoggingPlugin::subscribeFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("SubscribeFormat"),
Jupiter::StringS::Format(IRCCOLOR "03%.*s subscribed to the RCON data stream.", RenX::tags->nameTag.size(), RenX::tags->nameTag.ptr()));
@ -162,6 +203,39 @@ void RenX_LoggingPlugin::init()
RenX_LoggingPlugin::adminFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("AdminFormat"),
Jupiter::StringS::Format(IRCCOLOR "07[Admin]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(), RenX::tags->messageTag.ptr()));
RenX_LoggingPlugin::voteCallFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("VoteCallFormat"),
Jupiter::StringS::Format(IRCCOLOR "%.*s[Vote] " IRCBOLD "%.*s" IRCBOLD " has called a \"%.*s\" vote.", RenX::tags->victimTeamColorTag.size(), RenX::tags->victimTeamColorTag.ptr(), RenX::tags->nameTag.size(), RenX::tags->nameTag.ptr(), RenX::tags->objectTag.size(), RenX::tags->objectTag.ptr(), RenX::tags->victimTeamColorTag.size(), RenX::tags->victimTeamColorTag.ptr()));
RenX_LoggingPlugin::voteOverSuccessFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("VoteOverSuccessFormat"),
Jupiter::StringS::Format(IRCCOLOR "%.*s[Vote] A vote for \"%.*s\" " IRCBOLD IRCCOLOR "09passed" IRCBOLD IRCCOLOR "%.*s (Votes Yes: %.*s | Votes No: %.*s).", RenX::tags->victimTeamColorTag.size(), RenX::tags->victimTeamColorTag.ptr(), RenX::tags->objectTag.size(), RenX::tags->objectTag.ptr(), RenX::tags->victimTeamColorTag.size(), RenX::tags->victimTeamColorTag.ptr(), RenX::tags->winScoreTag.size(), RenX::tags->winScoreTag.ptr(), RenX::tags->loseScoreTag.size(), RenX::tags->loseScoreTag.ptr()));
RenX_LoggingPlugin::voteOverFailFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("VoteOverFailFormat"),
Jupiter::StringS::Format(IRCCOLOR "%.*s[Vote] A vote for \"%.*s\" " IRCBOLD IRCCOLOR "04failed" IRCBOLD IRCCOLOR "%.*s (Votes Yes: %.*s | Votes No: %.*s).", RenX::tags->victimTeamColorTag.size(), RenX::tags->victimTeamColorTag.ptr(), RenX::tags->objectTag.size(), RenX::tags->objectTag.ptr(), RenX::tags->victimTeamColorTag.size(), RenX::tags->victimTeamColorTag.ptr(), RenX::tags->winScoreTag.size(), RenX::tags->winScoreTag.ptr(), RenX::tags->loseScoreTag.size(), RenX::tags->loseScoreTag.ptr()));
RenX_LoggingPlugin::voteCancelFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("VoteCancelFormat"),
Jupiter::StringS::Format(IRCCOLOR "%.*s[Vote] A vote for \"%.*s\" was " IRCBOLD IRCCOLOR "07cancelled" IRCCOLOR IRCBOLD ".", RenX::tags->victimTeamColorTag.size(), RenX::tags->victimTeamColorTag.ptr(), RenX::tags->objectTag.size(), RenX::tags->objectTag.ptr()));
RenX_LoggingPlugin::voteFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("VoteFormat"),
Jupiter::StringS::Format(IRCCOLOR "06[Vote]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(), RenX::tags->messageTag.ptr()));
RenX_LoggingPlugin::mapChangeFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("MapChangeFormat"),
Jupiter::StringS::Format(IRCCOLOR "03Loading %.*s...", RenX::tags->messageTag.size(), RenX::tags->messageTag.ptr()));
RenX_LoggingPlugin::mapLoadFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("MapLoadFormat"),
Jupiter::StringS::Format(IRCCOLOR "03%.*s loaded.", RenX::tags->messageTag.size(), RenX::tags->messageTag.ptr()));
RenX_LoggingPlugin::mapFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("MapFormat"),
Jupiter::StringS::Format(IRCCOLOR "06[Map]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(), RenX::tags->messageTag.ptr()));
RenX_LoggingPlugin::demoRecordFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("DemoRecordFormat"),
Jupiter::StringS::Format("%.*s has started a demo recording.", RenX::tags->nameTag.size(), RenX::tags->nameTag.ptr()));
RenX_LoggingPlugin::rconDemoRecordFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("RCONDemoRecordFormat"),
STRING_LITERAL_AS_REFERENCE(IRCCOLOR "07A demo recording has started."));
RenX_LoggingPlugin::demoFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("DemoFormat"),
Jupiter::StringS::Format(IRCCOLOR "06[Demo]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(), RenX::tags->messageTag.ptr()));
RenX_LoggingPlugin::logFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("LogFormat"),
Jupiter::StringS::Format(IRCCOLOR "07[Log]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(), RenX::tags->messageTag.ptr()));
@ -198,16 +272,19 @@ void RenX_LoggingPlugin::init()
RenX_LoggingPlugin::otherFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("OtherFormat"),
Jupiter::StringS::Format(IRCCOLOR "06[Other]" IRCCOLOR " %.*s", RenX::tags->messageTag.size(), RenX::tags->messageTag.ptr()));
/** Sanitize tags in formats to prevent explotation */
/** Sanitize tags */
RenX::sanitizeTags(joinPublicFmt);
RenX::sanitizeTags(joinAdminFmt);
RenX::sanitizeTags(joinNoSteamAdminFmt);
RenX::sanitizeTags(partFmt);
RenX::sanitizeTags(nameChangeFmt);
RenX::sanitizeTags(teamChangeFmt);
RenX::sanitizeTags(playerFmt);
RenX::sanitizeTags(chatFmt);
RenX::sanitizeTags(teamChatFmt);
RenX::sanitizeTags(otherChatFmt);
RenX::sanitizeTags(deployFmt);
RenX::sanitizeTags(disarmFmt);
RenX::sanitizeTags(suicideFmt);
RenX::sanitizeTags(dieFmt);
RenX::sanitizeTags(dieFmt2);
@ -219,20 +296,36 @@ void RenX_LoggingPlugin::init()
RenX::sanitizeTags(destroyDefenceFmt2);
RenX::sanitizeTags(destroyVehicleFmt);
RenX::sanitizeTags(destroyVehicleFmt2);
RenX::sanitizeTags(captureFmt);
RenX::sanitizeTags(neutralizeFmt);
RenX::sanitizeTags(stealFmt);
RenX::sanitizeTags(stealNoOwnerFmt);
RenX::sanitizeTags(gameOverFmt);
RenX::sanitizeTags(gameOverTieFmt);
RenX::sanitizeTags(gameOverTieNoWinFmt);
RenX::sanitizeTags(gameOverScoreFmt);
RenX::sanitizeTags(gameFmt);
RenX::sanitizeTags(executeFmt);
RenX::sanitizeTags(evaFmt);
RenX::sanitizeTags(evaPrivateFmt);
RenX::sanitizeTags(playerExecuteFmt);
RenX::sanitizeTags(hostChatFmt);
RenX::sanitizeTags(hostPageFmt);
RenX::sanitizeTags(subscribeFmt);
RenX::sanitizeTags(rconFmt);
RenX::sanitizeTags(adminLoginFmt);
RenX::sanitizeTags(adminGrantFmt);
RenX::sanitizeTags(adminLogoutFmt);
RenX::sanitizeTags(adminFmt);
RenX::sanitizeTags(voteCallFmt);
RenX::sanitizeTags(voteOverSuccessFmt);
RenX::sanitizeTags(voteOverFailFmt);
RenX::sanitizeTags(voteCancelFmt);
RenX::sanitizeTags(voteFmt);
RenX::sanitizeTags(mapChangeFmt);
RenX::sanitizeTags(mapLoadFmt);
RenX::sanitizeTags(mapFmt);
RenX::sanitizeTags(demoRecordFmt);
RenX::sanitizeTags(rconDemoRecordFmt);
RenX::sanitizeTags(demoFmt);
RenX::sanitizeTags(logFmt);
RenX::sanitizeTags(xVersionFmt);
RenX::sanitizeTags(grantCharacterFmt);
@ -305,7 +398,7 @@ void RenX_LoggingPlugin::RenX_OnNameChange(RenX::Server *server, const RenX::Pla
}
}
void RenX_LoggingPlugin::RenX_OnTeamChange(RenX::Server *server, const RenX::PlayerInfo *player)
void RenX_LoggingPlugin::RenX_OnTeamChange(RenX::Server *server, const RenX::PlayerInfo *player, const RenX::TeamType &oldTeam)
{
logFuncType func;
if (RenX_LoggingPlugin::teamChangePublic)
@ -321,6 +414,40 @@ void RenX_LoggingPlugin::RenX_OnTeamChange(RenX::Server *server, const RenX::Pla
}
}
void RenX_LoggingPlugin::RenX_OnExecute(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &command)
{
logFuncType func;
if (RenX_LoggingPlugin::executePublic)
func = &RenX::Server::sendLogChan;
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg = this->playerExecuteFmt;
if (msg.isEmpty() == false)
{
processTags(msg, server, player);
msg.replace(RenX::tags->INTERNAL_MESSAGE_TAG, command);
(server->*func)(msg);
}
}
void RenX_LoggingPlugin::RenX_OnPlayer(RenX::Server *server, const Jupiter::ReadableString &raw)
{
logFuncType func;
if (RenX_LoggingPlugin::playerPublic)
func = &RenX::Server::sendLogChan;
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg = this->playerFmt;
if (msg.isEmpty() == false)
{
RenX::processTags(msg, server);
msg.replace(RenX::tags->INTERNAL_MESSAGE_TAG, raw);
(server->*func)(msg);
}
}
void RenX_LoggingPlugin::RenX_OnChat(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &message)
{
logFuncType func;
@ -355,6 +482,57 @@ void RenX_LoggingPlugin::RenX_OnTeamChat(RenX::Server *server, const RenX::Playe
}
}
void RenX_LoggingPlugin::RenX_OnHostChat(RenX::Server *server, const Jupiter::ReadableString &message)
{
logFuncType func;
if (RenX_LoggingPlugin::hostChatPublic)
func = &RenX::Server::sendLogChan;
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg = this->hostChatFmt;
if (msg.isEmpty() == false)
{
RenX::processTags(msg, server);
msg.replace(RenX::tags->INTERNAL_MESSAGE_TAG, message);
(server->*func)(msg);
}
}
void RenX_LoggingPlugin::RenX_OnHostPage(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &message)
{
logFuncType func;
if (RenX_LoggingPlugin::hostPagePublic)
func = &RenX::Server::sendLogChan;
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg = this->hostPageFmt;
if (msg.isEmpty() == false)
{
RenX::processTags(msg, server, player);
msg.replace(RenX::tags->INTERNAL_MESSAGE_TAG, message);
(server->*func)(msg);
}
}
void RenX_LoggingPlugin::RenX_OnOtherChat(RenX::Server *server, const Jupiter::ReadableString &raw)
{
logFuncType func;
if (RenX_LoggingPlugin::otherChatPublic)
func = &RenX::Server::sendLogChan;
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg = this->otherChatFmt;
if (msg.isEmpty() == false)
{
RenX::processTags(msg, server);
msg.replace(RenX::tags->INTERNAL_MESSAGE_TAG, raw);
(server->*func)(msg);
}
}
void RenX_LoggingPlugin::RenX_OnDeploy(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &object)
{
logFuncType func;
@ -372,6 +550,23 @@ void RenX_LoggingPlugin::RenX_OnDeploy(RenX::Server *server, const RenX::PlayerI
}
}
void RenX_LoggingPlugin::RenX_OnDisarm(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &object)
{
logFuncType func;
if (RenX_LoggingPlugin::disarmPublic)
func = &RenX::Server::sendLogChan;
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg = this->disarmFmt;
if (msg.isEmpty() == false)
{
RenX::processTags(msg, server, player);
msg.replace(RenX::tags->INTERNAL_OBJECT_TAG, RenX::translateName(object));
(server->*func)(msg);
}
}
void RenX_LoggingPlugin::RenX_OnSuicide(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &damageType)
{
logFuncType func;
@ -406,7 +601,7 @@ void RenX_LoggingPlugin::RenX_OnKill(RenX::Server *server, const RenX::PlayerInf
}
}
void RenX_LoggingPlugin::RenX_OnKill(RenX::Server *server, const Jupiter::ReadableString &killer, RenX::TeamType killerTeam, const RenX::PlayerInfo *victim, const Jupiter::ReadableString &damageType)
void RenX_LoggingPlugin::RenX_OnKill(RenX::Server *server, const Jupiter::ReadableString &killer, const RenX::TeamType &killerTeam, const RenX::PlayerInfo *victim, const Jupiter::ReadableString &damageType)
{
logFuncType func;
if (RenX_LoggingPlugin::killPublic)
@ -444,7 +639,7 @@ void RenX_LoggingPlugin::RenX_OnDie(RenX::Server *server, const RenX::PlayerInfo
}
}
void RenX_LoggingPlugin::RenX_OnDie(RenX::Server *server, const Jupiter::ReadableString &object, RenX::TeamType objectTeam, const Jupiter::ReadableString &damageType)
void RenX_LoggingPlugin::RenX_OnDie(RenX::Server *server, const Jupiter::ReadableString &object, const RenX::TeamType &objectTeam, const Jupiter::ReadableString &damageType)
{
logFuncType func;
if (RenX_LoggingPlugin::diePublic)
@ -499,7 +694,81 @@ void RenX_LoggingPlugin::RenX_OnDestroy(RenX::Server *server, const RenX::Player
}
}
void RenX_LoggingPlugin::RenX_OnDestroy(RenX::Server *server, const Jupiter::ReadableString &killer, RenX::TeamType killerTeam, const Jupiter::ReadableString &objectName, RenX::TeamType objectTeam, const Jupiter::ReadableString &damageType, RenX::ObjectType type)
void RenX_LoggingPlugin::RenX_OnCapture(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &building, const RenX::TeamType &oldTeam)
{
logFuncType func;
if (RenX_LoggingPlugin::capturePublic)
func = &RenX::Server::sendLogChan;
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg = this->captureFmt;
if (msg.isEmpty() == false)
{
RenX::processTags(msg, server, player);
msg.replace(RenX::tags->INTERNAL_OBJECT_TAG, RenX::translateName(building));
msg.replace(RenX::tags->INTERNAL_VICTIM_TEAM_COLOR_TAG, RenX::getTeamColor(oldTeam));
msg.replace(RenX::tags->INTERNAL_VICTIM_TEAM_SHORT_TAG, RenX::getTeamName(oldTeam));
msg.replace(RenX::tags->INTERNAL_VICTIM_TEAM_LONG_TAG, RenX::getFullTeamName(oldTeam));
(server->*func)(msg);
}
}
void RenX_LoggingPlugin::RenX_OnNeutralize(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &building, const RenX::TeamType &oldTeam)
{
logFuncType func;
if (RenX_LoggingPlugin::neutralizePublic)
func = &RenX::Server::sendLogChan;
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg = this->neutralizeFmt;
if (msg.isEmpty() == false)
{
RenX::processTags(msg, server, player);
msg.replace(RenX::tags->INTERNAL_OBJECT_TAG, RenX::translateName(building));
msg.replace(RenX::tags->INTERNAL_VICTIM_TEAM_COLOR_TAG, RenX::getTeamColor(oldTeam));
msg.replace(RenX::tags->INTERNAL_VICTIM_TEAM_SHORT_TAG, RenX::getTeamName(oldTeam));
msg.replace(RenX::tags->INTERNAL_VICTIM_TEAM_LONG_TAG, RenX::getFullTeamName(oldTeam));
(server->*func)(msg);
}
}
void RenX_LoggingPlugin::RenX_OnSteal(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &vehicle)
{
logFuncType func;
if (RenX_LoggingPlugin::stealPublic)
func = &RenX::Server::sendLogChan;
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg = this->stealNoOwnerFmt;
if (msg.isEmpty() == false)
{
RenX::processTags(msg, server, player);
msg.replace(RenX::tags->INTERNAL_OBJECT_TAG, RenX::translateName(vehicle));
(server->*func)(msg);
}
}
void RenX_LoggingPlugin::RenX_OnSteal(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &vehicle, const RenX::PlayerInfo *victim)
{
logFuncType func;
if (RenX_LoggingPlugin::stealPublic)
func = &RenX::Server::sendLogChan;
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg = this->stealFmt;
if (msg.isEmpty() == false)
{
RenX::processTags(msg, server, player, victim);
msg.replace(RenX::tags->INTERNAL_OBJECT_TAG, RenX::translateName(vehicle));
(server->*func)(msg);
}
}
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)
{
logFuncType func;
if (RenX_LoggingPlugin::destroyPublic)
@ -536,7 +805,7 @@ void RenX_LoggingPlugin::RenX_OnDestroy(RenX::Server *server, const Jupiter::Rea
}
}
void RenX_LoggingPlugin::RenX_OnGameOver(RenX::Server *server, RenX::WinType winType, RenX::TeamType team, int gScore, int nScore)
void RenX_LoggingPlugin::RenX_OnGameOver(RenX::Server *server, RenX::WinType winType, const RenX::TeamType &team, int gScore, int nScore)
{
RenX::TeamType loserTeam = RenX::getEnemy(team);
int winScore;
@ -563,7 +832,7 @@ void RenX_LoggingPlugin::RenX_OnGameOver(RenX::Server *server, RenX::WinType win
Jupiter::String msg;
if (winType == RenX::WinType::Tie)
{
if (team == RenX::TeamType::Other)
if (team == RenX::TeamType::None)
msg = this->gameOverTieNoWinFmt;
else
msg = this->gameOverTieFmt;
@ -571,7 +840,7 @@ void RenX_LoggingPlugin::RenX_OnGameOver(RenX::Server *server, RenX::WinType win
else
msg = this->gameOverFmt;
if (msg.isEmpty() == false)
if (msg.isEmpty() == false && team != RenX::TeamType::None)
{
msg.replace(RenX::tags->INTERNAL_TEAM_COLOR_TAG, RenX::getTeamColor(team));
msg.replace(RenX::tags->INTERNAL_TEAM_SHORT_TAG, RenX::getTeamName(team));
@ -586,13 +855,23 @@ void RenX_LoggingPlugin::RenX_OnGameOver(RenX::Server *server, RenX::WinType win
}
msg = this->gameOverScoreFmt;
if (team == RenX::TeamType::Other)
if (team == RenX::TeamType::None)
{
team = RenX::TeamType::GDI;
loserTeam = RenX::TeamType::Nod;
if (msg.isEmpty() == false)
{
msg.replace(RenX::tags->INTERNAL_TEAM_COLOR_TAG, RenX::getTeamColor(RenX::TeamType::GDI));
msg.replace(RenX::tags->INTERNAL_TEAM_SHORT_TAG, RenX::getTeamName(RenX::TeamType::GDI));
msg.replace(RenX::tags->INTERNAL_TEAM_LONG_TAG, RenX::getFullTeamName(RenX::TeamType::GDI));
msg.replace(RenX::tags->INTERNAL_WIN_SCORE_TAG, Jupiter::StringS::Format("%d", winScore));
msg.replace(RenX::tags->INTERNAL_LOSE_SCORE_TAG, Jupiter::StringS::Format("%d", loseScore));
msg.replace(RenX::tags->INTERNAL_VICTIM_TEAM_COLOR_TAG, RenX::getTeamColor(RenX::TeamType::Nod));
msg.replace(RenX::tags->INTERNAL_VICTIM_TEAM_SHORT_TAG, RenX::getTeamName(RenX::TeamType::Nod));
msg.replace(RenX::tags->INTERNAL_VICTIM_TEAM_LONG_TAG, RenX::getFullTeamName(RenX::TeamType::Nod));
msg.replace(RenX::tags->INTERNAL_MESSAGE_TAG, RenX::translateWinType(winType));
(server->*func)(msg);
}
}
if (msg.isEmpty() == false)
else if (msg.isEmpty() == false)
{
msg.replace(RenX::tags->INTERNAL_TEAM_COLOR_TAG, RenX::getTeamColor(team));
msg.replace(RenX::tags->INTERNAL_TEAM_SHORT_TAG, RenX::getTeamName(team));
@ -635,35 +914,7 @@ void RenX_LoggingPlugin::RenX_OnExecute(RenX::Server *server, const Jupiter::Rea
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg;
if (command.matchi("say *"))
{
msg = this->evaFmt;
if (msg.isEmpty() == false)
{
processTags(msg, server);
msg.replace(RenX::tags->INTERNAL_MESSAGE_TAG, Jupiter::ReferenceString::gotoToken(command, 1, ' '));
server->sendLogChan(msg);
return;
}
}
else if (command.matchi("evaprivatesay *"))
{
RenX::PlayerInfo *player = server->getPlayerByName(Jupiter::ReferenceString::getToken(command, 1, ' '));
if (player != nullptr)
{
msg = this->evaPrivateFmt;
if (msg.isEmpty() == false)
{
Jupiter::ReferenceString message = Jupiter::ReferenceString::gotoToken(command, 2, ' ');
processTags(msg, server, player);
msg.replace(RenX::tags->INTERNAL_MESSAGE_TAG, message);
(server->*func)(msg);
return;
}
}
}
msg = this->executeFmt;
Jupiter::String msg = this->executeFmt;
if (msg.isEmpty() == false)
{
processTags(msg, server);
@ -773,6 +1024,192 @@ void RenX_LoggingPlugin::RenX_OnAdmin(RenX::Server *server, const Jupiter::Reada
}
}
void RenX_LoggingPlugin::RenX_OnVoteCall(RenX::Server *server, const RenX::TeamType &team, const Jupiter::ReadableString &type, const RenX::PlayerInfo *player, const Jupiter::ReadableString &parameters)
{
logFuncType func;
if (RenX_LoggingPlugin::voteCallPublic)
func = &RenX::Server::sendLogChan;
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg = this->voteCallFmt;
if (msg.isEmpty() == false)
{
RenX::processTags(msg, server, player);
msg.replace(RenX::tags->INTERNAL_VICTIM_TEAM_COLOR_TAG, RenX::getTeamColor(team));
msg.replace(RenX::tags->INTERNAL_VICTIM_TEAM_SHORT_TAG, RenX::getTeamName(team));
msg.replace(RenX::tags->INTERNAL_VICTIM_TEAM_LONG_TAG, RenX::getFullTeamName(team));
msg.replace(RenX::tags->INTERNAL_OBJECT_TAG, RenX::translateName(type));
(server->*func)(msg);
}
}
void RenX_LoggingPlugin::RenX_OnVoteOver(RenX::Server *server, const RenX::TeamType &team, const Jupiter::ReadableString &type, bool success, int yesVotes, int noVotes)
{
logFuncType func;
if (RenX_LoggingPlugin::voteOverPublic)
func = &RenX::Server::sendLogChan;
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg = success ? this->voteOverSuccessFmt : this->voteOverFailFmt;
if (msg.isEmpty() == false)
{
RenX::processTags(msg, server);
msg.replace(RenX::tags->INTERNAL_OBJECT_TAG, RenX::translateName(type));
msg.replace(RenX::tags->INTERNAL_TEAM_COLOR_TAG, RenX::getTeamColor(team));
msg.replace(RenX::tags->INTERNAL_TEAM_SHORT_TAG, RenX::getTeamName(team));
msg.replace(RenX::tags->INTERNAL_TEAM_LONG_TAG, RenX::getFullTeamName(team));
msg.replace(RenX::tags->INTERNAL_VICTIM_TEAM_COLOR_TAG, RenX::getTeamColor(team));
msg.replace(RenX::tags->INTERNAL_VICTIM_TEAM_SHORT_TAG, RenX::getTeamName(team));
msg.replace(RenX::tags->INTERNAL_VICTIM_TEAM_LONG_TAG, RenX::getFullTeamName(team));
msg.replace(RenX::tags->INTERNAL_WIN_SCORE_TAG, Jupiter::StringS::Format("%d", yesVotes));
msg.replace(RenX::tags->INTERNAL_LOSE_SCORE_TAG, Jupiter::StringS::Format("%d", noVotes));
(server->*func)(msg);
}
}
void RenX_LoggingPlugin::RenX_OnVoteCancel(RenX::Server *server, const RenX::TeamType &team, const Jupiter::ReadableString &type)
{
logFuncType func;
if (RenX_LoggingPlugin::voteCancelPublic)
func = &RenX::Server::sendLogChan;
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg = this->voteCancelFmt;
if (msg.isEmpty() == false)
{
RenX::processTags(msg, server);
msg.replace(RenX::tags->INTERNAL_OBJECT_TAG, RenX::translateName(type));
msg.replace(RenX::tags->INTERNAL_TEAM_COLOR_TAG, RenX::getTeamColor(team));
msg.replace(RenX::tags->INTERNAL_TEAM_SHORT_TAG, RenX::getTeamName(team));
msg.replace(RenX::tags->INTERNAL_TEAM_LONG_TAG, RenX::getFullTeamName(team));
msg.replace(RenX::tags->INTERNAL_VICTIM_TEAM_COLOR_TAG, RenX::getTeamColor(team));
msg.replace(RenX::tags->INTERNAL_VICTIM_TEAM_SHORT_TAG, RenX::getTeamName(team));
msg.replace(RenX::tags->INTERNAL_VICTIM_TEAM_LONG_TAG, RenX::getFullTeamName(team));
(server->*func)(msg);
}
}
void RenX_LoggingPlugin::RenX_OnVote(RenX::Server *server, const Jupiter::ReadableString &raw)
{
logFuncType func;
if (RenX_LoggingPlugin::votePublic)
func = &RenX::Server::sendLogChan;
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg = this->voteFmt;
if (msg.isEmpty() == false)
{
RenX::processTags(msg, server);
msg.replace(RenX::tags->INTERNAL_MESSAGE_TAG, raw);
(server->*func)(msg);
}
}
void RenX_LoggingPlugin::RenX_OnMapChange(RenX::Server *server, const Jupiter::ReadableString &map, bool seamless)
{
logFuncType func;
if (RenX_LoggingPlugin::mapChangePublic)
func = &RenX::Server::sendLogChan;
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg = this->mapChangeFmt;
if (msg.isEmpty() == false)
{
RenX::processTags(msg, server);
msg.replace(RenX::tags->INTERNAL_MESSAGE_TAG, map);
(server->*func)(msg);
}
}
void RenX_LoggingPlugin::RenX_OnMapLoad(RenX::Server *server, const Jupiter::ReadableString &map)
{
logFuncType func;
if (RenX_LoggingPlugin::mapLoadPublic)
func = &RenX::Server::sendLogChan;
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg = this->mapLoadFmt;
if (msg.isEmpty() == false)
{
RenX::processTags(msg, server);
msg.replace(RenX::tags->INTERNAL_MESSAGE_TAG, map);
(server->*func)(msg);
}
}
void RenX_LoggingPlugin::RenX_OnMap(RenX::Server *server, const Jupiter::ReadableString &raw)
{
logFuncType func;
if (RenX_LoggingPlugin::mapPublic)
func = &RenX::Server::sendLogChan;
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg = this->mapFmt;
if (msg.isEmpty() == false)
{
RenX::processTags(msg, server);
msg.replace(RenX::tags->INTERNAL_MESSAGE_TAG, raw);
(server->*func)(msg);
}
}
void RenX_LoggingPlugin::RenX_OnDemoRecord(RenX::Server *server, const RenX::PlayerInfo *player)
{
logFuncType func;
if (RenX_LoggingPlugin::demoRecordPublic)
func = &RenX::Server::sendLogChan;
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg = this->demoRecordFmt;
if (msg.isEmpty() == false)
{
RenX::processTags(msg, server, player);
(server->*func)(msg);
}
}
void RenX_LoggingPlugin::RenX_OnDemoRecord(RenX::Server *server, const Jupiter::ReadableString &user)
{
logFuncType func;
if (RenX_LoggingPlugin::demoRecordPublic)
func = &RenX::Server::sendLogChan;
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg = this->rconDemoRecordFmt;
if (msg.isEmpty() == false)
{
RenX::processTags(msg, server);
msg.replace(RenX::tags->nameTag, user);
(server->*func)(msg);
}
}
void RenX_LoggingPlugin::RenX_OnDemo(RenX::Server *server, const Jupiter::ReadableString &raw)
{
logFuncType func;
if (RenX_LoggingPlugin::demoPublic)
func = &RenX::Server::sendLogChan;
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg = this->demoFmt;
if (msg.isEmpty() == false)
{
RenX::processTags(msg, server);
msg.replace(RenX::tags->INTERNAL_MESSAGE_TAG, raw);
(server->*func)(msg);
}
}
void RenX_LoggingPlugin::RenX_OnLog(RenX::Server *server, const Jupiter::ReadableString &raw)
{
logFuncType func;
@ -844,7 +1281,7 @@ void RenX_LoggingPlugin::RenX_OnSpawnVehicle(RenX::Server *server, const RenX::P
}
}
void RenX_LoggingPlugin::RenX_OnSpawnVehicleNoOwner(RenX::Server *server, const RenX::TeamType team, const Jupiter::ReadableString &vehicle)
void RenX_LoggingPlugin::RenX_OnSpawnVehicleNoOwner(RenX::Server *server, const RenX::TeamType &team, const Jupiter::ReadableString &vehicle)
{
logFuncType func;
if (RenX_LoggingPlugin::spawnVehicleNoOwnerPublic)

77
RenX.Logging/RenX_Logging.h

@ -1,5 +1,5 @@
/**
* Copyright (C) 2014 Justin James.
* Copyright (C) 2014-2015 Justin James.
*
* This license must be preserved.
* Any applications, libraries, or code which make any use of any
@ -27,20 +27,30 @@ public: // RenX::Plugin
void RenX_OnJoin(RenX::Server *server, const RenX::PlayerInfo *player) override;
void RenX_OnPart(RenX::Server *server, const RenX::PlayerInfo *player) override;
void RenX_OnNameChange(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &newPlayerName) override;
void RenX_OnTeamChange(RenX::Server *server, const RenX::PlayerInfo *player) 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_OnPlayer(RenX::Server *server, const Jupiter::ReadableString &raw) override;
void RenX_OnChat(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &message) override;
void RenX_OnTeamChat(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &message) override;
void RenX_OnHostChat(RenX::Server *server, const Jupiter::ReadableString &message) override;
void RenX_OnHostPage(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &message) override;
void RenX_OnOtherChat(RenX::Server *server, const Jupiter::ReadableString &raw) override;
void RenX_OnDeploy(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &object) override;
void RenX_OnDisarm(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &object) override;
void RenX_OnSuicide(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &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 Jupiter::ReadableString &killer, RenX::TeamType killerTeam, const RenX::PlayerInfo *victim, const Jupiter::ReadableString &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_OnDie(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &damageType) override;
void RenX_OnDie(RenX::Server *server, const Jupiter::ReadableString &object, RenX::TeamType objectTeam, const Jupiter::ReadableString &damageType) override;
void RenX_OnDie(RenX::Server *server, const Jupiter::ReadableString &object, const RenX::TeamType &objectTeam, const Jupiter::ReadableString &damageType) override;
void RenX_OnDestroy(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &objectName, const Jupiter::ReadableString &damageType, RenX::ObjectType type) override;
void RenX_OnDestroy(RenX::Server *server, const Jupiter::ReadableString &killer, RenX::TeamType killerTeam, const Jupiter::ReadableString &objectName, RenX::TeamType objectTeam, const Jupiter::ReadableString &damageType, RenX::ObjectType type) override;
void RenX_OnGameOver(RenX::Server *server, RenX::WinType winType, RenX::TeamType team, int gScore, int nScore) 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_OnCapture(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, const Jupiter::ReadableString &building, const RenX::TeamType &oldTeam) 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, const Jupiter::ReadableString &vehicle, const RenX::PlayerInfo *victim) 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_OnExecute(RenX::Server *server, const Jupiter::ReadableString &user, const Jupiter::ReadableString &command) override;
@ -52,12 +62,25 @@ public: // RenX::Plugin
void RenX_OnAdminLogout(RenX::Server *server, const RenX::PlayerInfo *player) override;
void RenX_OnAdmin(RenX::Server *server, const Jupiter::ReadableString &raw) override;
void RenX_OnVoteCall(RenX::Server *server, const RenX::TeamType &team, const Jupiter::ReadableString &type, const RenX::PlayerInfo *player, const Jupiter::ReadableString &parameters) override;
void RenX_OnVoteOver(RenX::Server *server, const RenX::TeamType &team, const Jupiter::ReadableString &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_OnVote(RenX::Server *server, const Jupiter::ReadableString &raw) override;
void RenX_OnMapChange(RenX::Server *server, const Jupiter::ReadableString &map, bool seamless) override;
void RenX_OnMapLoad(RenX::Server *server, const Jupiter::ReadableString &map) override;
void RenX_OnMap(RenX::Server *server, const Jupiter::ReadableString &raw) 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_OnDemo(RenX::Server *server, const Jupiter::ReadableString &raw) override;
void RenX_OnLog(RenX::Server *server, const Jupiter::ReadableString &raw) override;
void RenX_XOnVersion(RenX::Server *server, unsigned int version) override;
void RenX_OnGrantCharacter(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &character) override;
void RenX_OnSpawnVehicle(RenX::Server *server, const RenX::PlayerInfo *owner, const Jupiter::ReadableString &vehicle) override;
void RenX_OnSpawnVehicleNoOwner(RenX::Server *server, const RenX::TeamType team, const Jupiter::ReadableString &vehicle) override;
void RenX_OnSpawnVehicleNoOwner(RenX::Server *server, const RenX::TeamType &team, const Jupiter::ReadableString &vehicle) override;
void RenX_OnMinePlace(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &mine) override;
void RenX_XOnOther(RenX::Server *server, const Jupiter::ReadableString &raw) override;
@ -81,15 +104,23 @@ private:
unsigned int partPublic : 1;
unsigned int nameChangePublic : 1;
unsigned int teamChangePublic : 1;
unsigned int playerPublic : 1;
unsigned int chatPublic : 1;
unsigned int teamChatPublic : 1;
unsigned int hostChatPublic : 1;
unsigned int hostPagePublic : 1;
unsigned int otherChatPublic : 1;
unsigned int deployPublic : 1;
unsigned int disarmPublic : 1;
unsigned int suicidePublic : 1;
unsigned int killPublic : 1;
unsigned int diePublic : 1;
unsigned int destroyPublic : 1;
unsigned int gamePublic : 1;
unsigned int capturePublic : 1;
unsigned int neutralizePublic : 1;
unsigned int stealPublic : 1;
unsigned int gameOverPublic : 1;
unsigned int gamePublic : 1;
unsigned int executePublic : 1;
unsigned int subscribePublic : 1;
unsigned int RCONPublic : 1;
@ -97,6 +128,15 @@ private:
unsigned int adminGrantPublic : 1;
unsigned int adminLogoutPublic : 1;
unsigned int adminPublic : 1;
unsigned int voteCallPublic : 1;
unsigned int voteOverPublic : 1;
unsigned int voteCancelPublic : 1;
unsigned int votePublic : 1;
unsigned int mapChangePublic : 1;
unsigned int mapLoadPublic : 1;
unsigned int mapPublic : 1;
unsigned int demoRecordPublic : 1;
unsigned int demoPublic : 1;
unsigned int logPublic : 1;
unsigned int xVersionPublic : 1;
unsigned int grantCharacterPublic : 1;
@ -115,9 +155,14 @@ private:
Jupiter::StringS partFmt;
Jupiter::StringS nameChangeFmt;
Jupiter::StringS teamChangeFmt;
Jupiter::StringS playerFmt;
Jupiter::StringS chatFmt;
Jupiter::StringS teamChatFmt;
Jupiter::StringS hostChatFmt;
Jupiter::StringS hostPageFmt;
Jupiter::StringS otherChatFmt;
Jupiter::StringS deployFmt;
Jupiter::StringS disarmFmt;
Jupiter::StringS suicideFmt;
Jupiter::StringS dieFmt;
Jupiter::StringS dieFmt2;
@ -129,18 +174,32 @@ private:
Jupiter::StringS destroyDefenceFmt2;
Jupiter::StringS destroyVehicleFmt;
Jupiter::StringS destroyVehicleFmt2;
Jupiter::StringS captureFmt;
Jupiter::StringS neutralizeFmt;
Jupiter::StringS stealFmt;
Jupiter::StringS stealNoOwnerFmt;
Jupiter::StringS gameOverFmt;
Jupiter::StringS gameOverTieFmt;
Jupiter::StringS gameOverTieNoWinFmt;
Jupiter::StringS gameOverScoreFmt;
Jupiter::StringS gameFmt;
Jupiter::StringS executeFmt, evaFmt, evaPrivateFmt;
Jupiter::StringS executeFmt, playerExecuteFmt;
Jupiter::StringS subscribeFmt;
Jupiter::StringS rconFmt;
Jupiter::StringS adminLoginFmt;
Jupiter::StringS adminGrantFmt;
Jupiter::StringS adminLogoutFmt;
Jupiter::StringS adminFmt;
Jupiter::StringS voteCallFmt;
Jupiter::StringS voteOverSuccessFmt;
Jupiter::StringS voteOverFailFmt;
Jupiter::StringS voteCancelFmt;
Jupiter::StringS voteFmt;
Jupiter::StringS mapChangeFmt;
Jupiter::StringS mapLoadFmt;
Jupiter::StringS mapFmt;
Jupiter::StringS demoRecordFmt, rconDemoRecordFmt;
Jupiter::StringS demoFmt;
Jupiter::StringS logFmt;
Jupiter::StringS xVersionFmt;
Jupiter::StringS grantCharacterFmt;

2
RenX.Medals/RenX_Medals.cpp

@ -158,7 +158,7 @@ void RenX_MedalsPlugin::RenX_OnJoin(RenX::Server *server, const RenX::PlayerInfo
}
}
void RenX_MedalsPlugin::RenX_OnGameOver(RenX::Server *server, RenX::WinType winType, RenX::TeamType team, int gScore, int nScore)
void RenX_MedalsPlugin::RenX_OnGameOver(RenX::Server *server, RenX::WinType winType, const RenX::TeamType &team, int gScore, int nScore)
{
if (server->isFirstGame() == false) // No unfair medals for the first game! :D
{

2
RenX.Medals/RenX_Medals.h

@ -47,7 +47,7 @@ public: // RenX::Plugin
void RenX_OnPlayerCreate(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_OnGameOver(RenX::Server *server, RenX::WinType winType, 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 Jupiter::ReadableString &damageType, RenX::ObjectType type) override;
RenX_MedalsPlugin();
~RenX_MedalsPlugin();

Loading…
Cancel
Save