- ConfigTag* fantasy = ServerInstance->Config->ConfValue("fantasy");
- AllowBots = fantasy->getBool("allowbots", false);
- fprefix = fantasy->getString("prefix", "!", 1, ServerInstance->Config->Limits.MaxLine);
-
- Aliases.clear();
ConfigTagList tags = ServerInstance->Config->ConfTags("alias");
for(ConfigIter i = tags.first; i != tags.second; ++i)
{
ConfigTag* tag = i->second;
Alias a;
a.AliasedCommand = tag->getString("text");
ConfigTagList tags = ServerInstance->Config->ConfTags("alias");
for(ConfigIter i = tags.first; i != tags.second; ++i)
{
ConfigTag* tag = i->second;
Alias a;
a.AliasedCommand = tag->getString("text");
- std::transform(a.AliasedCommand.begin(), a.AliasedCommand.end(), a.AliasedCommand.begin(), ::toupper);
+ if (a.AliasedCommand.empty())
+ throw ModuleException("<alias:text> is empty! at " + tag->getTagLocation());
+
a.RequiredNick = tag->getString("requires");
a.ULineOnly = tag->getBool("uline");
a.ChannelCommand = tag->getBool("channelcommand", false);
a.UserCommand = tag->getBool("usercommand", true);
a.OperOnly = tag->getBool("operonly");
a.format = tag->getString("format");
a.RequiredNick = tag->getString("requires");
a.ULineOnly = tag->getBool("uline");
a.ChannelCommand = tag->getBool("channelcommand", false);
a.UserCommand = tag->getBool("usercommand", true);
a.OperOnly = tag->getBool("operonly");
a.format = tag->getString("format");
- Aliases.insert(std::make_pair(a.AliasedCommand, a));
+
+ std::transform(a.AliasedCommand.begin(), a.AliasedCommand.end(), a.AliasedCommand.begin(), ::toupper);
+ newAliases.insert(std::make_pair(a.AliasedCommand, a));
+
+ ConfigTag* fantasy = ServerInstance->Config->ConfValue("fantasy");
+ AllowBots = fantasy->getBool("allowbots", false);
+ fprefix = fantasy->getString("prefix", "!", 1, ServerInstance->Config->Limits.MaxLine);
+ Aliases.swap(newAliases);
{
std::string message(command);
for (CommandBase::Params::const_iterator iter = parameters.begin(); iter != parameters.end();)
{
{
std::string message(command);
for (CommandBase::Params::const_iterator iter = parameters.begin(); iter != parameters.end();)
{
void OnUserPostMessage(User* user, const MessageTarget& target, const MessageDetails& details) CXX11_OVERRIDE
{
if ((target.type != MessageTarget::TYPE_CHANNEL) || (details.type != MSG_PRIVMSG))
void OnUserPostMessage(User* user, const MessageTarget& target, const MessageDetails& details) CXX11_OVERRIDE
{
if ((target.type != MessageTarget::TYPE_CHANNEL) || (details.type != MSG_PRIVMSG))
- ServerInstance->SNO->WriteToSnoMask('a', "NOTICE -- Service "+a->RequiredNick+" required by alias "+a->AliasedCommand+" is not on a u-lined server, possibly underhanded antics detected!");
- user->WriteNumeric(ERR_NOSUCHNICK, a->RequiredNick, "is an imposter! Please inform an IRC operator as soon as possible.");
+ ServerInstance->SNO->WriteToSnoMask('a', "NOTICE -- Service "+a->RequiredNick+" required by alias "+a->AliasedCommand+" is not on a U-lined server, possibly underhanded antics detected!");
+ user->WriteNumeric(ERR_NOSUCHNICK, a->RequiredNick, "is an imposter! Please inform a server operator as soon as possible.");