From a08b3ec5924c946308ac086cd3ee7d701610d3be Mon Sep 17 00:00:00 2001 From: Adam- Date: Sat, 28 Nov 2009 23:02:07 +0000 Subject: Massive move of all of the Config variables out of global scope to the Config class git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2674 5417fbe8-f217-4b02-8779-1006273d7864 --- src/actions.c | 14 +- src/bots.cpp | 34 +- src/botserv.c | 98 +++--- src/channels.c | 36 +- src/chanserv.c | 78 ++--- src/commands.c | 2 +- src/config.c | 762 ++++++++++++++++--------------------------- src/configreader.cpp | 16 +- src/core/bs_act.c | 18 +- src/core/bs_assign.c | 18 +- src/core/bs_badwords.c | 44 +-- src/core/bs_bot.c | 82 ++--- src/core/bs_botlist.c | 18 +- src/core/bs_help.c | 6 +- src/core/bs_info.c | 82 ++--- src/core/bs_kick.c | 100 +++--- src/core/bs_say.c | 18 +- src/core/bs_set.c | 74 ++--- src/core/bs_unassign.c | 16 +- src/core/cs_access.c | 138 ++++---- src/core/cs_akick.c | 82 +++-- src/core/cs_ban.c | 34 +- src/core/cs_clear.c | 42 +-- src/core/cs_drop.c | 24 +- src/core/cs_forbid.c | 30 +- src/core/cs_getkey.c | 12 +- src/core/cs_help.c | 14 +- src/core/cs_info.c | 50 +-- src/core/cs_invite.c | 16 +- src/core/cs_kick.c | 20 +- src/core/cs_list.c | 36 +- src/core/cs_modes.c | 74 ++--- src/core/cs_register.c | 40 +-- src/core/cs_set.c | 190 +++++------ src/core/cs_status.c | 12 +- src/core/cs_suspend.c | 54 +-- src/core/cs_topic.c | 22 +- src/core/cs_xop.c | 94 +++--- src/core/enc_md5.c | 2 +- src/core/enc_none.c | 2 +- src/core/enc_old.c | 2 +- src/core/enc_sha1.c | 2 +- src/core/hs_del.c | 12 +- src/core/hs_delall.c | 12 +- src/core/hs_group.c | 10 +- src/core/hs_help.c | 4 +- src/core/hs_list.c | 32 +- src/core/hs_off.c | 8 +- src/core/hs_on.c | 10 +- src/core/hs_set.c | 26 +- src/core/hs_setall.c | 26 +- src/core/ms_cancel.c | 16 +- src/core/ms_check.c | 18 +- src/core/ms_del.c | 30 +- src/core/ms_help.c | 6 +- src/core/ms_info.c | 80 ++--- src/core/ms_list.c | 26 +- src/core/ms_read.c | 28 +- src/core/ms_rsend.c | 22 +- src/core/ms_send.c | 6 +- src/core/ms_sendall.c | 10 +- src/core/ms_set.c | 72 ++-- src/core/ms_staff.c | 8 +- src/core/ns_access.c | 42 +-- src/core/ns_alist.c | 20 +- src/core/ns_drop.c | 40 +-- src/core/ns_forbid.c | 30 +- src/core/ns_getemail.c | 12 +- src/core/ns_getpass.c | 32 +- src/core/ns_ghost.c | 30 +- src/core/ns_group.c | 82 ++--- src/core/ns_help.c | 16 +- src/core/ns_identify.c | 36 +- src/core/ns_info.c | 66 ++-- src/core/ns_list.c | 34 +- src/core/ns_logout.c | 18 +- src/core/ns_recover.c | 44 +-- src/core/ns_register.c | 126 +++---- src/core/ns_release.c | 30 +- src/core/ns_saset.c | 168 +++++----- src/core/ns_sendpass.c | 26 +- src/core/ns_set.c | 142 ++++---- src/core/ns_status.c | 14 +- src/core/ns_suspend.c | 56 ++-- src/core/ns_update.c | 6 +- src/core/os_akill.c | 68 ++-- src/core/os_chankill.c | 20 +- src/core/os_chanlist.c | 14 +- src/core/os_clearmodes.c | 46 +-- src/core/os_defcon.c | 146 ++++----- src/core/os_global.c | 10 +- src/core/os_help.c | 6 +- src/core/os_ignore.c | 24 +- src/core/os_jupe.c | 14 +- src/core/os_kick.c | 18 +- src/core/os_mode.c | 18 +- src/core/os_modinfo.c | 12 +- src/core/os_modlist.c | 22 +- src/core/os_modload.c | 10 +- src/core/os_modunload.c | 10 +- src/core/os_news.c | 60 ++-- src/core/os_noop.c | 16 +- src/core/os_oline.c | 22 +- src/core/os_quit.c | 8 +- src/core/os_reload.c | 6 +- src/core/os_restart.c | 8 +- src/core/os_session.c | 80 ++--- src/core/os_set.c | 96 +++--- src/core/os_sgline.c | 60 ++-- src/core/os_shutdown.c | 8 +- src/core/os_sqline.c | 62 ++-- src/core/os_staff.c | 16 +- src/core/os_stats.c | 144 ++++---- src/core/os_svsnick.c | 22 +- src/core/os_szline.c | 60 ++-- src/core/os_umode.c | 18 +- src/core/os_update.c | 6 +- src/core/os_userlist.c | 14 +- src/core/ss_main.c | 2 +- src/datafiles.c | 60 ++-- src/hostserv.c | 42 +-- src/init.c | 106 +++--- src/language.c | 14 +- src/log.c | 8 +- src/mail.c | 34 +- src/main.c | 20 +- src/memoserv.c | 64 ++-- src/messages.c | 132 ++++---- src/misc.c | 24 +- src/modes.cpp | 4 +- src/modulemanager.cpp | 12 +- src/modules.c | 36 +- src/modules/cs_appendtopic.c | 26 +- src/modules/cs_enforce.c | 38 +-- src/modules/cs_tban.c | 24 +- src/modules/hs_request.c | 88 ++--- src/modules/ns_maxemail.c | 6 +- src/modules/os_ignore_db.c | 4 +- src/modules/os_info.c | 34 +- src/nickcore.cpp | 4 +- src/nickserv.c | 76 ++--- src/operserv.c | 92 +++--- src/protocol.cpp | 8 +- src/protocol/bahamut.c | 30 +- src/protocol/inspircd11.c | 54 +-- src/protocol/inspircd12.cpp | 38 +-- src/protocol/ratbox.c | 26 +- src/protocol/unreal32.c | 44 +-- src/regchannel.cpp | 10 +- src/send.c | 2 +- src/servers.c | 14 +- src/sessions.c | 46 +-- src/sockutil.c | 6 +- src/users.c | 20 +- 154 files changed, 3107 insertions(+), 3325 deletions(-) (limited to 'src') diff --git a/src/actions.c b/src/actions.c index f6b8c7675..9ed6b3b72 100644 --- a/src/actions.c +++ b/src/actions.c @@ -26,16 +26,16 @@ void bad_password(User * u) { time_t now = time(NULL); - if (!u || !BadPassLimit) { + if (!u || !Config.BadPassLimit) { return; } - if (BadPassTimeout > 0 && u->invalid_pw_time > 0 - && u->invalid_pw_time < now - BadPassTimeout) + if (Config.BadPassTimeout > 0 && u->invalid_pw_time > 0 + && u->invalid_pw_time < now - Config.BadPassTimeout) u->invalid_pw_count = 0; u->invalid_pw_count++; u->invalid_pw_time = now; - if (u->invalid_pw_count >= BadPassLimit) { + if (u->invalid_pw_count >= Config.BadPassLimit) { kill_user(NULL, u->nick, "Too many invalid passwords"); } } @@ -57,7 +57,7 @@ void kill_user(const char *source, const char *user, const char *reason) return; } if (!source || !*source) { - source = ServerName; + source = Config.ServerName; } if (!reason) { reason = ""; @@ -106,9 +106,9 @@ void sqline(char *mask, char *reason) av[0] = c->name; av[1] = cu->user->nick; av[2] = reason; - ircdproto->SendKick(findbot(s_OperServ), av[0], av[1], + ircdproto->SendKick(findbot(Config.s_OperServ), av[0], av[1], "Q-Lined: %s", av[2]); - do_kick(s_ChanServ, 3, av); + do_kick(Config.s_ChanServ, 3, av); } } } diff --git a/src/bots.cpp b/src/bots.cpp index 6d7728a93..db236c175 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -21,19 +21,19 @@ BotInfo::BotInfo(const char *nnick) this->cmdTable = NULL; this->chancount = 0; - if (s_ChanServ && !stricmp(s_ChanServ, nnick)) + if (Config.s_ChanServ && !stricmp(Config.s_ChanServ, nnick)) this->SetFlag(BI_CHANSERV); - else if (s_BotServ && !stricmp(s_BotServ, nnick)) + else if (Config.s_BotServ && !stricmp(Config.s_BotServ, nnick)) this->SetFlag(BI_BOTSERV); - else if (s_HostServ && !stricmp(s_HostServ, nnick)) + else if (Config.s_HostServ && !stricmp(Config.s_HostServ, nnick)) this->SetFlag(BI_HOSTSERV); - else if (s_OperServ && !stricmp(s_OperServ, nnick)) + else if (Config.s_OperServ && !stricmp(Config.s_OperServ, nnick)) this->SetFlag(BI_OPERSERV); - else if (s_MemoServ && !stricmp(s_MemoServ, nnick)) + else if (Config.s_MemoServ && !stricmp(Config.s_MemoServ, nnick)) this->SetFlag(BI_MEMOSERV); - else if (s_NickServ && !stricmp(s_NickServ, nnick)) + else if (Config.s_NickServ && !stricmp(Config.s_NickServ, nnick)) this->SetFlag(BI_NICKSERV); - else if (s_GlobalNoticer && !stricmp(s_GlobalNoticer, nnick)) + else if (Config.s_GlobalNoticer && !stricmp(Config.s_GlobalNoticer, nnick)) this->SetFlag(BI_GLOBAL); FOREACH_MOD(I_OnBotPreLoad, OnBotPreLoad(this)); @@ -58,19 +58,19 @@ BotInfo::BotInfo(const char *nnick, const char *nuser, const char *nhost, const this->cmdTable = NULL; this->chancount = 0; - if (s_ChanServ && !stricmp(s_ChanServ, nnick)) + if (Config.s_ChanServ && !stricmp(Config.s_ChanServ, nnick)) this->SetFlag(BI_CHANSERV); - else if (s_BotServ && !stricmp(s_BotServ, nnick)) + else if (Config.s_BotServ && !stricmp(Config.s_BotServ, nnick)) this->SetFlag(BI_BOTSERV); - else if (s_HostServ && !stricmp(s_HostServ, nnick)) + else if (Config.s_HostServ && !stricmp(Config.s_HostServ, nnick)) this->SetFlag(BI_HOSTSERV); - else if (s_OperServ && !stricmp(s_OperServ, nnick)) + else if (Config.s_OperServ && !stricmp(Config.s_OperServ, nnick)) this->SetFlag(BI_OPERSERV); - else if (s_MemoServ && !stricmp(s_MemoServ, nnick)) + else if (Config.s_MemoServ && !stricmp(Config.s_MemoServ, nnick)) this->SetFlag(BI_MEMOSERV); - else if (s_NickServ && !stricmp(s_NickServ, nnick)) + else if (Config.s_NickServ && !stricmp(Config.s_NickServ, nnick)) this->SetFlag(BI_NICKSERV); - else if (s_GlobalNoticer && !stricmp(s_GlobalNoticer, nnick)) + else if (Config.s_GlobalNoticer && !stricmp(Config.s_GlobalNoticer, nnick)) this->SetFlag(BI_GLOBAL); FOREACH_MOD(I_OnBotPreLoad, OnBotPreLoad(this)); @@ -132,7 +132,7 @@ void BotInfo::RejoinAll() for (i = 0; i < 256; i++) for (ci = chanlists[i]; ci; ci = ci->next) - if (ci->bi == this && ci->c && (ci->c->usercount >= BSMinUsers)) + if (ci->bi == this && ci->c && (ci->c->usercount >= Config.BSMinUsers)) bot_join(ci); } @@ -153,7 +153,7 @@ void BotInfo::Assign(User *u, ChannelInfo *ci) ci->bi = this; this->chancount++; - if (ci->c && ci->c->usercount >= BSMinUsers) + if (ci->c && ci->c->usercount >= Config.BSMinUsers) bot_join(ci); } @@ -164,7 +164,7 @@ void BotInfo::UnAssign(User *u, ChannelInfo *ci) if (MOD_RESULT == EVENT_STOP) return; - if (ci->c && ci->c->usercount >= BSMinUsers) + if (ci->c && ci->c->usercount >= Config.BSMinUsers) { if (u) ircdproto->SendPart(ci->bi, ci->name, "UNASSIGN from %s", u->nick); diff --git a/src/botserv.c b/src/botserv.c index 7c1657187..0919df3aa 100644 --- a/src/botserv.c +++ b/src/botserv.c @@ -34,7 +34,7 @@ E void moduleAddBotServCmds(); /*************************************************************************/ /* *INDENT-OFF* */ void moduleAddBotServCmds() { - ModuleManager::LoadModuleList(BotServCoreModules); + ModuleManager::LoadModuleList(Config.BotServCoreModules); } /* *INDENT-ON* */ /*************************************************************************/ @@ -70,7 +70,7 @@ void get_botserv_stats(long *nrec, long *memuse) void bs_init() { - if (s_BotServ) { + if (Config.s_BotServ) { moduleAddBotServCmds(); } } @@ -91,9 +91,9 @@ void botserv(User * u, char *buf) if (!(s = strtok(NULL, ""))) { *s = 0; } - ircdproto->SendCTCP(findbot(s_BotServ), u->nick, "PING %s", s); + ircdproto->SendCTCP(findbot(Config.s_BotServ), u->nick, "PING %s", s); } else { - mod_run_cmd(s_BotServ, u, BOTSERV, cmd); + mod_run_cmd(Config.s_BotServ, u, BOTSERV, cmd); } } @@ -244,21 +244,21 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf) bw = ci->GetBadWord(i); if (bw->type == BW_ANY - && ((BSCaseSensitive && strstr(nbuf, bw->word.c_str())) - || (!BSCaseSensitive && stristr(nbuf, bw->word.c_str())))) { + && ((Config.BSCaseSensitive && strstr(nbuf, bw->word.c_str())) + || (!Config.BSCaseSensitive && stristr(nbuf, bw->word.c_str())))) { mustkick = 1; } else if (bw->type == BW_SINGLE) { int len = bw->word.length(); - if ((BSCaseSensitive && nbuf == bw->word) - || (!BSCaseSensitive + if ((Config.BSCaseSensitive && nbuf == bw->word) + || (!Config.BSCaseSensitive && (!stricmp(nbuf, bw->word.c_str())))) { mustkick = 1; /* two next if are quite odd isn't it? =) */ } else if ((strchr(nbuf, ' ') == nbuf + len) && - ((BSCaseSensitive && nbuf == bw->word) - || (!BSCaseSensitive + ((Config.BSCaseSensitive && nbuf == bw->word) + || (!Config.BSCaseSensitive && (stristr(nbuf, bw->word.c_str()) == nbuf)))) { mustkick = 1; @@ -266,10 +266,10 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf) if ((strrchr(nbuf, ' ') == nbuf + strlen(nbuf) - len - 1) && - ((BSCaseSensitive + ((Config.BSCaseSensitive && (strstr(nbuf, bw->word.c_str()) == nbuf + strlen(nbuf) - len)) - || (!BSCaseSensitive + || (!Config.BSCaseSensitive && (stristr(nbuf, bw->word.c_str()) == nbuf + strlen(nbuf) - len)))) { mustkick = 1; @@ -281,9 +281,9 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf) wordbuf[len + 2] = '\0'; memcpy(wordbuf + 1, bw->word.c_str(), len); - if ((BSCaseSensitive + if ((Config.BSCaseSensitive && (strstr(nbuf, wordbuf))) - || (!BSCaseSensitive + || (!Config.BSCaseSensitive && (stristr(nbuf, wordbuf)))) { mustkick = 1; } @@ -295,9 +295,9 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf) } else if (bw->type == BW_START) { int len = bw->word.length(); - if ((BSCaseSensitive + if ((Config.BSCaseSensitive && (!strncmp(nbuf, bw->word.c_str(), len))) - || (!BSCaseSensitive + || (!Config.BSCaseSensitive && (!strnicmp(nbuf, bw->word.c_str(), len)))) { mustkick = 1; } else { @@ -307,8 +307,8 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf) wordbuf[0] = ' '; wordbuf[len + 1] = '\0'; - if ((BSCaseSensitive && (strstr(nbuf, wordbuf))) - || (!BSCaseSensitive + if ((Config.BSCaseSensitive && (strstr(nbuf, wordbuf))) + || (!Config.BSCaseSensitive && (stristr(nbuf, wordbuf)))) mustkick = 1; @@ -317,11 +317,11 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf) } else if (bw->type == BW_END) { int len = bw->word.length(); - if ((BSCaseSensitive + if ((Config.BSCaseSensitive && (!strncmp (nbuf + strlen(nbuf) - len, bw->word.c_str(), len))) - || (!BSCaseSensitive + || (!Config.BSCaseSensitive && (!strnicmp (nbuf + strlen(nbuf) - len, bw->word.c_str(), @@ -334,8 +334,8 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf) wordbuf[len] = ' '; wordbuf[len + 1] = '\0'; - if ((BSCaseSensitive && (strstr(nbuf, wordbuf))) - || (!BSCaseSensitive + if ((Config.BSCaseSensitive && (strstr(nbuf, wordbuf))) + || (!Config.BSCaseSensitive && (stristr(nbuf, wordbuf)))) mustkick = 1; @@ -345,7 +345,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf) if (mustkick) { check_ban(ci, u, TTB_BADWORDS); - if (BSGentleBWReason) + if (Config.BSGentleBWReason) bot_kick(ci, u, BOT_REASON_BADWORD_GENTLE); else bot_kick(ci, u, BOT_REASON_BADWORD, bw->word.c_str()); @@ -415,10 +415,10 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf) /* Fantaisist commands */ - if (buf && ci->botflags.HasFlag(BS_FANTASY) && *buf == *BSFantasyCharacter && !was_action) { + if (buf && ci->botflags.HasFlag(BS_FANTASY) && *buf == *Config.BSFantasyCharacter && !was_action) { cmd = strtok(buf, " "); - if (cmd && (cmd[0] == *BSFantasyCharacter)) { + if (cmd && (cmd[0] == *Config.BSFantasyCharacter)) { char *params = strtok(NULL, ""); /* Strip off the fantasy character */ @@ -467,7 +467,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf) #define SAFE(x) do { \ if ((x) < 0) { \ if (!forceload) \ - fatal("Read error on %s", BotDBName); \ + fatal("Read error on %s", Config.BotDBName); \ failed = 1; \ break; \ } \ @@ -482,7 +482,7 @@ void load_bs_dbase() BotInfo *bi; int failed = 0; - if (!(f = open_db(s_BotServ, BotDBName, "r", BOT_VERSION))) + if (!(f = open_db(Config.s_BotServ, Config.BotDBName, "r", BOT_VERSION))) return; ver = get_file_version(f); @@ -491,7 +491,7 @@ void load_bs_dbase() char *s; if (c != 1) - fatal("Invalid format in %s %d", BotDBName, c); + fatal("Invalid format in %s %d", Config.BotDBName, c); SAFE(read_string(&s, f)); bi = new BotInfo(s); @@ -512,20 +512,20 @@ void load_bs_dbase() * changed in the config and different from database * names */ - if (s_ChanServ && bi->HasFlag(BI_CHANSERV) && strcmp(bi->nick, s_ChanServ)) - bi->ChangeNick(s_ChanServ); - else if (s_BotServ && bi->HasFlag(BI_BOTSERV) && strcmp(bi->nick, s_BotServ)) - bi->ChangeNick(s_BotServ); - else if (s_HostServ && bi->HasFlag(BI_HOSTSERV) && strcmp(bi->nick, s_HostServ)) - bi->ChangeNick(s_HostServ); - else if (s_OperServ && bi->HasFlag(BI_OPERSERV) && strcmp(bi->nick, s_OperServ)) - bi->ChangeNick(s_OperServ); - else if (s_MemoServ && bi->HasFlag(BI_MEMOSERV) && strcmp(bi->nick, s_MemoServ)) - bi->ChangeNick(s_MemoServ); - else if (s_NickServ && bi->HasFlag(BI_NICKSERV) && strcmp(bi->nick, s_NickServ)) - bi->ChangeNick(s_NickServ); - else if (s_GlobalNoticer && bi->HasFlag(BI_GLOBAL) && strcmp(bi->nick, s_GlobalNoticer)) - bi->ChangeNick(s_GlobalNoticer); + if (Config.s_ChanServ && bi->HasFlag(BI_CHANSERV) && strcmp(bi->nick, Config.s_ChanServ)) + bi->ChangeNick(Config.s_ChanServ); + else if (Config.s_BotServ && bi->HasFlag(BI_BOTSERV) && strcmp(bi->nick, Config.s_BotServ)) + bi->ChangeNick(Config.s_BotServ); + else if (Config.s_HostServ && bi->HasFlag(BI_HOSTSERV) && strcmp(bi->nick, Config.s_HostServ)) + bi->ChangeNick(Config.s_HostServ); + else if (Config.s_OperServ && bi->HasFlag(BI_OPERSERV) && strcmp(bi->nick, Config.s_OperServ)) + bi->ChangeNick(Config.s_OperServ); + else if (Config.s_MemoServ && bi->HasFlag(BI_MEMOSERV) && strcmp(bi->nick, Config.s_MemoServ)) + bi->ChangeNick(Config.s_MemoServ); + else if (Config.s_NickServ && bi->HasFlag(BI_NICKSERV) && strcmp(bi->nick, Config.s_NickServ)) + bi->ChangeNick(Config.s_NickServ); + else if (Config.s_GlobalNoticer && bi->HasFlag(BI_GLOBAL) && strcmp(bi->nick, Config.s_GlobalNoticer)) + bi->ChangeNick(Config.s_GlobalNoticer); } close_db(f); @@ -538,9 +538,9 @@ void load_bs_dbase() #define SAFE(x) do { \ if ((x) < 0) { \ restore_db(f); \ - log_perror("Write error on %s", BotDBName); \ - if (time(NULL) - lastwarn > WarningTimeout) { \ - ircdproto->SendGlobops(NULL, "Write error on %s: %s", BotDBName, \ + log_perror("Write error on %s", Config.BotDBName); \ + if (time(NULL) - lastwarn > Config.WarningTimeout) { \ + ircdproto->SendGlobops(NULL, "Write error on %s: %s", Config.BotDBName, \ strerror(errno)); \ lastwarn = time(NULL); \ } \ @@ -555,7 +555,7 @@ void save_bs_dbase() static time_t lastwarn = 0; int i; - if (!(f = open_db(s_BotServ, BotDBName, "w", BOT_VERSION))) + if (!(f = open_db(Config.s_BotServ, Config.BotDBName, "w", BOT_VERSION))) return; for (i = 0; i < 256; i++) { @@ -647,7 +647,7 @@ static BanData *get_ban_data(Channel * c, User * u) u->GetDisplayedHost().c_str()); for (bd = c->bd; bd; bd = next) { - if (now - bd->last_use > BSKeepData) { + if (now - bd->last_use > Config.BSKeepData) { if (bd->next) bd->next->prev = bd->prev; if (bd->prev) @@ -702,7 +702,7 @@ static UserData *get_user_data(Channel * c, User * u) time_t now = time(NULL); /* Checks whether data is obsolete */ - if (now - user->ud->last_use > BSKeepData) { + if (now - user->ud->last_use > Config.BSKeepData) { if (user->ud->lastline) delete [] user->ud->lastline; /* We should not free and realloc, but reset to 0 @@ -736,7 +736,7 @@ void bot_join(ChannelInfo * ci) if (!ci || !ci->c || !ci->bi) return; - if (BSSmartJoin) { + if (Config.BSSmartJoin) { /* We check for bans */ if (ci->c->bans && ci->c->bans->count) { char buf[BUFSIZE]; diff --git a/src/channels.c b/src/channels.c index e6ee45430..b9d276a49 100644 --- a/src/channels.c +++ b/src/channels.c @@ -187,7 +187,7 @@ void Channel::RemoveMode(ChannelModeName Name) if (Name == CMODE_PERM && ci) { ci->UnsetFlag(CI_PERSIST); - if (s_BotServ && ci->bi && usercount == BSMinUsers - 1) + if (Config.s_BotServ && ci->bi && usercount == Config.BSMinUsers - 1) ircdproto->SendPart(ci->bi, name, NULL); if (!users) delete this; @@ -440,7 +440,7 @@ void chan_deluser(User * user, Channel * c) if (c->ci && c->ci->HasFlag(CI_PERSIST)) return; - if (s_BotServ && c->ci && c->ci->bi && c->usercount == BSMinUsers - 1) + if (Config.s_BotServ && c->ci && c->ci->bi && c->usercount == Config.BSMinUsers - 1) ircdproto->SendPart(c->ci->bi, c->name, NULL); if (!c->users) @@ -766,8 +766,8 @@ void chan_set_user_status(Channel * chan, User * user, int16 status) alog("debug: setting user status (%d) on %s for %s", status, user->nick, chan->name); - if (HelpChannel && ((um = ModeManager::FindUserModeByName(UMODE_HELPOP))) && (status & CUS_OP) - && (stricmp(chan->name, HelpChannel) == 0) + if (Config.HelpChannel && ((um = ModeManager::FindUserModeByName(UMODE_HELPOP))) && (status & CUS_OP) + && (stricmp(chan->name, Config.HelpChannel) == 0) && (!chan->ci || check_access(user, chan->ci, CA_AUTOOP))) { if (debug) { alog("debug: %s being given helpop for having %d status in %s", @@ -1044,7 +1044,7 @@ void do_kick(const char *source, int ac, const char **av) * channel and stop immediately. * --lara */ - if (s_BotServ && (bi = findbot(s)) && (ci = cs_findchan(av[0]))) { + if (Config.s_BotServ && (bi = findbot(s)) && (ci = cs_findchan(av[0]))) { bot_join(ci); continue; } @@ -1329,7 +1329,7 @@ void do_sjoin(const char *source, int ac, const char **av) } if (is_sqlined && !is_oper(user)) { - ircdproto->SendKick(findbot(s_OperServ), av[1], s, "Q-Lined"); + ircdproto->SendKick(findbot(Config.s_OperServ), av[1], s, "Q-Lined"); } else { if (!check_kick(user, av[1], ts)) { FOREACH_MOD(I_OnPreJoinChannel, OnPreJoinChannel(user, av[1])); @@ -1415,7 +1415,7 @@ void do_sjoin(const char *source, int ac, const char **av) } if (is_sqlined && !is_oper(user)) { - ircdproto->SendKick(findbot(s_OperServ), av[1], s, "Q-Lined"); + ircdproto->SendKick(findbot(Config.s_OperServ), av[1], s, "Q-Lined"); } else { if (!check_kick(user, av[1], ts)) { FOREACH_MOD(I_OnPreJoinChannel, OnPreJoinChannel(user, av[1])); @@ -1491,7 +1491,7 @@ void do_sjoin(const char *source, int ac, const char **av) } if (is_sqlined && !is_oper(user)) { - ircdproto->SendKick(findbot(s_OperServ), av[1], s, "Q-Lined"); + ircdproto->SendKick(findbot(Config.s_OperServ), av[1], s, "Q-Lined"); } else { if (!check_kick(user, av[1], ts)) { FOREACH_MOD(I_OnPreJoinChannel, OnPreJoinChannel(user, av[1])); @@ -1550,7 +1550,7 @@ void do_sjoin(const char *source, int ac, const char **av) } if (is_sqlined && !is_oper(user)) { - ircdproto->SendKick(findbot(s_OperServ), av[1], user->nick, "Q-Lined"); + ircdproto->SendKick(findbot(Config.s_OperServ), av[1], user->nick, "Q-Lined"); } else { FOREACH_MOD(I_OnPreJoinChannel, OnPreJoinChannel(user, av[1])); @@ -1910,10 +1910,10 @@ void chan_adduser2(User * user, Channel * c) if (c->ci && (check_access(user, c->ci, CA_MEMO)) && (c->ci->memos.memos.size() > 0)) { if (c->ci->memos.memos.size() == 1) { - notice_lang(s_MemoServ, user, MEMO_X_ONE_NOTICE, + notice_lang(Config.s_MemoServ, user, MEMO_X_ONE_NOTICE, c->ci->memos.memos.size(), c->ci->name); } else { - notice_lang(s_MemoServ, user, MEMO_X_MANY_NOTICE, + notice_lang(Config.s_MemoServ, user, MEMO_X_MANY_NOTICE, c->ci->memos.memos.size(), c->ci->name); } } @@ -1930,14 +1930,14 @@ void chan_adduser2(User * user, Channel * c) * legit users - Rob * But don't join the bot if the channel is persistant - Adam **/ - if (s_BotServ && c->ci && c->ci->bi && !c->ci->HasFlag(CI_PERSIST)) + if (Config.s_BotServ && c->ci && c->ci->bi && !c->ci->HasFlag(CI_PERSIST)) { - if (c->usercount == BSMinUsers) + if (c->usercount == Config.BSMinUsers) bot_join(c->ci); } - if (s_BotServ && c->ci && c->ci->bi) + if (Config.s_BotServ && c->ci && c->ci->bi) { - if (c->usercount >= BSMinUsers && (c->ci->botflags.HasFlag(BS_GREET)) + if (c->usercount >= Config.BSMinUsers && (c->ci->botflags.HasFlag(BS_GREET)) && user->nc && user->nc->greet && check_access(user, c->ci, CA_GREET)) { /* Only display the greet if the main uplink we're connected @@ -1978,7 +1978,7 @@ Channel *join_user_update(User * user, Channel * chan, const char *name, modes[0] = "-ov"; modes[1] = cu->user->nick; modes[2] = cu->user->nick; - chan_set_modes(s_OperServ, chan, 3, modes, 2); + chan_set_modes(Config.s_OperServ, chan, 3, modes, 2); } if (chan->ci) { @@ -2040,8 +2040,8 @@ void do_mass_mode(char *modes) delete [] myModes; return; } else { - ircdproto->SendMode(findbot(s_OperServ), c->name, "%s", modes); - chan_set_modes(s_OperServ, c, ac, av, 1); + ircdproto->SendMode(findbot(Config.s_OperServ), c->name, "%s", modes); + chan_set_modes(Config.s_OperServ, c, ac, av, 1); } } free(av); diff --git a/src/chanserv.c b/src/chanserv.c index 19ab774f1..e54ce75fd 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -113,7 +113,7 @@ int levelinfo_maxwidth = 0; /*************************************************************************/ void moduleAddChanServCmds() { - ModuleManager::LoadModuleList(ChanServCoreModules); + ModuleManager::LoadModuleList(Config.ChanServCoreModules); } /* *INDENT-ON* */ @@ -136,7 +136,7 @@ class ChanServTimer : public Timer if (ci) ci->UnsetFlag(CI_INHABIT); - ircdproto->SendPart(findbot(s_ChanServ), channel.c_str(), NULL); + ircdproto->SendPart(findbot(Config.s_ChanServ), channel.c_str(), NULL); } }; @@ -295,9 +295,9 @@ void chanserv(User * u, char *buf) if (!(s = strtok(NULL, ""))) { *s = 0; } - ircdproto->SendCTCP(findbot(s_ChanServ), u->nick, "PING %s", s); + ircdproto->SendCTCP(findbot(Config.s_ChanServ), u->nick, "PING %s", s); } else { - mod_run_cmd(s_ChanServ, u, CHANSERV, cmd); + mod_run_cmd(Config.s_ChanServ, u, CHANSERV, cmd); } } @@ -309,7 +309,7 @@ void chanserv(User * u, char *buf) #define SAFE(x) do { \ if ((x) < 0) { \ if (!forceload) \ - fatal("Read error on %s", ChanDBName); \ + fatal("Read error on %s", Config.ChanDBName); \ failed = 1; \ break; \ } \ @@ -323,7 +323,7 @@ void load_cs_dbase() ChannelInfo *ci, **last, *prev; int failed = 0; - if (!(f = open_db(s_ChanServ, ChanDBName, "r", CHAN_VERSION))) + if (!(f = open_db(Config.s_ChanServ, Config.ChanDBName, "r", CHAN_VERSION))) return; ver = get_file_version(f); @@ -343,7 +343,7 @@ void load_cs_dbase() prev = NULL; while ((c = getc_db(f)) != 0) { if (c != 1) - fatal("Invalid format in %s", ChanDBName); + fatal("Invalid format in %s", Config.ChanDBName); char channame[CHANMAX]; SAFE(read = read_buffer(channame, f)); ci = new ChannelInfo(channame); @@ -594,7 +594,7 @@ void load_cs_dbase() next = ci->next; if (!(ci->HasFlag(CI_FORBIDDEN)) && !ci->founder) { alog("%s: database load: Deleting founderless channel %s", - s_ChanServ, ci->name); + Config.s_ChanServ, ci->name); delete ci; continue; } @@ -609,9 +609,9 @@ void load_cs_dbase() #define SAFE(x) do { \ if ((x) < 0) { \ restore_db(f); \ - log_perror("Write error on %s", ChanDBName); \ - if (time(NULL) - lastwarn > WarningTimeout) { \ - ircdproto->SendGlobops(NULL, "Write error on %s: %s", ChanDBName, \ + log_perror("Write error on %s", Config.ChanDBName); \ + if (time(NULL) - lastwarn > Config.WarningTimeout) { \ + ircdproto->SendGlobops(NULL, "Write error on %s: %s", Config.ChanDBName, \ strerror(errno)); \ lastwarn = time(NULL); \ } \ @@ -627,7 +627,7 @@ void save_cs_dbase() static time_t lastwarn = 0; std::string param; - if (!(f = open_db(s_ChanServ, ChanDBName, "w", CHAN_VERSION))) + if (!(f = open_db(Config.s_ChanServ, Config.ChanDBName, "w", CHAN_VERSION))) return; for (i = 0; i < 256; i++) { @@ -806,7 +806,7 @@ void check_modes(Channel * c) if (c->server_modecount >= 3 && c->chanserv_modecount >= 3) { ircdproto->SendGlobops(NULL, "Warning: unable to set modes on channel %s. Are your servers' U:lines configured correctly?", c->name); - alog("%s: Bouncy modes on channel %s", s_ChanServ, c->name); + alog("%s: Bouncy modes on channel %s", Config.s_ChanServ, c->name); c->bouncy_modes = 1; return; } @@ -911,7 +911,7 @@ void check_modes(Channel * c) if (modebuf.empty()) return; - ircdproto->SendMode((ci ? whosends(ci) : findbot(s_OperServ)), c->name, "%s%s", modebuf.c_str(), argbuf.empty() ? "" : argbuf.c_str()); + ircdproto->SendMode((ci ? whosends(ci) : findbot(Config.s_OperServ)), c->name, "%s%s", modebuf.c_str(), argbuf.empty() ? "" : argbuf.c_str()); } /*************************************************************************/ @@ -931,7 +931,7 @@ int check_valid_admin(User * user, Channel * chan, int servermode) return 0; if (servermode && !check_access(user, chan->ci, CA_AUTOPROTECT)) { - notice_lang(s_ChanServ, user, CHAN_IS_REGISTERED, s_ChanServ); + notice_lang(Config.s_ChanServ, user, CHAN_IS_REGISTERED, Config.s_ChanServ); ircdproto->SendMode(whosends(chan->ci), chan->name, "-%s %s", cm->ModeChar, user->nick); return 0; @@ -967,7 +967,7 @@ int check_valid_op(User * user, Channel * chan, int servermode) halfop = ModeManager::FindChannelModeByName(CMODE_HALFOP); if (servermode && !check_access(user, chan->ci, CA_AUTOOP)) { - notice_lang(s_ChanServ, user, CHAN_IS_REGISTERED, s_ChanServ); + notice_lang(Config.s_ChanServ, user, CHAN_IS_REGISTERED, Config.s_ChanServ); if (halfop) { if (owner && protect) @@ -1214,7 +1214,7 @@ int check_kick(User * user, const char *chan, time_t chants) get_idealban(ci, user, mask, sizeof(mask)); else strlcpy(mask, akick->mask.c_str(), sizeof(mask)); - reason = !akick->reason.empty() ? akick->reason.c_str() : CSAutokickReason; + reason = !akick->reason.empty() ? akick->reason.c_str() : Config.CSAutokickReason; goto kick; } } @@ -1241,16 +1241,16 @@ int check_kick(User * user, const char *chan, time_t chants) * c may be NULL even if it exists */ if ((!(c = findchan(chan)) || c->usercount == 0) && !ci->HasFlag(CI_INHABIT)) { - ircdproto->SendJoin(findbot(s_ChanServ), chan, (c ? c->creation_time : chants)); + ircdproto->SendJoin(findbot(Config.s_ChanServ), chan, (c ? c->creation_time : chants)); /* * If channel was forbidden, etc, set it +si to prevent rejoin */ if (set_modes) { - ircdproto->SendMode(findbot(s_ChanServ), chan, "+ntsi"); + ircdproto->SendMode(findbot(Config.s_ChanServ), chan, "+ntsi"); } - t = new ChanServTimer(CSInhabit, chan); + t = new ChanServTimer(Config.CSInhabit, chan); ci->SetFlag(CI_INHABIT); } @@ -1339,16 +1339,16 @@ void restore_topic(const char *chan) strscpy(c->topic_setter, whosends(ci)->nick, NICKMAX); } if (ircd->join2set) { - if (whosends(ci) == findbot(s_ChanServ)) { - ircdproto->SendJoin(findbot(s_ChanServ), chan, c->creation_time); - ircdproto->SendMode(NULL, chan, "+o %s", s_ChanServ); + if (whosends(ci) == findbot(Config.s_ChanServ)) { + ircdproto->SendJoin(findbot(Config.s_ChanServ), chan, c->creation_time); + ircdproto->SendMode(NULL, chan, "+o %s", Config.s_ChanServ); } } ircdproto->SendTopic(whosends(ci), c->name, c->topic_setter, c->topic ? c->topic : "", c->topic_time); if (ircd->join2set) { - if (whosends(ci) == findbot(s_ChanServ)) { - ircdproto->SendPart(findbot(s_ChanServ), c->name, NULL); + if (whosends(ci) == findbot(Config.s_ChanServ)) { + ircdproto->SendPart(findbot(Config.s_ChanServ), c->name, NULL); } } } @@ -1380,7 +1380,7 @@ int check_topiclock(Channel * c, time_t topic_time) } else { c->topic = NULL; /* Bot assigned & Symbiosis ON?, the bot will set the topic - doc */ - /* Altough whosends() also checks for BSMinUsers -GD */ + /* Altough whosends() also checks for Config.BSMinUsers -GD */ strscpy(c->topic_setter, whosends(ci)->nick, NICKMAX); } @@ -1401,9 +1401,9 @@ int check_topiclock(Channel * c, time_t topic_time) } if (ircd->join2set) { - if (whosends(ci) == findbot(s_ChanServ)) { - ircdproto->SendJoin(findbot(s_ChanServ), c->name, c->creation_time); - ircdproto->SendMode(NULL, c->name, "+o %s", s_ChanServ); + if (whosends(ci) == findbot(Config.s_ChanServ)) { + ircdproto->SendJoin(findbot(Config.s_ChanServ), c->name, c->creation_time); + ircdproto->SendMode(NULL, c->name, "+o %s", Config.s_ChanServ); } } @@ -1411,8 +1411,8 @@ int check_topiclock(Channel * c, time_t topic_time) c->topic ? c->topic : "", c->topic_time); if (ircd->join2set) { - if (whosends(ci) == findbot(s_ChanServ)) { - ircdproto->SendPart(findbot(s_ChanServ), c->ci->name, NULL); + if (whosends(ci) == findbot(Config.s_ChanServ)) { + ircdproto->SendPart(findbot(Config.s_ChanServ), c->ci->name, NULL); } } return 1; @@ -1428,13 +1428,13 @@ void expire_chans() int i; time_t now = time(NULL); - if (!CSExpire) + if (!Config.CSExpire) return; for (i = 0; i < 256; i++) { for (ci = chanlists[i]; ci; ci = next) { next = ci->next; - if (!ci->c && now - ci->last_used >= CSExpire && !ci->HasFlag(CI_FORBIDDEN) && !ci->HasFlag(CI_NO_EXPIRE) && !ci->HasFlag(CI_SUSPENDED)) + if (!ci->c && now - ci->last_used >= Config.CSExpire && !ci->HasFlag(CI_FORBIDDEN) && !ci->HasFlag(CI_NO_EXPIRE) && !ci->HasFlag(CI_SUSPENDED)) { EventReturn MOD_RESULT; FOREACH_RESULT(I_OnPreChanExpire, OnPreChanExpire(ci)); @@ -1469,18 +1469,18 @@ void cs_remove_nick(const NickCore * nc) if (ci->founder == nc) { if (ci->successor) { NickCore *nc2 = ci->successor; - if (!nc2->IsServicesOper() && CSMaxReg && nc2->channelcount >= CSMaxReg) { - alog("%s: Successor (%s) of %s owns too many channels, " "deleting channel", s_ChanServ, nc2->display, ci->name); + if (!nc2->IsServicesOper() && Config.CSMaxReg && nc2->channelcount >= Config.CSMaxReg) { + alog("%s: Successor (%s) of %s owns too many channels, " "deleting channel", Config.s_ChanServ, nc2->display, ci->name); delete ci; continue; } else { - alog("%s: Transferring foundership of %s from deleted " "nick %s to successor %s", s_ChanServ, ci->name, nc->display, nc2->display); + alog("%s: Transferring foundership of %s from deleted " "nick %s to successor %s", Config.s_ChanServ, ci->name, nc->display, nc2->display); ci->founder = nc2; ci->successor = NULL; nc2->channelcount++; } } else { - alog("%s: Deleting channel %s owned by deleted nick %s", s_ChanServ, ci->name, nc->display); + alog("%s: Deleting channel %s owned by deleted nick %s", Config.s_ChanServ, ci->name, nc->display); if ((ModeManager::FindChannelModeByName(CMODE_REGISTERED))) { @@ -1898,7 +1898,7 @@ void stick_mask(ChannelInfo * ci, AutoKick * akick) av[0] = "+b"; av[1] = akick->mask.c_str(); ircdproto->SendMode(whosends(ci), ci->c->name, "+b %s", akick->mask.c_str()); - chan_set_modes(s_ChanServ, ci->c, 2, av, 1); + chan_set_modes(Config.s_ChanServ, ci->c, 2, av, 1); } /* Ban the stuck mask in a safe manner. */ @@ -1920,6 +1920,6 @@ void stick_all(ChannelInfo * ci) av[0] = "+b"; av[1] = akick->mask.c_str(); ircdproto->SendMode(whosends(ci), ci->c->name, "+b %s", akick->mask.c_str()); - chan_set_modes(s_ChanServ, ci->c, 2, av, 1); + chan_set_modes(Config.s_ChanServ, ci->c, 2, av, 1); } } diff --git a/src/commands.c b/src/commands.c index 22e9fb8de..ad6a154d6 100644 --- a/src/commands.c +++ b/src/commands.c @@ -70,7 +70,7 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char * // Command requires registered users only if (!nick_identified(u)) { - notice_lang(service, u, NICK_IDENTIFY_REQUIRED, s_NickServ); + notice_lang(service, u, NICK_IDENTIFY_REQUIRED, Config.s_NickServ); alog("Access denied for unregistered user %s with service %s and command %s", u->nick, service, cmd); return; } diff --git a/src/config.c b/src/config.c index e531dafa1..e7e821f0a 100644 --- a/src/config.c +++ b/src/config.c @@ -18,242 +18,26 @@ /*************************************************************************/ -ServerConfig serverConfig; - -/* Configurable variables: */ - -char *IRCDModule; - -std::list Uplinks; - -char *LocalHost; -unsigned LocalPort; - -char *ServerName; -char *ServerDesc; -char *ServiceUser; -char *ServiceHost; - -char *HelpChannel; -char *LogChannel; -char *NetworkName; -unsigned NickLen; - -char *s_NickServ; -char *s_ChanServ; -char *s_MemoServ; -char *s_BotServ; -char *s_OperServ; -char *s_GlobalNoticer; -char *desc_NickServ; -char *desc_ChanServ; -char *desc_MemoServ; -char *desc_BotServ; -char *desc_OperServ; -char *desc_GlobalNoticer; - -char *HostDBName; /* Name of HostServ DB File */ -char *s_HostServ; /* HostServ Name */ -char *desc_HostServ; /* HostServ Description */ - -char *PIDFilename; -char *MOTDFilename; -char *NickDBName; -char *PreNickDBName; -char *ChanDBName; -char *BotDBName; -char *OperDBName; -char *NewsDBName; - -bool NoBackupOkay; -bool StrictPasswords; -unsigned BadPassLimit; -time_t BadPassTimeout; -time_t UpdateTimeout; -time_t ExpireTimeout; -time_t ReadTimeout; -time_t WarningTimeout; -time_t TimeoutCheck; -int KeepLogs; -int KeepBackups; -bool ForceForbidReason; -bool UsePrivmsg; -bool UseStrictPrivMsg; -bool DumpCore; -bool LogUsers; -unsigned NickRegDelay; -unsigned NewsCount; - -bool UseMail; -char *SendMailPath; -char *SendFrom; -bool RestrictMail; -time_t MailDelay; -bool DontQuoteAddresses; - -static std::string NSDefaults; -char *NSGuestNickPrefix; -bool NSAllowKillImmed; -bool NSNoGroupChange; -Flags NSDefFlags; -unsigned NSDefLanguage; -time_t NSRegDelay; -time_t NSResendDelay; -time_t NSExpire; -time_t NSRExpire; -bool NSForceEmail; -int NSMaxAliases; -unsigned NSAccessMax; -char *NSEnforcerUser; -char *NSEnforcerHost; -static char *temp_nsuserhost; -time_t NSReleaseTimeout; -bool NSListOpersOnly; -unsigned NSListMax; -bool NSSecureAdmins; -bool NSStrictPrivileges; -bool NSEmailReg; -bool NSModeOnID; -bool NSAddAccessOnReg; - -static std::string CSDefaults; -Flags CSDefFlags; -unsigned CSMaxReg; -time_t CSExpire; -int CSDefBantype; -unsigned CSAccessMax; -unsigned CSAutokickMax; -char *CSAutokickReason; -time_t CSInhabit; -bool CSListOpersOnly; -unsigned CSListMax; -bool CSOpersOnly; - -unsigned MSMaxMemos; -time_t MSSendDelay; -bool MSNotifyAll; -unsigned MSMemoReceipt; - -static std::string BSDefaults; -Flags BSDefFlags; -time_t BSKeepData; -unsigned BSMinUsers; -unsigned BSBadWordsMax; -bool BSSmartJoin; -bool BSGentleBWReason; -bool BSCaseSensitive; -char *BSFantasyCharacter; - -bool HideStatsO; -bool GlobalOnCycle; -bool AnonymousGlobal; -bool RestrictOperNicks; -char *GlobalOnCycleMessage; -char *GlobalOnCycleUP; -bool SuperAdmin; -bool LogBot; -bool LogMaxUsers; -bool DisableRaw; -time_t AutokillExpiry; -time_t ChankillExpiry; -time_t SGLineExpiry; -time_t SQLineExpiry; -time_t SZLineExpiry; -bool AkillOnAdd; -bool KillonSGline; -bool KillonSQline; -static std::string OSNotifications; -bool WallOper; -bool WallBadOS; -bool WallOSGlobal; -bool WallOSMode; -bool WallOSClearmodes; -bool WallOSKick; -bool WallOSAkill; -bool WallOSSGLine; -bool WallOSSQLine; -bool WallOSSZLine; -bool WallOSNoOp; -bool WallOSJupe; -bool WallAkillExpire; -bool WallSGLineExpire; -bool WallSQLineExpire; -bool WallSZLineExpire; -bool WallExceptionExpire; -bool WallDrop; -bool WallForbid; -bool WallGetpass; -bool WallSetpass; -bool AddAkiller; - -bool LimitSessions; -unsigned DefSessionLimit; -time_t ExceptionExpiry; -int MaxSessionKill; -unsigned MaxSessionLimit; -time_t SessionAutoKillExpiry; -char *ExceptionDBName; -char *SessionLimitExceeded; -char *SessionLimitDetailsLoc; - -bool OSOpersOnly; +ServerConfig Config; static std::string Modules; -std::list ModulesAutoLoad; - -/** - * Core Module Stuff - **/ static std::string EncModules; -std::list EncModuleList; - static std::string HostCoreModules; -std::list HostServCoreModules; - static std::string MemoCoreModules; -std::list MemoServCoreModules; - static std::string BotCoreModules; -std::list BotServCoreModules; - static std::string OperCoreModules; -std::list OperServCoreModules; - static std::string NickCoreModules; -std::list NickServCoreModules; - static std::string ChanCoreModules; -std::list ChanServCoreModules; - -int DefConLevel; static std::string DefCon1; static std::string DefCon2; static std::string DefCon3; static std::string DefCon4; -time_t DefConTimeOut; -int DefConSessionLimit; -time_t DefConAKILL; -char *DefConChanModes; -bool GlobalOnDefcon; -bool GlobalOnDefconMore; -char *DefConOffMessage; -char *DefconMessage; -char *DefConAkillReason; - -long unsigned int UserKey1; -long unsigned int UserKey2; -long unsigned int UserKey3; - -char *Numeric; static char *UlineServers; -char **Ulines; -int NumUlines; - -std::list MyOperTypes; -/* Pair of nick/opertype lookup. It's stored like this currently, because config is parsed before db load. - * XXX: It would be nice to not need this. - */ -std::list > svsopers_in_config; +static std::string OSNotifications; +static std::string BSDefaults; +static std::string CSDefaults; +static char *temp_nsuserhost; +static std::string NSDefaults; /*************************************************************************/ @@ -394,7 +178,7 @@ bool ValidateNotZero(ServerConfig *, const char *tag, const char *value, ValueIt bool ValidateEmailReg(ServerConfig *, const char *tag, const char *value, ValueItem &data) { - if (NSEmailReg) + if (Config.NSEmailReg) { if (std::string(value) == "prenickdatabase") { @@ -454,7 +238,7 @@ bool ValidateBantype(ServerConfig *, const char *, const char *, ValueItem &data bool ValidateBotServ(ServerConfig *, const char *tag, const char *value, ValueItem &data) { - if (s_BotServ) + if (Config.s_BotServ) { if (std::string(value) == "description" || std::string(value) == "database") { @@ -472,7 +256,7 @@ bool ValidateBotServ(ServerConfig *, const char *tag, const char *value, ValueIt bool ValidateHostServ(ServerConfig *, const char *tag, const char *value, ValueItem &data) { - if (s_HostServ) + if (Config.s_HostServ) { if (std::string(value) == "description" || std::string(value) == "database") { @@ -485,7 +269,7 @@ bool ValidateHostServ(ServerConfig *, const char *tag, const char *value, ValueI bool ValidateLimitSessions(ServerConfig *, const char *tag, const char *value, ValueItem &data) { - if (LimitSessions) + if (Config.LimitSessions) { if (std::string(value) == "maxsessionlimit" || std::string(value) == "exceptionexpiry") { @@ -506,14 +290,14 @@ bool ValidateDefCon(ServerConfig *, const char *tag, const char *value, ValueIte if (level > 5) throw ConfigException("The value for must be between 1 through 5 if you wish to use DefCon or 0 if you wish to disable it!"); } - else if (DefConLevel) + else if (Config.DefConLevel) { if ((std::string(value).substr(0, 5) == "level" && isdigit(value[5])) || std::string(value) == "chanmodes" || std::string(value) == "akillreason") { if (data.GetValue().empty()) throw ConfigException(std::string("The value for <") + tag + ":" + value + "> cannot be empty when DefCon is enabled!"); } - else if (std::string(value) == "message" && GlobalOnDefconMore) + else if (std::string(value) == "message" && Config.GlobalOnDefconMore) { if (data.GetValue().empty()) throw ConfigException("The value for cannot be empty when globalondefconmore is enabled!"); @@ -546,7 +330,7 @@ bool ValidateNickLen(ServerConfig *, const char *, const char *, ValueItem &data bool ValidateMail(ServerConfig *, const char *tag, const char *value, ValueItem &data) { - if (UseMail) + if (Config.UseMail) { if (std::string(value) == "sendmailpath" || std::string(value) == "sendfrom") { @@ -559,12 +343,12 @@ bool ValidateMail(ServerConfig *, const char *tag, const char *value, ValueItem bool ValidateGlobalOnCycle(ServerConfig *, const char *tag, const char *value, ValueItem &data) { - if (GlobalOnCycle) + if (Config.GlobalOnCycle) { if (data.GetValue().empty()) { alog("<%s:%s> was undefined, disabling ", tag, value); - GlobalOnCycle = false; + Config.GlobalOnCycle = false; } } return true; @@ -585,13 +369,13 @@ bool InitUplinks(ServerConfig *, const char *, bool bail) // If bail is false, we were reloading, don't clear anything if (!bail) return true; - if (!Uplinks.empty()) + if (!Config.Uplinks.empty()) { - std::list::iterator curr_uplink = Uplinks.begin(), end_uplink = Uplinks.end(); + std::list::iterator curr_uplink = Config.Uplinks.begin(), end_uplink = Config.Uplinks.end(); for (; curr_uplink != end_uplink; ++curr_uplink) delete *curr_uplink; } - Uplinks.clear(); + Config.Uplinks.clear(); return true; } @@ -614,7 +398,7 @@ bool DoUplink(ServerConfig *conf, const char *, const char **, ValueList &values if (!ValidateNotEmpty(conf, "uplink", "password", vi_password)) throw ConfigException("One or more values in your configuration file failed to validate. Please see your log for more information."); // If we get here, all the values are valid, we'll add it to the Uplinks list - Uplinks.push_back(new Uplink(host, port, password)); + Config.Uplinks.push_back(new Uplink(host, port, password)); return true; } @@ -623,17 +407,17 @@ bool DoneUplinks(ServerConfig *, const char *, bool bail) // If bail is false, we were reloading, ignore this check if (!bail) return true; - if (Uplinks.empty()) + if (Config.Uplinks.empty()) throw ConfigException("You must define at least one uplink block!"); return true; } static bool InitOperTypes(ServerConfig *, const char *, bool) { - for (std::list::iterator it = MyOperTypes.begin(); it != MyOperTypes.end(); ++it) + for (std::list::iterator it = Config.MyOperTypes.begin(); it != Config.MyOperTypes.end(); ++it) delete *it; - MyOperTypes.clear(); + Config.MyOperTypes.clear(); return true; } @@ -658,7 +442,7 @@ static bool DoOperType(ServerConfig *conf, const char *, const char **, ValueLis while (privstr.GetToken(tok)) ot->AddPriv(tok); - MyOperTypes.push_back(ot); + Config.MyOperTypes.push_back(ot); return true; } @@ -694,14 +478,14 @@ static bool DoOper(ServerConfig *conf, const char *, const char **, ValueList &v if (!ValidateNotEmpty(conf, "oper", "type", vi2)) throw ConfigException("One or more values in your configuration file failed to validate. Please see your log for more information."); - svsopers_in_config.push_back(std::make_pair(name, type)); + Config.Opers.push_back(std::make_pair(name, type)); return true; } static bool DoneOpers(ServerConfig *, const char *, bool) { // XXX: this is duplicated in config.c - for (std::list >::iterator it = svsopers_in_config.begin(); it != svsopers_in_config.end(); ++it) + for (std::list >::iterator it = Config.Opers.begin(); it != Config.Opers.end(); ++it) { std::string nick = it->first, type = it->second; @@ -714,7 +498,7 @@ static bool DoneOpers(ServerConfig *, const char *, bool) // Nick with no core (wtf?) abort(); - for (std::list::iterator tit = MyOperTypes.begin(); tit != MyOperTypes.end(); ++tit) + for (std::list::iterator tit = Config.MyOperTypes.begin(); tit != Config.MyOperTypes.end(); ++tit) { OperType *ot = *tit; if (ot->GetName() == type) @@ -811,164 +595,164 @@ int ServerConfig::Read(bool bail) * * We may need to add some other validation functions to handle certain things, we can handle that later. * Any questions about these, w00t, feel free to ask. */ - {"serverinfo", "name", "", new ValueContainerChar(&ServerName), DT_HOSTNAME | DT_NORELOAD, ValidateNotEmpty}, - {"serverinfo", "description", "", new ValueContainerChar(&ServerDesc), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, - {"serverinfo", "localhost", "", new ValueContainerChar(&LocalHost), DT_HOSTNAME | DT_NORELOAD, NoValidation}, - {"serverinfo", "localport", "0", new ValueContainerUInt(&LocalPort), DT_UINTEGER | DT_NORELOAD, ValidatePort}, - {"serverinfo", "type", "", new ValueContainerChar(&IRCDModule), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, - {"serverinfo", "id", "", new ValueContainerChar(&Numeric), DT_NOSPACES | DT_NORELOAD, NoValidation}, - {"serverinfo", "ident", "", new ValueContainerChar(&ServiceUser), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, - {"serverinfo", "hostname", "", new ValueContainerChar(&ServiceHost), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, - {"serverinfo", "pid", "services.pid", new ValueContainerChar(&PIDFilename), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, - {"serverinfo", "motd", "services.motd", new ValueContainerChar(&MOTDFilename), DT_CHARPTR, ValidateNotEmpty}, - {"networkinfo", "helpchannel", "", new ValueContainerChar(&HelpChannel), DT_CHARPTR, NoValidation}, - {"networkinfo", "logchannel", "", new ValueContainerChar(&LogChannel), DT_CHARPTR, NoValidation}, - {"networkinfo", "logbot", "no", new ValueContainerBool(&LogBot), DT_BOOLEAN, NoValidation}, - {"networkinfo", "networkname", "", new ValueContainerChar(&NetworkName), DT_CHARPTR, ValidateNotEmpty}, - {"networkinfo", "nicklen", "0", new ValueContainerUInt(&NickLen), DT_UINTEGER | DT_NORELOAD, ValidateNickLen}, + {"serverinfo", "name", "", new ValueContainerChar(&Config.ServerName), DT_HOSTNAME | DT_NORELOAD, ValidateNotEmpty}, + {"serverinfo", "description", "", new ValueContainerChar(&Config.ServerDesc), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, + {"serverinfo", "localhost", "", new ValueContainerChar(&Config.LocalHost), DT_HOSTNAME | DT_NORELOAD, NoValidation}, + {"serverinfo", "localport", "0", new ValueContainerUInt(&Config.LocalPort), DT_UINTEGER | DT_NORELOAD, ValidatePort}, + {"serverinfo", "type", "", new ValueContainerChar(&Config.IRCDModule), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, + {"serverinfo", "id", "", new ValueContainerChar(&Config.Numeric), DT_NOSPACES | DT_NORELOAD, NoValidation}, + {"serverinfo", "ident", "", new ValueContainerChar(&Config.ServiceUser), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, + {"serverinfo", "hostname", "", new ValueContainerChar(&Config.ServiceHost), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, + {"serverinfo", "pid", "services.pid", new ValueContainerChar(&Config.PIDFilename), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, + {"serverinfo", "motd", "services.motd", new ValueContainerChar(&Config.MOTDFilename), DT_CHARPTR, ValidateNotEmpty}, + {"networkinfo", "helpchannel", "", new ValueContainerChar(&Config.HelpChannel), DT_CHARPTR, NoValidation}, + {"networkinfo", "logchannel", "", new ValueContainerChar(&Config.LogChannel), DT_CHARPTR, NoValidation}, + {"networkinfo", "logbot", "no", new ValueContainerBool(&Config.LogBot), DT_BOOLEAN, NoValidation}, + {"networkinfo", "networkname", "", new ValueContainerChar(&Config.NetworkName), DT_CHARPTR, ValidateNotEmpty}, + {"networkinfo", "nicklen", "0", new ValueContainerUInt(&Config.NickLen), DT_UINTEGER | DT_NORELOAD, ValidateNickLen}, {"options", "encryption", "", new ValueContainerString(&EncModules), DT_STRING | DT_NORELOAD, ValidateNotEmpty}, - {"options", "userkey1", "0", new ValueContainerLUInt(&UserKey1), DT_LUINTEGER, NoValidation}, - {"options", "userkey2", "0", new ValueContainerLUInt(&UserKey2), DT_LUINTEGER, NoValidation}, - {"options", "userkey3", "0", new ValueContainerLUInt(&UserKey3), DT_LUINTEGER, NoValidation}, - {"options", "nobackupokay", "no", new ValueContainerBool(&NoBackupOkay), DT_BOOLEAN, NoValidation}, - {"options", "strictpasswords", "no", new ValueContainerBool(&StrictPasswords), DT_BOOLEAN, NoValidation}, - {"options", "badpasslimit", "0", new ValueContainerUInt(&BadPassLimit), DT_UINTEGER, NoValidation}, - {"options", "badpasstimeout", "0", new ValueContainerTime(&BadPassTimeout), DT_TIME, NoValidation}, - {"options", "updatetimeout", "0", new ValueContainerTime(&UpdateTimeout), DT_TIME, ValidateNotZero}, - {"options", "expiretimeout", "0", new ValueContainerTime(&ExpireTimeout), DT_TIME, ValidateNotZero}, - {"options", "readtimeout", "0", new ValueContainerTime(&ReadTimeout), DT_TIME, ValidateNotZero}, - {"options", "warningtimeout", "0", new ValueContainerTime(&WarningTimeout), DT_TIME, ValidateNotZero}, - {"options", "timeoutcheck", "0", new ValueContainerTime(&TimeoutCheck), DT_TIME, NoValidation}, - {"options", "keeplogs", "0", new ValueContainerInt(&KeepLogs), DT_INTEGER, NoValidation}, - {"options", "keepbackups", "0", new ValueContainerInt(&KeepBackups), DT_INTEGER, NoValidation}, - {"options", "forceforbidreason", "no", new ValueContainerBool(&ForceForbidReason), DT_BOOLEAN, NoValidation}, - {"options", "useprivmsg", "no", new ValueContainerBool(&UsePrivmsg), DT_BOOLEAN, NoValidation}, - {"options", "usestrictprivmsg", "no", new ValueContainerBool(&UseStrictPrivMsg), DT_BOOLEAN, NoValidation}, - {"options", "dumpcore", "yes", new ValueContainerBool(&DumpCore), DT_BOOLEAN | DT_NORELOAD, NoValidation}, - {"options", "logusers", "no", new ValueContainerBool(&LogUsers), DT_BOOLEAN, NoValidation}, - {"options", "hidestatso", "no", new ValueContainerBool(&HideStatsO), DT_BOOLEAN, NoValidation}, - {"options", "globaloncycle", "no", new ValueContainerBool(&GlobalOnCycle), DT_BOOLEAN, NoValidation}, - {"options", "globaloncycledown", "", new ValueContainerChar(&GlobalOnCycleMessage), DT_CHARPTR, ValidateGlobalOnCycle}, - {"options", "globaloncycleup", "", new ValueContainerChar(&GlobalOnCycleUP), DT_CHARPTR, ValidateGlobalOnCycle}, - {"options", "anonymousglobal", "no", new ValueContainerBool(&AnonymousGlobal), DT_BOOLEAN, NoValidation}, - {"options", "nickregdelay", "0", new ValueContainerUInt(&NickRegDelay), DT_UINTEGER, NoValidation}, - {"options", "restrictopernicks", "no", new ValueContainerBool(&RestrictOperNicks), DT_BOOLEAN, NoValidation}, - {"options", "newscount", "3", new ValueContainerUInt(&NewsCount), DT_UINTEGER, NoValidation}, + {"options", "userkey1", "0", new ValueContainerLUInt(&Config.UserKey1), DT_LUINTEGER, NoValidation}, + {"options", "userkey2", "0", new ValueContainerLUInt(&Config.UserKey2), DT_LUINTEGER, NoValidation}, + {"options", "userkey3", "0", new ValueContainerLUInt(&Config.UserKey3), DT_LUINTEGER, NoValidation}, + {"options", "nobackupokay", "no", new ValueContainerBool(&Config.NoBackupOkay), DT_BOOLEAN, NoValidation}, + {"options", "strictpasswords", "no", new ValueContainerBool(&Config.StrictPasswords), DT_BOOLEAN, NoValidation}, + {"options", "badpasslimit", "0", new ValueContainerUInt(&Config.BadPassLimit), DT_UINTEGER, NoValidation}, + {"options", "badpasstimeout", "0", new ValueContainerTime(&Config.BadPassTimeout), DT_TIME, NoValidation}, + {"options", "updatetimeout", "0", new ValueContainerTime(&Config.UpdateTimeout), DT_TIME, ValidateNotZero}, + {"options", "expiretimeout", "0", new ValueContainerTime(&Config.ExpireTimeout), DT_TIME, ValidateNotZero}, + {"options", "readtimeout", "0", new ValueContainerTime(&Config.ReadTimeout), DT_TIME, ValidateNotZero}, + {"options", "warningtimeout", "0", new ValueContainerTime(&Config.WarningTimeout), DT_TIME, ValidateNotZero}, + {"options", "timeoutcheck", "0", new ValueContainerTime(&Config.TimeoutCheck), DT_TIME, NoValidation}, + {"options", "keeplogs", "0", new ValueContainerInt(&Config.KeepLogs), DT_INTEGER, NoValidation}, + {"options", "keepbackups", "0", new ValueContainerInt(&Config.KeepBackups), DT_INTEGER, NoValidation}, + {"options", "forceforbidreason", "no", new ValueContainerBool(&Config.ForceForbidReason), DT_BOOLEAN, NoValidation}, + {"options", "useprivmsg", "no", new ValueContainerBool(&Config.UsePrivmsg), DT_BOOLEAN, NoValidation}, + {"options", "usestrictprivmsg", "no", new ValueContainerBool(&Config.UseStrictPrivMsg), DT_BOOLEAN, NoValidation}, + {"options", "dumpcore", "yes", new ValueContainerBool(&Config.DumpCore), DT_BOOLEAN | DT_NORELOAD, NoValidation}, + {"options", "logusers", "no", new ValueContainerBool(&Config.LogUsers), DT_BOOLEAN, NoValidation}, + {"options", "hidestatso", "no", new ValueContainerBool(&Config.HideStatsO), DT_BOOLEAN, NoValidation}, + {"options", "globaloncycle", "no", new ValueContainerBool(&Config.GlobalOnCycle), DT_BOOLEAN, NoValidation}, + {"options", "globaloncycledown", "", new ValueContainerChar(&Config.GlobalOnCycleMessage), DT_CHARPTR, ValidateGlobalOnCycle}, + {"options", "globaloncycleup", "", new ValueContainerChar(&Config.GlobalOnCycleUP), DT_CHARPTR, ValidateGlobalOnCycle}, + {"options", "anonymousglobal", "no", new ValueContainerBool(&Config.AnonymousGlobal), DT_BOOLEAN, NoValidation}, + {"options", "nickregdelay", "0", new ValueContainerUInt(&Config.NickRegDelay), DT_UINTEGER, NoValidation}, + {"options", "restrictopernicks", "no", new ValueContainerBool(&Config.RestrictOperNicks), DT_BOOLEAN, NoValidation}, + {"options", "newscount", "3", new ValueContainerUInt(&Config.NewsCount), DT_UINTEGER, NoValidation}, {"options", "ulineservers", "", new ValueContainerChar(&UlineServers), DT_CHARPTR, NoValidation}, {"options", "enablelogchannel", "no", new ValueContainerBool(&LogChan), DT_BOOLEAN, NoValidation}, - {"nickserv", "nick", "NickServ", new ValueContainerChar(&s_NickServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, - {"nickserv", "description", "Nickname Registration Service", new ValueContainerChar(&desc_NickServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, - {"nickserv", "database", "nick.db", new ValueContainerChar(&NickDBName), DT_CHARPTR, ValidateNotEmpty}, - {"nickserv", "emailregistration", "no", new ValueContainerBool(&NSEmailReg), DT_BOOLEAN, NoValidation}, - {"nickserv", "prenickdatabase", "", new ValueContainerChar(&PreNickDBName), DT_CHARPTR, ValidateEmailReg}, + {"nickserv", "nick", "NickServ", new ValueContainerChar(&Config.s_NickServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, + {"nickserv", "description", "Nickname Registration Service", new ValueContainerChar(&Config.desc_NickServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, + {"nickserv", "database", "nick.db", new ValueContainerChar(&Config.NickDBName), DT_CHARPTR, ValidateNotEmpty}, + {"nickserv", "emailregistration", "no", new ValueContainerBool(&Config.NSEmailReg), DT_BOOLEAN, NoValidation}, + {"nickserv", "prenickdatabase", "", new ValueContainerChar(&Config.PreNickDBName), DT_CHARPTR, ValidateEmailReg}, {"nickserv", "modules", "", new ValueContainerString(&NickCoreModules), DT_STRING, NoValidation}, - {"nickserv", "forceemail", "no", new ValueContainerBool(&NSForceEmail), DT_BOOLEAN, ValidateEmailReg}, + {"nickserv", "forceemail", "no", new ValueContainerBool(&Config.NSForceEmail), DT_BOOLEAN, ValidateEmailReg}, {"nickserv", "defaults", "secure memosignon memoreceive", new ValueContainerString(&NSDefaults), DT_STRING, NoValidation}, - {"nickserv", "defaultlanguage", "0", new ValueContainerUInt(&NSDefLanguage), DT_UINTEGER, ValidateLanguage}, - {"nickserv", "regdelay", "0", new ValueContainerTime(&NSRegDelay), DT_TIME, NoValidation}, - {"nickserv", "resenddelay", "0", new ValueContainerTime(&NSResendDelay), DT_TIME, NoValidation}, - {"nickserv", "expire", "21d", new ValueContainerTime(&NSExpire), DT_TIME, NoValidation}, - {"nickserv", "preregexpire", "0", new ValueContainerTime(&NSRExpire), DT_TIME, ValidateEmailReg}, - {"nickserv", "maxaliases", "0", new ValueContainerInt(&NSMaxAliases), DT_INTEGER, NoValidation}, - {"nickserv", "accessmax", "0", new ValueContainerUInt(&NSAccessMax), DT_UINTEGER, ValidateNotZero}, + {"nickserv", "defaultlanguage", "0", new ValueContainerUInt(&Config.NSDefLanguage), DT_UINTEGER, ValidateLanguage}, + {"nickserv", "regdelay", "0", new ValueContainerTime(&Config.NSRegDelay), DT_TIME, NoValidation}, + {"nickserv", "resenddelay", "0", new ValueContainerTime(&Config.NSResendDelay), DT_TIME, NoValidation}, + {"nickserv", "expire", "21d", new ValueContainerTime(&Config.NSExpire), DT_TIME, NoValidation}, + {"nickserv", "preregexpire", "0", new ValueContainerTime(&Config.NSRExpire), DT_TIME, ValidateEmailReg}, + {"nickserv", "maxaliases", "0", new ValueContainerInt(&Config.NSMaxAliases), DT_INTEGER, NoValidation}, + {"nickserv", "accessmax", "0", new ValueContainerUInt(&Config.NSAccessMax), DT_UINTEGER, ValidateNotZero}, {"nickserv", "enforceruser", "", new ValueContainerChar(&temp_nsuserhost), DT_CHARPTR, ValidateNotEmpty}, - {"nickserv", "releasetimeout", "0", new ValueContainerTime(&NSReleaseTimeout), DT_TIME, ValidateNotZero}, - {"nickserv", "allowkillimmed", "no", new ValueContainerBool(&NSAllowKillImmed), DT_BOOLEAN | DT_NORELOAD, NoValidation}, - {"nickserv", "nogroupchange", "no", new ValueContainerBool(&NSNoGroupChange), DT_BOOLEAN, NoValidation}, - {"nickserv", "listopersonly", "no", new ValueContainerBool(&NSListOpersOnly), DT_BOOLEAN, NoValidation}, - {"nickserv", "listmax", "0", new ValueContainerUInt(&NSListMax), DT_UINTEGER, ValidateNotZero}, - {"nickserv", "guestnickprefix", "", new ValueContainerChar(&NSGuestNickPrefix), DT_CHARPTR, ValidateGuestPrefix}, - {"nickserv", "secureadmins", "no", new ValueContainerBool(&NSSecureAdmins), DT_BOOLEAN, NoValidation}, - {"nickserv", "strictprivileges", "no", new ValueContainerBool(&NSStrictPrivileges), DT_BOOLEAN, NoValidation}, - {"nickserv", "modeonid", "no", new ValueContainerBool(&NSModeOnID), DT_BOOLEAN, NoValidation}, - {"nickserv", "addaccessonreg", "no", new ValueContainerBool(&NSAddAccessOnReg), DT_BOOLEAN, NoValidation}, - {"mail", "usemail", "no", new ValueContainerBool(&UseMail), DT_BOOLEAN, ValidateEmailReg}, - {"mail", "sendmailpath", "", new ValueContainerChar(&SendMailPath), DT_CHARPTR, ValidateMail}, - {"mail", "sendfrom", "", new ValueContainerChar(&SendFrom), DT_CHARPTR, ValidateMail}, - {"mail", "restrict", "no", new ValueContainerBool(&RestrictMail), DT_BOOLEAN, NoValidation}, - {"mail", "delay", "0", new ValueContainerTime(&MailDelay), DT_TIME, NoValidation}, - {"mail", "dontquoteaddresses", "no", new ValueContainerBool(&DontQuoteAddresses), DT_BOOLEAN, NoValidation}, - {"chanserv", "nick", "ChanServ", new ValueContainerChar(&s_ChanServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, - {"chanserv", "description", "Channel Registration Service", new ValueContainerChar(&desc_ChanServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, - {"chanserv", "database", "chan.db", new ValueContainerChar(&ChanDBName), DT_CHARPTR, ValidateNotEmpty}, + {"nickserv", "releasetimeout", "0", new ValueContainerTime(&Config.NSReleaseTimeout), DT_TIME, ValidateNotZero}, + {"nickserv", "allowkillimmed", "no", new ValueContainerBool(&Config.NSAllowKillImmed), DT_BOOLEAN | DT_NORELOAD, NoValidation}, + {"nickserv", "nogroupch