|
@ -257,6 +257,10 @@ bool RenX_ModSystemPlugin::set(RenX::PlayerInfo &player, RenX_ModSystemPlugin::M |
|
|
return r; |
|
|
return r; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool RenX_ModSystemPlugin::removeModSection(const Jupiter::ReadableString& section) { |
|
|
|
|
|
return config.removeSection(section) && config.write(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
RenX_ModSystemPlugin::ModGroup *RenX_ModSystemPlugin::getGroupByName(const Jupiter::ReadableString &name, ModGroup *defaultGroup) const |
|
|
RenX_ModSystemPlugin::ModGroup *RenX_ModSystemPlugin::getGroupByName(const Jupiter::ReadableString &name, ModGroup *defaultGroup) const |
|
|
{ |
|
|
{ |
|
|
if (RenX_ModSystemPlugin::groups.size() != 0) |
|
|
if (RenX_ModSystemPlugin::groups.size() != 0) |
|
@ -758,14 +762,14 @@ void DelIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &chan |
|
|
player = server->getPlayerByPartName(parameters); |
|
|
player = server->getPlayerByPartName(parameters); |
|
|
if (player == nullptr) |
|
|
if (player == nullptr) |
|
|
{ |
|
|
{ |
|
|
if (pluginInstance.modsFile.removeSection(parameters)) |
|
|
if (pluginInstance.removeModSection(parameters)) |
|
|
source->sendNotice(nick, "Player has been removed from the moderator list."_jrs); |
|
|
source->sendNotice(nick, "Player has been removed from the moderator list."_jrs); |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
for (auto& section : pluginInstance.modsFile.getSections()) |
|
|
for (auto& section : pluginInstance.getConfig().getSections()) |
|
|
{ |
|
|
{ |
|
|
if (section.second.get("Name"_jrs).equalsi(parameters)) { |
|
|
if (section.second.get("Name"_jrs).equalsi(parameters)) { |
|
|
if (pluginInstance.modsFile.removeSection(section.first)) |
|
|
if (pluginInstance.removeModSection(section.first)) |
|
|
source->sendNotice(nick, "Player has been removed from the moderator list."_jrs); |
|
|
source->sendNotice(nick, "Player has been removed from the moderator list."_jrs); |
|
|
else |
|
|
else |
|
|
source->sendNotice(nick, "Error: Unknown error occurred."_jrs); |
|
|
source->sendNotice(nick, "Error: Unknown error occurred."_jrs); |
|
@ -779,7 +783,7 @@ void DelIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &chan |
|
|
} |
|
|
} |
|
|
else if (player->isBot) |
|
|
else if (player->isBot) |
|
|
source->sendNotice(nick, "Error: A bot can not be a moderator."_jrs); |
|
|
source->sendNotice(nick, "Error: A bot can not be a moderator."_jrs); |
|
|
else if (pluginInstance.modsFile.removeSection(player->uuid)) |
|
|
else if (pluginInstance.removeModSection(player->uuid)) |
|
|
source->sendNotice(nick, "Player has been removed from the moderator list."_jrs); |
|
|
source->sendNotice(nick, "Player has been removed from the moderator list."_jrs); |
|
|
else |
|
|
else |
|
|
source->sendNotice(nick, "Player is not in the moderator list."_jrs); |
|
|
source->sendNotice(nick, "Player is not in the moderator list."_jrs); |
|
@ -888,7 +892,7 @@ void ModListIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString & |
|
|
msg.aformat(IRCNORMAL " (Access: %d): ", node->access); |
|
|
msg.aformat(IRCNORMAL " (Access: %d): ", node->access); |
|
|
msgBaseSize = msg.size(); |
|
|
msgBaseSize = msg.size(); |
|
|
|
|
|
|
|
|
for (auto& section : pluginInstance.modsFile.getSections()) { |
|
|
for (auto& section : pluginInstance.getConfig().getSections()) { |
|
|
if (section.second.get("Group"_jrs).equalsi(node->name)) |
|
|
if (section.second.get("Group"_jrs).equalsi(node->name)) |
|
|
{ |
|
|
{ |
|
|
msg += section.second.get("Name"_jrs, section.second.getName()); |
|
|
msg += section.second.get("Name"_jrs, section.second.getName()); |
|
|