Browse Source

Added parsing and events for admin and warn message types

release/0.19
Jessica James 5 years ago
parent
commit
a7de4dc042
  1. 40
      src/Plugins/RenX/RenX.Core/RenX_Plugin.cpp
  2. 10
      src/Plugins/RenX/RenX.Core/RenX_Plugin.h
  3. 58
      src/Plugins/RenX/RenX.Core/RenX_Server.cpp

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

@ -181,6 +181,46 @@ void RenX::Plugin::RenX_OnHostPage(Server &, const PlayerInfo &, const Jupiter::
return; return;
} }
void RenX::Plugin::RenX_OnAdminMessage(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message)
{
return;
}
void RenX::Plugin::RenX_OnWarnMessage(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message)
{
return;
}
void RenX::Plugin::RenX_OnAdminPMessage(Server &server, const PlayerInfo &player, const PlayerInfo &target, const Jupiter::ReadableString &message)
{
return;
}
void RenX::Plugin::RenX_OnWarnPMessage(Server &server, const PlayerInfo &player, const PlayerInfo &target, const Jupiter::ReadableString &message)
{
return;
}
void RenX::Plugin::RenX_OnHostAdminMessage(Server &server, const Jupiter::ReadableString &message)
{
return;
}
void RenX::Plugin::RenX_OnHostAdminPMessage(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message)
{
return;
}
void RenX::Plugin::RenX_OnHostWarnMessage(Server &server, const Jupiter::ReadableString &message)
{
return;
}
void RenX::Plugin::RenX_OnHostWarnPMessage(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message)
{
return;
}
void RenX::Plugin::RenX_OnOtherChat(Server &, const Jupiter::ReadableString &) void RenX::Plugin::RenX_OnOtherChat(Server &, const Jupiter::ReadableString &)
{ {
return; return;

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

@ -77,6 +77,16 @@ namespace RenX
virtual void RenX_OnRadioChat(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message); virtual void RenX_OnRadioChat(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message);
virtual void RenX_OnHostChat(Server &server, 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_OnHostPage(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message);
virtual void RenX_OnAdminMessage(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message);
virtual void RenX_OnWarnMessage(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message);
virtual void RenX_OnAdminPMessage(Server &server, const PlayerInfo &player, const PlayerInfo &target, const Jupiter::ReadableString &message);
virtual void RenX_OnWarnPMessage(Server &server, const PlayerInfo &player, const PlayerInfo &target, const Jupiter::ReadableString &message);
virtual void RenX_OnHostAdminMessage(Server &server, const Jupiter::ReadableString &message);
virtual void RenX_OnHostAdminPMessage(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message);
virtual void RenX_OnHostWarnMessage(Server &server, const Jupiter::ReadableString &message);
virtual void RenX_OnHostWarnPMessage(Server &server, const PlayerInfo &player, const Jupiter::ReadableString &message);
virtual void RenX_OnOtherChat(Server &server, const Jupiter::ReadableString &raw); virtual void RenX_OnOtherChat(Server &server, const Jupiter::ReadableString &raw);
/** Game type logs */ /** Game type logs */

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

@ -2665,6 +2665,40 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line)
xPlugins.get(i)->RenX_OnRadioChat(*this, *player, message); xPlugins.get(i)->RenX_OnRadioChat(*this, *player, message);
onAction(); onAction();
} }
else if (subHeader.equals("AdminMsg;"))
{
RenX::PlayerInfo *player = parseGetPlayerOrAdd(tokens.getToken(2));
Jupiter::ReferenceString message = tokens.getToken(4);
for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnAdminMessage(*this, *player, message);
onAction();
}
else if (subHeader.equals("AdminWarn;"))
{
RenX::PlayerInfo *player = parseGetPlayerOrAdd(tokens.getToken(2));
Jupiter::ReferenceString message = tokens.getToken(4);
for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnWarnMessage(*this, *player, message);
onAction();
}
else if (subHeader.equals("PAdminMsg;"))
{
RenX::PlayerInfo *player = parseGetPlayerOrAdd(tokens.getToken(2));
RenX::PlayerInfo *target = parseGetPlayerOrAdd(tokens.getToken(4));
Jupiter::ReferenceString message = tokens.getToken(6);
for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnAdminPMessage(*this, *player, *target, message);
onAction();
}
else if (subHeader.equals("PAdminWarn;"))
{
RenX::PlayerInfo *player = parseGetPlayerOrAdd(tokens.getToken(2));
RenX::PlayerInfo *target = parseGetPlayerOrAdd(tokens.getToken(4));
Jupiter::ReferenceString message = tokens.getToken(6);
for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnWarnPMessage(*this, *player, *target, message);
onAction();
}
else if (subHeader.equals("HostSay;")) else if (subHeader.equals("HostSay;"))
{ {
Jupiter::ReferenceString message = tokens.getToken(3); Jupiter::ReferenceString message = tokens.getToken(3);
@ -2677,6 +2711,30 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line)
for (size_t i = 0; i < xPlugins.size(); i++) for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnHostPage(*this, *player, message); xPlugins.get(i)->RenX_OnHostPage(*this, *player, message);
} }
else if (subHeader.equals("HostAdminMsg;"))
{
Jupiter::ReferenceString message = tokens.getToken(3);
for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnHostAdminMessage(*this, message);
}
else if (subHeader.equals("HostAdminWarn;"))
{
Jupiter::ReferenceString message = tokens.getToken(3);
for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnHostWarnMessage(*this, message);
}
else if (subHeader.equals("HostPAdminMsg;")) {
RenX::PlayerInfo *player = parseGetPlayerOrAdd(tokens.getToken(2));
Jupiter::ReferenceString message = tokens.getToken(4);
for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnHostAdminPMessage(*this, *player, message);
}
else if (subHeader.equals("HostPAdminWarn;")) {
RenX::PlayerInfo *player = parseGetPlayerOrAdd(tokens.getToken(2));
Jupiter::ReferenceString message = tokens.getToken(4);
for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnHostWarnPMessage(*this, *player, message);
}
/*else if (subHeader.equals("AdminSay;")) /*else if (subHeader.equals("AdminSay;"))
{ {
// Player | "said:" | Message // Player | "said:" | Message

Loading…
Cancel
Save