Browse Source

Added HostPMsg; chat parsing

release/0.19
Jessica James 5 years ago
parent
commit
ccb5cf7c8a
  1. 13
      src/Plugins/RenX/RenX.Core/RenX_Server.cpp

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

@ -2671,6 +2671,12 @@ 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_OnHostChat(*this, message); xPlugins.get(i)->RenX_OnHostChat(*this, message);
} }
else if (subHeader.equals("HostPMsg;")) {
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_OnHostPage(*this, *player, message);
}
/*else if (subHeader.equals("AdminSay;")) /*else if (subHeader.equals("AdminSay;"))
{ {
// Player | "said:" | Message // Player | "said:" | Message
@ -2892,13 +2898,6 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line)
if (cmd.equalsi("hostprivatesay")) if (cmd.equalsi("hostprivatesay"))
{ {
RenX::PlayerInfo *player = this->getPlayerByName(command.getWord(1, " ")); RenX::PlayerInfo *player = this->getPlayerByName(command.getWord(1, " "));
if (player != nullptr)
{
Jupiter::ReferenceString message = command.gotoWord(2, " ");
for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnHostPage(*this, *player, message);
}
else
for (size_t i = 0; i < xPlugins.size(); i++) for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnExecute(*this, user, command); xPlugins.get(i)->RenX_OnExecute(*this, user, command);
} }

Loading…
Cancel
Save