Browse Source

RenX.Core:

* Added safety check in Server::banCheck().
RenX.Commands:
* Added confirmation message for "addban" command
* Fixed in-game "ban" command not taking reason parameters (wrong variable was being used)
pull/3/head
Jessica James 9 years ago
parent
commit
bcbe9a56e1
  1. BIN
      Release/Plugins/RenX.Core.lib
  2. 3
      RenX.Commands/RenX_Commands.cpp
  3. 1
      RenX.Core/RenX_Server.cpp

BIN
Release/Plugins/RenX.Core.lib

Binary file not shown.

3
RenX.Commands/RenX_Commands.cpp

@ -2179,6 +2179,7 @@ void AddBanIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &c
RenX::banDatabase->add(name, ip, prefix_length, steamid, rdns, banner, reason, duration); RenX::banDatabase->add(name, ip, prefix_length, steamid, rdns, banner, reason, duration);
RenX::getCore()->banCheck(); RenX::getCore()->banCheck();
source->sendMessage(channel, Jupiter::StringS::Format("Ban added to the database with ID #%u", RenX::banDatabase->getEntries().size() - 1));
} }
} }
} }
@ -3056,7 +3057,7 @@ void KickBanGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player,
{ {
Jupiter::StringS name = Jupiter::StringS::getWord(parameters, 0, WHITESPACE); Jupiter::StringS name = Jupiter::StringS::getWord(parameters, 0, WHITESPACE);
Jupiter::StringS reason = parameters.wordCount(WHITESPACE) > 1 ? Jupiter::StringS::gotoWord(parameters, 1, WHITESPACE) : STRING_LITERAL_AS_REFERENCE("No reason"); Jupiter::StringS reason = parameters.wordCount(WHITESPACE) > 1 ? Jupiter::StringS::gotoWord(parameters, 1, WHITESPACE) : STRING_LITERAL_AS_REFERENCE("No reason");
RenX::PlayerInfo *target = source->getPlayerByPartName(parameters); RenX::PlayerInfo *target = source->getPlayerByPartName(name);
if (target == nullptr) if (target == nullptr)
source->sendMessage(player, STRING_LITERAL_AS_REFERENCE("Error: Player not found.")); source->sendMessage(player, STRING_LITERAL_AS_REFERENCE("Error: Player not found."));
else if (player == target) else if (player == target)

1
RenX.Core/RenX_Server.cpp

@ -387,6 +387,7 @@ void RenX::Server::forceKickPlayer(const RenX::PlayerInfo *player, const Jupiter
void RenX::Server::banCheck() void RenX::Server::banCheck()
{ {
if (RenX::Server::players.size() != 0)
for (Jupiter::DLList<RenX::PlayerInfo>::Node *node = RenX::Server::players.getNode(0); node != nullptr; node = node->next) for (Jupiter::DLList<RenX::PlayerInfo>::Node *node = RenX::Server::players.getNode(0); node != nullptr; node = node->next)
this->banCheck(node->data); this->banCheck(node->data);
} }

Loading…
Cancel
Save