Browse Source

Added Radio chat IRC logging

pull/3/head v0.15.1
JustinAJ 9 years ago
parent
commit
ab30b97cc1
  1. 24
      RenX.Logging/RenX_Logging.cpp
  2. 3
      RenX.Logging/RenX_Logging.h

24
RenX.Logging/RenX_Logging.cpp

@ -34,7 +34,8 @@ void RenX_LoggingPlugin::init()
RenX_LoggingPlugin::teamChangePublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("TeamChangePublic"), 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::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::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::teamChatPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("TeamChatPublic"), false);
RenX_LoggingPlugin::radioChatPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("RadioChatPublic"), false);
RenX_LoggingPlugin::hostChatPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("HostChatPublic"), 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::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::otherChatPublic = Jupiter::IRC::Client::Config->getBool(RenX_LoggingPlugin::getName(), STRING_LITERAL_AS_REFERENCE("OtherChatPublic"), false);
@ -134,6 +135,9 @@ void RenX_LoggingPlugin::init()
RenX_LoggingPlugin::teamChatFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("TeamChatFormat"), 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())); 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::radioChatFmt = Jupiter::IRC::Client::Config->get(this->getName(), STRING_LITERAL_AS_REFERENCE("RadioChatFormat"),
Jupiter::StringS::Format(IRCBOLD "%.*s" IRCBOLD ": \x1D%.*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"), 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())); Jupiter::StringS::Format(IRCCOLOR "12Host" IRCCOLOR "0: %.*s", RenX::tags->messageTag.size(), RenX::tags->messageTag.ptr()));
@ -385,6 +389,7 @@ void RenX_LoggingPlugin::init()
RenX::sanitizeTags(playerFmt); RenX::sanitizeTags(playerFmt);
RenX::sanitizeTags(chatFmt); RenX::sanitizeTags(chatFmt);
RenX::sanitizeTags(teamChatFmt); RenX::sanitizeTags(teamChatFmt);
RenX::sanitizeTags(radioChatFmt);
RenX::sanitizeTags(otherChatFmt); RenX::sanitizeTags(otherChatFmt);
RenX::sanitizeTags(deployFmt); RenX::sanitizeTags(deployFmt);
RenX::sanitizeTags(mineDeployFmt); RenX::sanitizeTags(mineDeployFmt);
@ -627,6 +632,23 @@ void RenX_LoggingPlugin::RenX_OnTeamChat(RenX::Server *server, const RenX::Playe
} }
} }
void RenX_LoggingPlugin::RenX_OnRadioChat(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &message)
{
logFuncType func;
if (RenX_LoggingPlugin::radioChatPublic)
func = &RenX::Server::sendLogChan;
else
func = &RenX::Server::sendAdmChan;
Jupiter::String msg = this->radioChatFmt;
if (msg.isNotEmpty())
{
RenX::processTags(msg, server, player);
msg.replace(RenX::tags->INTERNAL_MESSAGE_TAG, message);
(server->*func)(msg);
}
}
void RenX_LoggingPlugin::RenX_OnHostChat(RenX::Server *server, const Jupiter::ReadableString &message) void RenX_LoggingPlugin::RenX_OnHostChat(RenX::Server *server, const Jupiter::ReadableString &message)
{ {
logFuncType func; logFuncType func;

3
RenX.Logging/RenX_Logging.h

@ -34,6 +34,7 @@ public: // RenX::Plugin
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;
void RenX_OnTeamChat(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &message) override; void RenX_OnTeamChat(RenX::Server *server, const RenX::PlayerInfo *player, const Jupiter::ReadableString &message) override;
void RenX_OnRadioChat(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_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_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_OnOtherChat(RenX::Server *server, const Jupiter::ReadableString &raw) override;
@ -131,6 +132,7 @@ private:
unsigned int playerPublic : 1; unsigned int playerPublic : 1;
unsigned int chatPublic : 1; unsigned int chatPublic : 1;
unsigned int teamChatPublic : 1; unsigned int teamChatPublic : 1;
unsigned int radioChatPublic : 1;
unsigned int hostChatPublic : 1; unsigned int hostChatPublic : 1;
unsigned int hostPagePublic : 1; unsigned int hostPagePublic : 1;
unsigned int otherChatPublic : 1; unsigned int otherChatPublic : 1;
@ -205,6 +207,7 @@ private:
Jupiter::StringS playerFmt; Jupiter::StringS playerFmt;
Jupiter::StringS chatFmt; Jupiter::StringS chatFmt;
Jupiter::StringS teamChatFmt; Jupiter::StringS teamChatFmt;
Jupiter::StringS radioChatFmt;
Jupiter::StringS hostChatFmt; Jupiter::StringS hostChatFmt;
Jupiter::StringS hostPageFmt; Jupiter::StringS hostPageFmt;
Jupiter::StringS otherChatFmt; Jupiter::StringS otherChatFmt;

Loading…
Cancel
Save