From e65d8b2f3dfdb40858259b3bb48ef6998c31e62f Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 17 Aug 2010 19:27:37 -0400 Subject: Rewrote the config reader to better handle invalid configs. This prevents Anope from exploding when /os reload has errors. --- docs/TODO | 2 +- include/config.h | 47 +- include/extern.h | 12 +- modules/core/bs_act.cpp | 16 +- modules/core/bs_assign.cpp | 18 +- modules/core/bs_badwords.cpp | 44 +- modules/core/bs_bot.cpp | 96 +- modules/core/bs_botlist.cpp | 18 +- modules/core/bs_help.cpp | 8 +- modules/core/bs_info.cpp | 88 +- modules/core/bs_kick.cpp | 110 +-- modules/core/bs_say.cpp | 16 +- modules/core/bs_set.cpp | 74 +- modules/core/bs_unassign.cpp | 16 +- modules/core/cs_access.cpp | 142 +-- modules/core/cs_akick.cpp | 82 +- modules/core/cs_ban.cpp | 18 +- modules/core/cs_clear.cpp | 24 +- modules/core/cs_drop.cpp | 22 +- modules/core/cs_forbid.cpp | 24 +- modules/core/cs_getkey.cpp | 12 +- modules/core/cs_help.cpp | 14 +- modules/core/cs_info.cpp | 42 +- modules/core/cs_invite.cpp | 14 +- modules/core/cs_kick.cpp | 18 +- modules/core/cs_list.cpp | 34 +- modules/core/cs_modes.cpp | 72 +- modules/core/cs_register.cpp | 30 +- modules/core/cs_saset.cpp | 14 +- modules/core/cs_saset_noexpire.cpp | 10 +- modules/core/cs_set.cpp | 16 +- modules/core/cs_set_bantype.cpp | 14 +- modules/core/cs_set_description.cpp | 12 +- modules/core/cs_set_entrymsg.cpp | 14 +- modules/core/cs_set_founder.cpp | 24 +- modules/core/cs_set_keeptopic.cpp | 14 +- modules/core/cs_set_mlock.cpp | 20 +- modules/core/cs_set_opnotice.cpp | 14 +- modules/core/cs_set_peace.cpp | 14 +- modules/core/cs_set_persist.cpp | 18 +- modules/core/cs_set_private.cpp | 14 +- modules/core/cs_set_restricted.cpp | 14 +- modules/core/cs_set_secure.cpp | 14 +- modules/core/cs_set_securefounder.cpp | 16 +- modules/core/cs_set_secureops.cpp | 14 +- modules/core/cs_set_signkick.cpp | 16 +- modules/core/cs_set_successor.cpp | 24 +- modules/core/cs_set_topiclock.cpp | 14 +- modules/core/cs_set_xop.cpp | 20 +- modules/core/cs_status.cpp | 12 +- modules/core/cs_suspend.cpp | 46 +- modules/core/cs_topic.cpp | 14 +- modules/core/cs_unban.cpp | 16 +- modules/core/cs_xop.cpp | 96 +- modules/core/db_plain.cpp | 6 +- modules/core/enc_md5.cpp | 2 +- modules/core/enc_none.cpp | 2 +- modules/core/enc_old.cpp | 2 +- modules/core/enc_sha1.cpp | 2 +- modules/core/enc_sha256.cpp | 2 +- modules/core/hs_del.cpp | 12 +- modules/core/hs_delall.cpp | 12 +- modules/core/hs_group.cpp | 10 +- modules/core/hs_help.cpp | 4 +- modules/core/hs_list.cpp | 26 +- modules/core/hs_off.cpp | 8 +- modules/core/hs_on.cpp | 10 +- modules/core/hs_set.cpp | 30 +- modules/core/hs_setall.cpp | 30 +- modules/core/ms_cancel.cpp | 16 +- modules/core/ms_check.cpp | 18 +- modules/core/ms_del.cpp | 22 +- modules/core/ms_help.cpp | 6 +- modules/core/ms_info.cpp | 80 +- modules/core/ms_list.cpp | 32 +- modules/core/ms_read.cpp | 24 +- modules/core/ms_rsend.cpp | 20 +- modules/core/ms_send.cpp | 6 +- modules/core/ms_sendall.cpp | 10 +- modules/core/ms_set.cpp | 72 +- modules/core/ms_staff.cpp | 8 +- modules/core/ns_access.cpp | 40 +- modules/core/ns_alist.cpp | 20 +- modules/core/ns_drop.cpp | 36 +- modules/core/ns_forbid.cpp | 28 +- modules/core/ns_getemail.cpp | 12 +- modules/core/ns_getpass.cpp | 28 +- modules/core/ns_ghost.cpp | 30 +- modules/core/ns_group.cpp | 92 +- modules/core/ns_help.cpp | 16 +- modules/core/ns_identify.cpp | 36 +- modules/core/ns_info.cpp | 56 +- modules/core/ns_list.cpp | 34 +- modules/core/ns_logout.cpp | 18 +- modules/core/ns_recover.cpp | 42 +- modules/core/ns_register.cpp | 124 +-- modules/core/ns_release.cpp | 30 +- modules/core/ns_resetpass.cpp | 38 +- modules/core/ns_saset.cpp | 58 +- modules/core/ns_saset_noexpire.cpp | 10 +- modules/core/ns_sendpass.cpp | 26 +- modules/core/ns_set.cpp | 48 +- modules/core/ns_set_autoop.cpp | 16 +- modules/core/ns_set_email.cpp | 24 +- modules/core/ns_set_greet.cpp | 12 +- modules/core/ns_set_hide.cpp | 16 +- modules/core/ns_set_kill.cpp | 24 +- modules/core/ns_set_language.cpp | 16 +- modules/core/ns_set_message.cpp | 20 +- modules/core/ns_set_private.cpp | 16 +- modules/core/ns_set_secure.cpp | 16 +- modules/core/ns_status.cpp | 14 +- modules/core/ns_suspend.cpp | 44 +- modules/core/ns_update.cpp | 6 +- modules/core/os_akill.cpp | 58 +- modules/core/os_chankill.cpp | 16 +- modules/core/os_chanlist.cpp | 14 +- modules/core/os_clearmodes.cpp | 16 +- modules/core/os_defcon.cpp | 132 +-- modules/core/os_global.cpp | 8 +- modules/core/os_help.cpp | 6 +- modules/core/os_ignore.cpp | 24 +- modules/core/os_jupe.cpp | 12 +- modules/core/os_kick.cpp | 14 +- modules/core/os_mode.cpp | 12 +- modules/core/os_modinfo.cpp | 12 +- modules/core/os_modlist.cpp | 26 +- modules/core/os_modload.cpp | 10 +- modules/core/os_modunload.cpp | 10 +- modules/core/os_news.cpp | 46 +- modules/core/os_noop.cpp | 14 +- modules/core/os_oline.cpp | 18 +- modules/core/os_quit.cpp | 8 +- modules/core/os_reload.cpp | 19 +- modules/core/os_restart.cpp | 8 +- modules/core/os_session.cpp | 82 +- modules/core/os_set.cpp | 92 +- modules/core/os_shutdown.cpp | 8 +- modules/core/os_snline.cpp | 58 +- modules/core/os_sqline.cpp | 56 +- modules/core/os_staff.cpp | 16 +- modules/core/os_stats.cpp | 144 +-- modules/core/os_svsnick.cpp | 24 +- modules/core/os_szline.cpp | 54 +- modules/core/os_umode.cpp | 14 +- modules/core/os_update.cpp | 6 +- modules/core/os_userlist.cpp | 14 +- modules/core/ss_main.cpp | 2 +- modules/extra/cs_appendtopic.cpp | 18 +- modules/extra/cs_enforce.cpp | 30 +- modules/extra/cs_set_misc.cpp | 12 +- modules/extra/cs_tban.cpp | 20 +- modules/extra/db_mysql.cpp | 14 +- modules/extra/hs_request.cpp | 86 +- modules/extra/m_ssl.cpp | 2 +- modules/extra/ns_maxemail.cpp | 6 +- modules/extra/ns_set_misc.cpp | 12 +- modules/protocol/bahamut.cpp | 26 +- modules/protocol/inspircd11.cpp | 40 +- modules/protocol/inspircd12.cpp | 10 +- modules/protocol/inspircd20.cpp | 10 +- modules/protocol/ratbox.cpp | 14 +- modules/protocol/unreal32.cpp | 40 +- modules/socketengines/m_socketengine_epoll.cpp | 2 +- modules/socketengines/m_socketengine_select.cpp | 2 +- src/actions.cpp | 8 +- src/bots.cpp | 20 +- src/botserv.cpp | 32 +- src/channels.cpp | 18 +- src/chanserv.cpp | 28 +- src/commands.cpp | 4 +- src/config.cpp | 1183 +++++++++++------------ src/configreader.cpp | 40 +- src/hostserv.cpp | 8 +- src/init.cpp | 59 +- src/language.cpp | 14 +- src/log.cpp | 8 +- src/mail.cpp | 16 +- src/main.cpp | 38 +- src/memoserv.cpp | 50 +- src/messages.cpp | 92 +- src/misc.cpp | 26 +- src/modes.cpp | 12 +- src/modulemanager.cpp | 8 +- src/modules.cpp | 12 +- src/nickalias.cpp | 8 +- src/nickcore.cpp | 4 +- src/nickserv.cpp | 24 +- src/operserv.cpp | 42 +- src/protocol.cpp | 12 +- src/regchannel.cpp | 10 +- src/send.cpp | 2 +- src/servers.cpp | 8 +- src/sessions.cpp | 26 +- src/users.cpp | 24 +- 195 files changed, 3131 insertions(+), 3247 deletions(-) diff --git a/docs/TODO b/docs/TODO index 080008461..85bba12e7 100644 --- a/docs/TODO +++ b/docs/TODO @@ -20,7 +20,7 @@ Legend: [ ] Modules should also have a way to add strings programatically [ ] Should be able to add many strings by dropping a file in a set location. [+] Method to store listmodes (more generically than AKICK, too) for e.g. +beI and extbans, etc. -[ ] Config bailing on /os reload needs to be non fatal +[x] Config bailing on /os reload needs to be non fatal [ ] AutoID needs to be able to live through /os restart, current system is just annoying. [ ] SQL tables need to changed to have references etc [ ] MS IGNORE. Make it take nick (accounts) or n!u@h masks. Fake success of memo send still, but send to opers? diff --git a/include/config.h b/include/config.h index 54e3d095f..8313f94d6 100644 --- a/include/config.h +++ b/include/config.h @@ -343,10 +343,10 @@ typedef std::deque ValueList; typedef bool (*Validator)(ServerConfig *, const Anope::string &, const Anope::string &, ValueItem &); /** A callback for validating multiple value entries */ -typedef bool (*MultiValidator)(ServerConfig *, const Anope::string &, const Anope::string *, ValueList &, int *, bool); +typedef bool (*MultiValidator)(ServerConfig *, const Anope::string &, const Anope::string *, ValueList &, int *); /** A callback indicating the end of a group of entries */ -typedef bool (*MultiNotify)(ServerConfig *, const Anope::string &, bool); +typedef bool (*MultiNotify)(ServerConfig *, const Anope::string &); /** Holds a core configuration item and its callbacks */ @@ -395,18 +395,12 @@ struct MultiConfig class ServerConfig { private: - /** This variable holds the names of all - * files included from the main one. This - * is used to make sure that no files are - * recursively included. - */ - std::vector include_stack; /** Check that there is only one of each configuration item */ bool CheckOnce(const Anope::string &); public: + /* Error from the config */ std::ostringstream errstr; - ConfigDataHash newconfig; /** This holds all the information in the config file, * it's indexed by tag name to a vector of key/values. */ @@ -414,25 +408,15 @@ class ServerConfig /** Construct a new ServerConfig */ ServerConfig(); - /** Clears the include stack in preperation for a Read() call. - */ - void ClearStack(); /** Read the entire configuration into memory * and initialize this class. All other methods * should be used only by the core. */ - int Read(bool); - /** Report a configuration error given in errormessage. - * @param bail If this is set to true, the error is sent to the console, and the program exits - * @param connection If this is set to a non-null value, and bail is false, the errors are spooled to - * this connection as SNOTICEs. - * If the parameter is NULL, the messages are spooled to all connections via WriteOpers as SNOTICEs. - */ - void ReportConfigError(const Anope::string &, bool); + void Read(); /** Load 'filename' into 'target', with the new config parser everything is parsed into * tag/key/value at load-time rather than at read-value time. */ - bool LoadConf(ConfigDataHash &, const Anope::string &, std::ostringstream &); + bool LoadConf(ConfigDataHash &, const Anope::string &); // Both these return true if the value existed or false otherwise /** Writes 'length' chars into 'result' as a string */ @@ -454,7 +438,7 @@ class ServerConfig bool ConfValueBool(ConfigDataHash &, const Anope::string &, const Anope::string &, const Anope::string &, int); /** Returns the number of occurences of tag in the config file */ - int ConfValueEnum(ConfigDataHash &, const Anope::string &); + int ConfValueEnum(const ConfigDataHash &, const Anope::string &); /** Returns the numbers of vars inside the index'th 'tag in the config file */ int ConfVarEnum(ConfigDataHash &, const Anope::string &, int); @@ -880,18 +864,6 @@ class ConfigException : public CoreException class CoreExport ConfigReader { protected: - /** The contents of the configuration file - * This protected member should never be accessed by a module (and cannot be accessed unless the - * core is changed). It will contain a pointer to the configuration file data with unneeded data - * (such as comments) stripped from it. - */ - ConfigDataHash *data; - /** Used to store errors - */ - std::ostringstream *errorlog; - /** If we're using our own config data hash or not - */ - bool privatehash; /** True if an error occured reading the config file */ bool readerror; @@ -971,13 +943,6 @@ class CoreExport ConfigReader * file does not exist or could not be opened. */ bool Verify(); - /** Dumps the list of errors in a config file to an output location. If bail is true, - * then the program will abort. If bail is false and user points to a valid user - * record, the error report will be spooled to the given user by means of NOTICE. - * if bool is false AND user is false, the error report will be spooled to all opers - * by means of a NOTICE to all opers. - */ - void DumpErrors(bool); /** Returns the number of items within a tag. * For example if the tag was <test tag="blah" data="foo"> then this * function would return 2. Spaces and newlines both qualify as valid seperators diff --git a/include/extern.h b/include/extern.h index f7c488030..b2dd30b79 100644 --- a/include/extern.h +++ b/include/extern.h @@ -94,7 +94,12 @@ E Entry *elist_match_user(EList *list, User *u); E Entry *elist_find_mask(EList *list, const Anope::string &mask); E long get_memuse(EList *list); -#define whosends(ci) (!(ci) || !((ci)->botflags.HasFlag(BS_SYMBIOSIS)) || !(ci)->bi || !(ci)->c || (ci)->c->FindUser((ci)->bi) ? findbot(Config.s_ChanServ) : (ci)->bi) +inline BotInfo *whosends(ChannelInfo *ci) +{ + if (!ci || !ci->bi || !ci->c || !ci->botflags.HasFlag(BS_SYMBIOSIS) || !ci->c->FindUser(ci->bi)) + return ChanServ; + return ci->bi; +} /**** chanserv.c ****/ @@ -130,8 +135,7 @@ E Anope::string get_mlock_modes(ChannelInfo *ci, int complete); /**** config.c ****/ E Anope::string services_conf; -E ServerConfig Config; -E int read_config(int reload); +E ServerConfig *Config; /* hostserv.c */ E void do_on_id(User *u); @@ -297,7 +301,7 @@ E Flags DefMLockOff; E std::map DefMLockParams; /* Modes to set on bots when they join the channel */ E std::list BotModes; -E void SetDefaultMLock(); +E void SetDefaultMLock(ServerConfig *config); /**** nickserv.c ****/ diff --git a/modules/core/bs_act.cpp b/modules/core/bs_act.cpp index d553aa950..34251cbb2 100644 --- a/modules/core/bs_act.cpp +++ b/modules/core/bs_act.cpp @@ -27,19 +27,19 @@ class CommandBSAct : public Command if (!check_access(u, ci, CA_SAY)) { - notice_lang(Config.s_BotServ, u, ACCESS_DENIED); + notice_lang(Config->s_BotServ, u, ACCESS_DENIED); return MOD_CONT; } if (!ci->bi) { - notice_help(Config.s_BotServ, u, BOT_NOT_ASSIGNED); + notice_help(Config->s_BotServ, u, BOT_NOT_ASSIGNED); return MOD_CONT; } if (!ci->c || !ci->c->FindUser(ci->bi)) { - notice_lang(Config.s_BotServ, u, BOT_NOT_ON_CHANNEL, ci->name.c_str()); + notice_lang(Config->s_BotServ, u, BOT_NOT_ON_CHANNEL, ci->name.c_str()); return MOD_CONT; } @@ -49,25 +49,25 @@ class CommandBSAct : public Command ircdproto->SendAction(ci->bi, ci->name, "%s", message.c_str()); ci->bi->lastmsg = time(NULL); - if (Config.LogBot && !Config.LogChannel.empty() && LogChan && !debug && findchan(Config.LogChannel)) - ircdproto->SendPrivmsg(ci->bi, Config.LogChannel, "ACT %s %s %s", u->nick.c_str(), ci->name.c_str(), message.c_str()); + if (Config->LogBot && !Config->LogChannel.empty() && LogChan && !debug && findchan(Config->LogChannel)) + ircdproto->SendPrivmsg(ci->bi, Config->LogChannel, "ACT %s %s %s", u->nick.c_str(), ci->name.c_str(), message.c_str()); return MOD_CONT; } void OnSyntaxError(User *u, const Anope::string &subcommand) { - syntax_error(Config.s_BotServ, u, "ACT", BOT_ACT_SYNTAX); + syntax_error(Config->s_BotServ, u, "ACT", BOT_ACT_SYNTAX); } bool OnHelp(User *u, const Anope::string &subcommand) { - notice_help(Config.s_BotServ, u, BOT_HELP_ACT); + notice_help(Config->s_BotServ, u, BOT_HELP_ACT); return true; } void OnServHelp(User *u) { - notice_lang(Config.s_BotServ, u, BOT_HELP_CMD_ACT); + notice_lang(Config->s_BotServ, u, BOT_HELP_CMD_ACT); } }; diff --git a/modules/core/bs_assign.cpp b/modules/core/bs_assign.cpp index ab24b1f39..b1242c857 100644 --- a/modules/core/bs_assign.cpp +++ b/modules/core/bs_assign.cpp @@ -29,13 +29,13 @@ class CommandBSAssign : public Command if (readonly) { - notice_lang(Config.s_BotServ, u, BOT_ASSIGN_READONLY); + notice_lang(Config->s_BotServ, u, BOT_ASSIGN_READONLY); return MOD_CONT; } if (!(bi = findbot(nick))) { - notice_lang(Config.s_BotServ, u, BOT_DOES_NOT_EXIST, nick.c_str()); + notice_lang(Config->s_BotServ, u, BOT_DOES_NOT_EXIST, nick.c_str()); return MOD_CONT; } @@ -43,41 +43,41 @@ class CommandBSAssign : public Command if (ci->botflags.HasFlag(BS_NOBOT) || (!check_access(u, ci, CA_ASSIGN) && !u->Account()->HasPriv("botserv/administration"))) { - notice_lang(Config.s_BotServ, u, ACCESS_DENIED); + notice_lang(Config->s_BotServ, u, ACCESS_DENIED); return MOD_CONT; } if (bi->HasFlag(BI_PRIVATE) && !u->Account()->HasCommand("botserv/assign/private")) { - notice_lang(Config.s_BotServ, u, ACCESS_DENIED); + notice_lang(Config->s_BotServ, u, ACCESS_DENIED); return MOD_CONT; } if (ci->bi && nick.equals_ci(ci->bi->nick)) { - notice_lang(Config.s_BotServ, u, BOT_ASSIGN_ALREADY, ci->bi->nick.c_str(), chan.c_str()); + notice_lang(Config->s_BotServ, u, BOT_ASSIGN_ALREADY, ci->bi->nick.c_str(), chan.c_str()); return MOD_CONT; } bi->Assign(u, ci); - notice_lang(Config.s_BotServ, u, BOT_ASSIGN_ASSIGNED, bi->nick.c_str(), ci->name.c_str()); + notice_lang(Config->s_BotServ, u, BOT_ASSIGN_ASSIGNED, bi->nick.c_str(), ci->name.c_str()); return MOD_CONT; } bool OnHelp(User *u, const Anope::string &subcommand) { - notice_help(Config.s_BotServ, u, BOT_HELP_ASSIGN); + notice_help(Config->s_BotServ, u, BOT_HELP_ASSIGN); return true; } void OnSyntaxError(User *u, const Anope::string &subcommand) { - syntax_error(Config.s_BotServ, u, "ASSIGN", BOT_ASSIGN_SYNTAX); + syntax_error(Config->s_BotServ, u, "ASSIGN", BOT_ASSIGN_SYNTAX); } void OnServHelp(User *u) { - notice_lang(Config.s_BotServ, u, BOT_HELP_CMD_ASSIGN); + notice_lang(Config->s_BotServ, u, BOT_HELP_CMD_ASSIGN); } }; diff --git a/modules/core/bs_badwords.cpp b/modules/core/bs_badwords.cpp index 92567252e..46b38bf1d 100644 --- a/modules/core/bs_badwords.cpp +++ b/modules/core/bs_badwords.cpp @@ -26,7 +26,7 @@ class BadwordsListCallback : public NumberList ~BadwordsListCallback() { if (!SentHeader) - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_NO_MATCH, ci->name.c_str()); + notice_lang(Config->s_BotServ, u, BOT_BADWORDS_NO_MATCH, ci->name.c_str()); } void HandleNumber(unsigned Number) @@ -37,7 +37,7 @@ class BadwordsListCallback : public NumberList if (!SentHeader) { SentHeader = true; - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_LIST_HEADER, ci->name.c_str()); + notice_lang(Config->s_BotServ, u, BOT_BADWORDS_LIST_HEADER, ci->name.c_str()); } DoList(u, ci, Number - 1, ci->GetBadWord(Number - 1)); @@ -45,7 +45,7 @@ class BadwordsListCallback : public NumberList static void DoList(User *u, ChannelInfo *ci, unsigned Number, BadWord *bw) { - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_LIST_FORMAT, Number + 1, bw->word.c_str(), bw->type == BW_SINGLE ? "(SINGLE)" : (bw->type == BW_START ? "(START)" : (bw->type == BW_END ? "(END)" : ""))); + notice_lang(Config->s_BotServ, u, BOT_BADWORDS_LIST_FORMAT, Number + 1, bw->word.c_str(), bw->type == BW_SINGLE ? "(SINGLE)" : (bw->type == BW_START ? "(START)" : (bw->type == BW_END ? "(END)" : ""))); } }; @@ -62,11 +62,11 @@ class BadwordsDelCallback : public NumberList ~BadwordsDelCallback() { if (!Deleted) - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_NO_MATCH, ci->name.c_str()); + notice_lang(Config->s_BotServ, u, BOT_BADWORDS_NO_MATCH, ci->name.c_str()); else if (Deleted == 1) - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_DELETED_ONE, ci->name.c_str()); + notice_lang(Config->s_BotServ, u, BOT_BADWORDS_DELETED_ONE, ci->name.c_str()); else - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_DELETED_SEVERAL, Deleted, ci->name.c_str()); + notice_lang(Config->s_BotServ, u, BOT_BADWORDS_DELETED_SEVERAL, Deleted, ci->name.c_str()); } void HandleNumber(unsigned Number) @@ -85,7 +85,7 @@ class CommandBSBadwords : public Command CommandReturn DoList(User *u, ChannelInfo *ci, const Anope::string &word) { if (!ci->GetBadWordCount()) - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_LIST_EMPTY, ci->name.c_str()); + notice_lang(Config->s_BotServ, u, BOT_BADWORDS_LIST_EMPTY, ci->name.c_str()); else if (!word.empty() && word.find_first_not_of("1234567890,-") == Anope::string::npos) { BadwordsListCallback list(u, ci, word); @@ -105,14 +105,14 @@ class CommandBSBadwords : public Command if (!SentHeader) { SentHeader = true; - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_LIST_HEADER, ci->name.c_str()); + notice_lang(Config->s_BotServ, u, BOT_BADWORDS_LIST_HEADER, ci->name.c_str()); } BadwordsListCallback::DoList(u, ci, i, bw); } if (!SentHeader) - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_NO_MATCH, ci->name.c_str()); + notice_lang(Config->s_BotServ, u, BOT_BADWORDS_NO_MATCH, ci->name.c_str()); } return MOD_CONT; @@ -139,9 +139,9 @@ class CommandBSBadwords : public Command realword = word.substr(0, pos); } - if (ci->GetBadWordCount() >= Config.BSBadWordsMax) + if (ci->GetBadWordCount() >= Config->BSBadWordsMax) { - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_REACHED_LIMIT, Config.BSBadWordsMax); + notice_lang(Config->s_BotServ, u, BOT_BADWORDS_REACHED_LIMIT, Config->BSBadWordsMax); return MOD_CONT; } @@ -149,16 +149,16 @@ class CommandBSBadwords : public Command { BadWord *bw = ci->GetBadWord(i); - if (!bw->word.empty() && ((Config.BSCaseSensitive && realword.equals_cs(bw->word)) || (!Config.BSCaseSensitive && realword.equals_ci(bw->word)))) + if (!bw->word.empty() && ((Config->BSCaseSensitive && realword.equals_cs(bw->word)) || (!Config->BSCaseSensitive && realword.equals_ci(bw->word)))) { - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_ALREADY_EXISTS, bw->word.c_str(), ci->name.c_str()); + notice_lang(Config->s_BotServ, u, BOT_BADWORDS_ALREADY_EXISTS, bw->word.c_str(), ci->name.c_str()); return MOD_CONT; } } ci->AddBadWord(realword, type); - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_ADDED, realword.c_str(), ci->name.c_str()); + notice_lang(Config->s_BotServ, u, BOT_BADWORDS_ADDED, realword.c_str(), ci->name.c_str()); return MOD_CONT; } @@ -186,13 +186,13 @@ class CommandBSBadwords : public Command if (i == end) { - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_NOT_FOUND, word.c_str(), ci->name.c_str()); + notice_lang(Config->s_BotServ, u, BOT_BADWORDS_NOT_FOUND, word.c_str(), ci->name.c_str()); return MOD_CONT; } ci->EraseBadWord(i); - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_DELETED, badword->word.c_str(), ci->name.c_str()); + notice_lang(Config->s_BotServ, u, BOT_BADWORDS_DELETED, badword->word.c_str(), ci->name.c_str()); } return MOD_CONT; @@ -201,7 +201,7 @@ class CommandBSBadwords : public Command CommandReturn DoClear(User *u, ChannelInfo *ci) { ci->ClearBadWords(); - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_CLEAR); + notice_lang(Config->s_BotServ, u, BOT_BADWORDS_CLEAR); return MOD_CONT; } public: @@ -227,13 +227,13 @@ class CommandBSBadwords : public Command if (!check_access(u, ci, CA_BADWORDS) && (!need_args || !u->Account()->HasPriv("botserv/administration"))) { - notice_lang(Config.s_BotServ, u, ACCESS_DENIED); + notice_lang(Config->s_BotServ, u, ACCESS_DENIED); return MOD_CONT; } if (readonly) { - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_DISABLED); + notice_lang(Config->s_BotServ, u, BOT_BADWORDS_DISABLED); return MOD_CONT; } @@ -253,18 +253,18 @@ class CommandBSBadwords : public Command bool OnHelp(User *u, const Anope::string &subcommand) { - notice_help(Config.s_BotServ, u, BOT_HELP_BADWORDS); + notice_help(Config->s_BotServ, u, BOT_HELP_BADWORDS); return true; } void OnSyntaxError(User *u, const Anope::string &subcommand) { - syntax_error(Config.s_BotServ, u, "BADWORDS", BOT_BADWORDS_SYNTAX); + syntax_error(Config->s_BotServ, u, "BADWORDS", BOT_BADWORDS_SYNTAX); } void OnServHelp(User *u) { - notice_lang(Config.s_BotServ, u, BOT_HELP_CMD_BADWORDS); + notice_lang(Config->s_BotServ, u, BOT_HELP_CMD_BADWORDS); } }; diff --git a/modules/core/bs_bot.cpp b/modules/core/bs_bot.cpp index fdff5ba5c..f001c81a4 100644 --- a/modules/core/bs_bot.cpp +++ b/modules/core/bs_bot.cpp @@ -26,60 +26,60 @@ class CommandBSBot : public Command if (findbot(nick)) { - notice_lang(Config.s_BotServ, u, BOT_BOT_ALREADY_EXISTS, nick.c_str()); + notice_lang(Config->s_BotServ, u, BOT_BOT_ALREADY_EXISTS, nick.c_str()); return MOD_CONT; } - if (nick.length() > Config.NickLen) + if (nick.length() > Config->NickLen) { - notice_lang(Config.s_BotServ, u, BOT_BAD_NICK); + notice_lang(Config->s_BotServ, u, BOT_BAD_NICK); return MOD_CONT; } - if (user.length() > Config.UserLen) + if (user.length() > Config->UserLen) { - notice_lang(Config.s_BotServ, u, BOT_LONG_IDENT, Config.UserLen); + notice_lang(Config->s_BotServ, u, BOT_LONG_IDENT, Config->UserLen); return MOD_CONT; } - if (host.length() > Config.HostLen) + if (host.length() > Config->HostLen) { - notice_lang(Config.s_BotServ, u, BOT_LONG_HOST, Config.HostLen); + notice_lang(Config->s_BotServ, u, BOT_LONG_HOST, Config->HostLen); return MOD_CONT; } /* Check the nick is valid re RFC 2812 */ if (isdigit(nick[0]) || nick[0] == '-') { - notice_lang(Config.s_BotServ, u, BOT_BAD_NICK); + notice_lang(Config->s_BotServ, u, BOT_BAD_NICK); return MOD_CONT; } - for (unsigned i = 0, end = nick.length(); i < end && i < Config.NickLen; ++i) + for (unsigned i = 0, end = nick.length(); i < end && i < Config->NickLen; ++i) if (!isvalidnick(nick[i])) { - notice_lang(Config.s_BotServ, u, BOT_BAD_NICK); + notice_lang(Config->s_BotServ, u, BOT_BAD_NICK); return MOD_CONT; } /* check for hardcored ircd forbidden nicks */ if (!ircdproto->IsNickValid(nick)) { - notice_lang(Config.s_BotServ, u, BOT_BAD_NICK); + notice_lang(Config->s_BotServ, u, BOT_BAD_NICK); return MOD_CONT; } /* Check the host is valid re RFC 2812 */ if (!isValidHost(host, 3)) { - notice_lang(Config.s_BotServ, u, BOT_BAD_HOST); + notice_lang(Config->s_BotServ, u, BOT_BAD_HOST); return MOD_CONT; } - for (unsigned i = 0, end = user.length(); i < end && i < Config.UserLen; ++i) + for (unsigned i = 0, end = user.length(); i < end && i < Config->UserLen; ++i) if (!isalnum(user[i])) { - notice_lang(Config.s_BotServ, u, BOT_BAD_IDENT, Config.UserLen); + notice_lang(Config->s_BotServ, u, BOT_BAD_IDENT, Config->UserLen); return MOD_CONT; } @@ -89,17 +89,17 @@ class CommandBSBot : public Command */ if (findnick(nick)) { - notice_lang(Config.s_BotServ, u, NICK_ALREADY_REGISTERED, nick.c_str()); + notice_lang(Config->s_BotServ, u, NICK_ALREADY_REGISTERED, nick.c_str()); return MOD_CONT; } if (!(bi = new BotInfo(nick, user, host, real))) { - notice_lang(Config.s_BotServ, u, BOT_BOT_CREATION_FAILED); + notice_lang(Config->s_BotServ, u, BOT_BOT_CREATION_FAILED); return MOD_CONT; } - notice_lang(Config.s_BotServ, u, BOT_BOT_ADDED, bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str()); + notice_lang(Config->s_BotServ, u, BOT_BOT_ADDED, bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str()); FOREACH_MOD(I_OnBotCreate, OnBotCreate(bi)); return MOD_CONT; @@ -122,37 +122,37 @@ class CommandBSBot : public Command if (!(bi = findbot(oldnick))) { - notice_lang(Config.s_BotServ, u, BOT_DOES_NOT_EXIST, oldnick.c_str()); + notice_lang(Config->s_BotServ, u, BOT_DOES_NOT_EXIST, oldnick.c_str()); return MOD_CONT; } if (!oldnick.equals_ci(nick) && nickIsServices(oldnick, false)) { - notice_lang(Config.s_BotServ, u, BOT_DOES_NOT_EXIST, oldnick.c_str()); + notice_lang(Config->s_BotServ, u, BOT_DOES_NOT_EXIST, oldnick.c_str()); return MOD_CONT; } - if (nick.length() > Config.NickLen) + if (nick.length() > Config->NickLen) { - notice_lang(Config.s_BotServ, u, BOT_BAD_NICK); + notice_lang(Config->s_BotServ, u, BOT_BAD_NICK); return MOD_CONT; } - if (!user.empty() && user.length() > Config.UserLen) + if (!user.empty() && user.length() > Config->UserLen) { - notice_lang(Config.s_BotServ, u, BOT_LONG_IDENT, Config.UserLen); + notice_lang(Config->s_BotServ, u, BOT_LONG_IDENT, Config->UserLen); return MOD_CONT; } - if (!host.empty() && host.length() > Config.HostLen) + if (!host.empty() && host.length() > Config->HostLen) { - notice_lang(Config.s_BotServ, u, BOT_LONG_HOST, Config.HostLen); + notice_lang(Config->s_BotServ, u, BOT_LONG_HOST, Config->HostLen); return MOD_CONT; } if (!oldnick.equals_ci(nick) && nickIsServices(nick, false)) { - notice_lang(Config.s_BotServ, u, BOT_DOES_NOT_EXIST, oldnick.c_str()); + notice_lang(Config->s_BotServ, u, BOT_DOES_NOT_EXIST, oldnick.c_str()); return MOD_CONT; } @@ -163,48 +163,48 @@ class CommandBSBot : public Command */ if (nick.equals_cs(bi->nick) && (!user.empty() ? user.equals_cs(bi->GetIdent()) : 1) && (!host.empty() ? host.equals_cs(bi->host) : 1) && (!real.empty() ? real.equals_cs(bi->realname) : 1)) { - notice_lang(Config.s_BotServ, u, BOT_BOT_ANY_CHANGES); + notice_lang(Config->s_BotServ, u, BOT_BOT_ANY_CHANGES); return MOD_CONT; } /* Check the nick is valid re RFC 2812 */ if (isdigit(nick[0]) || nick[0] == '-') { - notice_lang(Config.s_BotServ, u, BOT_BAD_NICK); + notice_lang(Config->s_BotServ, u, BOT_BAD_NICK); return MOD_CONT; } - for (unsigned i = 0, end = nick.length(); i < end && i < Config.NickLen; ++i) + for (unsigned i = 0, end = nick.length(); i < end && i < Config->NickLen; ++i) if (!isvalidnick(nick[i])) { - notice_lang(Config.s_BotServ, u, BOT_BAD_NICK); + notice_lang(Config->s_BotServ, u, BOT_BAD_NICK); return MOD_CONT; } /* check for hardcored ircd forbidden nicks */ if (!ircdproto->IsNickValid(nick)) { - notice_lang(Config.s_BotServ, u, BOT_BAD_NICK); + notice_lang(Config->s_BotServ, u, BOT_BAD_NICK); return MOD_CONT; } if (!host.empty() && !isValidHost(host, 3)) { - notice_lang(Config.s_BotServ, u, BOT_BAD_HOST); + notice_lang(Config->s_BotServ, u, BOT_BAD_HOST); return MOD_CONT; } if (!user.empty()) - for (unsigned i = 0, end = user.length(); i < end && i < Config.UserLen; ++i) + for (unsigned i = 0, end = user.length(); i < end && i < Config->UserLen; ++i) if (!isalnum(user[i])) { - notice_lang(Config.s_BotServ, u, BOT_BAD_IDENT, Config.UserLen); + notice_lang(Config->s_BotServ, u, BOT_BAD_IDENT, Config->UserLen); return MOD_CONT; } if (!nick.equals_ci(bi->nick) && findbot(nick)) { - notice_lang(Config.s_BotServ, u, BOT_BOT_ALREADY_EXISTS, nick.c_str()); + notice_lang(Config->s_BotServ, u, BOT_BOT_ALREADY_EXISTS, nick.c_str()); return MOD_CONT; } @@ -216,7 +216,7 @@ class CommandBSBot : public Command */ if (findnick(nick)) { - notice_lang(Config.s_BotServ, u, NICK_ALREADY_REGISTERED, nick.c_str()); + notice_lang(Config->s_BotServ, u, NICK_ALREADY_REGISTERED, nick.c_str()); return MOD_CONT; } @@ -229,7 +229,7 @@ class CommandBSBot : public Command } /* We check whether user with this nick is online, and kill it if so */ - EnforceQlinedNick(nick, Config.s_BotServ); + EnforceQlinedNick(nick, Config->s_BotServ); } if (!user.empty()) @@ -259,7 +259,7 @@ class CommandBSBot : public Command bi->RejoinAll(); } - notice_lang(Config.s_BotServ, u, BOT_BOT_CHANGED, oldnick.c_str(), bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str()); + notice_lang(Config->s_BotServ, u, BOT_BOT_CHANGED, oldnick.c_str(), bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str()); FOREACH_MOD(I_OnBotChange, OnBotChange(bi)); return MOD_CONT; @@ -278,13 +278,13 @@ class CommandBSBot : public Command if (!(bi = findbot(nick))) { - notice_lang(Config.s_BotServ, u, BOT_DOES_NOT_EXIST, nick.c_str()); + notice_lang(Config->s_BotServ, u, BOT_DOES_NOT_EXIST, nick.c_str()); return MOD_CONT; } if (nickIsServices(nick, false)) { - notice_lang(Config.s_BotServ, u, BOT_DOES_NOT_EXIST, nick.c_str()); + notice_lang(Config->s_BotServ, u, BOT_DOES_NOT_EXIST, nick.c_str()); return MOD_CONT; } @@ -295,7 +295,7 @@ class CommandBSBot : public Command ircdproto->SendSQLineDel(&x); delete bi; - notice_lang(Config.s_BotServ, u, BOT_BOT_DELETED, nick.c_str()); + notice_lang(Config->s_BotServ, u, BOT_BOT_DELETED, nick.c_str()); return MOD_CONT; } public: @@ -310,7 +310,7 @@ class CommandBSBot : public Command if (readonly) { - notice_lang(Config.s_BotServ, u, BOT_BOT_READONLY); + notice_lang(Config->s_BotServ, u, BOT_BOT_READONLY); return MOD_CONT; } @@ -319,7 +319,7 @@ class CommandBSBot : public Command // ADD nick user host real - 5 if (!u->Account()->HasCommand("botserv/bot/add")) { - notice_lang(Config.s_BotServ, u, ACCESS_DENIED); + notice_lang(Config->s_BotServ, u, ACCESS_DENIED); return MOD_CONT; } @@ -342,7 +342,7 @@ class CommandBSBot : public Command // but only oldn and newn are required if (!u->Account()->HasCommand("botserv/bot/change")) { - notice_lang(Config.s_BotServ, u, ACCESS_DENIED); + notice_lang(Config->s_BotServ, u, ACCESS_DENIED); return MOD_CONT; } @@ -359,7 +359,7 @@ class CommandBSBot : public Command // DEL nick if (!u->Account()->HasCommand("botserv/bot/del")) { - notice_lang(Config.s_BotServ, u, ACCESS_DENIED); + notice_lang(Config->s_BotServ, u, ACCESS_DENIED); return MOD_CONT; } @@ -379,18 +379,18 @@ class CommandBSBot : public Command bool OnHelp(User *u, const Anope::string &subcommand) { - notice_lang(Config.s_BotServ, u, BOT_SERVADMIN_HELP_BOT); + notice_lang(Config->s_BotServ, u, BOT_SERVADMIN_HELP_BOT); return true; } void OnSyntaxError(User *u, const Anope::string &subcommand) { - syntax_error(Config.s_BotServ, u, "BOT", BOT_BOT_SYNTAX); + syntax_error(Config->s_BotServ, u, "BOT", BOT_BOT_SYNTAX); } void OnServHelp(User *u) { - notice_lang(Config.s_BotServ, u, BOT_HELP_CMD_BOT); + notice_lang(Config->s_BotServ, u, BOT_HELP_CMD_BOT); } }; diff --git a/modules/core/bs_botlist.cpp b/modules/core/bs_botlist.cpp index 0dbb8bedf..3234027ed 100644 --- a/modules/core/bs_botlist.cpp +++ b/modules/core/bs_botlist.cpp @@ -26,7 +26,7 @@ class CommandBSBotList : public Command if (BotListByNick.empty()) { - notice_lang(Config.s_BotServ, u, BOT_BOTLIST_EMPTY); + notice_lang(Config->s_BotServ, u, BOT_BOTLIST_EMPTY); return MOD_CONT; } @@ -37,15 +37,15 @@ class CommandBSBotList : public Command if (!bi->HasFlag(BI_PRIVATE)) { if (!count) - notice_lang(Config.s_BotServ, u, BOT_BOTLIST_HEADER); + notice_lang(Config->s_BotServ, u, BOT_BOTLIST_HEADER); ++count; - u->SendMessage(Config.s_BotServ, " %-15s (%s@%s)", bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str()); + u->SendMessage(Config->s_BotServ, " %-15s (%s@%s)", bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str()); } } if (u->Account()->HasCommand("botserv/botlist") && count < BotListByNick.size()) { - notice_lang(Config.s_BotServ, u, BOT_BOTLIST_PRIVATE_HEADER); + notice_lang(Config->s_BotServ, u, BOT_BOTLIST_PRIVATE_HEADER); for (botinfo_map::const_iterator it = BotListByNick.begin(), it_end = BotListByNick.end(); it != it_end; ++it) { @@ -53,29 +53,29 @@ class CommandBSBotList : public Command if (bi->HasFlag(BI_PRIVATE)) { - u->SendMessage(Config.s_BotServ, " %-15s (%s@%s)", bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str()); + u->SendMessage(Config->s_BotServ, " %-15s (%s@%s)", bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str()); ++count; } } } if (!count) - notice_lang(Config.s_BotServ, u, BOT_BOTLIST_EMPTY); + notice_lang(Config->s_BotServ, u, BOT_BOTLIST_EMPTY); else - notice_lang(Config.s_BotServ, u, BOT_BOTLIST_FOOTER, count); + notice_lang(Config->s_BotServ, u, BOT_BOTLIST_FOOTER, count); return MOD_CONT; } bool OnHelp(User *u, const Anope::string &subcommand) { - notice_help(Config.s_BotServ, u, BOT_HELP_BOTLIST); + notice_help(Config->s_BotServ, u, BOT_HELP_BOTLIST); return true; } void OnServHelp(User *u) { - notice_lang(Config.s_BotServ, u, BOT_HELP_CMD_BOTLIST); + notice_lang(Config->s_BotServ, u, BOT_HELP_CMD_BOTLIST); } }; diff --git a/modules/core/bs_help.cpp b/modules/core/bs_help.cpp index c41472ad3..9faeae9cf 100644 --- a/modules/core/bs_help.cpp +++ b/modules/core/bs_help.cpp @@ -24,18 +24,18 @@ class CommandBSHelp : public Command CommandReturn Execute(User *u, const std::vector ¶ms) { - mod_help_cmd(findbot(Config.s_BotServ), u, params[0]); + mod_help_cmd(findbot(Config->s_BotServ), u, params[0]); return MOD_CONT; } void OnSyntaxError(User *u, const Anope::string &subcommand) { // Abuse syntax error to display general list help. - notice_help(Config.s_BotServ, u, BOT_HELP); + notice_help(Config->s_BotServ, u, BOT_HELP); for (CommandMap::const_iterator it = BotServ->Commands.begin(), it_end = BotServ->Commands.end(); it != it_end; ++it) - if (!Config.HidePrivilegedCommands || it->second->permission.empty() || (u->Account() && u->Account()->HasCommand(it->second->permission))) + if (!Config->HidePrivilegedCommands || it->second->permission.empty() || (u->Account() && u->Account()->HasCommand(it->second->permission))) it->second->OnServHelp(u); - notice_help(Config.s_BotServ, u, BOT_HELP_FOOTER, Config.BSMinUsers); + notice_help(Config->s_BotServ, u, BOT_HELP_FOOTER, Config->BSMinUsers); } }; diff --git a/modules/core/bs_info.cpp b/modules/core/bs_info.cpp index fdf1b8d10..214ed6e3a 100644 --- a/modules/core/bs_info.cpp +++ b/modules/core/bs_info.cpp @@ -28,7 +28,7 @@ class CommandBSInfo : public Command { if (buf.length() + ci->name.length() > 300) { - u->SendMessage(Config.s_BotServ, "%s", buf.c_str()); + u->SendMessage(Config->s_BotServ, "%s", buf.c_str()); buf.clear(); } buf += " " + ci->name + " "; @@ -36,7 +36,7 @@ class CommandBSInfo : public Command } if (!buf.empty()) - u->SendMessage(Config.s_BotServ, "%s", buf.c_str()); + u->SendMessage(Config->s_BotServ, "%s", buf.c_str()); return; } public: @@ -59,14 +59,14 @@ class CommandBSInfo : public Command { struct tm *tm; - notice_lang(Config.s_BotServ, u, BOT_INFO_BOT_HEADER, bi->nick.c_str()); - notice_lang(Config.s_BotServ, u, BOT_INFO_BOT_MASK, bi->GetIdent().c_str(), bi->host.c_str()); - notice_lang(Config.s_BotServ, u, BOT_INFO_BOT_REALNAME, bi->realname.c_str()); + notice_lang(Config->s_BotServ, u, BOT_INFO_BOT_HEADER, bi->nick.c_str()); + notice_lang(Config->s_BotServ, u, BOT_INFO_BOT_MASK, bi->GetIdent().c_str(), bi->host.c_str()); + notice_lang(Config->s_BotServ, u, BOT_INFO_BOT_REALNAME, bi->realname.c_str()); tm = localtime(&bi->created); strftime_lang(buf, sizeof(buf), u, STRFTIME_DATE_TIME_FORMAT, tm); - notice_lang(Config.s_BotServ, u, BOT_INFO_BOT_CREATED, buf); - notice_lang(Config.s_BotServ, u, BOT_INFO_BOT_OPTIONS, getstring(u, (bi->HasFlag(BI_PRIVATE) ? BOT_INFO_OPT_PRIVATE : BOT_INFO_OPT_NONE))); - notice_lang(Config.s_BotServ, u, BOT_INFO_BOT_USAGE, bi->chancount); + notice_lang(Config->s_BotServ, u, BOT_INFO_BOT_CREATED, buf); + notice_lang(Config->s_BotServ, u, BOT_INFO_BOT_OPTIONS, getstring(u, (bi->HasFlag(BI_PRIVATE) ? BOT_INFO_OPT_PRIVATE : BOT_INFO_OPT_NONE))); + notice_lang(Config->s_BotServ, u, BOT_INFO_BOT_USAGE, bi->chancount); if (u->Account()->HasPriv("botserv/administration")) this->send_bot_channels(u, bi); @@ -75,97 +75,97 @@ class CommandBSInfo : public Command { if (!check_access(u, ci, CA_FOUNDER) && !u->Account()->HasPriv("botserv/administration")) { - notice_lang(Config.s_BotServ, u, ACCESS_DENIED); + notice_lang(Config->s_BotServ, u, ACCESS_DENIED); return MOD_CONT; } - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_HEADER, ci->name.c_str()); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_HEADER, ci->name.c_str()); if (ci->bi) - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_BOT, ci->bi->nick.c_str()); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_BOT, ci->bi->nick.c_str()); else - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_BOT_NONE); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_BOT_NONE); if (ci->botflags.HasFlag(BS_KICK_BADWORDS)) { if (ci->ttb[TTB_BADWORDS]) - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_BADWORDS_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_BADWORDS]); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_BADWORDS_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_BADWORDS]); else - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_BADWORDS, getstring(u, BOT_INFO_ACTIVE)); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_BADWORDS, getstring(u, BOT_INFO_ACTIVE)); } else - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_BADWORDS, getstring(u, BOT_INFO_INACTIVE)); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_BADWORDS, getstring(u, BOT_INFO_INACTIVE)); if (ci->botflags.HasFlag(BS_KICK_BOLDS)) { if (ci->ttb[TTB_BOLDS]) - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_BOLDS_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_BOLDS]); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_BOLDS_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_BOLDS]); else - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_BOLDS, getstring(u, BOT_INFO_ACTIVE)); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_BOLDS, getstring(u, BOT_INFO_ACTIVE)); } else - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_BOLDS, getstring(u, BOT_INFO_INACTIVE)); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_BOLDS, getstring(u, BOT_INFO_INACTIVE)); if (ci->botflags.HasFlag(BS_KICK_CAPS)) { if (ci->ttb[TTB_CAPS]) - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_CAPS_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_CAPS], ci->capsmin, ci->capspercent); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_CAPS_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_CAPS], ci->capsmin, ci->capspercent); else - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_CAPS_ON, getstring(u, BOT_INFO_ACTIVE), ci->capsmin, ci->capspercent); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_CAPS_ON, getstring(u, BOT_INFO_ACTIVE), ci->capsmin, ci->capspercent); } else - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_CAPS_OFF, getstring(u, BOT_INFO_INACTIVE)); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_CAPS_OFF, getstring(u, BOT_INFO_INACTIVE)); if (ci->botflags.HasFlag(BS_KICK_COLORS)) { if (ci->ttb[TTB_COLORS]) - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_COLORS_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_COLORS]); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_COLORS_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_COLORS]); else - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_COLORS, getstring(u, BOT_INFO_ACTIVE)); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_COLORS, getstring(u, BOT_INFO_ACTIVE)); } else - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_COLORS, getstring(u, BOT_INFO_INACTIVE)); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_COLORS, getstring(u, BOT_INFO_INACTIVE)); if (ci->botflags.HasFlag(BS_KICK_FLOOD)) { if (ci->ttb[TTB_FLOOD]) - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_FLOOD_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_FLOOD], ci->floodlines, ci->floodsecs); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_FLOOD_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_FLOOD], ci->floodlines, ci->floodsecs); else - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_FLOOD_ON, getstring(u, BOT_INFO_ACTIVE), ci->floodlines, ci->floodsecs); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_FLOOD_ON, getstring(u, BOT_INFO_ACTIVE), ci->floodlines, ci->floodsecs); } else - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_FLOOD_OFF, getstring(u, BOT_INFO_INACTIVE)); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_FLOOD_OFF, getstring(u, BOT_INFO_INACTIVE)); if (ci->botflags.HasFlag(BS_KICK_REPEAT)) { if (ci->ttb[TTB_REPEAT]) - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_REPEAT_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_REPEAT], ci->repeattimes); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_REPEAT_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_REPEAT], ci->repeattimes); else - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_REPEAT_ON, getstring(u, BOT_INFO_ACTIVE), ci->repeattimes); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_REPEAT_ON, getstring(u, BOT_INFO_ACTIVE), ci->repeattimes); } else - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_REPEAT_OFF, getstring(u, BOT_INFO_INACTIVE)); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_REPEAT_OFF, getstring(u, BOT_INFO_INACTIVE)); if (ci->botflags.HasFlag(BS_KICK_REVERSES)) { if (ci->ttb[TTB_REVERSES]) - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_REVERSES_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_REVERSES]); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_REVERSES_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_REVERSES]); else - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_REVERSES, getstring(u, BOT_INFO_ACTIVE)); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_REVERSES, getstring(u, BOT_INFO_ACTIVE)); } else - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_REVERSES, getstring(u, BOT_INFO_INACTIVE)); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_REVERSES, getstring(u, BOT_INFO_INACTIVE)); if (ci->botflags.HasFlag(BS_KICK_UNDERLINES)) { if (ci->ttb[TTB_UNDERLINES]) - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_UNDERLINES_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_UNDERLINES]); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_UNDERLINES_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_UNDERLINES]); else - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_UNDERLINES, getstring(u, BOT_INFO_ACTIVE)); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_UNDERLINES, getstring(u, BOT_INFO_ACTIVE)); } else - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_UNDERLINES, getstring(u, BOT_INFO_INACTIVE)); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_UNDERLINES, getstring(u, BOT_INFO_INACTIVE)); if (ci->botflags.HasFlag(BS_KICK_ITALICS)) { if (ci->ttb[TTB_ITALICS]) - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_ITALICS_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_ITALICS]); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_ITALICS_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_ITALICS]); else - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_ITALICS, getstring(u, BOT_INFO_ACTIVE)); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_ITALICS, getstring(u, BOT_INFO_ACTIVE)); } else - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_ITALICS, getstring(u, BOT_INFO_INACTIVE)); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_ITALICS, getstring(u, BOT_INFO_INACTIVE)); end = buf; *end = 0; @@ -199,27 +199,27 @@ class CommandBSInfo : public Command end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? commastr : "", getstring(u, BOT_INFO_OPT_SYMBIOSIS)); need_comma = 1; } - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_OPTIONS, *buf ? buf : getstring(u, BOT_INFO_OPT_NONE)); + notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_OPTIONS, *buf ? buf : getstring(u, BOT_INFO_OPT_NONE)); } else - notice_lang(Config.s_BotServ, u, BOT_INFO_NOT_FOUND, query.c_str()); + notice_lang(Config->s_BotServ, u, BOT_INFO_NOT_FOUND, query.c_str()); return MOD_CONT; } bool OnHelp(User *u, const Anope::string &subcommand) { - notice_help(Config.s_BotServ, u, BOT_HELP_INFO); + notice_help(Config->s_BotServ, u, BOT_HELP_INFO); return true; } void OnSyntaxError(User *u, const Anope::string &subcommand) { - syntax_error(Config.s_BotServ, u, "INFO", BOT_INFO_SYNTAX); + syntax_error(Config->s_BotServ, u, "INFO", BOT_INFO_SYNTAX); } void OnServHelp(User *u) { - notice_lang(Config.s_BotServ, u, BOT_HELP_CMD_INFO); + notice_lang(Config->s_BotServ, u, BOT_HELP_CMD_INFO); } }; diff --git a/modules/core/bs_kick.cpp b/modules/core/bs_kick.cpp index 6a4528b7e..849efb7d0 100644 --- a/modules/core/bs_kick.cpp +++ b/modules/core/bs_kick.cpp @@ -31,15 +31,15 @@ class CommandBSKick : public Command ChannelInfo *ci = cs_findchan(chan); if (readonly) - notice_lang(Config.s_BotServ, u, BOT_KICK_DISABLED); + notice_lang(Config->s_BotServ, u, BOT_KICK_DISABLED); else if (chan.empty() || option.empty() || value.empty()) - syntax_error(Config.s_BotServ, u, "KICK", BOT_KICK_SYNTAX); + syntax_error(Config->s_BotServ, u, "KICK", BOT_KICK_SYNTAX); else if (!value.equals_ci("ON") && !value.equals_ci("OFF")) - syntax_error(Config.s_BotServ, u, "KICK", BOT_KICK_SYNTAX); + syntax_error(Config->s_BotServ, u, "KICK", BOT_KICK_SYNTAX); else if (!check_access(u, ci, CA_SET) && !u->Account()->HasPriv("botserv/administration")) - notice_lang(Config.s_BotServ, u, ACCESS_DENIED); + notice_lang(Config->s_BotServ, u, ACCESS_DENIED); else if (!ci->bi) - notice_help(Config.s_BotServ, u, BOT_NOT_ASSIGNED); + notice_help(Config->s_BotServ, u, BOT_NOT_ASSIGNED); else { if (option.equals_ci("BADWORDS")) @@ -57,7 +57,7 @@ class CommandBSKick : public Command Alog(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_BADWORDS]; /* reset the value back to 0 - TSL */ ci->ttb[TTB_BADWORDS] = 0; - notice_lang(Config.s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); + notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); return MOD_CONT; } } @@ -65,14 +65,14 @@ class CommandBSKick : public Command ci->ttb[TTB_BADWORDS] = 0; ci->botflags.SetFlag(BS_KICK_BADWORDS); if (ci->ttb[TTB_BADWORDS]) - notice_lang(Config.s_BotServ, u, BOT_KICK_BADWORDS_ON_BAN, ci->ttb[TTB_BADWORDS]); + notice_lang(Config->s_BotServ, u, BOT_KICK_BADWORDS_ON_BAN, ci->ttb[TTB_BADWORDS]); else - notice_lang(Config.s_BotServ, u, BOT_KICK_BADWORDS_ON); + notice_lang(Config->s_BotServ, u, BOT_KICK_BADWORDS_ON); } else { ci->botflags.UnsetFlag(BS_KICK_BADWORDS); - notice_lang(Config.s_BotServ, u, BOT_KICK_BADWORDS_OFF); + notice_lang(Config->s_BotServ, u, BOT_KICK_BADWORDS_OFF); } } else if (option.equals_ci("BOLDS")) @@ -87,7 +87,7 @@ class CommandBSKick : public Command { Alog(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_BOLDS]; ci->ttb[TTB_BOLDS] = 0; - notice_lang(Config.s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); + notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); return MOD_CONT; } } @@ -95,14 +95,14 @@ class CommandBSKick : public Command ci->ttb[TTB_BOLDS] = 0; ci->botflags.SetFlag(BS_KICK_BOLDS); if (ci->ttb[TTB_BOLDS]) - notice_lang(Config.s_BotServ, u, BOT_KICK_BOLDS_ON_BAN, ci->ttb[TTB_BOLDS]); + notice_lang(Config->s_BotServ, u, BOT_KICK_BOLDS_ON_BAN, ci->ttb[TTB_BOLDS]); else - notice_lang(Config.s_BotServ, u, BOT_KICK_BOLDS_ON); + notice_lang(Config->s_BotServ, u, BOT_KICK_BOLDS_ON); } else { ci->botflags.UnsetFlag(BS_KICK_BOLDS); - notice_lang(Config.s_BotServ, u, BOT_KICK_BOLDS_OFF); + notice_lang(Config->s_BotServ, u, BOT_KICK_BOLDS_OFF); } } else if (option.equals_ci("CAPS")) @@ -120,7 +120,7 @@ class CommandBSKick : public Command { Alog(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_CAPS]; ci->ttb[TTB_CAPS] = 0; - notice_lang(Config.s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); + notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); return MOD_CONT; } } @@ -143,14 +143,14 @@ class CommandBSKick : public Command ci->botflags.SetFlag(BS_KICK_CAPS); if (ci->ttb[TTB_CAPS]) - notice_lang(Config.s_BotServ, u, BOT_KICK_CAPS_ON_BAN, ci->capsmin, ci->capspercent, ci->ttb[TTB_CAPS]); + notice_lang(Config->s_BotServ, u, BOT_KICK_CAPS_ON_BAN, ci->capsmin, ci->capspercent, ci->ttb[TTB_CAPS]); else - notice_lang(Config.s_BotServ, u, BOT_KICK_CAPS_ON, ci->capsmin, ci->capspercent); + notice_lang(Config->s_BotServ, u, BOT_KICK_CAPS_ON, ci->capsmin, ci->capspercent); } else { ci->botflags.UnsetFlag(BS_KICK_CAPS); - notice_lang(Config.s_BotServ, u, BOT_KICK_CAPS_OFF); + notice_lang(Config->s_BotServ, u, BOT_KICK_CAPS_OFF); } } else if (option.equals_ci("COLORS")) @@ -165,7 +165,7 @@ class CommandBSKick : public Command { Alog(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_COLORS]; ci->ttb[TTB_COLORS] = 0; - notice_lang(Config.s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); + notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); return MOD_CONT; } } @@ -173,14 +173,14 @@ class CommandBSKick : public Command ci->ttb[TTB_COLORS] = 0; ci->botflags.SetFlag(BS_KICK_COLORS); if (ci->ttb[TTB_COLORS]) - notice_lang(Config.s_BotServ, u, BOT_KICK_COLORS_ON_BAN, ci->ttb[TTB_COLORS]); + notice_lang(Config->s_BotServ, u, BOT_KICK_COLORS_ON_BAN, ci->ttb[TTB_COLORS]); else - notice_lang(Config.s_BotServ, u, BOT_KICK_COLORS_ON); + notice_lang(Config->s_BotServ, u, BOT_KICK_COLORS_ON); } else { ci->botflags.UnsetFlag(BS_KICK_COLORS); - notice_lang(Config.s_BotServ, u, BOT_KICK_COLORS_OFF); + notice_lang(Config->s_BotServ, u, BOT_KICK_COLORS_OFF); } } else if (option.equals_ci("FLOOD")) @@ -198,7 +198,7 @@ class CommandBSKick : public Command { Alog(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_FLOOD]; ci->ttb[TTB_FLOOD] = 0; - notice_lang(Config.s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); + notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); return MOD_CONT; } } @@ -216,19 +216,19 @@ class CommandBSKick : public Command ci->floodsecs = 10; else ci->floodsecs = secs.is_number_only() ? convertTo(secs) : 10; - if (ci->floodsecs < 1 || ci->floodsecs > Config.BSKeepData) + if (ci->floodsecs < 1 || ci->floodsecs > Config->BSKeepData) ci->floodsecs = 10; ci->botflags.SetFlag(BS_KICK_FLOOD); if (ci->ttb[TTB_FLOOD]) - notice_lang(Config.s_BotServ, u, BOT_KICK_FLOOD_ON_BAN, ci->floodlines, ci->floodsecs, ci->ttb[TTB_FLOOD]); + notice_lang(Config->s_BotServ, u, BOT_KICK_FLOOD_ON_BAN, ci->floodlines, ci->floodsecs, ci->ttb[TTB_FLOOD]); else - notice_lang(Config.s_BotServ, u, BOT_KICK_FLOOD_ON, ci->floodlines, ci->floodsecs); + notice_lang(Config->s_BotServ, u, BOT_KICK_FLOOD_ON, ci->floodlines, ci->floodsecs); } else { ci->botflags.UnsetFlag(BS_KICK_FLOOD); - notice_lang(Config.s_BotServ, u, BOT_KICK_FLOOD_OFF); + notice_lang(Config->s_BotServ, u, BOT_KICK_FLOOD_OFF); } } else if (option.equals_ci("REPEAT")) @@ -245,7 +245,7 @@ class CommandBSKick : public Command { Alog(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_REPEAT]; ci->ttb[TTB_REPEAT] = 0; - notice_lang(Config.s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); + notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); return MOD_CONT; } } @@ -261,14 +261,14 @@ class CommandBSKick : public Command ci->botflags.SetFlag(BS_KICK_REPEAT); if (ci->ttb[TTB_REPEAT]) - notice_lang(Config.s_BotServ, u, BOT_KICK_REPEAT_ON_BAN, ci->repeattimes, ci->ttb[TTB_REPEAT]); + notice_lang(Config->s_BotServ, u, BOT_KICK_REPEAT_ON_BAN, ci->repeattimes, ci->ttb[TTB_REPEAT]); else - notice_lang(Config.s_BotServ, u, BOT_KICK_REPEAT_ON, ci->repeattimes); + notice_lang(Config->s_BotServ, u, BOT_KICK_REPEAT_ON, ci->repeattimes); } else { ci->botflags.UnsetFlag(BS_KICK_REPEAT); - notice_lang(Config.s_BotServ, u, BOT_KICK_REPEAT_OFF); + notice_lang(Config->s_BotServ, u, BOT_KICK_REPEAT_OFF); } } else if (option.equals_ci("REVERSES")) @@ -283,7 +283,7 @@ class CommandBSKick : public Command { Alog(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_REVERSES]; ci->ttb[TTB_REVERSES] = 0; - notice_lang(Config.s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); + notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); return MOD_CONT; } } @@ -291,14 +291,14 @@ class CommandBSKick : public Command ci->ttb[TTB_REVERSES] = 0; ci->botflags.SetFlag(BS_KICK_REVERSES); if (ci->ttb[TTB_REVERSES]) - notice_lang(Config.s_BotServ, u, BOT_KICK_REVERSES_ON_BAN, ci->ttb[TTB_REVERSES]); + notice_lang(Config->s_BotServ, u, BOT_KICK_REVERSES_ON_BAN, ci->ttb[TTB_REVERSES]); else - notice_lang(Config.s_BotServ, u, BOT_KICK_REVERSES_ON); + notice_lang(Config->s_BotServ, u, BOT_KICK_REVERSES_ON); } else { ci->botflags.UnsetFlag(BS_KICK_REVERSES); - notice_lang(Config.s_BotServ, u, BOT_KICK_REVERSES_OFF); + notice_lang(Config->s_BotServ, u, BOT_KICK_REVERSES_OFF); } } else if (option.equals_ci("UNDERLINES")) @@ -313,7 +313,7 @@ class CommandBSKick : public Command { Alog(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_UNDERLINES]; ci->ttb[TTB_UNDERLINES] = 0; - notice_lang(Config.s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); + notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); return MOD_CONT; } } @@ -321,14 +321,14 @@ class CommandBSKick : public Command ci->ttb[TTB_UNDERLINES] = 0; ci->botflags.SetFlag(BS_KICK_UNDERLINES); if (ci->ttb[TTB_UNDERLINES]) - notice_lang(Config.s_BotServ, u, BOT_KICK_UNDERLINES_ON_BAN, ci->ttb[TTB_UNDERLINES]); + notice_lang(Config->s_BotServ, u, BOT_KICK_UNDERLINES_ON_BAN, ci->ttb[TTB_UNDERLINES]); else - notice_lang(Config.s_BotServ, u, BOT_KICK_UNDERLINES_ON); + notice_lang(Config->s_BotServ, u, BOT_KICK_UNDERLINES_ON); } else { ci->botflags.UnsetFlag(BS_KICK_UNDERLINES); - notice_lang(Config.s_BotServ, u, BOT_KICK_UNDERLINES_OFF); + notice_lang(Config->s_BotServ, u, BOT_KICK_UNDERLINES_OFF); } } else if (option.equals_ci("ITALICS")) @@ -343,7 +343,7 @@ class CommandBSKick : public Command { Alog(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_ITALICS]; ci->ttb[TTB_ITALICS] = 0; - notice_lang(Config.s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); + notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); return MOD_CONT; } } @@ -351,18 +351,18 @@ class CommandBSKick :