Browse Source

Additional tags added; PlayerInfo IRC command now configurable.

pull/3/head
JustinAJ 10 years ago
parent
commit
c2b3a0defb
  1. BIN
      Release/Plugins/RenX.Core.lib
  2. 26
      RenX.Commands/RenX_Commands.cpp
  3. 4
      RenX.Commands/RenX_Commands.h
  4. 120
      RenX.Core/RenX_Tags.cpp
  5. 60
      RenX.Core/RenX_Tags.h

BIN
Release/Plugins/RenX.Core.lib

Binary file not shown.

26
RenX.Commands/RenX_Commands.cpp

@ -24,6 +24,7 @@
#include "RenX_PlayerInfo.h" #include "RenX_PlayerInfo.h"
#include "RenX_Functions.h" #include "RenX_Functions.h"
#include "RenX_BanDatabase.h" #include "RenX_BanDatabase.h"
#include "RenX_Tags.h"
inline bool togglePhasing(RenX::Server *server, bool newState) inline bool togglePhasing(RenX::Server *server, bool newState)
{ {
@ -65,6 +66,11 @@ void RenX_CommandsPlugin::RenX_OnDie(RenX::Server *server, const RenX::PlayerInf
int RenX_CommandsPlugin::OnRehash() int RenX_CommandsPlugin::OnRehash()
{ {
RenX_CommandsPlugin::_defaultTempBanTime = Jupiter::IRC::Client::Config->getLongLong(RenX_CommandsPlugin::getName(), STRING_LITERAL_AS_REFERENCE("TBanTime"), 86400); RenX_CommandsPlugin::_defaultTempBanTime = Jupiter::IRC::Client::Config->getLongLong(RenX_CommandsPlugin::getName(), STRING_LITERAL_AS_REFERENCE("TBanTime"), 86400);
RenX_CommandsPlugin::playerInfoFormat = Jupiter::IRC::Client::Config->get(RenX_CommandsPlugin::getName(), STRING_LITERAL_AS_REFERENCE("PlayerInfoFormat"), STRING_LITERAL_AS_REFERENCE(IRCCOLOR "03[Player Info]" IRCCOLOR "04 Name: " IRCBOLD "{RNAME}" IRCBOLD " - ID: {ID} - Team: " IRCBOLD "{TEAML}" IRCBOLD " - Vehicle Kills: {VEHICLEKILLS} - Building Kills {BUILDINGKILLS} - Kills {KILLS} - Deaths: {DEATHS} - KDR: {KDR} - Access: {ACCESS}"));
RenX_CommandsPlugin::adminPlayerInfoFormat = Jupiter::IRC::Client::Config->get(RenX_CommandsPlugin::getName(), STRING_LITERAL_AS_REFERENCE("AdminPlayerInfoFormat"), Jupiter::StringS::Format("%.*s - IP: " IRCBOLD "{IP}" IRCBOLD " - Steam ID: " IRCBOLD "{STEAM}", RenX_CommandsPlugin::playerInfoFormat.size(), RenX_CommandsPlugin::playerInfoFormat.ptr()));
RenX::sanitizeTags(RenX_CommandsPlugin::playerInfoFormat);
RenX::sanitizeTags(RenX_CommandsPlugin::adminPlayerInfoFormat);
return 0; return 0;
} }
@ -73,6 +79,16 @@ time_t RenX_CommandsPlugin::getTBanTime()
return RenX_CommandsPlugin::_defaultTempBanTime; return RenX_CommandsPlugin::_defaultTempBanTime;
} }
const Jupiter::ReadableString &RenX_CommandsPlugin::getPlayerInfoFormat() const
{
return RenX_CommandsPlugin::playerInfoFormat;
}
const Jupiter::ReadableString &RenX_CommandsPlugin::getAdminPlayerInfoFormat() const
{
return RenX_CommandsPlugin::adminPlayerInfoFormat;
}
RenX_CommandsPlugin::RenX_CommandsPlugin() RenX_CommandsPlugin::RenX_CommandsPlugin()
{ {
this->OnRehash(); this->OnRehash();
@ -421,7 +437,13 @@ void PlayerInfoIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableStrin
player = node->data; player = node->data;
if (player->name.findi(parameters) != Jupiter::INVALID_INDEX) if (player->name.findi(parameters) != Jupiter::INVALID_INDEX)
{ {
const Jupiter::ReadableString &teamColor = RenX::getTeamColor(player->team); if (source->getAccessLevel(channel, nick) > 1)
msg = pluginInstance.getAdminPlayerInfoFormat();
else
msg = pluginInstance.getPlayerInfoFormat();
RenX::processTags(msg, server, player);
source->sendMessage(channel, msg);
/*const Jupiter::ReadableString &teamColor = RenX::getTeamColor(player->team);
const Jupiter::ReadableString &teamName = RenX::getFullTeamName(player->team); const Jupiter::ReadableString &teamName = RenX::getFullTeamName(player->team);
msg.format(IRCCOLOR "03[Player Info]" IRCCOLOR "%.*s Name: " IRCBOLD "%.*s" IRCBOLD " - ID: %d - Team: " IRCBOLD "%.*s" IRCBOLD " - Vehicle Kills: %u - Defence Kills: %u - Building Kills: %u - Kills: %u (%u headshots) - Deaths: %u (%u suicides) - KDR: %.2f - Access: %d", teamColor.size(), teamColor.ptr(), player->name.size(), player->name.ptr(), player->id, teamName.size(), teamName.ptr(), player->vehicleKills, player->defenceKills, player->buildingKills, player->kills, player->headshots, player->deaths, player->suicides, ((float)player->kills) / (player->deaths == 0 ? 1.0 : (float)player->deaths), player->access); msg.format(IRCCOLOR "03[Player Info]" IRCCOLOR "%.*s Name: " IRCBOLD "%.*s" IRCBOLD " - ID: %d - Team: " IRCBOLD "%.*s" IRCBOLD " - Vehicle Kills: %u - Defence Kills: %u - Building Kills: %u - Kills: %u (%u headshots) - Deaths: %u (%u suicides) - KDR: %.2f - Access: %d", teamColor.size(), teamColor.ptr(), player->name.size(), player->name.ptr(), player->id, teamName.size(), teamName.ptr(), player->vehicleKills, player->defenceKills, player->buildingKills, player->kills, player->headshots, player->deaths, player->suicides, ((float)player->kills) / (player->deaths == 0 ? 1.0 : (float)player->deaths), player->access);
if (source->getAccessLevel(channel, nick) > 1) if (source->getAccessLevel(channel, nick) > 1)
@ -446,7 +468,7 @@ void PlayerInfoIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableStrin
msg += player->adminType; msg += player->adminType;
msg += IRCBOLD; msg += IRCBOLD;
} }
source->sendMessage(channel, msg); source->sendMessage(channel, msg);*/
} }
} }
} }

4
RenX.Commands/RenX_Commands.h

@ -38,11 +38,15 @@ public: // Jupiter::Plugin
public: public:
time_t getTBanTime(); time_t getTBanTime();
const Jupiter::ReadableString &getPlayerInfoFormat() const;
const Jupiter::ReadableString &getAdminPlayerInfoFormat() const;
RenX_CommandsPlugin(); RenX_CommandsPlugin();
private: private:
STRING_LITERAL_AS_NAMED_REFERENCE(name, "RenX.Commands"); STRING_LITERAL_AS_NAMED_REFERENCE(name, "RenX.Commands");
time_t _defaultTempBanTime; time_t _defaultTempBanTime;
Jupiter::StringS playerInfoFormat;
Jupiter::StringS adminPlayerInfoFormat;
}; };
GENERIC_CONSOLE_COMMAND(RCONConsoleCommand) GENERIC_CONSOLE_COMMAND(RCONConsoleCommand)

120
RenX.Core/RenX_Tags.cpp

@ -68,6 +68,21 @@ TagsImp::TagsImp()
this->INTERNAL_TEAM_COLOR_TAG = STRING_LITERAL_AS_REFERENCE("\0TC\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_SHORT_TAG = STRING_LITERAL_AS_REFERENCE("\0TS\0");
this->INTERNAL_TEAM_LONG_TAG = STRING_LITERAL_AS_REFERENCE("\0TL\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");
/** Victim tags */ /** Victim tags */
this->INTERNAL_VICTIM_NAME_TAG = STRING_LITERAL_AS_REFERENCE("\0VNAME\0"); this->INTERNAL_VICTIM_NAME_TAG = STRING_LITERAL_AS_REFERENCE("\0VNAME\0");
@ -84,6 +99,21 @@ TagsImp::TagsImp()
this->INTERNAL_VICTIM_TEAM_COLOR_TAG = STRING_LITERAL_AS_REFERENCE("\0VTC\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_SHORT_TAG = STRING_LITERAL_AS_REFERENCE("\0VTS\0");
this->INTERNAL_VICTIM_TEAM_LONG_TAG = STRING_LITERAL_AS_REFERENCE("\0VTL\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");
/** Other tags */ /** Other tags */
this->INTERNAL_WEAPON_TAG = STRING_LITERAL_AS_REFERENCE("\0WEP\0"); this->INTERNAL_WEAPON_TAG = STRING_LITERAL_AS_REFERENCE("\0WEP\0");
@ -120,6 +150,21 @@ TagsImp::TagsImp()
this->teamColorTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("TeamColorTag"), STRING_LITERAL_AS_REFERENCE("{TCOLOR}")); this->teamColorTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("TeamColorTag"), STRING_LITERAL_AS_REFERENCE("{TCOLOR}"));
this->teamShortTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("ShortTeamTag"), STRING_LITERAL_AS_REFERENCE("{TEAMS}")); this->teamShortTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("ShortTeamTag"), STRING_LITERAL_AS_REFERENCE("{TEAMS}"));
this->teamLongTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("LongTeamTag"), STRING_LITERAL_AS_REFERENCE("{TEAML}")); this->teamLongTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("LongTeamTag"), STRING_LITERAL_AS_REFERENCE("{TEAML}"));
this->pingTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("PingTag"), STRING_LITERAL_AS_REFERENCE("{PING}"));
this->scoreTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("ScoreTag"), STRING_LITERAL_AS_REFERENCE("{SCORE}"));
this->creditsTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("CreditsTag"), STRING_LITERAL_AS_REFERENCE("{CREDITS}"));
this->killsTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("KillsTag"), STRING_LITERAL_AS_REFERENCE("{KILLS}"));
this->deathsTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("DeathsTag"), STRING_LITERAL_AS_REFERENCE("{DEATHS}"));
this->kdrTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("KDRTag"), STRING_LITERAL_AS_REFERENCE("{KDR}"));
this->suicidesTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("SuicidesTag"), STRING_LITERAL_AS_REFERENCE("{SUICIDES}"));
this->headshotsTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("HeadshotsTag"), STRING_LITERAL_AS_REFERENCE("{HEADSHOTS}"));
this->vehicleKillsTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VehicleKillsTag"), STRING_LITERAL_AS_REFERENCE("{VEHICLEKILLS}"));
this->buildingKillsTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("BuildingKillsTag"), STRING_LITERAL_AS_REFERENCE("{BUILDINGKILLS}"));
this->defenceKillsTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("DefenceKillsTag"), STRING_LITERAL_AS_REFERENCE("{DEFENCEKILLS}"));
this->winsTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("WinsTag"), STRING_LITERAL_AS_REFERENCE("{WINS}"));
this->losesTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("LosesTag"), STRING_LITERAL_AS_REFERENCE("{LOSES}"));
this->beaconPlacementsTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("BeaconPlacementsTag"), STRING_LITERAL_AS_REFERENCE("{BEACONPLACEMENTS}"));
this->accessTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("AccessTag"), STRING_LITERAL_AS_REFERENCE("{ACCESS}"));
/** Victim player tags */ /** Victim player tags */
this->victimNameTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VictimNameTag"), STRING_LITERAL_AS_REFERENCE("{VNAME}")); this->victimNameTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VictimNameTag"), STRING_LITERAL_AS_REFERENCE("{VNAME}"));
@ -136,6 +181,21 @@ TagsImp::TagsImp()
this->victimTeamColorTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VictimTeamColorTag"), STRING_LITERAL_AS_REFERENCE("{VTCOLOR}")); this->victimTeamColorTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VictimTeamColorTag"), STRING_LITERAL_AS_REFERENCE("{VTCOLOR}"));
this->victimTeamShortTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VictimShortTeamTag"), STRING_LITERAL_AS_REFERENCE("{VTEAMS}")); this->victimTeamShortTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VictimShortTeamTag"), STRING_LITERAL_AS_REFERENCE("{VTEAMS}"));
this->victimTeamLongTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VictimLongTeamTag"), STRING_LITERAL_AS_REFERENCE("{VTEAML}")); this->victimTeamLongTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VictimLongTeamTag"), STRING_LITERAL_AS_REFERENCE("{VTEAML}"));
this->victimPingTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VictimPingTag"), STRING_LITERAL_AS_REFERENCE("{VPING}"));
this->victimScoreTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VictimScoreTag"), STRING_LITERAL_AS_REFERENCE("{VSCORE}"));
this->victimCreditsTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VictimCreditsTag"), STRING_LITERAL_AS_REFERENCE("{VCREDITS}"));
this->victimKillsTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VictimKillsTag"), STRING_LITERAL_AS_REFERENCE("{VKILLS}"));
this->victimDeathsTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VictimDeathsTag"), STRING_LITERAL_AS_REFERENCE("{VDEATHS}"));
this->victimKDRTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VictimKDRTag"), STRING_LITERAL_AS_REFERENCE("{VKDR}"));
this->victimSuicidesTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VictimSuicidesTag"), STRING_LITERAL_AS_REFERENCE("{VSUICIDES}"));
this->victimHeadshotsTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VictimHeadshotsTag"), STRING_LITERAL_AS_REFERENCE("{VHEADSHOTS}"));
this->victimVehicleKillsTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VictimVehicleKillsTag"), STRING_LITERAL_AS_REFERENCE("{VVEHICLEKILLS}"));
this->victimBuildingKillsTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VictimBuildingKillsTag"), STRING_LITERAL_AS_REFERENCE("{VBUILDINGKILLS}"));
this->victimDefenceKillsTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VictimDefenceKillsTag"), STRING_LITERAL_AS_REFERENCE("{VDEFENCEKILLS}"));
this->victimWinsTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VictimWinsTag"), STRING_LITERAL_AS_REFERENCE("{VWINS}"));
this->victimLosesTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VictimLosesTag"), STRING_LITERAL_AS_REFERENCE("{VLOSES}"));
this->victimBeaconPlacementsTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VictimBeaconPlacementsTag"), STRING_LITERAL_AS_REFERENCE("{VBEACONPLACEMENTS}"));
this->victimAccessTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("VictimAccessTag"), STRING_LITERAL_AS_REFERENCE("{VACCESS}"));
/** Other tags */ /** Other tags */
this->weaponTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("WeaponTag"), STRING_LITERAL_AS_REFERENCE("{WEAPON}")); this->weaponTag = Jupiter::IRC::Client::Config->get(configSection, STRING_LITERAL_AS_REFERENCE("WeaponTag"), STRING_LITERAL_AS_REFERENCE("{WEAPON}"));
@ -180,6 +240,21 @@ void TagsImp::processTags(Jupiter::StringType &msg, const RenX::Server *server,
msg.replace(this->INTERNAL_TEAM_COLOR_TAG, RenX::getTeamColor(player->team)); msg.replace(this->INTERNAL_TEAM_COLOR_TAG, RenX::getTeamColor(player->team));
msg.replace(this->INTERNAL_TEAM_SHORT_TAG, RenX::getTeamName(player->team)); msg.replace(this->INTERNAL_TEAM_SHORT_TAG, RenX::getTeamName(player->team));
msg.replace(this->INTERNAL_TEAM_LONG_TAG, RenX::getFullTeamName(player->team)); msg.replace(this->INTERNAL_TEAM_LONG_TAG, RenX::getFullTeamName(player->team));
msg.replace(this->INTERNAL_PING_TAG, Jupiter::StringS::Format("%.2f", player->ping));
msg.replace(this->INTERNAL_SCORE_TAG, Jupiter::StringS::Format("%.0f", player->score));
msg.replace(this->INTERNAL_CREDITS_TAG, Jupiter::StringS::Format("%.0f", player->credits));
msg.replace(this->INTERNAL_KILLS_TAG, Jupiter::StringS::Format("%u", player->kills));
msg.replace(this->INTERNAL_DEATHS_TAG, Jupiter::StringS::Format("%u", player->deaths));
msg.replace(this->INTERNAL_KDR_TAG, Jupiter::StringS::Format("%.2f", static_cast<float>(player->kills) / (player->deaths == 0 ? 1.0f : static_cast<float>(player->deaths))));
msg.replace(this->INTERNAL_SUICIDES_TAG, Jupiter::StringS::Format("%u", player->suicides));
msg.replace(this->INTERNAL_HEADSHOTS_TAG, Jupiter::StringS::Format("%u", player->headshots));
msg.replace(this->INTERNAL_VEHICLE_KILLS_TAG, Jupiter::StringS::Format("%u", player->vehicleKills));
msg.replace(this->INTERNAL_BUILDING_KILLS_TAG, Jupiter::StringS::Format("%u", player->buildingKills));
msg.replace(this->INTERNAL_DEFENCE_KILLS_TAG, Jupiter::StringS::Format("%u", player->defenceKills));
msg.replace(this->INTERNAL_WINS_TAG, Jupiter::StringS::Format("%u", player->wins));
msg.replace(this->INTERNAL_LOSES_TAG, Jupiter::StringS::Format("%u", player->loses));
msg.replace(this->INTERNAL_BEACON_PLACEMENTS_TAG, Jupiter::StringS::Format("%u", player->beaconPlacements));
msg.replace(this->INTERNAL_ACCESS_TAG, Jupiter::StringS::Format("%d", player->access));
} }
if (victim != nullptr) if (victim != nullptr)
{ {
@ -196,6 +271,21 @@ void TagsImp::processTags(Jupiter::StringType &msg, const RenX::Server *server,
msg.replace(this->INTERNAL_VICTIM_TEAM_COLOR_TAG, RenX::getTeamColor(victim->team)); msg.replace(this->INTERNAL_VICTIM_TEAM_COLOR_TAG, RenX::getTeamColor(victim->team));
msg.replace(this->INTERNAL_VICTIM_TEAM_SHORT_TAG, RenX::getTeamName(victim->team)); msg.replace(this->INTERNAL_VICTIM_TEAM_SHORT_TAG, RenX::getTeamName(victim->team));
msg.replace(this->INTERNAL_VICTIM_TEAM_LONG_TAG, RenX::getFullTeamName(victim->team)); msg.replace(this->INTERNAL_VICTIM_TEAM_LONG_TAG, RenX::getFullTeamName(victim->team));
msg.replace(this->INTERNAL_VICTIM_PING_TAG, Jupiter::StringS::Format("%f", victim->ping));
msg.replace(this->INTERNAL_VICTIM_SCORE_TAG, Jupiter::StringS::Format("%f", victim->score));
msg.replace(this->INTERNAL_VICTIM_CREDITS_TAG, Jupiter::StringS::Format("%f", victim->credits));
msg.replace(this->INTERNAL_VICTIM_KILLS_TAG, Jupiter::StringS::Format("%u", victim->kills));
msg.replace(this->INTERNAL_VICTIM_DEATHS_TAG, Jupiter::StringS::Format("%u", victim->deaths));
msg.replace(this->INTERNAL_VICTIM_KDR_TAG, Jupiter::StringS::Format("%.2f", static_cast<float>(victim->kills) / (victim->deaths == 0 ? 1.0f : static_cast<float>(victim->deaths))));
msg.replace(this->INTERNAL_VICTIM_SUICIDES_TAG, Jupiter::StringS::Format("%u", victim->suicides));
msg.replace(this->INTERNAL_VICTIM_HEADSHOTS_TAG, Jupiter::StringS::Format("%u", victim->headshots));
msg.replace(this->INTERNAL_VICTIM_VEHICLE_KILLS_TAG, Jupiter::StringS::Format("%u", victim->vehicleKills));
msg.replace(this->INTERNAL_VICTIM_BUILDING_KILLS_TAG, Jupiter::StringS::Format("%u", victim->buildingKills));
msg.replace(this->INTERNAL_VICTIM_DEFENCE_KILLS_TAG, Jupiter::StringS::Format("%u", victim->defenceKills));
msg.replace(this->INTERNAL_VICTIM_WINS_TAG, Jupiter::StringS::Format("%u", victim->wins));
msg.replace(this->INTERNAL_VICTIM_LOSES_TAG, Jupiter::StringS::Format("%u", victim->loses));
msg.replace(this->INTERNAL_VICTIM_BEACON_PLACEMENTS_TAG, Jupiter::StringS::Format("%u", victim->beaconPlacements));
msg.replace(this->INTERNAL_VICTIM_ACCESS_TAG, Jupiter::StringS::Format("%d", victim->access));
} }
Jupiter::ArrayList<RenX::Plugin> &xPlugins = *RenX::getCore()->getPlugins(); Jupiter::ArrayList<RenX::Plugin> &xPlugins = *RenX::getCore()->getPlugins();
@ -230,6 +320,21 @@ void TagsImp::sanitizeTags(Jupiter::StringType &fmt)
fmt.replace(this->teamColorTag, this->INTERNAL_TEAM_COLOR_TAG); fmt.replace(this->teamColorTag, this->INTERNAL_TEAM_COLOR_TAG);
fmt.replace(this->teamShortTag, this->INTERNAL_TEAM_SHORT_TAG); fmt.replace(this->teamShortTag, this->INTERNAL_TEAM_SHORT_TAG);
fmt.replace(this->teamLongTag, this->INTERNAL_TEAM_LONG_TAG); fmt.replace(this->teamLongTag, this->INTERNAL_TEAM_LONG_TAG);
fmt.replace(this->pingTag, this->INTERNAL_PING_TAG);
fmt.replace(this->scoreTag, this->INTERNAL_SCORE_TAG);
fmt.replace(this->creditsTag, this->INTERNAL_CREDITS_TAG);
fmt.replace(this->killsTag, this->INTERNAL_KILLS_TAG);
fmt.replace(this->deathsTag, this->INTERNAL_DEATHS_TAG);
fmt.replace(this->kdrTag, this->INTERNAL_KDR_TAG);
fmt.replace(this->suicidesTag, this->INTERNAL_SUICIDES_TAG);
fmt.replace(this->headshotsTag, this->INTERNAL_HEADSHOTS_TAG);
fmt.replace(this->vehicleKillsTag, this->INTERNAL_VEHICLE_KILLS_TAG);
fmt.replace(this->buildingKillsTag, this->INTERNAL_BUILDING_KILLS_TAG);
fmt.replace(this->defenceKillsTag, this->INTERNAL_DEFENCE_KILLS_TAG);
fmt.replace(this->winsTag, this->INTERNAL_WINS_TAG);
fmt.replace(this->losesTag, this->INTERNAL_LOSES_TAG);
fmt.replace(this->beaconPlacementsTag, this->INTERNAL_BEACON_PLACEMENTS_TAG);
fmt.replace(this->accessTag, this->INTERNAL_ACCESS_TAG);
/** Victim tags */ /** Victim tags */
fmt.replace(this->victimNameTag, this->INTERNAL_VICTIM_NAME_TAG); fmt.replace(this->victimNameTag, this->INTERNAL_VICTIM_NAME_TAG);
@ -246,6 +351,21 @@ void TagsImp::sanitizeTags(Jupiter::StringType &fmt)
fmt.replace(this->victimTeamColorTag, this->INTERNAL_VICTIM_TEAM_COLOR_TAG); fmt.replace(this->victimTeamColorTag, this->INTERNAL_VICTIM_TEAM_COLOR_TAG);
fmt.replace(this->victimTeamShortTag, this->INTERNAL_VICTIM_TEAM_SHORT_TAG); fmt.replace(this->victimTeamShortTag, this->INTERNAL_VICTIM_TEAM_SHORT_TAG);
fmt.replace(this->victimTeamLongTag, this->INTERNAL_VICTIM_TEAM_LONG_TAG); fmt.replace(this->victimTeamLongTag, this->INTERNAL_VICTIM_TEAM_LONG_TAG);
fmt.replace(this->victimPingTag, this->INTERNAL_VICTIM_PING_TAG);
fmt.replace(this->victimScoreTag, this->INTERNAL_VICTIM_SCORE_TAG);
fmt.replace(this->victimCreditsTag, this->INTERNAL_VICTIM_CREDITS_TAG);
fmt.replace(this->victimKillsTag, this->INTERNAL_VICTIM_KILLS_TAG);
fmt.replace(this->victimDeathsTag, this->INTERNAL_VICTIM_DEATHS_TAG);
fmt.replace(this->victimKDRTag, this->INTERNAL_VICTIM_KDR_TAG);
fmt.replace(this->victimSuicidesTag, this->INTERNAL_VICTIM_SUICIDES_TAG);
fmt.replace(this->victimHeadshotsTag, this->INTERNAL_VICTIM_HEADSHOTS_TAG);
fmt.replace(this->victimVehicleKillsTag, this->INTERNAL_VICTIM_VEHICLE_KILLS_TAG);
fmt.replace(this->victimBuildingKillsTag, this->INTERNAL_VICTIM_BUILDING_KILLS_TAG);
fmt.replace(this->victimDefenceKillsTag, this->INTERNAL_VICTIM_DEFENCE_KILLS_TAG);
fmt.replace(this->victimWinsTag, this->INTERNAL_VICTIM_WINS_TAG);
fmt.replace(this->victimLosesTag, this->INTERNAL_VICTIM_LOSES_TAG);
fmt.replace(this->victimBeaconPlacementsTag, this->INTERNAL_VICTIM_BEACON_PLACEMENTS_TAG);
fmt.replace(this->victimAccessTag, this->INTERNAL_VICTIM_ACCESS_TAG);
/** Other tags */ /** Other tags */
fmt.replace(this->weaponTag, this->INTERNAL_WEAPON_TAG); fmt.replace(this->weaponTag, this->INTERNAL_WEAPON_TAG);

60
RenX.Core/RenX_Tags.h

@ -75,6 +75,21 @@ namespace RenX
Jupiter::ReferenceString INTERNAL_TEAM_COLOR_TAG; Jupiter::ReferenceString INTERNAL_TEAM_COLOR_TAG;
Jupiter::ReferenceString INTERNAL_TEAM_SHORT_TAG; Jupiter::ReferenceString INTERNAL_TEAM_SHORT_TAG;
Jupiter::ReferenceString INTERNAL_TEAM_LONG_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;
/** Victim tags */ /** Victim tags */
Jupiter::ReferenceString INTERNAL_VICTIM_NAME_TAG; Jupiter::ReferenceString INTERNAL_VICTIM_NAME_TAG;
@ -91,6 +106,21 @@ namespace RenX
Jupiter::ReferenceString INTERNAL_VICTIM_TEAM_COLOR_TAG; Jupiter::ReferenceString INTERNAL_VICTIM_TEAM_COLOR_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_TEAM_SHORT_TAG; Jupiter::ReferenceString INTERNAL_VICTIM_TEAM_SHORT_TAG;
Jupiter::ReferenceString INTERNAL_VICTIM_TEAM_LONG_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;
/** Other tags */ /** Other tags */
Jupiter::ReferenceString INTERNAL_WEAPON_TAG; Jupiter::ReferenceString INTERNAL_WEAPON_TAG;
@ -127,6 +157,21 @@ namespace RenX
Jupiter::StringS teamColorTag; Jupiter::StringS teamColorTag;
Jupiter::StringS teamShortTag; Jupiter::StringS teamShortTag;
Jupiter::StringS teamLongTag; Jupiter::StringS teamLongTag;
Jupiter::StringS pingTag;
Jupiter::StringS scoreTag;
Jupiter::StringS creditsTag;
Jupiter::StringS killsTag;
Jupiter::StringS deathsTag;
Jupiter::StringS kdrTag;
Jupiter::StringS suicidesTag;
Jupiter::StringS headshotsTag;
Jupiter::StringS vehicleKillsTag;
Jupiter::StringS buildingKillsTag;
Jupiter::StringS defenceKillsTag;
Jupiter::StringS winsTag;
Jupiter::StringS losesTag;
Jupiter::StringS beaconPlacementsTag;
Jupiter::StringS accessTag;
/** Victim tags */ /** Victim tags */
Jupiter::StringS victimNameTag; Jupiter::StringS victimNameTag;
@ -143,6 +188,21 @@ namespace RenX
Jupiter::StringS victimTeamColorTag; Jupiter::StringS victimTeamColorTag;
Jupiter::StringS victimTeamShortTag; Jupiter::StringS victimTeamShortTag;
Jupiter::StringS victimTeamLongTag; Jupiter::StringS victimTeamLongTag;
Jupiter::StringS victimPingTag;
Jupiter::StringS victimScoreTag;
Jupiter::StringS victimCreditsTag;
Jupiter::StringS victimKillsTag;
Jupiter::StringS victimDeathsTag;
Jupiter::StringS victimKDRTag;
Jupiter::StringS victimSuicidesTag;
Jupiter::StringS victimHeadshotsTag;
Jupiter::StringS victimVehicleKillsTag;
Jupiter::StringS victimBuildingKillsTag;
Jupiter::StringS victimDefenceKillsTag;
Jupiter::StringS victimWinsTag;
Jupiter::StringS victimLosesTag;
Jupiter::StringS victimBeaconPlacementsTag;
Jupiter::StringS victimAccessTag;
/** Other tags */ /** Other tags */
Jupiter::StringS weaponTag; Jupiter::StringS weaponTag;

Loading…
Cancel
Save