Browse Source

Added "any" and "all" options to BanSearchIRCCommand; Jupiter updated.

pull/3/head
JustinAJ 10 years ago
parent
commit
dc93e3b4a8
  1. 2
      Jupiter
  2. BIN
      Release/Bot.lib
  3. BIN
      Release/Plugins/RenX.Core.lib
  4. 22
      RenX.ModSystem/RenX_ModSystem.cpp

2
Jupiter

@ -1 +1 @@
Subproject commit 4fdd55288d85b0500b88a56b384d9b433b42bc39
Subproject commit 7ca20a9d47af050ea46ac72f21e9c1e29c3ab12f

BIN
Release/Bot.lib

Binary file not shown.

BIN
Release/Plugins/RenX.Core.lib

Binary file not shown.

22
RenX.ModSystem/RenX_ModSystem.cpp

@ -635,18 +635,20 @@ void BanSearchIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString
switch (type_l)
{
default:
case 0:
return isMatch(1) || isMatch(2) || isMatch(3) || isMatch(4) || isMatch(5);
case 1:
case 0: // ANY
return isMatch(1) || isMatch(2) || isMatch(3) || isMatch(4);
case 1: // IP
return entry->ip == params.asUnsignedInt();
case 2:
case 2: // STEAM
return entry->steamid == params.asUnsignedLongLong();
case 3:
case 3: // NAME
return entry->name.equalsi(params);
case 4:
case 4: // BANNER
return entry->varData.get(STRING_LITERAL_AS_REFERENCE("RenX.Commands")).equalsi(params);
case 5:
case 5: // ACTIVE
return entry->active == params.asBool();
case 6: // ALL
return true;
}
};
@ -662,6 +664,10 @@ void BanSearchIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString
type = 4;
else if (type_str.equalsi(STRING_LITERAL_AS_REFERENCE("active")))
type = 5;
else if (type_str.equalsi(STRING_LITERAL_AS_REFERENCE("any")))
type = 0;
else if (type_str.equalsi(STRING_LITERAL_AS_REFERENCE("all")) || type_str.equals('*'))
type = 6;
else
{
type = 0;
@ -693,7 +699,7 @@ void BanSearchIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString
const Jupiter::ReadableString &BanSearchIRCCommand::getHelp(const Jupiter::ReadableString &)
{
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Searches the ban database for an entry. Syntax: bsearch [ip/steam/name/banner/active/all = all] <player ip/steam/name/banner>");
static STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Searches the ban database for an entry. Syntax: bsearch [ip/steam/name/banner/active/any/all = any] <player ip/steam/name/banner>");
return defaultHelp;
}

Loading…
Cancel
Save