Browse Source

RenX.ModSystem:

* Added another search mechanism for DelIRCCommand
pull/3/head
JustinAJ 9 years ago
parent
commit
3e9f7f2e60
  1. 25
      RenX.ModSystem/RenX_ModSystem.cpp

25
RenX.ModSystem/RenX_ModSystem.cpp

@ -732,20 +732,37 @@ void DelIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &chan
{ {
if (pluginInstance.modsFile.remove(parameters)) if (pluginInstance.modsFile.remove(parameters))
source->sendNotice(nick, STRING_LITERAL_AS_REFERENCE("Player has been removed from the moderator list.")); source->sendNotice(nick, STRING_LITERAL_AS_REFERENCE("Player has been removed from the moderator list."));
else
{
size_t index = pluginInstance.modsFile.getSections();
Jupiter::INIFile::Section *section;
DelIRCCommand_trigger_loop:
if (index != 0)
{
section = pluginInstance.modsFile.getSection(--index);
if (section->get(STRING_LITERAL_AS_REFERENCE("Name")).equalsi(parameters))
{
if (pluginInstance.modsFile.remove(index))
source->sendNotice(nick, STRING_LITERAL_AS_REFERENCE("Player has been removed from the moderator list."));
else
source->sendNotice(nick, STRING_LITERAL_AS_REFERENCE("Error: Unknown error occurred."));
}
else
goto DelIRCCommand_trigger_loop;
}
else else
source->sendNotice(nick, STRING_LITERAL_AS_REFERENCE("Error: Player not found.")); source->sendNotice(nick, STRING_LITERAL_AS_REFERENCE("Error: Player not found."));
} }
}
else if (player->isBot) else if (player->isBot)
source->sendNotice(nick, STRING_LITERAL_AS_REFERENCE("Error: A bot can not be a moderator.")); source->sendNotice(nick, STRING_LITERAL_AS_REFERENCE("Error: A bot can not be a moderator."));
else else if (pluginInstance.modsFile.remove(player->uuid))
{
if (pluginInstance.modsFile.remove(player->uuid))
source->sendNotice(nick, STRING_LITERAL_AS_REFERENCE("Player has been removed from the moderator list.")); source->sendNotice(nick, STRING_LITERAL_AS_REFERENCE("Player has been removed from the moderator list."));
else else
source->sendNotice(nick, STRING_LITERAL_AS_REFERENCE("Player is not in the moderator list.")); source->sendNotice(nick, STRING_LITERAL_AS_REFERENCE("Player is not in the moderator list."));
} }
} }
}
if (serverMatch == false) if (serverMatch == false)
source->sendMessage(channel, STRING_LITERAL_AS_REFERENCE("Error: Channel not attached to any connected Renegade X servers.")); source->sendMessage(channel, STRING_LITERAL_AS_REFERENCE("Error: Channel not attached to any connected Renegade X servers."));
} }

Loading…
Cancel
Save