Browse Source

RenX.Logging:

* Added OverMine and SpeedHack IRC log outputs
pull/3/head
Jessica James 9 years ago
parent
commit
8d9939750f
  1. BIN
      Release/Bot.lib
  2. BIN
      Release/Plugins/RenX.Core.lib
  3. 43
      RenX.Logging/RenX_Logging.cpp
  4. 6
      RenX.Logging/RenX_Logging.h

BIN
Release/Bot.lib

Binary file not shown.

BIN
Release/Plugins/RenX.Core.lib

Binary file not shown.

43
RenX.Logging/RenX_Logging.cpp

@ -35,6 +35,7 @@ void RenX_LoggingPlugin::init()
RenX_LoggingPlugin::kickPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "KickPublic"_jrs, true); RenX_LoggingPlugin::kickPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "KickPublic"_jrs, true);
RenX_LoggingPlugin::nameChangePublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "NameChangePublic"_jrs, true); RenX_LoggingPlugin::nameChangePublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "NameChangePublic"_jrs, true);
RenX_LoggingPlugin::teamChangePublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "TeamChangePublic"_jrs, true); RenX_LoggingPlugin::teamChangePublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "TeamChangePublic"_jrs, true);
RenX_LoggingPlugin::speedHackPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "SpeedHackPublic"_jrs, false);
RenX_LoggingPlugin::playerPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "PlayerPublic"_jrs, false); RenX_LoggingPlugin::playerPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "PlayerPublic"_jrs, false);
RenX_LoggingPlugin::chatPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "ChatPublic"_jrs, true); RenX_LoggingPlugin::chatPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "ChatPublic"_jrs, true);
RenX_LoggingPlugin::teamChatPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "TeamChatPublic"_jrs, false); RenX_LoggingPlugin::teamChatPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "TeamChatPublic"_jrs, false);
@ -44,6 +45,7 @@ void RenX_LoggingPlugin::init()
RenX_LoggingPlugin::otherChatPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "OtherChatPublic"_jrs, false); RenX_LoggingPlugin::otherChatPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "OtherChatPublic"_jrs, false);
RenX_LoggingPlugin::deployPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "DeployPublic"_jrs, true); RenX_LoggingPlugin::deployPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "DeployPublic"_jrs, true);
RenX_LoggingPlugin::mineDeployPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "MineDeployPublic"_jrs, false); RenX_LoggingPlugin::mineDeployPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "MineDeployPublic"_jrs, false);
RenX_LoggingPlugin::overMinePublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "OverMinePublic"_jrs, false);
RenX_LoggingPlugin::disarmPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "DisarmPublic"_jrs, true); RenX_LoggingPlugin::disarmPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "DisarmPublic"_jrs, true);
RenX_LoggingPlugin::mineDisarmPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "MineDisarmPublic"_jrs, false); RenX_LoggingPlugin::mineDisarmPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "MineDisarmPublic"_jrs, false);
RenX_LoggingPlugin::explodePublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "ExplodePublic"_jrs, false); RenX_LoggingPlugin::explodePublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), "ExplodePublic"_jrs, false);
@ -132,6 +134,9 @@ void RenX_LoggingPlugin::init()
RenX_LoggingPlugin::teamChangeFmt = Jupiter::IRC::Client::Config->get(this->getName(), "TeamChangeFormat"_jrs, RenX_LoggingPlugin::teamChangeFmt = Jupiter::IRC::Client::Config->get(this->getName(), "TeamChangeFormat"_jrs,
Jupiter::StringS::Format("%.*s" IRCCOLOR " switched teams!", RenX::tags->nameTag.size(), RenX::tags->nameTag.ptr())); Jupiter::StringS::Format("%.*s" IRCCOLOR " switched teams!", RenX::tags->nameTag.size(), RenX::tags->nameTag.ptr()));
RenX_LoggingPlugin::speedHackFmt = Jupiter::IRC::Client::Config->get(this->getName(), "SpeedHackFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "04[SpeedHack] " IRCBOLD "%.*s" IRCBOLD " has thrown a Speed Hack warning!", RenX::tags->nameTag.size(), RenX::tags->nameTag.ptr()));
RenX_LoggingPlugin::chatFmt = Jupiter::IRC::Client::Config->get(this->getName(), "ChatFormat"_jrs, RenX_LoggingPlugin::chatFmt = Jupiter::IRC::Client::Config->get(this->getName(), "ChatFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD ": %.*s", RenX::tags->nameTag.size(), RenX::tags->nameTag.ptr(), RenX::tags->messageTag.size(), RenX::tags->messageTag.ptr())); Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD ": %.*s", RenX::tags->nameTag.size(), RenX::tags->nameTag.ptr(), RenX::tags->messageTag.size(), RenX::tags->messageTag.ptr()));
@ -156,6 +161,9 @@ void RenX_LoggingPlugin::init()
RenX_LoggingPlugin::mineDeployFmt = Jupiter::IRC::Client::Config->get(this->getName(), "MineDeployFormat"_jrs, RenX_LoggingPlugin::mineDeployFmt = Jupiter::IRC::Client::Config->get(this->getName(), "MineDeployFormat"_jrs,
RenX_LoggingPlugin::deployFmt); RenX_LoggingPlugin::deployFmt);
RenX_LoggingPlugin::overMineFmt = Jupiter::IRC::Client::Config->get(this->getName(), "OverMineFormat"_jrs,
Jupiter::StringS::Format(IRCCOLOR "04[OverMine]" IRCBOLD "%.*s" IRCCOLOR IRCBOLD " is " IRCCOLOR "04over-mining" IRCCOLOR " near " IRCBOLD IRCCOLOR "12%.*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(), "DisarmFormat"_jrs, RenX_LoggingPlugin::disarmFmt = Jupiter::IRC::Client::Config->get(this->getName(), "DisarmFormat"_jrs,
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " disarmed %.*s" IRCBOLD IRCCOLOR "'s " IRCCOLOR "12%.*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())); Jupiter::StringS::Format(IRCBOLD "%.*s" IRCCOLOR IRCBOLD " disarmed %.*s" IRCBOLD IRCCOLOR "'s " IRCCOLOR "12%.*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()));
@ -415,6 +423,7 @@ void RenX_LoggingPlugin::init()
RenX::sanitizeTags(kickFmt); RenX::sanitizeTags(kickFmt);
RenX::sanitizeTags(nameChangeFmt); RenX::sanitizeTags(nameChangeFmt);
RenX::sanitizeTags(teamChangeFmt); RenX::sanitizeTags(teamChangeFmt);
RenX::sanitizeTags(speedHackFmt);
RenX::sanitizeTags(playerFmt); RenX::sanitizeTags(playerFmt);
RenX::sanitizeTags(chatFmt); RenX::sanitizeTags(chatFmt);
RenX::sanitizeTags(teamChatFmt); RenX::sanitizeTags(teamChatFmt);
@ -422,6 +431,7 @@ void RenX_LoggingPlugin::init()
RenX::sanitizeTags(otherChatFmt); RenX::sanitizeTags(otherChatFmt);
RenX::sanitizeTags(deployFmt); RenX::sanitizeTags(deployFmt);
RenX::sanitizeTags(mineDeployFmt); RenX::sanitizeTags(mineDeployFmt);
RenX::sanitizeTags(overMineFmt);
RenX::sanitizeTags(disarmFmt); RenX::sanitizeTags(disarmFmt);
RenX::sanitizeTags(mineDisarmFmt); RenX::sanitizeTags(mineDisarmFmt);
RenX::sanitizeTags(disarmNoOwnerFmt); RenX::sanitizeTags(disarmNoOwnerFmt);
@ -602,6 +612,22 @@ void RenX_LoggingPlugin::RenX_OnTeamChange(RenX::Server *server, const RenX::Pla
} }
} }
void RenX_LoggingPlugin::RenX_OnSpeedHack(RenX::Server *server, const RenX::PlayerInfo *player)
{
logFuncType func;
if (RenX_LoggingPlugin::speedHackPublic)
func = &RenX::Server::sendLogChan;
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg = this->speedHackFmt;
if (msg.isNotEmpty())
{
RenX::processTags(msg, server, player);
(server->*func)(msg);
}
}
void RenX_LoggingPlugin::RenX_OnExecute(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &command) void RenX_LoggingPlugin::RenX_OnExecute(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &command)
{ {
logFuncType func; logFuncType func;
@ -768,6 +794,23 @@ void RenX_LoggingPlugin::RenX_OnDeploy(RenX::Server *server, const RenX::PlayerI
} }
} }
void RenX_LoggingPlugin::RenX_OnOverMine(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &location)
{
logFuncType func;
if (RenX_LoggingPlugin::overMinePublic)
func = &RenX::Server::sendLogChan;
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg = this->overMineFmt;
if (msg.isNotEmpty())
{
RenX::processTags(msg, server, player);
msg.replace(RenX::tags->INTERNAL_OBJECT_TAG, RenX::translateName(location));
(server->*func)(msg);
}
}
void RenX_LoggingPlugin::RenX_OnDisarm(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &object, const RenX::PlayerInfo *victim) void RenX_LoggingPlugin::RenX_OnDisarm(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &object, const RenX::PlayerInfo *victim)
{ {
logFuncType func; logFuncType func;

6
RenX.Logging/RenX_Logging.h

@ -31,6 +31,7 @@ public: // RenX::Plugin
void RenX_OnNameChange(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &newPlayerName) override; void RenX_OnNameChange(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &newPlayerName) override;
void RenX_OnTeamChange(RenX::Server *server, const RenX::PlayerInfo *player, const RenX::TeamType &oldTeam) override; void RenX_OnTeamChange(RenX::Server *server, const RenX::PlayerInfo *player, const RenX::TeamType &oldTeam) override;
void RenX_OnExecute(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &command) override; void RenX_OnExecute(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &command) override;
void RenX_OnSpeedHack(RenX::Server *server, const RenX::PlayerInfo *player) override;
void RenX_OnPlayer(RenX::Server *server, const Jupiter::ReadableString &raw) override; void RenX_OnPlayer(RenX::Server *server, const Jupiter::ReadableString &raw) override;
void RenX_OnChat(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &message) override; void RenX_OnChat(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &message) override;
@ -41,6 +42,7 @@ public: // RenX::Plugin
void RenX_OnOtherChat(RenX::Server *server, const Jupiter::ReadableString &raw) 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_OnDeploy(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &object) override;
void RenX_OnOverMine(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &location) override;
void RenX_OnDisarm(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &object, const RenX::PlayerInfo *victim) override; void RenX_OnDisarm(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &object, const RenX::PlayerInfo *victim) override;
void RenX_OnDisarm(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &object) override; void RenX_OnDisarm(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &object) override;
void RenX_OnExplode(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &object) override; void RenX_OnExplode(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &object) override;
@ -138,6 +140,7 @@ private:
unsigned int kickPublic : 1; unsigned int kickPublic : 1;
unsigned int nameChangePublic : 1; unsigned int nameChangePublic : 1;
unsigned int teamChangePublic : 1; unsigned int teamChangePublic : 1;
unsigned int speedHackPublic : 1;
unsigned int playerPublic : 1; unsigned int playerPublic : 1;
unsigned int chatPublic : 1; unsigned int chatPublic : 1;
unsigned int teamChatPublic : 1; unsigned int teamChatPublic : 1;
@ -147,6 +150,7 @@ private:
unsigned int otherChatPublic : 1; unsigned int otherChatPublic : 1;
unsigned int deployPublic : 1; unsigned int deployPublic : 1;
unsigned int mineDeployPublic : 1; unsigned int mineDeployPublic : 1;
unsigned int overMinePublic : 1;
unsigned int disarmPublic : 1; unsigned int disarmPublic : 1;
unsigned int mineDisarmPublic : 1; unsigned int mineDisarmPublic : 1;
unsigned int explodePublic : 1; unsigned int explodePublic : 1;
@ -213,6 +217,7 @@ private:
Jupiter::StringS kickFmt; Jupiter::StringS kickFmt;
Jupiter::StringS nameChangeFmt; Jupiter::StringS nameChangeFmt;
Jupiter::StringS teamChangeFmt; Jupiter::StringS teamChangeFmt;
Jupiter::StringS speedHackFmt;
Jupiter::StringS playerFmt; Jupiter::StringS playerFmt;
Jupiter::StringS chatFmt; Jupiter::StringS chatFmt;
Jupiter::StringS teamChatFmt; Jupiter::StringS teamChatFmt;
@ -222,6 +227,7 @@ private:
Jupiter::StringS otherChatFmt; Jupiter::StringS otherChatFmt;
Jupiter::StringS deployFmt; Jupiter::StringS deployFmt;
Jupiter::StringS mineDeployFmt; Jupiter::StringS mineDeployFmt;
Jupiter::StringS overMineFmt;
Jupiter::StringS disarmFmt; Jupiter::StringS disarmFmt;
Jupiter::StringS mineDisarmFmt; Jupiter::StringS mineDisarmFmt;
Jupiter::StringS disarmNoOwnerFmt; Jupiter::StringS disarmNoOwnerFmt;

Loading…
Cancel
Save