mirror of
https://github.com/anope/anope.git
synced 2026-07-10 13:23:14 +02:00
Rewrote the config reader to better handle invalid configs.
This prevents Anope from exploding when /os reload has errors.
This commit is contained in:
+4
-4
@@ -23,14 +23,14 @@ bool bad_password(User *u)
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
|
||||
if (!u || !Config.BadPassLimit)
|
||||
if (!u || !Config->BadPassLimit)
|
||||
return false;
|
||||
|
||||
if (Config.BadPassTimeout > 0 && u->invalid_pw_time > 0 && u->invalid_pw_time < now - Config.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 >= Config.BadPassLimit)
|
||||
if (u->invalid_pw_count >= Config->BadPassLimit)
|
||||
{
|
||||
kill_user("", u->nick, "Too many invalid passwords");
|
||||
return true;
|
||||
@@ -53,7 +53,7 @@ void kill_user(const Anope::string &source, const Anope::string &user, const Ano
|
||||
if (user.empty())
|
||||
return;
|
||||
|
||||
Anope::string real_source = source.empty() ? Config.ServerName : source;
|
||||
Anope::string real_source = source.empty() ? Config->ServerName : source;
|
||||
|
||||
Anope::string buf = real_source + " (" + reason + ")";
|
||||
|
||||
|
||||
+10
-10
@@ -30,19 +30,19 @@ BotInfo::BotInfo(const Anope::string &nnick, const Anope::string &nuser, const A
|
||||
this->chancount = 0;
|
||||
this->lastmsg = this->created = time(NULL);
|
||||
|
||||
if (!Config.s_ChanServ.empty() && nnick.equals_ci(Config.s_ChanServ))
|
||||
if (!Config->s_ChanServ.empty() && nnick.equals_ci(Config->s_ChanServ))
|
||||
ChanServ = this;
|
||||
else if (!Config.s_BotServ.empty() && nnick.equals_ci(Config.s_BotServ))
|
||||
else if (!Config->s_BotServ.empty() && nnick.equals_ci(Config->s_BotServ))
|
||||
BotServ = this;
|
||||
else if (!Config.s_HostServ.empty() && nnick.equals_ci(Config.s_HostServ))
|
||||
else if (!Config->s_HostServ.empty() && nnick.equals_ci(Config->s_HostServ))
|
||||
HostServ = this;
|
||||
else if (!Config.s_OperServ.empty() && nnick.equals_ci(Config.s_OperServ))
|
||||
else if (!Config->s_OperServ.empty() && nnick.equals_ci(Config->s_OperServ))
|
||||
OperServ = this;
|
||||
else if (!Config.s_MemoServ.empty() && nnick.equals_ci(Config.s_MemoServ))
|
||||
else if (!Config->s_MemoServ.empty() && nnick.equals_ci(Config->s_MemoServ))
|
||||
MemoServ = this;
|
||||
else if (!Config.s_NickServ.empty() && nnick.equals_ci(Config.s_NickServ))
|
||||
else if (!Config->s_NickServ.empty() && nnick.equals_ci(Config->s_NickServ))
|
||||
NickServ = this;
|
||||
else if (!Config.s_GlobalNoticer.empty() && nnick.equals_ci(Config.s_GlobalNoticer))
|
||||
else if (!Config->s_GlobalNoticer.empty() && nnick.equals_ci(Config->s_GlobalNoticer))
|
||||
Global = this;
|
||||
|
||||
BotListByNick[this->nick] = this;
|
||||
@@ -94,7 +94,7 @@ void BotInfo::RejoinAll()
|
||||
{
|
||||
ChannelInfo *ci = it->second;
|
||||
|
||||
if (ci->bi == this && ci->c && ci->c->users.size() >= Config.BSMinUsers)
|
||||
if (ci->bi == this && ci->c && ci->c->users.size() >= Config->BSMinUsers)
|
||||
this->Join(ci->c);
|
||||
}
|
||||
}
|
||||
@@ -112,7 +112,7 @@ void BotInfo::Assign(User *u, ChannelInfo *ci)
|
||||
++this->chancount;
|
||||
|
||||
ci->bi = this;
|
||||
if (ci->c && ci->c->users.size() >= Config.BSMinUsers)
|
||||
if (ci->c && ci->c->users.size() >= Config->BSMinUsers)
|
||||
this->Join(ci->c);
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ void BotInfo::UnAssign(User *u, ChannelInfo *ci)
|
||||
|
||||
void BotInfo::Join(Channel *c)
|
||||
{
|
||||
if (Config.BSSmartJoin)
|
||||
if (Config->BSSmartJoin)
|
||||
{
|
||||
/* We check for bans */
|
||||
if (c->bans && c->bans->count)
|
||||
|
||||
+16
-16
@@ -26,7 +26,7 @@ E void moduleAddBotServCmds();
|
||||
|
||||
void moduleAddBotServCmds()
|
||||
{
|
||||
ModuleManager::LoadModuleList(Config.BotServCoreModules);
|
||||
ModuleManager::LoadModuleList(Config->BotServCoreModules);
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
@@ -61,7 +61,7 @@ void get_botserv_stats(long *nrec, long *memuse)
|
||||
|
||||
void bs_init()
|
||||
{
|
||||
if (!Config.s_BotServ.empty())
|
||||
if (!Config->s_BotServ.empty())
|
||||
moduleAddBotServCmds();
|
||||
}
|
||||
|
||||
@@ -198,25 +198,25 @@ void botchanmsgs(User *u, ChannelInfo *ci, const Anope::string &buf)
|
||||
{
|
||||
BadWord *bw = ci->GetBadWord(i);
|
||||
|
||||
if (bw->type == BW_ANY && ((Config.BSCaseSensitive && nbuf.find(bw->word) != Anope::string::npos) || (!Config.BSCaseSensitive && nbuf.find_ci(bw->word) != Anope::string::npos)))
|
||||
if (bw->type == BW_ANY && ((Config->BSCaseSensitive && nbuf.find(bw->word) != Anope::string::npos) || (!Config->BSCaseSensitive && nbuf.find_ci(bw->word) != Anope::string::npos)))
|
||||
mustkick = true;
|
||||
else if (bw->type == BW_SINGLE)
|
||||
{
|
||||
size_t len = bw->word.length();
|
||||
|
||||
if ((Config.BSCaseSensitive && bw->word.equals_cs(nbuf)) || (!Config.BSCaseSensitive && bw->word.equals_ci(nbuf)))
|
||||
if ((Config->BSCaseSensitive && bw->word.equals_cs(nbuf)) || (!Config->BSCaseSensitive && bw->word.equals_ci(nbuf)))
|
||||
mustkick = true;
|
||||
else if (nbuf.find(' ') == len && ((Config.BSCaseSensitive && bw->word.equals_cs(nbuf)) || (!Config.BSCaseSensitive && bw->word.equals_ci(nbuf))))
|
||||
else if (nbuf.find(' ') == len && ((Config->BSCaseSensitive && bw->word.equals_cs(nbuf)) || (!Config->BSCaseSensitive && bw->word.equals_ci(nbuf))))
|
||||
mustkick = true;
|
||||
else
|
||||
{
|
||||
if (nbuf.rfind(' ') == nbuf.length() - len - 1 && ((Config.BSCaseSensitive && nbuf.find(bw->word) == nbuf.length() - len) || (!Config.BSCaseSensitive && nbuf.find_ci(bw->word) == nbuf.length() - len)))
|
||||
if (nbuf.rfind(' ') == nbuf.length() - len - 1 && ((Config->BSCaseSensitive && nbuf.find(bw->word) == nbuf.length() - len) || (!Config->BSCaseSensitive && nbuf.find_ci(bw->word) == nbuf.length() - len)))
|
||||
mustkick = true;
|
||||
else
|
||||
{
|
||||
Anope::string wordbuf = " " + bw->word + " ";
|
||||
|
||||
if ((Config.BSCaseSensitive && nbuf.find(wordbuf) != Anope::string::npos) || (!Config.BSCaseSensitive && nbuf.find_ci(wordbuf) != Anope::string::npos))
|
||||
if ((Config->BSCaseSensitive && nbuf.find(wordbuf) != Anope::string::npos) || (!Config->BSCaseSensitive && nbuf.find_ci(wordbuf) != Anope::string::npos))
|
||||
mustkick = true;
|
||||
}
|
||||
}
|
||||
@@ -225,13 +225,13 @@ void botchanmsgs(User *u, ChannelInfo *ci, const Anope::string &buf)
|
||||
{
|
||||
size_t len = bw->word.length();
|
||||
|
||||
if ((Config.BSCaseSensitive && nbuf.substr(0, len).equals_cs(bw->word)) || (!Config.BSCaseSensitive && nbuf.substr(0, len).equals_ci(bw->word)))
|
||||
if ((Config->BSCaseSensitive && nbuf.substr(0, len).equals_cs(bw->word)) || (!Config->BSCaseSensitive && nbuf.substr(0, len).equals_ci(bw->word)))
|
||||
mustkick = true;
|
||||
else
|
||||
{
|
||||
Anope::string wordbuf = " " + bw->word;
|
||||
|
||||
if ((Config.BSCaseSensitive && nbuf.find(wordbuf) != Anope::string::npos) || (!Config.BSCaseSensitive && nbuf.find_ci(wordbuf) != Anope::string::npos))
|
||||
if ((Config->BSCaseSensitive && nbuf.find(wordbuf) != Anope::string::npos) || (!Config->BSCaseSensitive && nbuf.find_ci(wordbuf) != Anope::string::npos))
|
||||
mustkick = true;
|
||||
}
|
||||
}
|
||||
@@ -239,13 +239,13 @@ void botchanmsgs(User *u, ChannelInfo *ci, const Anope::string &buf)
|
||||
{
|
||||
size_t len = bw->word.length();
|
||||
|
||||
if ((Config.BSCaseSensitive && nbuf.substr(nbuf.length() - len).equals_cs(bw->word)) || (!Config.BSCaseSensitive && nbuf.substr(nbuf.length() - len).equals_ci(bw->word)))
|
||||
if ((Config->BSCaseSensitive && nbuf.substr(nbuf.length() - len).equals_cs(bw->word)) || (!Config->BSCaseSensitive && nbuf.substr(nbuf.length() - len).equals_ci(bw->word)))
|
||||
mustkick = true;
|
||||
else
|
||||
{
|
||||
Anope::string wordbuf = bw->word + " ";
|
||||
|
||||
if ((Config.BSCaseSensitive && nbuf.find(wordbuf) != Anope::string::npos) || (!Config.BSCaseSensitive && nbuf.find_ci(wordbuf) != Anope::string::npos))
|
||||
if ((Config->BSCaseSensitive && nbuf.find(wordbuf) != Anope::string::npos) || (!Config->BSCaseSensitive && nbuf.find_ci(wordbuf) != Anope::string::npos))
|
||||
mustkick = true;
|
||||
}
|
||||
}
|
||||
@@ -253,7 +253,7 @@ void botchanmsgs(User *u, ChannelInfo *ci, const Anope::string &buf)
|
||||
if (mustkick)
|
||||
{
|
||||
check_ban(ci, u, TTB_BADWORDS);
|
||||
if (Config.BSGentleBWReason)
|
||||
if (Config->BSGentleBWReason)
|
||||
bot_kick(ci, u, BOT_REASON_BADWORD_GENTLE);
|
||||
else
|
||||
bot_kick(ci, u, BOT_REASON_BADWORD, bw->word.c_str());
|
||||
@@ -320,12 +320,12 @@ void botchanmsgs(User *u, ChannelInfo *ci, const Anope::string &buf)
|
||||
return;
|
||||
|
||||
/* Fantaisist commands */
|
||||
if (ci->botflags.HasFlag(BS_FANTASY) && buf[0] == Config.BSFantasyCharacter[0] && !was_action)
|
||||
if (ci->botflags.HasFlag(BS_FANTASY) && buf[0] == Config->BSFantasyCharacter[0] && !was_action)
|
||||
{
|
||||
spacesepstream sep(buf);
|
||||
Anope::string token;
|
||||
|
||||
if (sep.GetToken(token) && token[0] == Config.BSFantasyCharacter[0])
|
||||
if (sep.GetToken(token) && token[0] == Config->BSFantasyCharacter[0])
|
||||
{
|
||||
/* Strip off the fantasy character */
|
||||
token.erase(token.begin());
|
||||
@@ -396,7 +396,7 @@ static BanData *get_ban_data(Channel *c, User *u)
|
||||
|
||||
for (bd = c->bd; bd; bd = next)
|
||||
{
|
||||
if (now - bd->last_use > Config.BSKeepData)
|
||||
if (now - bd->last_use > Config->BSKeepData)
|
||||
{
|
||||
if (bd->next)
|
||||
bd->next->prev = bd->prev;
|
||||
@@ -452,7 +452,7 @@ static UserData *get_user_data(Channel *c, User *u)
|
||||
time_t now = time(NULL);
|
||||
|
||||
/* Checks whether data is obsolete */
|
||||
if (now - uc->ud.last_use > Config.BSKeepData)
|
||||
if (now - uc->ud.last_use > Config->BSKeepData)
|
||||
{
|
||||
/* We should not free and realloc, but reset to 0
|
||||
instead. */
|
||||
|
||||
+9
-9
@@ -109,9 +109,9 @@ void Channel::JoinUser(User *user)
|
||||
if (this->ci && check_access(user, this->ci, CA_MEMO) && this->ci->memos.memos.size() > 0)
|
||||
{
|
||||
if (this->ci->memos.memos.size() == 1)
|
||||
notice_lang(Config.s_MemoServ, user, MEMO_X_ONE_NOTICE, this->ci->memos.memos.size(), this->ci->name.c_str());
|
||||
notice_lang(Config->s_MemoServ, user, MEMO_X_ONE_NOTICE, this->ci->memos.memos.size(), this->ci->name.c_str());
|
||||
else
|
||||
notice_lang(Config.s_MemoServ, user, MEMO_X_MANY_NOTICE, this->ci->memos.memos.size(), this->ci->name.c_str());
|
||||
notice_lang(Config->s_MemoServ, user, MEMO_X_MANY_NOTICE, this->ci->memos.memos.size(), this->ci->name.c_str());
|
||||
}
|
||||
/* Added channelname to entrymsg - 30.03.2004, Certus */
|
||||
/* Also, don't send the entrymsg when bursting -GD */
|
||||
@@ -119,7 +119,7 @@ void Channel::JoinUser(User *user)
|
||||
user->SendMessage(whosends(this->ci)->nick, "[%s] %s", this->name.c_str(), this->ci->entry_message.c_str());
|
||||
}
|
||||
|
||||
if (!Config.s_BotServ.empty() && this->ci && this->ci->bi)
|
||||
if (!Config->s_BotServ.empty() && this->ci && this->ci->bi)
|
||||
{
|
||||
/**
|
||||
* We let the bot join even if it was an ignored user, as if we don't,
|
||||
@@ -129,7 +129,7 @@ void Channel::JoinUser(User *user)
|
||||
* But don't join the bot if the channel is persistant - Adam
|
||||
* But join persistant channels when syncing with our uplink- DP
|
||||
**/
|
||||
if ((!Me->IsSynced() || !this->ci->HasFlag(CI_PERSIST)) && this->users.size() >= Config.BSMinUsers && !this->FindUser(this->ci->bi))
|
||||
if ((!Me->IsSynced() || !this->ci->HasFlag(CI_PERSIST)) && this->users.size() >= Config->BSMinUsers && !this->FindUser(this->ci->bi))
|
||||
this->ci->bi->Join(this);
|
||||
/* Only display the greet if the main uplink we're connected
|
||||
* to has synced, or we'll get greet-floods when the net
|
||||
@@ -193,7 +193,7 @@ void Channel::DeleteUser(User *user)
|
||||
/* check for BSMinUsers and part the BotServ bot from the channel
|
||||
* Use <= because the bot is included in this->users.size()
|
||||
*/
|
||||
if (!Config.s_BotServ.empty() && this->ci && this->ci->bi && this->users.size() <= Config.BSMinUsers && this->FindUser(this->ci->bi))
|
||||
if (!Config->s_BotServ.empty() && this->ci && this->ci->bi && this->users.size() <= Config->BSMinUsers && this->FindUser(this->ci->bi))
|
||||
this->ci->bi->Part(this->ci->c);
|
||||
else if (this->users.empty())
|
||||
delete this;
|
||||
@@ -278,7 +278,7 @@ void Channel::SetModeInternal(ChannelMode *cm, const Anope::string ¶m, bool
|
||||
}
|
||||
|
||||
BotInfo *bi = NULL;
|
||||
if (!Config.s_BotServ.empty())
|
||||
if (!Config->s_BotServ.empty())
|
||||
bi = findbot(param);
|
||||
User *u = bi ? bi : finduser(param);
|
||||
|
||||
@@ -404,7 +404,7 @@ void Channel::RemoveModeInternal(ChannelMode *cm, const Anope::string ¶m, bo
|
||||
}
|
||||
|
||||
BotInfo *bi = NULL;
|
||||
if (!Config.s_BotServ.empty())
|
||||
if (!Config->s_BotServ.empty())
|
||||
bi = findbot(param);
|
||||
User *u = bi ? bi : finduser(param);
|
||||
|
||||
@@ -460,7 +460,7 @@ void Channel::RemoveModeInternal(ChannelMode *cm, const Anope::string ¶m, bo
|
||||
if (ci)
|
||||
{
|
||||
ci->UnsetFlag(CI_PERSIST);
|
||||
if (!Config.s_BotServ.empty() && ci->bi && this->FindUser(ci->bi))
|
||||
if (!Config->s_BotServ.empty() && ci->bi && this->FindUser(ci->bi))
|
||||
this->ci->bi->Part(this);
|
||||
}
|
||||
}
|
||||
@@ -865,7 +865,7 @@ void ChanSetInternalModes(Channel *c, int ac, const char **av)
|
||||
void Channel::KickInternal(const Anope::string &source, const Anope::string &nick, const Anope::string &reason)
|
||||
{
|
||||
BotInfo *bi = NULL;
|
||||
if (!Config.s_BotServ.empty() && this->ci)
|
||||
if (!Config->s_BotServ.empty() && this->ci)
|
||||
bi = findbot(nick);
|
||||
User *user = bi ? bi : finduser(nick);
|
||||
if (!user)
|
||||
|
||||
+14
-14
@@ -110,7 +110,7 @@ int levelinfo_maxwidth = 0;
|
||||
|
||||
void moduleAddChanServCmds()
|
||||
{
|
||||
ModuleManager::LoadModuleList(Config.ChanServCoreModules);
|
||||
ModuleManager::LoadModuleList(Config->ChanServCoreModules);
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
@@ -263,7 +263,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.c_str());
|
||||
Alog() << Config.s_ChanServ << ": Bouncy modes on channel " << c->name;
|
||||
Alog() << Config->s_ChanServ << ": Bouncy modes on channel " << c->name;
|
||||
c->bouncy_modes = 1;
|
||||
return;
|
||||
}
|
||||
@@ -355,7 +355,7 @@ int check_valid_admin(User *user, Channel *chan, int servermode)
|
||||
|
||||
if (servermode && !check_access(user, chan->ci, CA_AUTOPROTECT))
|
||||
{
|
||||
notice_lang(Config.s_ChanServ, user, CHAN_IS_REGISTERED, Config.s_ChanServ.c_str());
|
||||
notice_lang(Config->s_ChanServ, user, CHAN_IS_REGISTERED, Config->s_ChanServ.c_str());
|
||||
chan->RemoveMode(NULL, CMODE_PROTECT, user->nick);
|
||||
return 0;
|
||||
}
|
||||
@@ -391,7 +391,7 @@ int check_valid_op(User *user, Channel *chan, int servermode)
|
||||
|
||||
if (servermode && !check_access(user, chan->ci, CA_AUTOOP))
|
||||
{
|
||||
notice_lang(Config.s_ChanServ, user, CHAN_IS_REGISTERED, Config.s_ChanServ.c_str());
|
||||
notice_lang(Config->s_ChanServ, user, CHAN_IS_REGISTERED, Config->s_ChanServ.c_str());
|
||||
|
||||
if (owner)
|
||||
chan->RemoveMode(NULL, CMODE_OWNER, user->nick);
|
||||
@@ -479,7 +479,7 @@ void restore_topic(const Anope::string &chan)
|
||||
if (ircd->join2set && whosends(ci) == ChanServ)
|
||||
{
|
||||
ChanServ->Join(chan);
|
||||
c->SetMode(NULL, CMODE_OP, Config.s_ChanServ);
|
||||
c->SetMode(NULL, CMODE_OP, Config->s_ChanServ);
|
||||
}
|
||||
ircdproto->SendTopic(whosends(ci), c, c->topic_setter, c->topic);
|
||||
if (ircd->join2set && whosends(ci) == ChanServ)
|
||||
@@ -513,7 +513,7 @@ int check_topiclock(Channel *c, time_t topic_time)
|
||||
{
|
||||
c->topic.clear();
|
||||
/* Bot assigned & Symbiosis ON?, the bot will set the topic - doc */
|
||||
/* Altough whosends() also checks for Config.BSMinUsers -GD */
|
||||
/* Altough whosends() also checks for Config->BSMinUsers -GD */
|
||||
c->topic_setter = whosends(ci)->nick;
|
||||
}
|
||||
|
||||
@@ -538,7 +538,7 @@ int check_topiclock(Channel *c, time_t topic_time)
|
||||
if (ircd->join2set && whosends(ci) == ChanServ)
|
||||
{
|
||||
ChanServ->Join(c);
|
||||
c->SetMode(NULL, CMODE_OP, Config.s_ChanServ);
|
||||
c->SetMode(NULL, CMODE_OP, Config->s_ChanServ);
|
||||
}
|
||||
|
||||
ircdproto->SendTopic(whosends(ci), c, c->topic_setter, c->topic);
|
||||
@@ -554,7 +554,7 @@ int check_topiclock(Channel *c, time_t topic_time)
|
||||
|
||||
void expire_chans()
|
||||
{
|
||||
if (!Config.CSExpire)
|
||||
if (!Config->CSExpire)
|
||||
return;
|
||||
|
||||
time_t now = time(NULL);
|
||||
@@ -564,7 +564,7 @@ void expire_chans()
|
||||
ChannelInfo *ci = it->second;
|
||||
++it;
|
||||
|
||||
if (!ci->c && now - ci->last_used >= Config.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));
|
||||
@@ -597,15 +597,15 @@ void cs_remove_nick(const NickCore *nc)
|
||||
if (ci->successor)
|
||||
{
|
||||
NickCore *nc2 = ci->successor;
|
||||
if (!nc2->IsServicesOper() && Config.CSMaxReg && nc2->channelcount >= Config.CSMaxReg)
|
||||
if (!nc2->IsServicesOper() && Config->CSMaxReg && nc2->channelcount >= Config->CSMaxReg)
|
||||
{
|
||||
Alog() << Config.s_ChanServ << ": Successor (" << nc2->display << " ) of " << ci->name << " owns too many channels, deleting channel",
|
||||
Alog() << Config->s_ChanServ << ": Successor (" << nc2->display << " ) of " << ci->name << " owns too many channels, deleting channel",
|
||||
delete ci;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
Alog() << Config.s_ChanServ << ": Transferring foundership of " << ci->name << " from deleted nick " << nc->display << " to successor " << nc2->display;
|
||||
Alog() << Config->s_ChanServ << ": Transferring foundership of " << ci->name << " from deleted nick " << nc->display << " to successor " << nc2->display;
|
||||
ci->founder = nc2;
|
||||
ci->successor = NULL;
|
||||
++nc2->channelcount;
|
||||
@@ -613,7 +613,7 @@ void cs_remove_nick(const NickCore *nc)
|
||||
}
|
||||
else
|
||||
{
|
||||
Alog() << Config.s_ChanServ << ": Deleting channel " << ci->name << "owned by deleted nick " << nc->display;
|
||||
Alog() << Config->s_ChanServ << ": Deleting channel " << ci->name << "owned by deleted nick " << nc->display;
|
||||
|
||||
if (ModeManager::FindChannelModeByName(CMODE_REGISTERED))
|
||||
{
|
||||
@@ -963,7 +963,7 @@ void stick_all(ChannelInfo *ci)
|
||||
}
|
||||
}
|
||||
|
||||
ChanServTimer::ChanServTimer(Channel *chan) : Timer(Config.CSInhabit), c(chan)
|
||||
ChanServTimer::ChanServTimer(Channel *chan) : Timer(Config->CSInhabit), c(chan)
|
||||
{
|
||||
if (c->ci)
|
||||
c->ci->SetFlag(CI_INHABIT);
|
||||
|
||||
+2
-2
@@ -57,7 +57,7 @@ void mod_run_cmd(BotInfo *bi, User *u, Command *c, const Anope::string &command,
|
||||
// Command requires registered users only
|
||||
if (!c->HasFlag(CFLAG_ALLOW_UNREGISTERED) && !u->IsIdentified())
|
||||
{
|
||||
notice_lang(bi->nick, u, NICK_IDENTIFY_REQUIRED, Config.s_NickServ.c_str());
|
||||
notice_lang(bi->nick, u, NICK_IDENTIFY_REQUIRED, Config->s_NickServ.c_str());
|
||||
Alog() << "Access denied for unregistered user " << u->nick << " with service " << bi->nick << " and command " << command;
|
||||
return;
|
||||
}
|
||||
@@ -164,7 +164,7 @@ void mod_help_cmd(BotInfo *bi, User *u, const Anope::string &cmd)
|
||||
|
||||
Anope::string subcommand = tokens.StreamEnd() ? "" : tokens.GetRemaining();
|
||||
|
||||
if (!c || (Config.HidePrivilegedCommands && !c->permission.empty() && (!u->Account() || !u->Account()->HasCommand(c->permission))) || !c->OnHelp(u, subcommand))
|
||||
if (!c || (Config->HidePrivilegedCommands && !c->permission.empty() && (!u->Account() || !u->Account()->HasCommand(c->permission))) || !c->OnHelp(u, subcommand))
|
||||
notice_lang(bi->nick, u, NO_HELP_AVAILABLE, cmd.c_str());
|
||||
else
|
||||
{
|
||||
|
||||
+538
-645
File diff suppressed because it is too large
Load Diff
+23
-21
@@ -1,4 +1,16 @@
|
||||
/* +------------------------------------+
|
||||
/* Configuration file handling.
|
||||
*
|
||||
* (C) 2003-2010 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
/* Taken from:
|
||||
* +------------------------------------+
|
||||
* | Inspire Internet Relay Chat Daemon |
|
||||
* +------------------------------------+
|
||||
*
|
||||
@@ -13,21 +25,16 @@
|
||||
|
||||
#include "services.h"
|
||||
|
||||
ConfigReader::ConfigReader() : data(&Config.config_data), errorlog(new std::ostringstream(std::stringstream::in | std::stringstream::out)), privatehash(false), error(CONF_NO_ERROR)
|
||||
ConfigReader::ConfigReader() : error(CONF_NO_ERROR)
|
||||
{
|
||||
}
|
||||
|
||||
ConfigReader::ConfigReader(const Anope::string &filename) : error(CONF_NO_ERROR)
|
||||
{
|
||||
}
|
||||
|
||||
ConfigReader::~ConfigReader()
|
||||
{
|
||||
if (this->errorlog)
|
||||
delete this->errorlog;
|
||||
if (this->privatehash)
|
||||
delete this->data;
|
||||
}
|
||||
|
||||
ConfigReader::ConfigReader(const Anope::string &filename) : data(new ConfigDataHash), errorlog(new std::ostringstream(std::stringstream::in | std::stringstream::out)), privatehash(true), error(CONF_NO_ERROR)
|
||||
{
|
||||
Config.ClearStack();
|
||||
}
|
||||
|
||||
Anope::string ConfigReader::ReadValue(const Anope::string &tag, const Anope::string &name, const Anope::string &default_value, int index, bool allow_linefeeds)
|
||||
@@ -35,7 +42,7 @@ Anope::string ConfigReader::ReadValue(const Anope::string &tag, const Anope::str
|
||||
/* Don't need to strlcpy() tag and name anymore, ReadConf() takes const char* */
|
||||
Anope::string result;
|
||||
|
||||
if (!Config.ConfValue(*this->data, tag, name, default_value, index, result, allow_linefeeds))
|
||||
if (!Config->ConfValue(Config->config_data, tag, name, default_value, index, result, allow_linefeeds))
|
||||
this->error = CONF_VALUE_NOT_FOUND;
|
||||
|
||||
return result;
|
||||
@@ -48,7 +55,7 @@ Anope::string ConfigReader::ReadValue(const Anope::string &tag, const Anope::str
|
||||
|
||||
bool ConfigReader::ReadFlag(const Anope::string &tag, const Anope::string &name, const Anope::string &default_value, int index)
|
||||
{
|
||||
return Config.ConfValueBool(*this->data, tag, name, default_value, index);
|
||||
return Config->ConfValueBool(Config->config_data, tag, name, default_value, index);
|
||||
}
|
||||
|
||||
bool ConfigReader::ReadFlag(const Anope::string &tag, const Anope::string &name, int index)
|
||||
@@ -60,7 +67,7 @@ int ConfigReader::ReadInteger(const Anope::string &tag, const Anope::string &nam
|
||||
{
|
||||
int result;
|
||||
|
||||
if (!Config.ConfValueInteger(*this->data, tag, name, default_value, index, result))
|
||||
if (!Config->ConfValueInteger(Config->config_data, tag, name, default_value, index, result))
|
||||
{
|
||||
this->error = CONF_VALUE_NOT_FOUND;
|
||||
return 0;
|
||||
@@ -87,19 +94,14 @@ long ConfigReader::GetError()
|
||||
return olderr;
|
||||
}
|
||||
|
||||
void ConfigReader::DumpErrors(bool bail)
|
||||
{
|
||||
Config.ReportConfigError(this->errorlog->str(), bail);
|
||||
}
|
||||
|
||||
int ConfigReader::Enumerate(const Anope::string &tag) const
|
||||
{
|
||||
return Config.ConfValueEnum(*this->data, tag);
|
||||
return Config->ConfValueEnum(Config->config_data, tag);
|
||||
}
|
||||
|
||||
int ConfigReader::EnumerateValues(const Anope::string &tag, int index)
|
||||
{
|
||||
return Config.ConfVarEnum(*this->data, tag, index);
|
||||
return Config->ConfVarEnum(Config->config_data, tag, index);
|
||||
}
|
||||
|
||||
bool ConfigReader::Verify()
|
||||
|
||||
+4
-4
@@ -19,7 +19,7 @@ E void moduleAddHostServCmds();
|
||||
|
||||
void moduleAddHostServCmds()
|
||||
{
|
||||
ModuleManager::LoadModuleList(Config.HostServCoreModules);
|
||||
ModuleManager::LoadModuleList(Config->HostServCoreModules);
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
@@ -61,7 +61,7 @@ void get_hostserv_stats(long *nrec, long *memuse)
|
||||
*/
|
||||
void hostserv_init()
|
||||
{
|
||||
if (!Config.s_HostServ.empty())
|
||||
if (!Config->s_HostServ.empty())
|
||||
moduleAddHostServCmds();
|
||||
}
|
||||
|
||||
@@ -170,8 +170,8 @@ void do_on_id(User *u)
|
||||
u->UpdateHost();
|
||||
|
||||
if (!na->hostinfo.GetIdent().empty())
|
||||
notice_lang(Config.s_HostServ, u, HOST_IDENT_ACTIVATED, na->hostinfo.GetIdent().c_str(), na->hostinfo.GetHost().c_str());
|
||||
notice_lang(Config->s_HostServ, u, HOST_IDENT_ACTIVATED, na->hostinfo.GetIdent().c_str(), na->hostinfo.GetHost().c_str());
|
||||
else
|
||||
notice_lang(Config.s_HostServ, u, HOST_ACTIVATED, na->hostinfo.GetHost().c_str());
|
||||
notice_lang(Config->s_HostServ, u, HOST_ACTIVATED, na->hostinfo.GetHost().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
+35
-24
@@ -149,7 +149,7 @@ bool GetCommandLineArgument(const Anope::string &name, char shortname, Anope::st
|
||||
|
||||
static void remove_pidfile()
|
||||
{
|
||||
remove(Config.PIDFilename.c_str());
|
||||
remove(Config->PIDFilename.c_str());
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
@@ -160,7 +160,7 @@ static void write_pidfile()
|
||||
{
|
||||
FILE *pidfile;
|
||||
|
||||
pidfile = fopen(Config.PIDFilename.c_str(), "w");
|
||||
pidfile = fopen(Config->PIDFilename.c_str(), "w");
|
||||
if (pidfile)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
@@ -172,7 +172,7 @@ static void write_pidfile()
|
||||
atexit(remove_pidfile);
|
||||
}
|
||||
else
|
||||
log_perror("Warning: cannot write to PID file %s", Config.PIDFilename.c_str());
|
||||
log_perror("Warning: cannot write to PID file %s", Config->PIDFilename.c_str());
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
@@ -311,15 +311,26 @@ int init_primary(int ac, char **av)
|
||||
}
|
||||
|
||||
/* Read configuration file; exit if there are problems. */
|
||||
if (!read_config(0))
|
||||
try
|
||||
{
|
||||
Config = new ServerConfig();
|
||||
}
|
||||
catch (const ConfigException &ex)
|
||||
{
|
||||
Alog(LOG_TERMINAL) << ex.GetReason();
|
||||
Alog(LOG_TERMINAL) << "*** Support resources: Read through the services.conf self-contained";
|
||||
Alog(LOG_TERMINAL) << "*** documentation. Read the documentation files found in the 'docs'";
|
||||
Alog(LOG_TERMINAL) << "*** folder. Visit our portal located at http://www.anope.org/. Join";
|
||||
Alog(LOG_TERMINAL) << "*** our support channel on /server irc.anope.org channel #anope.";
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Add IRCD Protocol Module; exit if there are errors */
|
||||
if (protocol_module_init())
|
||||
return -1;
|
||||
|
||||
/* Create me */
|
||||
Me = new Server(NULL, Config.ServerName, 0, Config.ServerDesc, Config.Numeric);
|
||||
Me = new Server(NULL, Config->ServerName, 0, Config->ServerDesc, Config->Numeric);
|
||||
|
||||
/* First thing, add our core bots internally. Before modules are loaded and before the database is read
|
||||
* This is used for modules adding commands and for the BotInfo* poiners in the command classes.
|
||||
@@ -333,31 +344,31 @@ int init_primary(int ac, char **av)
|
||||
* Note that it is important this is after loading the protocol module. The ircd struct must exist for
|
||||
* the ts6_ functions
|
||||
*/
|
||||
if (!Config.s_OperServ.empty())
|
||||
new BotInfo(Config.s_OperServ, Config.ServiceUser, Config.ServiceHost, Config.desc_OperServ);
|
||||
if (!Config.s_NickServ.empty())
|
||||
new BotInfo(Config.s_NickServ, Config.ServiceUser, Config.ServiceHost, Config.desc_NickServ);
|
||||
if (!Config.s_ChanServ.empty())
|
||||
new BotInfo(Config.s_ChanServ, Config.ServiceUser, Config.ServiceHost, Config.desc_ChanServ);
|
||||
if (!Config.s_HostServ.empty())
|
||||
new BotInfo(Config.s_HostServ, Config.ServiceUser, Config.ServiceHost, Config.desc_HostServ);
|
||||
if (!Config.s_MemoServ.empty())
|
||||
new BotInfo(Config.s_MemoServ, Config.ServiceUser, Config.ServiceHost, Config.desc_MemoServ);
|
||||
if (!Config.s_BotServ.empty())
|
||||
new BotInfo(Config.s_BotServ, Config.ServiceUser, Config.ServiceHost, Config.desc_BotServ);
|
||||
if (!Config.s_GlobalNoticer.empty())
|
||||
new BotInfo(Config.s_GlobalNoticer, Config.ServiceUser, Config.ServiceHost, Config.desc_GlobalNoticer);
|
||||
if (!Config->s_OperServ.empty())
|
||||
new BotInfo(Config->s_OperServ, Config->ServiceUser, Config->ServiceHost, Config->desc_OperServ);
|
||||
if (!Config->s_NickServ.empty())
|
||||
new BotInfo(Config->s_NickServ, Config->ServiceUser, Config->ServiceHost, Config->desc_NickServ);
|
||||
if (!Config->s_ChanServ.empty())
|
||||
new BotInfo(Config->s_ChanServ, Config->ServiceUser, Config->ServiceHost, Config->desc_ChanServ);
|
||||
if (!Config->s_HostServ.empty())
|
||||
new BotInfo(Config->s_HostServ, Config->ServiceUser, Config->ServiceHost, Config->desc_HostServ);
|
||||
if (!Config->s_MemoServ.empty())
|
||||
new BotInfo(Config->s_MemoServ, Config->ServiceUser, Config->ServiceHost, Config->desc_MemoServ);
|
||||
if (!Config->s_BotServ.empty())
|
||||
new BotInfo(Config->s_BotServ, Config->ServiceUser, Config->ServiceHost, Config->desc_BotServ);
|
||||
if (!Config->s_GlobalNoticer.empty())
|
||||
new BotInfo(Config->s_GlobalNoticer, Config->ServiceUser, Config->ServiceHost, Config->desc_GlobalNoticer);
|
||||
|
||||
/* Add Encryption Modules */
|
||||
ModuleManager::LoadModuleList(Config.EncModuleList);
|
||||
ModuleManager::LoadModuleList(Config->EncModuleList);
|
||||
|
||||
/* Add Database Modules */
|
||||
ModuleManager::LoadModuleList(Config.DBModuleList);
|
||||
ModuleManager::LoadModuleList(Config->DBModuleList);
|
||||
|
||||
/* Load the socket engine */
|
||||
if (ModuleManager::LoadModule(Config.SocketEngine, NULL))
|
||||
if (ModuleManager::LoadModule(Config->SocketEngine, NULL))
|
||||
{
|
||||
Alog(LOG_TERMINAL) << "Unable to load socket engine " << Config.SocketEngine;
|
||||
Alog(LOG_TERMINAL) << "Unable to load socket engine " << Config->SocketEngine;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -448,7 +459,7 @@ int init_secondary(int ac, char **av)
|
||||
|
||||
/* load any custom modules */
|
||||
if (!nothird)
|
||||
ModuleManager::LoadModuleList(Config.ModulesAutoLoad);
|
||||
ModuleManager::LoadModuleList(Config->ModulesAutoLoad);
|
||||
|
||||
/* Initialize random number generator */
|
||||
rand_init();
|
||||
|
||||
+7
-7
@@ -168,7 +168,7 @@ void lang_sanitize()
|
||||
{
|
||||
len = strlen(langtexts[i][j]);
|
||||
strscpy(tmp, langtexts[i][j], sizeof(tmp));
|
||||
if (Config.UseStrictPrivMsg)
|
||||
if (Config->UseStrictPrivMsg)
|
||||
strnrepl(tmp, sizeof(tmp), "%R", "/");
|
||||
else
|
||||
strnrepl(tmp, sizeof(tmp), "%R", "/msg ");
|
||||
@@ -221,8 +221,8 @@ void lang_init()
|
||||
|
||||
/* Not what I intended to do, but these services are so archaïc
|
||||
* that it's difficult to do more. */
|
||||
if ((Config.NSDefLanguage = langlist[Config.NSDefLanguage]) < 0)
|
||||
Config.NSDefLanguage = DEF_LANGUAGE;
|
||||
if ((Config->NSDefLanguage = langlist[Config->NSDefLanguage]) < 0)
|
||||
Config->NSDefLanguage = DEF_LANGUAGE;
|
||||
|
||||
if (!langtexts[DEF_LANGUAGE])
|
||||
fatal("Unable to load default language");
|
||||
@@ -247,7 +247,7 @@ void lang_init()
|
||||
|
||||
int strftime_lang(char *buf, int size, User *u, int format, struct tm *tm)
|
||||
{
|
||||
int language = u && u->Account() ? u->Account()->language : Config.NSDefLanguage;
|
||||
int language = u && u->Account() ? u->Account()->language : Config->NSDefLanguage;
|
||||
char tmpbuf[BUFSIZE], buf2[BUFSIZE];
|
||||
char *s;
|
||||
int i, ret;
|
||||
@@ -318,7 +318,7 @@ void syntax_error(const Anope::string &service, User *u, const Anope::string &co
|
||||
const char *getstring(NickAlias *na, int index)
|
||||
{
|
||||
// Default to config
|
||||
int langidx = Config.NSDefLanguage;
|
||||
int langidx = Config->NSDefLanguage;
|
||||
|
||||
// If they are registered (na->nc), and NOT forbidden
|
||||
if (na && na->nc && !na->HasFlag(NS_FORBIDDEN))
|
||||
@@ -330,7 +330,7 @@ const char *getstring(NickAlias *na, int index)
|
||||
const char *getstring(const NickCore *nc, int index)
|
||||
{
|
||||
// Default to config
|
||||
int langidx = Config.NSDefLanguage;
|
||||
int langidx = Config->NSDefLanguage;
|
||||
|
||||
if (nc)
|
||||
langidx = nc->language;
|
||||
@@ -346,7 +346,7 @@ const char *getstring(const User *u, int index)
|
||||
const char *getstring(int index)
|
||||
{
|
||||
// Default to config
|
||||
int langidx = Config.NSDefLanguage;
|
||||
int langidx = Config->NSDefLanguage;
|
||||
|
||||
return langtexts[langidx][index];
|
||||
}
|
||||
|
||||
+4
-4
@@ -45,11 +45,11 @@ static void remove_log()
|
||||
|
||||
Anope::string name;
|
||||
|
||||
if (!Config.KeepLogs)
|
||||
if (!Config->KeepLogs)
|
||||
return;
|
||||
|
||||
time(&t);
|
||||
t -= (60 * 60 * 24 * Config.KeepLogs);
|
||||
t -= (60 * 60 * 24 * Config->KeepLogs);
|
||||
tm = *localtime(&t);
|
||||
|
||||
/* removed if from here cause get_logchan is always 1 */
|
||||
@@ -258,7 +258,7 @@ Alog::~Alog()
|
||||
std::cout << tbuf << " " << buf.str() << std::endl;
|
||||
else if (Level == LOG_TERMINAL) // XXX dont use this yet unless you know we're at terminal and not daemonized
|
||||
std::cout << buf.str() << std::endl;
|
||||
if (!Config.LogChannel.empty() && LogChan && !debug && findchan(Config.LogChannel))
|
||||
ircdproto->SendPrivmsg(Global, Config.LogChannel, "%s", buf.str().c_str());
|
||||
if (Config && !Config->LogChannel.empty() && LogChan && !debug && findchan(Config->LogChannel))
|
||||
ircdproto->SendPrivmsg(Global, Config->LogChannel, "%s", buf.str().c_str());
|
||||
errno = errno_save;
|
||||
}
|
||||
|
||||
+8
-8
@@ -11,13 +11,13 @@ MailThread::~MailThread()
|
||||
|
||||
void MailThread::Run()
|
||||
{
|
||||
FILE *pipe = popen(Config.SendMailPath.c_str(), "w");
|
||||
FILE *pipe = popen(Config->SendMailPath.c_str(), "w");
|
||||
|
||||
if (!pipe)
|
||||
return;
|
||||
|
||||
fprintf(pipe, "From: %s\n", Config.SendFrom.c_str());
|
||||
if (Config.DontQuoteAddresses)
|
||||
fprintf(pipe, "From: %s\n", Config->SendFrom.c_str());
|
||||
if (Config->DontQuoteAddresses)
|
||||
fprintf(pipe, "To: %s <%s>\n", MailTo.c_str(), Addr.c_str());
|
||||
else
|
||||
fprintf(pipe, "To: \"%s\" <%s>\n", MailTo.c_str(), Addr.c_str());
|
||||
@@ -37,9 +37,9 @@ bool Mail(User *u, NickRequest *nr, const Anope::string &service, const Anope::s
|
||||
|
||||
time_t t = time(NULL);
|
||||
|
||||
if (!Config.UseMail)
|
||||
if (!Config->UseMail)
|
||||
notice_lang(service, u, MAIL_DISABLED);
|
||||
else if (t - u->lastmail < Config.MailDelay)
|
||||
else if (t - u->lastmail < Config->MailDelay)
|
||||
notice_lang(service, u, MAIL_DELAYED, t - u->lastmail);
|
||||
else if (nr->email.empty())
|
||||
notice_lang(service, u, MAIL_INVALID, nr->nick.c_str());
|
||||
@@ -60,9 +60,9 @@ bool Mail(User *u, NickCore *nc, const Anope::string &service, const Anope::stri
|
||||
|
||||
time_t t = time(NULL);
|
||||
|
||||
if (!Config.UseMail)
|
||||
if (!Config->UseMail)
|
||||
notice_lang(service, u, MAIL_DISABLED);
|
||||
else if (t - u->lastmail < Config.MailDelay)
|
||||
else if (t - u->lastmail < Config->MailDelay)
|
||||
notice_lang(service, u, MAIL_DELAYED, t - u->lastmail);
|
||||
else if (nc->email.empty())
|
||||
notice_lang(service, u, MAIL_INVALID, nc->display.c_str());
|
||||
@@ -78,7 +78,7 @@ bool Mail(User *u, NickCore *nc, const Anope::string &service, const Anope::stri
|
||||
|
||||
bool Mail(NickCore *nc, const Anope::string &subject, const Anope::string &message)
|
||||
{
|
||||
if (!Config.UseMail || !nc || nc->email.empty() || subject.empty() || message.empty())
|
||||
if (!Config->UseMail || !nc || nc->email.empty() || subject.empty() || message.empty())
|
||||
return false;
|
||||
|
||||
nc->lastmail = time(NULL);
|
||||
|
||||
+21
-17
@@ -185,7 +185,7 @@ void do_restart_services()
|
||||
if (!it->second->GetUID().empty())
|
||||
UserListByUID.erase(it->second->GetUID());
|
||||
}
|
||||
ircdproto->SendSquit(Config.ServerName, quitmsg);
|
||||
ircdproto->SendSquit(Config->ServerName, quitmsg);
|
||||
SocketEngine->Process();
|
||||
delete UplinkSock;
|
||||
close_log();
|
||||
@@ -230,7 +230,7 @@ static void services_shutdown()
|
||||
UserListByUID.erase(it->second->GetUID());
|
||||
}
|
||||
|
||||
ircdproto->SendSquit(Config.ServerName, quitmsg);
|
||||
ircdproto->SendSquit(Config->ServerName, quitmsg);
|
||||
|
||||
while (!UserListByNick.empty())
|
||||
delete UserListByNick.begin()->second;
|
||||
@@ -268,13 +268,17 @@ void sighandler(int signum)
|
||||
expire_all();
|
||||
save_databases();
|
||||
|
||||
if (!read_config(1))
|
||||
try
|
||||
{
|
||||
quitmsg = "Error Reading Configuration File (Received SIGHUP)";
|
||||
quitting = true;
|
||||
ServerConfig *newconfig = new ServerConfig();
|
||||
delete Config;
|
||||
Config = newconfig;
|
||||
FOREACH_MOD(I_OnReload, OnReload(true));
|
||||
}
|
||||
catch (const ConfigException &ex)
|
||||
{
|
||||
Alog() << "Error reloading configuration file: " << ex.GetReason();
|
||||
}
|
||||
|
||||
FOREACH_MOD(I_OnReload, OnReload(true));
|
||||
return;
|
||||
|
||||
}
|
||||
@@ -379,7 +383,7 @@ static bool Connect()
|
||||
{
|
||||
/* Connect to the remote server */
|
||||
int servernum = 1;
|
||||
for (std::list<Uplink *>::iterator curr_uplink = Config.Uplinks.begin(), end_uplink = Config.Uplinks.end(); curr_uplink != end_uplink; ++curr_uplink, ++servernum)
|
||||
for (std::list<Uplink *>::iterator curr_uplink = Config->Uplinks.begin(), end_uplink = Config->Uplinks.end(); curr_uplink != end_uplink; ++curr_uplink, ++servernum)
|
||||
{
|
||||
uplink_server = *curr_uplink;
|
||||
|
||||
@@ -394,7 +398,7 @@ static bool Connect()
|
||||
|
||||
try
|
||||
{
|
||||
new UplinkSocket(uplink_server->host, uplink_server->port, Config.LocalHost, uplink_server->ipv6);
|
||||
new UplinkSocket(uplink_server->host, uplink_server->port, Config->LocalHost, uplink_server->ipv6);
|
||||
}
|
||||
catch (const SocketException &ex)
|
||||
{
|
||||
@@ -479,7 +483,7 @@ int main(int ac, char **av, char **envp)
|
||||
started = true;
|
||||
|
||||
#ifndef _WIN32
|
||||
if (Config.DumpCore)
|
||||
if (Config->DumpCore)
|
||||
{
|
||||
rlimit rl;
|
||||
if (getrlimit(RLIMIT_CORE, &rl) == -1)
|
||||
@@ -495,8 +499,8 @@ int main(int ac, char **av, char **envp)
|
||||
|
||||
/* Set up timers */
|
||||
time_t last_check = time(NULL);
|
||||
ExpireTimer expireTimer(Config.ExpireTimeout, last_check);
|
||||
UpdateTimer updateTimer(Config.UpdateTimeout, last_check);
|
||||
ExpireTimer expireTimer(Config->ExpireTimeout, last_check);
|
||||
UpdateTimer updateTimer(Config->UpdateTimeout, last_check);
|
||||
|
||||
/*** Main loop. ***/
|
||||
while (!quitting)
|
||||
@@ -523,7 +527,7 @@ int main(int ac, char **av, char **envp)
|
||||
break;
|
||||
}
|
||||
|
||||
if (t - last_check >= Config.TimeoutCheck)
|
||||
if (t - last_check >= Config->TimeoutCheck)
|
||||
{
|
||||
TimerManager::TickTimers(t);
|
||||
last_check = t;
|
||||
@@ -566,11 +570,11 @@ int main(int ac, char **av, char **envp)
|
||||
Me->ClearLinks();
|
||||
|
||||
unsigned j = 0;
|
||||
for (; j < (Config.MaxRetries ? Config.MaxRetries : j + 1); ++j)
|
||||
for (; j < (Config->MaxRetries ? Config->MaxRetries : j + 1); ++j)
|
||||
{
|
||||
Alog() << "Disconnected from the server, retrying in " << Config.RetryWait << " seconds";
|
||||
Alog() << "Disconnected from the server, retrying in " << Config->RetryWait << " seconds";
|
||||
|
||||
sleep(Config.RetryWait);
|
||||
sleep(Config->RetryWait);
|
||||
if (Connect())
|
||||
{
|
||||
ircdproto->SendConnect();
|
||||
@@ -578,7 +582,7 @@ int main(int ac, char **av, char **envp)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (Config.MaxRetries && j == Config.MaxRetries)
|
||||
if (Config->MaxRetries && j == Config->MaxRetries)
|
||||
{
|
||||
Alog() << "Max connection retry limit exceeded";
|
||||
quitting = true;
|
||||
|
||||
+25
-25
@@ -22,7 +22,7 @@ static bool SendMemoMail(NickCore *nc, Memo *m);
|
||||
|
||||
void moduleAddMemoServCmds()
|
||||
{
|
||||
ModuleManager::LoadModuleList(Config.MemoServCoreModules);
|
||||
ModuleManager::LoadModuleList(Config->MemoServCoreModules);
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
@@ -66,9 +66,9 @@ void check_memos(User *u)
|
||||
}
|
||||
if (newcnt > 0)
|
||||
{
|
||||
notice_lang(Config.s_MemoServ, u, newcnt == 1 ? MEMO_HAVE_NEW_MEMO : MEMO_HAVE_NEW_MEMOS, newcnt);
|
||||
notice_lang(Config->s_MemoServ, u, newcnt == 1 ? MEMO_HAVE_NEW_MEMO : MEMO_HAVE_NEW_MEMOS, newcnt);
|
||||
if (newcnt == 1 && (nc->memos.memos[i - 1]->HasFlag(MF_UNREAD)))
|
||||
notice_lang(Config.s_MemoServ, u, MEMO_TYPE_READ_LAST, Config.s_MemoServ.c_str());
|
||||
notice_lang(Config->s_MemoServ, u, MEMO_TYPE_READ_LAST, Config->s_MemoServ.c_str());
|
||||
else if (newcnt == 1)
|
||||
{
|
||||
for (i = 0; i < end; ++i)
|
||||
@@ -76,17 +76,17 @@ void check_memos(User *u)
|
||||
if (nc->memos.memos[i]->HasFlag(MF_UNREAD))
|
||||
break;
|
||||
}
|
||||
notice_lang(Config.s_MemoServ, u, MEMO_TYPE_READ_NUM, Config.s_MemoServ.c_str(), nc->memos.memos[i]->number);
|
||||
notice_lang(Config->s_MemoServ, u, MEMO_TYPE_READ_NUM, Config->s_MemoServ.c_str(), nc->memos.memos[i]->number);
|
||||
}
|
||||
else
|
||||
notice_lang(Config.s_MemoServ, u, MEMO_TYPE_LIST_NEW, Config.s_MemoServ.c_str());
|
||||
notice_lang(Config->s_MemoServ, u, MEMO_TYPE_LIST_NEW, Config->s_MemoServ.c_str());
|
||||
}
|
||||
if (nc->memos.memomax > 0 && nc->memos.memos.size() >= nc->memos.memomax)
|
||||
{
|
||||
if (nc->memos.memos.size() > nc->memos.memomax)
|
||||
notice_lang(Config.s_MemoServ, u, MEMO_OVER_LIMIT, nc->memos.memomax);
|
||||
notice_lang(Config->s_MemoServ, u, MEMO_OVER_LIMIT, nc->memos.memomax);
|
||||
else
|
||||
notice_lang(Config.s_MemoServ, u, MEMO_AT_LIMIT, nc->memos.memomax);
|
||||
notice_lang(Config->s_MemoServ, u, MEMO_AT_LIMIT, nc->memos.memomax);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,48 +175,48 @@ void memo_send(User *u, const Anope::string &name, const Anope::string &text, in
|
||||
int is_servoper = u->Account() && u->Account()->IsServicesOper();
|
||||
|
||||
if (readonly)
|
||||
notice_lang(Config.s_MemoServ, u, MEMO_SEND_DISABLED);
|
||||
notice_lang(Config->s_MemoServ, u, MEMO_SEND_DISABLED);
|
||||
else if (text.empty())
|
||||
{
|
||||
if (!z)
|
||||
syntax_error(Config.s_MemoServ, u, "SEND", MEMO_SEND_SYNTAX);
|
||||
syntax_error(Config->s_MemoServ, u, "SEND", MEMO_SEND_SYNTAX);
|
||||
|
||||
if (z == 3)
|
||||
syntax_error(Config.s_MemoServ, u, "RSEND", MEMO_RSEND_SYNTAX);
|
||||
syntax_error(Config->s_MemoServ, u, "RSEND", MEMO_RSEND_SYNTAX);
|
||||
}
|
||||
else if (!u->IsIdentified() && !u->IsRecognized())
|
||||
{
|
||||
if (!z || z == 3)
|
||||
notice_lang(Config.s_MemoServ, u, NICK_IDENTIFY_REQUIRED, Config.s_NickServ.c_str());
|
||||
notice_lang(Config->s_MemoServ, u, NICK_IDENTIFY_REQUIRED, Config->s_NickServ.c_str());
|
||||
}
|
||||
else if (!(mi = getmemoinfo(name, ischan, isforbid)))
|
||||
{
|
||||
if (!z || z == 3)
|
||||
{
|
||||
if (isforbid)
|
||||
notice_lang(Config.s_MemoServ, u, ischan ? CHAN_X_FORBIDDEN : NICK_X_FORBIDDEN, name.c_str());
|
||||
notice_lang(Config->s_MemoServ, u, ischan ? CHAN_X_FORBIDDEN : NICK_X_FORBIDDEN, name.c_str());
|
||||
else
|
||||
notice_lang(Config.s_MemoServ, u, ischan ? CHAN_X_NOT_REGISTERED : NICK_X_NOT_REGISTERED, name.c_str());
|
||||
notice_lang(Config->s_MemoServ, u, ischan ? CHAN_X_NOT_REGISTERED : NICK_X_NOT_REGISTERED, name.c_str());
|
||||
}
|
||||
}
|
||||
else if (z != 2 && Config.MSSendDelay > 0 && u && u->lastmemosend + Config.MSSendDelay > now)
|
||||
else if (z != 2 && Config->MSSendDelay > 0 && u && u->lastmemosend + Config->MSSendDelay > now)
|
||||
{
|
||||
u->lastmemosend = now;
|
||||
if (!z)
|
||||
notice_lang(Config.s_MemoServ, u, MEMO_SEND_PLEASE_WAIT, Config.MSSendDelay);
|
||||
notice_lang(Config->s_MemoServ, u, MEMO_SEND_PLEASE_WAIT, Config->MSSendDelay);
|
||||
|
||||
if (z == 3)
|
||||
notice_lang(Config.s_MemoServ, u, MEMO_RSEND_PLEASE_WAIT, Config.MSSendDelay);
|
||||
notice_lang(Config->s_MemoServ, u, MEMO_RSEND_PLEASE_WAIT, Config->MSSendDelay);
|
||||
}
|
||||
else if (!mi->memomax && !is_servoper)
|
||||
{
|
||||
if (!z || z == 3)
|
||||
notice_lang(Config.s_MemoServ, u, MEMO_X_GETS_NO_MEMOS, name.c_str());
|
||||
notice_lang(Config->s_MemoServ, u, MEMO_X_GETS_NO_MEMOS, name.c_str());
|
||||
}
|
||||
else if (mi->memomax > 0 && mi->memos.size() >= mi->memomax && !is_servoper)
|
||||
{
|
||||
if (!z || z == 3)
|
||||
notice_lang(Config.s_MemoServ, u, MEMO_X_HAS_TOO_MANY_MEMOS, name.c_str());
|
||||
notice_lang(Config->s_MemoServ, u, MEMO_X_HAS_TOO_MANY_MEMOS, name.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -245,14 +245,14 @@ void memo_send(User *u, const Anope::string &name, const Anope::string &text, in
|
||||
if (z == 3)
|
||||
m->SetFlag(MF_RECEIPT);
|
||||
if (!z || z == 3)
|
||||
notice_lang(Config.s_MemoServ, u, MEMO_SENT, name.c_str());
|
||||
notice_lang(Config->s_MemoServ, u, MEMO_SENT, name.c_str());
|
||||
if (!ischan)
|
||||
{
|
||||
NickCore *nc = findnick(name)->nc;
|
||||
|
||||
FOREACH_MOD(I_OnMemoSend, OnMemoSend(u, nc, m));
|
||||
|
||||
if (Config.MSNotifyAll)
|
||||
if (Config->MSNotifyAll)
|
||||
{
|
||||
if (nc->HasFlag(NI_MEMO_RECEIVE) && !get_ignore(name))
|
||||
{
|
||||
@@ -261,13 +261,13 @@ void memo_send(User *u, const Anope::string &name, const Anope::string &text, in
|
||||
NickAlias *na = *it;
|
||||
User *user = finduser(na->nick);
|
||||
if (user && user->IsIdentified())
|
||||
notice_lang(Config.s_MemoServ, user, MEMO_NEW_MEMO_ARRIVED, source.c_str(), Config.s_MemoServ.c_str(), m->number);
|
||||
notice_lang(Config->s_MemoServ, user, MEMO_NEW_MEMO_ARRIVED, source.c_str(), Config->s_MemoServ.c_str(), m->number);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((u = finduser(name)) && u->IsIdentified() && nc->HasFlag(NI_MEMO_RECEIVE))
|
||||
notice_lang(Config.s_MemoServ, u, MEMO_NEW_MEMO_ARRIVED, source.c_str(), Config.s_MemoServ.c_str(), m->number);
|
||||
notice_lang(Config->s_MemoServ, u, MEMO_NEW_MEMO_ARRIVED, source.c_str(), Config->s_MemoServ.c_str(), m->number);
|
||||
} /* if (flags & MEMO_RECEIVE) */
|
||||
}
|
||||
/* if (MSNotifyAll) */
|
||||
@@ -281,7 +281,7 @@ void memo_send(User *u, const Anope::string &name, const Anope::string &text, in
|
||||
|
||||
FOREACH_MOD(I_OnMemoSend, OnMemoSend(u, cs_findchan(name), m));
|
||||
|
||||
if (Config.MSNotifyAll && (c = findchan(name)))
|
||||
if (Config->MSNotifyAll && (c = findchan(name)))
|
||||
{
|
||||
for (CUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; ++it)
|
||||
{
|
||||
@@ -290,7 +290,7 @@ void memo_send(User *u, const Anope::string &name, const Anope::string &text, in
|
||||
if (check_access(cu->user, c->ci, CA_MEMO))
|
||||
{
|
||||
if (cu->user->Account() && cu->user->Account()->HasFlag(NI_MEMO_RECEIVE) && !get_ignore(cu->user->nick))
|
||||
notice_lang(Config.s_MemoServ, cu->user, MEMO_NEW_X_MEMO_ARRIVED, c->ci->name.c_str(), Config.s_MemoServ.c_str(), c->ci->name.c_str(), m->number);
|
||||
notice_lang(Config->s_MemoServ, cu->user, MEMO_NEW_X_MEMO_ARRIVED, c->ci->name.c_str(), Config->s_MemoServ.c_str(), c->ci->name.c_str(), m->number);
|
||||
}
|
||||
}
|
||||
} /* MSNotifyAll */
|
||||
@@ -376,7 +376,7 @@ void rsend_notify(User *u, Memo *m, const Anope::string &chan)
|
||||
|
||||
/* Notify recepient of the memo that a notification has
|
||||
been sent to the sender */
|
||||
notice_lang(Config.s_MemoServ, u, MEMO_RSEND_USER_NOTIFICATION, nc->display.c_str());
|
||||
notice_lang(Config->s_MemoServ, u, MEMO_RSEND_USER_NOTIFICATION, nc->display.c_str());
|
||||
}
|
||||
|
||||
/* Remove receipt flag from the original memo */
|
||||
|
||||
+46
-46
@@ -39,7 +39,7 @@ int m_kill(const Anope::string &nick, const Anope::string &msg)
|
||||
BotInfo *bi;
|
||||
|
||||
/* Recover if someone kills us. */
|
||||
if (!Config.s_BotServ.empty() && (bi = findbot(nick)))
|
||||
if (!Config->s_BotServ.empty() && (bi = findbot(nick)))
|
||||
{
|
||||
introduce_user(nick);
|
||||
bi->RejoinAll();
|
||||
@@ -62,7 +62,7 @@ int m_time(const Anope::string &source, int ac, const char **av)
|
||||
struct tm *tm = localtime(t);
|
||||
char buf[64];
|
||||
strftime(buf, sizeof(buf), "%a %b %d %H:%M:%S %Y %Z", tm);
|
||||
ircdproto->SendNumeric(Config.ServerName, 391, source, "%s :%s", Config.ServerName.c_str(), buf);
|
||||
ircdproto->SendNumeric(Config->ServerName, 391, source, "%s :%s", Config->ServerName.c_str(), buf);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
@@ -73,21 +73,21 @@ int m_motd(const Anope::string &source)
|
||||
if (source.empty())
|
||||
return MOD_CONT;
|
||||
|
||||
FILE *f = fopen(Config.MOTDFilename.c_str(), "r");
|
||||
FILE *f = fopen(Config->MOTDFilename.c_str(), "r");
|
||||
if (f)
|
||||
{
|
||||
ircdproto->SendNumeric(Config.ServerName, 375, source, ":- %s Message of the Day", Config.ServerName.c_str());
|
||||
ircdproto->SendNumeric(Config->ServerName, 375, source, ":- %s Message of the Day", Config->ServerName.c_str());
|
||||
char buf[BUFSIZE];
|
||||
while (fgets(buf, sizeof(buf), f))
|
||||
{
|
||||
buf[strlen(buf) - 1] = 0;
|
||||
ircdproto->SendNumeric(Config.ServerName, 372, source, ":- %s", buf);
|
||||
ircdproto->SendNumeric(Config->ServerName, 372, source, ":- %s", buf);
|
||||
}
|
||||
fclose(f);
|
||||
ircdproto->SendNumeric(Config.ServerName, 376, source, ":End of /MOTD command.");
|
||||
ircdproto->SendNumeric(Config->ServerName, 376, source, ":End of /MOTD command.");
|
||||
}
|
||||
else
|
||||
ircdproto->SendNumeric(Config.ServerName, 422, source, ":- MOTD file not found! Please contact your IRC administrator.");
|
||||
ircdproto->SendNumeric(Config->ServerName, 422, source, ":- MOTD file not found! Please contact your IRC administrator.");
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ int m_privmsg(const Anope::string &source, const Anope::string &receiver, const
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (receiver[0] == '#' && !Config.s_BotServ.empty())
|
||||
if (receiver[0] == '#' && !Config->s_BotServ.empty())
|
||||
{
|
||||
ChannelInfo *ci = cs_findchan(receiver);
|
||||
if (ci)
|
||||
@@ -142,13 +142,13 @@ int m_privmsg(const Anope::string &source, const Anope::string &receiver, const
|
||||
{
|
||||
Anope::string servername(receiver.begin() + s + 1, receiver.end());
|
||||
botname = botname.substr(0, s);
|
||||
if (!servername.equals_ci(Config.ServerName))
|
||||
if (!servername.equals_ci(Config->ServerName))
|
||||
return MOD_CONT;
|
||||
}
|
||||
else if (Config.UseStrictPrivMsg)
|
||||
else if (Config->UseStrictPrivMsg)
|
||||
{
|
||||
Alog(LOG_DEBUG) << "Ignored PRIVMSG without @ from " << source;
|
||||
notice_lang(receiver, u, INVALID_TARGET, receiver.c_str(), receiver.c_str(), Config.ServerName.c_str(), receiver.c_str());
|
||||
notice_lang(receiver, u, INVALID_TARGET, receiver.c_str(), receiver.c_str(), Config->ServerName.c_str(), receiver.c_str());
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
@@ -167,36 +167,36 @@ int m_privmsg(const Anope::string &source, const Anope::string &receiver, const
|
||||
}
|
||||
else if (message.substr(0, 9).equals_ci("\1VERSION\1"))
|
||||
{
|
||||
ircdproto->SendCTCP(bi, u->nick, "VERSION Anope-%s %s :%s - (%s) -- %s", Anope::Version().c_str(), Config.ServerName.c_str(), ircd->name, Config.EncModuleList.begin()->c_str(), Anope::Build().c_str());
|
||||
ircdproto->SendCTCP(bi, u->nick, "VERSION Anope-%s %s :%s - (%s) -- %s", Anope::Version().c_str(), Config->ServerName.c_str(), ircd->name, Config->EncModuleList.begin()->c_str(), Anope::Build().c_str());
|
||||
}
|
||||
}
|
||||
else if (bi->nick.equals_ci(Config.s_NickServ) || bi->nick.equals_ci(Config.s_MemoServ) || (!Config.s_BotServ.empty() && bi->nick.equals_ci(Config.s_BotServ)))
|
||||
else if (bi->nick.equals_ci(Config->s_NickServ) || bi->nick.equals_ci(Config->s_MemoServ) || (!Config->s_BotServ.empty() && bi->nick.equals_ci(Config->s_BotServ)))
|
||||
mod_run_cmd(bi, u, message);
|
||||
else if (bi->nick.equals_ci(Config.s_ChanServ))
|
||||
else if (bi->nick.equals_ci(Config->s_ChanServ))
|
||||
{
|
||||
if (!is_oper(u) && Config.CSOpersOnly)
|
||||
notice_lang(Config.s_ChanServ, u, ACCESS_DENIED);
|
||||
if (!is_oper(u) && Config->CSOpersOnly)
|
||||
notice_lang(Config->s_ChanServ, u, ACCESS_DENIED);
|
||||
else
|
||||
mod_run_cmd(bi, u, message);
|
||||
}
|
||||
else if (!Config.s_HostServ.empty() && bi->nick.equals_ci(Config.s_HostServ))
|
||||
else if (!Config->s_HostServ.empty() && bi->nick.equals_ci(Config->s_HostServ))
|
||||
{
|
||||
if (!ircd->vhost)
|
||||
notice_lang(Config.s_HostServ, u, SERVICE_OFFLINE, Config.s_HostServ.c_str());
|
||||
notice_lang(Config->s_HostServ, u, SERVICE_OFFLINE, Config->s_HostServ.c_str());
|
||||
else
|
||||
mod_run_cmd(bi, u, message);
|
||||
}
|
||||
else if (bi->nick.equals_ci(Config.s_OperServ))
|
||||
else if (bi->nick.equals_ci(Config->s_OperServ))
|
||||
{
|
||||
if (!is_oper(u) && Config.OSOpersOnly)
|
||||
if (!is_oper(u) && Config->OSOpersOnly)
|
||||
{
|
||||
notice_lang(Config.s_OperServ, u, ACCESS_DENIED);
|
||||
if (Config.WallBadOS)
|
||||
ircdproto->SendGlobops(OperServ, "Denied access to %s from %s!%s@%s (non-oper)", Config.s_OperServ.c_str(), u->nick.c_str(), u->GetIdent().c_str(), u->host.c_str());
|
||||
notice_lang(Config->s_OperServ, u, ACCESS_DENIED);
|
||||
if (Config->WallBadOS)
|
||||
ircdproto->SendGlobops(OperServ, "Denied access to %s from %s!%s@%s (non-oper)", Config->s_OperServ.c_str(), u->nick.c_str(), u->GetIdent().c_str(), u->host.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
Alog() << Config.s_OperServ << ": " << u->nick << ": " << message;
|
||||
Alog() << Config->s_OperServ << ": " << u->nick << ": " << message;
|
||||
mod_run_cmd(bi, u, message);
|
||||
}
|
||||
}
|
||||
@@ -220,31 +220,31 @@ int m_stats(const Anope::string &source, int ac, const char **av)
|
||||
case 'l':
|
||||
if (u && is_oper(u))
|
||||
{
|
||||
ircdproto->SendNumeric(Config.ServerName, 211, source, "Server SendBuf SentBytes SentMsgs RecvBuf RecvBytes RecvMsgs ConnTime");
|
||||
ircdproto->SendNumeric(Config.ServerName, 211, source, "%s %d %d %d %d %d %d %ld", uplink_server->host.c_str(), UplinkSock->WriteBufferLen(), TotalWritten, -1, UplinkSock->ReadBufferLen(), TotalRead, -1, time(NULL) - start_time);
|
||||
ircdproto->SendNumeric(Config->ServerName, 211, source, "Server SendBuf SentBytes SentMsgs RecvBuf RecvBytes RecvMsgs ConnTime");
|
||||
ircdproto->SendNumeric(Config->ServerName, 211, source, "%s %d %d %d %d %d %d %ld", uplink_server->host.c_str(), UplinkSock->WriteBufferLen(), TotalWritten, -1, UplinkSock->ReadBufferLen(), TotalRead, -1, time(NULL) - start_time);
|
||||
}
|
||||
|
||||
ircdproto->SendNumeric(Config.ServerName, 219, source, "%c :End of /STATS report.", *av[0] ? *av[0] : '*');
|
||||
ircdproto->SendNumeric(Config->ServerName, 219, source, "%c :End of /STATS report.", *av[0] ? *av[0] : '*');
|
||||
break;
|
||||
case 'o':
|
||||
case 'O':
|
||||
/* Check whether the user is an operator */
|
||||
if (u && !is_oper(u) && Config.HideStatsO)
|
||||
ircdproto->SendNumeric(Config.ServerName, 219, source, "%c :End of /STATS report.", *av[0] ? *av[0] : '*');
|
||||
if (u && !is_oper(u) && Config->HideStatsO)
|
||||
ircdproto->SendNumeric(Config->ServerName, 219, source, "%c :End of /STATS report.", *av[0] ? *av[0] : '*');
|
||||
else
|
||||
{
|
||||
std::list<std::pair<Anope::string, Anope::string> >::iterator it, it_end;
|
||||
|
||||
for (it = Config.Opers.begin(), it_end = Config.Opers.end(); it != it_end; ++it)
|
||||
for (it = Config->Opers.begin(), it_end = Config->Opers.end(); it != it_end; ++it)
|
||||
{
|
||||
Anope::string nick = it->first, type = it->second;
|
||||
|
||||
NickCore *nc = findcore(nick);
|
||||
if (nc)
|
||||
ircdproto->SendNumeric(Config.ServerName, 243, source, "O * * %s %s 0", nick.c_str(), type.c_str());
|
||||
ircdproto->SendNumeric(Config->ServerName, 243, source, "O * * %s %s 0", nick.c_str(), type.c_str());
|
||||
}
|
||||
|
||||
ircdproto->SendNumeric(Config.ServerName, 219, source, "%c :End of /STATS report.", *av[0] ? *av[0] : '*');
|
||||
ircdproto->SendNumeric(Config->ServerName, 219, source, "%c :End of /STATS report.", *av[0] ? *av[0] : '*');
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -252,14 +252,14 @@ int m_stats(const Anope::string &source, int ac, const char **av)
|
||||
case 'u':
|
||||
{
|
||||
int uptime = time(NULL) - start_time;
|
||||
ircdproto->SendNumeric(Config.ServerName, 242, source, ":Services up %d day%s, %02d:%02d:%02d", uptime / 86400, uptime / 86400 == 1 ? "" : "s", (uptime / 3600) % 24, (uptime / 60) % 60, uptime % 60);
|
||||
ircdproto->SendNumeric(Config.ServerName, 250, source, ":Current users: %d (%d ops); maximum %d", usercnt, opcnt, maxusercnt);
|
||||
ircdproto->SendNumeric(Config.ServerName, 219, source, "%c :End of /STATS report.", *av[0] ? *av[0] : '*');
|
||||
ircdproto->SendNumeric(Config->ServerName, 242, source, ":Services up %d day%s, %02d:%02d:%02d", uptime / 86400, uptime / 86400 == 1 ? "" : "s", (uptime / 3600) % 24, (uptime / 60) % 60, uptime % 60);
|
||||
ircdproto->SendNumeric(Config->ServerName, 250, source, ":Current users: %d (%d ops); maximum %d", usercnt, opcnt, maxusercnt);
|
||||
ircdproto->SendNumeric(Config->ServerName, 219, source, "%c :End of /STATS report.", *av[0] ? *av[0] : '*');
|
||||
break;
|
||||
} /* case 'u' */
|
||||
|
||||
default:
|
||||
ircdproto->SendNumeric(Config.ServerName, 219, source, "%c :End of /STATS report.", *av[0] ? *av[0] : '*');
|
||||
ircdproto->SendNumeric(Config->ServerName, 219, source, "%c :End of /STATS report.", *av[0] ? *av[0] : '*');
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
@@ -269,7 +269,7 @@ int m_stats(const Anope::string &source, int ac, const char **av)
|
||||
int m_version(const Anope::string &source, int ac, const char **av)
|
||||
{
|
||||
if (!source.empty())
|
||||
ircdproto->SendNumeric(Config.ServerName, 351, source, "Anope-%s %s :%s -(%s) -- %s", Anope::Version().c_str(), Config.ServerName.c_str(), ircd->name, Config.EncModuleList.begin()->c_str(), Anope::Build().c_str());
|
||||
ircdproto->SendNumeric(Config->ServerName, 351, source, "Anope-%s %s :%s -(%s) -- %s", Anope::Version().c_str(), Config->ServerName.c_str(), ircd->name, Config->EncModuleList.begin()->c_str(), Anope::Build().c_str());
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
@@ -283,11 +283,11 @@ int m_whois(const Anope::string &source, const Anope::string &who)
|
||||
BotInfo *bi = findbot(who);
|
||||
if (bi)
|
||||
{
|
||||
ircdproto->SendNumeric(Config.ServerName, 311, source, "%s %s %s * :%s", bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str());
|
||||
ircdproto->SendNumeric(Config.ServerName, 307, source, "%s :is a registered nick", bi->nick.c_str());
|
||||
ircdproto->SendNumeric(Config.ServerName, 312, source, "%s %s :%s", bi->nick.c_str(), Config.ServerName.c_str(), Config.ServerDesc.c_str());
|
||||
ircdproto->SendNumeric(Config.ServerName, 317, source, "%s %ld %ld :seconds idle, signon time", bi->nick.c_str(), time(NULL) - bi->lastmsg, start_time);
|
||||
ircdproto->SendNumeric(Config.ServerName, 318, source, "%s :End of /WHOIS list.", who.c_str());
|
||||
ircdproto->SendNumeric(Config->ServerName, 311, source, "%s %s %s * :%s", bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str());
|
||||
ircdproto->SendNumeric(Config->ServerName, 307, source, "%s :is a registered nick", bi->nick.c_str());
|
||||
ircdproto->SendNumeric(Config->ServerName, 312, source, "%s %s :%s", bi->nick.c_str(), Config->ServerName.c_str(), Config->ServerDesc.c_str());
|
||||
ircdproto->SendNumeric(Config->ServerName, 317, source, "%s %ld %ld :seconds idle, signon time", bi->nick.c_str(), time(NULL) - bi->lastmsg, start_time);
|
||||
ircdproto->SendNumeric(Config->ServerName, 318, source, "%s :End of /WHOIS list.", who.c_str());
|
||||
}
|
||||
else if (!ircd->svshold && (na = findnick(who)) && na->HasFlag(NS_HELD))
|
||||
{
|
||||
@@ -295,12 +295,12 @@ int m_whois(const Anope::string &source, const Anope::string &who)
|
||||
* We can't just say it doesn't exist here, even tho it does for
|
||||
* other servers :) -GD
|
||||
*/
|
||||
ircdproto->SendNumeric(Config.ServerName, 311, source, "%s %s %s * :Services Enforcer", na->nick.c_str(), Config.NSEnforcerUser.c_str(), Config.NSEnforcerHost.c_str());
|
||||
ircdproto->SendNumeric(Config.ServerName, 312, source, "%s %s :%s", na->nick.c_str(), Config.ServerName.c_str(), Config.ServerDesc.c_str());
|
||||
ircdproto->SendNumeric(Config.ServerName, 318, source, "%s :End of /WHOIS list.", who.c_str());
|
||||
ircdproto->SendNumeric(Config->ServerName, 311, source, "%s %s %s * :Services Enforcer", na->nick.c_str(), Config->NSEnforcerUser.c_str(), Config->NSEnforcerHost.c_str());
|
||||
ircdproto->SendNumeric(Config->ServerName, 312, source, "%s %s :%s", na->nick.c_str(), Config->ServerName.c_str(), Config->ServerDesc.c_str());
|
||||
ircdproto->SendNumeric(Config->ServerName, 318, source, "%s :End of /WHOIS list.", who.c_str());
|
||||
}
|
||||
else
|
||||
ircdproto->SendNumeric(Config.ServerName, 401, source, "%s :No such service.", who.c_str());
|
||||
ircdproto->SendNumeric(Config->ServerName, 401, source, "%s :No such service.", who.c_str());
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
+13
-13
@@ -411,7 +411,7 @@ bool doValidHost(const Anope::string &host, int type)
|
||||
|
||||
size_t len = host.length();
|
||||
|
||||
if (len > Config.HostLen)
|
||||
if (len > Config->HostLen)
|
||||
return false;
|
||||
|
||||
size_t idx, sec_len = 0, dots = 1;
|
||||
@@ -625,26 +625,26 @@ bool nickIsServices(const Anope::string &tempnick, bool bot)
|
||||
if (at != Anope::string::npos)
|
||||
{
|
||||
Anope::string servername = nick.substr(at + 1);
|
||||
if (!servername.equals_ci(Config.ServerName))
|
||||
if (!servername.equals_ci(Config->ServerName))
|
||||
return false;
|
||||
nick = nick.substr(0, at);
|
||||
}
|
||||
|
||||
if (!Config.s_NickServ.empty() && nick.equals_ci(Config.s_NickServ))
|
||||
if (!Config->s_NickServ.empty() && nick.equals_ci(Config->s_NickServ))
|
||||
return true;
|
||||
else if (!Config.s_ChanServ.empty() && nick.equals_ci(Config.s_ChanServ))
|
||||
else if (!Config->s_ChanServ.empty() && nick.equals_ci(Config->s_ChanServ))
|
||||
return true;
|
||||
else if (!Config.s_HostServ.empty() && nick.equals_ci(Config.s_HostServ))
|
||||
else if (!Config->s_HostServ.empty() && nick.equals_ci(Config->s_HostServ))
|
||||
return true;
|
||||
else if (!Config.s_MemoServ.empty() && nick.equals_ci(Config.s_MemoServ))
|
||||
else if (!Config->s_MemoServ.empty() && nick.equals_ci(Config->s_MemoServ))
|
||||
return true;
|
||||
else if (!Config.s_BotServ.empty() && nick.equals_ci(Config.s_BotServ))
|
||||
else if (!Config->s_BotServ.empty() && nick.equals_ci(Config->s_BotServ))
|
||||
return true;
|
||||
else if (!Config.s_OperServ.empty() && nick.equals_ci(Config.s_OperServ))
|
||||
else if (!Config->s_OperServ.empty() && nick.equals_ci(Config->s_OperServ))
|
||||
return true;
|
||||
else if (!Config.s_GlobalNoticer.empty() && nick.equals_ci(Config.s_GlobalNoticer))
|
||||
else if (!Config->s_GlobalNoticer.empty() && nick.equals_ci(Config->s_GlobalNoticer))
|
||||
return true;
|
||||
else if (!Config.s_BotServ.empty() && bot)
|
||||
else if (!Config->s_BotServ.empty() && bot)
|
||||
{
|
||||
for (botinfo_map::const_iterator it = BotListByNick.begin(), it_end = BotListByNick.end(); it != it_end; ++it)
|
||||
{
|
||||
@@ -743,9 +743,9 @@ void rand_init()
|
||||
*/
|
||||
void add_entropy_userkeys()
|
||||
{
|
||||
arc4_addrandom(&Config.UserKey1, sizeof(Config.UserKey1));
|
||||
arc4_addrandom(&Config.UserKey2, sizeof(Config.UserKey2));
|
||||
arc4_addrandom(&Config.UserKey3, sizeof(Config.UserKey3));
|
||||
arc4_addrandom(&Config->UserKey1, sizeof(Config->UserKey1));
|
||||
arc4_addrandom(&Config->UserKey2, sizeof(Config->UserKey2));
|
||||
arc4_addrandom(&Config->UserKey3, sizeof(Config->UserKey3));
|
||||
/* UserKey3 is also used in mysql_rand() */
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -38,7 +38,7 @@ std::list<ChannelModeStatus *> BotModes;
|
||||
|
||||
/** Parse the mode string from the config file and set the default mlocked modes
|
||||
*/
|
||||
void SetDefaultMLock()
|
||||
void SetDefaultMLock(ServerConfig *config)
|
||||
{
|
||||
DefMLockOn.ClearFlags();
|
||||
DefMLockOff.ClearFlags();
|
||||
@@ -46,7 +46,7 @@ void SetDefaultMLock()
|
||||
Flags<ChannelModeName> *ptr = NULL;
|
||||
|
||||
Anope::string modes, param;
|
||||
spacesepstream sep(Config.MLock);
|
||||
spacesepstream sep(config->MLock);
|
||||
sep.GetToken(modes);
|
||||
|
||||
for (unsigned i = 0, end_mode = modes.length(); i < end_mode; ++i)
|
||||
@@ -82,9 +82,9 @@ void SetDefaultMLock()
|
||||
|
||||
/* Set Bot Modes */
|
||||
BotModes.clear();
|
||||
for (unsigned i = 0, end_mode = Config.BotModes.length(); i < end_mode; ++i)
|
||||
for (unsigned i = 0, end_mode = config->BotModes.length(); i < end_mode; ++i)
|
||||
{
|
||||
ChannelMode *cm = ModeManager::FindChannelModeByChar(Config.BotModes[i]);
|
||||
ChannelMode *cm = ModeManager::FindChannelModeByChar(config->BotModes[i]);
|
||||
|
||||
if (cm && cm->Type == MODE_STATUS && std::find(BotModes.begin(), BotModes.end(), cm) == BotModes.end())
|
||||
BotModes.push_back(debug_cast<ChannelModeStatus *>(cm));
|
||||
@@ -266,7 +266,7 @@ void ChannelModeBan::AddMask(Channel *chan, const Anope::string &mask)
|
||||
|
||||
/* Check whether it matches a botserv bot after adding internally
|
||||
* and parsing it through cidr support. ~ Viper */
|
||||
if (!Config.s_BotServ.empty() && Config.BSSmartJoin && chan->ci && chan->ci->bi && chan->FindUser(chan->ci->bi))
|
||||
if (!Config->s_BotServ.empty() && Config->BSSmartJoin && chan->ci && chan->ci->bi && chan->FindUser(chan->ci->bi))
|
||||
{
|
||||
BotInfo *bi = chan->ci->bi;
|
||||
|
||||
@@ -634,7 +634,7 @@ bool ModeManager::AddChannelMode(ChannelMode *cm)
|
||||
ModeManager::Modes.push_back(cm);
|
||||
|
||||
/* Apply this mode to the new default mlock if its used */
|
||||
SetDefaultMLock();
|
||||
SetDefaultMLock(Config);
|
||||
|
||||
FOREACH_MOD(I_OnChannelModeAdd, OnChannelModeAdd(cm));
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ int ModuleManager::LoadModule(const Anope::string &modname, User *u)
|
||||
if (u)
|
||||
{
|
||||
ircdproto->SendGlobops(OperServ, "%s loaded module %s", u->nick.c_str(), modname.c_str());
|
||||
notice_lang(Config.s_OperServ, u, OPER_MODULE_LOADED, modname.c_str());
|
||||
notice_lang(Config->s_OperServ, u, OPER_MODULE_LOADED, modname.c_str());
|
||||
|
||||
/* If a user is loading this module, then the core databases have already been loaded
|
||||
* so trigger the event manually
|
||||
@@ -221,21 +221,21 @@ int ModuleManager::UnloadModule(Module *m, User *u)
|
||||
if (!m || !m->handle)
|
||||
{
|
||||
if (u)
|
||||
notice_lang(Config.s_OperServ, u, OPER_MODULE_REMOVE_FAIL, m->name.c_str());
|
||||
notice_lang(Config->s_OperServ, u, OPER_MODULE_REMOVE_FAIL, m->name.c_str());
|
||||
return MOD_ERR_PARAMS;
|
||||
}
|
||||
|
||||
if (m->GetPermanent() || m->type == PROTOCOL || m->type == ENCRYPTION || m->type == DATABASE)
|
||||
{
|
||||
if (u)
|
||||
notice_lang(Config.s_OperServ, u, OPER_MODULE_NO_UNLOAD);
|
||||
notice_lang(Config->s_OperServ, u, OPER_MODULE_NO_UNLOAD);
|
||||
return MOD_ERR_NOUNLOAD;
|
||||
}
|
||||
|
||||
if (u)
|
||||
{
|
||||
ircdproto->SendGlobops(OperServ, "%s unloaded module %s", u->nick.c_str(), m->name.c_str());
|
||||
notice_lang(Config.s_OperServ, u, OPER_MODULE_UNLOADED, m->name.c_str());
|
||||
notice_lang(Config->s_OperServ, u, OPER_MODULE_UNLOADED, m->name.c_str());
|
||||
}
|
||||
|
||||
FOREACH_MOD(I_OnModuleUnload, OnModuleUnload(u, m));
|
||||
|
||||
+6
-6
@@ -46,19 +46,19 @@ int protocol_module_init()
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
Alog() << "Loading IRCD Protocol Module: [" << Config.IRCDModule << "]";
|
||||
ret = ModuleManager::LoadModule(Config.IRCDModule, NULL);
|
||||
Alog() << "Loading IRCD Protocol Module: [" << Config->IRCDModule << "]";
|
||||
ret = ModuleManager::LoadModule(Config->IRCDModule, NULL);
|
||||
|
||||
if (ret == MOD_ERR_OK)
|
||||
{
|
||||
FindModule(Config.IRCDModule)->SetType(PROTOCOL);
|
||||
FindModule(Config->IRCDModule)->SetType(PROTOCOL);
|
||||
/* This is really NOT the correct place to do config checks, but
|
||||
* as we only have the ircd struct filled here, we have to over
|
||||
* here. -GD
|
||||
*/
|
||||
if (ircd->ts6)
|
||||
{
|
||||
if (Config.Numeric.empty())
|
||||
if (Config->Numeric.empty())
|
||||
{
|
||||
Alog() << "This IRCd protocol requires a server id to be set in Anope's configuration.";
|
||||
ret = -1;
|
||||
@@ -256,7 +256,7 @@ bool moduleMinVersion(int major, int minor, int patch, int build)
|
||||
void Module::NoticeLang(const Anope::string &source, const User *u, int number, ...) const
|
||||
{
|
||||
/* Find the users lang, and use it if we can */
|
||||
int mlang = Config.NSDefLanguage;
|
||||
int mlang = Config->NSDefLanguage;
|
||||
if (u && u->Account())
|
||||
mlang = u->Account()->language;
|
||||
|
||||
@@ -289,7 +289,7 @@ const char *Module::GetLangString(User *u, int number)
|
||||
{
|
||||
|
||||
/* Find the users lang, and use it if we can */
|
||||
int mlang = Config.NSDefLanguage;
|
||||
int mlang = Config->NSDefLanguage;
|
||||
if (u && u->Account())
|
||||
mlang = u->Account()->language;
|
||||
|
||||
|
||||
+4
-4
@@ -39,14 +39,14 @@ NickAlias::NickAlias(const Anope::string &nickname, NickCore *nickcore)
|
||||
|
||||
NickAliasList[this->nick] = this;
|
||||
|
||||
for (std::list<std::pair<Anope::string, Anope::string> >::iterator it = Config.Opers.begin(), it_end = Config.Opers.end(); it != it_end; ++it)
|
||||
for (std::list<std::pair<Anope::string, Anope::string> >::iterator it = Config->Opers.begin(), it_end = Config->Opers.end(); it != it_end; ++it)
|
||||
{
|
||||
if (this->nc->ot)
|
||||
break;
|
||||
if (!this->nick.equals_ci(it->first))
|
||||
continue;
|
||||
|
||||
for (std::list<OperType *>::iterator tit = Config.MyOperTypes.begin(), tit_end = Config.MyOperTypes.end(); tit != tit_end; ++tit)
|
||||
for (std::list<OperType *>::iterator tit = Config->MyOperTypes.begin(), tit_end = Config->MyOperTypes.end(); tit != tit_end; ++tit)
|
||||
{
|
||||
OperType *ot = *tit;
|
||||
|
||||
@@ -135,8 +135,8 @@ void NickAlias::OnCancel(User *)
|
||||
{
|
||||
Anope::string uid = ircd->ts6 ? ts6_uid_retrieve() : "";
|
||||
|
||||
ircdproto->SendClientIntroduction(this->nick, Config.NSEnforcerUser, Config.NSEnforcerHost, "Services Enforcer", "+", uid);
|
||||
new NickServRelease(this->nick, uid, Config.NSReleaseTimeout);
|
||||
ircdproto->SendClientIntroduction(this->nick, Config->NSEnforcerUser, Config->NSEnforcerHost, "Services Enforcer", "+", uid);
|
||||
new NickServRelease(this->nick, uid, Config->NSReleaseTimeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -17,7 +17,7 @@ NickCore::NickCore(const Anope::string &coredisplay)
|
||||
|
||||
/* Set default nick core flags */
|
||||
for (size_t t = NI_BEGIN + 1; t != NI_END; ++t)
|
||||
if (Config.NSDefFlags.HasFlag(static_cast<NickCoreFlag>(t)))
|
||||
if (Config->NSDefFlags.HasFlag(static_cast<NickCoreFlag>(t)))
|
||||
this->SetFlag(static_cast<NickCoreFlag>(t));
|
||||
|
||||
NickCoreList[this->display] = this;
|
||||
@@ -50,7 +50,7 @@ NickCore::~NickCore()
|
||||
NickCoreList.erase(this->display);
|
||||
|
||||
/* Log .. */
|
||||
Alog() << Config.s_NickServ << ": deleting nickname group " << this->display;
|
||||
Alog() << Config->s_NickServ << ": deleting nickname group " << this->display;
|
||||
|
||||
/* Clear access before deleting display name, we want to be able to use the display name in the clear access event */
|
||||
this->ClearAccess();
|
||||
|
||||
+12
-12
@@ -76,7 +76,7 @@ void NickServRelease::Tick(time_t ctime)
|
||||
/* *INDENT-OFF* */
|
||||
void moduleAddNickServCmds()
|
||||
{
|
||||
ModuleManager::LoadModuleList(Config.NickServCoreModules);
|
||||
ModuleManager::LoadModuleList(Config->NickServCoreModules);
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
/*************************************************************************/
|
||||
@@ -166,7 +166,7 @@ int validate_user(User *u)
|
||||
NickRequest *nr = findrequestnick(u->nick);
|
||||
if (nr)
|
||||
{
|
||||
notice_lang(Config.s_NickServ, u, NICK_IS_PREREG);
|
||||
notice_lang(Config->s_NickServ, u, NICK_IS_PREREG);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -176,14 +176,14 @@ int validate_user(User *u)
|
||||
|
||||
if (na->HasFlag(NS_FORBIDDEN))
|
||||
{
|
||||
notice_lang(Config.s_NickServ, u, NICK_MAY_NOT_BE_USED);
|
||||
notice_lang(Config->s_NickServ, u, NICK_MAY_NOT_BE_USED);
|
||||
u->Collide(na);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (na->nc->HasFlag(NI_SUSPENDED))
|
||||
{
|
||||
notice_lang(Config.s_NickServ, u, NICK_X_SUSPENDED, u->nick.c_str());
|
||||
notice_lang(Config->s_NickServ, u, NICK_X_SUSPENDED, u->nick.c_str());
|
||||
u->Collide(na);
|
||||
return 0;
|
||||
}
|
||||
@@ -203,26 +203,26 @@ int validate_user(User *u)
|
||||
if (u->IsRecognized() || !na->nc->HasFlag(NI_KILL_IMMED))
|
||||
{
|
||||
if (na->nc->HasFlag(NI_SECURE))
|
||||
notice_lang(Config.s_NickServ, u, NICK_IS_SECURE, Config.s_NickServ.c_str());
|
||||
notice_lang(Config->s_NickServ, u, NICK_IS_SECURE, Config->s_NickServ.c_str());
|
||||
else
|
||||
notice_lang(Config.s_NickServ, u, NICK_IS_REGISTERED, Config.s_NickServ.c_str());
|
||||
notice_lang(Config->s_NickServ, u, NICK_IS_REGISTERED, Config->s_NickServ.c_str());
|
||||
}
|
||||
|
||||
if (na->nc->HasFlag(NI_KILLPROTECT) && !u->IsRecognized())
|
||||
{
|
||||
if (na->nc->HasFlag(NI_KILL_IMMED))
|
||||
{
|
||||
notice_lang(Config.s_NickServ, u, FORCENICKCHANGE_NOW);
|
||||
notice_lang(Config->s_NickServ, u, FORCENICKCHANGE_NOW);
|
||||
u->Collide(na);
|
||||
}
|
||||
else if (na->nc->HasFlag(NI_KILL_QUICK))
|
||||
{
|
||||
notice_lang(Config.s_NickServ, u, FORCENICKCHANGE_IN_20_SECONDS);
|
||||
notice_lang(Config->s_NickServ, u, FORCENICKCHANGE_IN_20_SECONDS);
|
||||
new NickServCollide(na->nick, 20);
|
||||
}
|
||||
else
|
||||
{
|
||||
notice_lang(Config.s_NickServ, u, FORCENICKCHANGE_IN_1_MINUTE);
|
||||
notice_lang(Config->s_NickServ, u, FORCENICKCHANGE_IN_1_MINUTE);
|
||||
new NickServCollide(na->nick, 60);
|
||||
}
|
||||
}
|
||||
@@ -253,7 +253,7 @@ void expire_nicks()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Config.NSExpire && now - na->last_seen >= Config.NSExpire && !na->HasFlag(NS_FORBIDDEN) && !na->HasFlag(NS_NO_EXPIRE) && !na->nc->HasFlag(NI_SUSPENDED))
|
||||
if (Config->NSExpire && now - na->last_seen >= Config->NSExpire && !na->HasFlag(NS_FORBIDDEN) && !na->HasFlag(NS_NO_EXPIRE) && !na->nc->HasFlag(NI_SUSPENDED))
|
||||
{
|
||||
EventReturn MOD_RESULT;
|
||||
FOREACH_RESULT(I_OnPreNickExpire, OnPreNickExpire(na));
|
||||
@@ -275,7 +275,7 @@ void expire_requests()
|
||||
NickRequest *nr = it->second;
|
||||
++it;
|
||||
|
||||
if (Config.NSRExpire && now - nr->requested >= Config.NSRExpire)
|
||||
if (Config->NSRExpire && now - nr->requested >= Config->NSRExpire)
|
||||
{
|
||||
Alog() << "Request for nick " << nr->nick << " expiring";
|
||||
delete nr;
|
||||
@@ -356,7 +356,7 @@ void change_core_display(NickCore *nc, const Anope::string &newdisplay)
|
||||
{
|
||||
/* Log ... */
|
||||
FOREACH_MOD(I_OnChangeCoreDisplay, OnChangeCoreDisplay(nc, newdisplay));
|
||||
Alog() << Config.s_NickServ << ": changing " << nc->display << " nickname group display to " << newdisplay;
|
||||
Alog() << Config->s_NickServ << ": changing " << nc->display << " nickname group display to " << newdisplay;
|
||||
|
||||
/* Remove the core from the list */
|
||||
NickCoreList.erase(nc->display);
|
||||
|
||||
+21
-21
@@ -28,7 +28,7 @@ XLineManager *SGLine, *SZLine, *SQLine, *SNLine;
|
||||
|
||||
void os_init()
|
||||
{
|
||||
ModuleManager::LoadModuleList(Config.OperServCoreModules);
|
||||
ModuleManager::LoadModuleList(Config->OperServCoreModules);
|
||||
|
||||
/* Yes, these are in this order for a reason. Most violent->least violent. */
|
||||
XLineManager::RegisterXLineManager(SGLine = new SGLineManager());
|
||||
@@ -71,8 +71,8 @@ void UnsetDefConParam(ChannelModeName Name)
|
||||
*/
|
||||
bool CheckDefCon(DefconLevel Level)
|
||||
{
|
||||
if (Config.DefConLevel)
|
||||
return DefCon[Config.DefConLevel][Level];
|
||||
if (Config->DefConLevel)
|
||||
return DefCon[Config->DefConLevel][Level];
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ void server_global(const Server *s, const Anope::string &message)
|
||||
{
|
||||
/* Do not send the notice to ourselves our juped servers */
|
||||
if (s != Me && !s->HasFlag(SERVER_JUPED))
|
||||
notice_server(Config.s_GlobalNoticer, s, "%s", message.c_str());
|
||||
notice_server(Config->s_GlobalNoticer, s, "%s", message.c_str());
|
||||
|
||||
if (!s->GetLinks().empty())
|
||||
{
|
||||
@@ -126,7 +126,7 @@ void oper_global(const Anope::string &nick, const char *fmt, ...)
|
||||
vsnprintf(msg, sizeof(msg), fmt, args);
|
||||
va_end(args);
|
||||
|
||||
if (!nick.empty() && !Config.AnonymousGlobal)
|
||||
if (!nick.empty() && !Config->AnonymousGlobal)
|
||||
{
|
||||
Anope::string rmsg = "[" + nick + "] " + msg;
|
||||
server_global(Me->GetLinks().front(), rmsg);
|
||||
@@ -490,7 +490,7 @@ XLine *SGLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_
|
||||
}
|
||||
|
||||
Anope::string realreason = reason;
|
||||
if (u && Config.AddAkiller)
|
||||
if (u && Config->AddAkiller)
|
||||
realreason = "[" + u->nick + "]" + reason;
|
||||
|
||||
XLine *x = new XLine(mask, u ? u->nick : "", expires, realreason);
|
||||
@@ -505,7 +505,7 @@ XLine *SGLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_
|
||||
|
||||
this->AddXLine(x);
|
||||
|
||||
if (Config.AkillOnAdd)
|
||||
if (Config->AkillOnAdd)
|
||||
ircdproto->SendAkill(x);
|
||||
|
||||
return x;
|
||||
@@ -523,7 +523,7 @@ void SGLineManager::OnMatch(User *u, XLine *x)
|
||||
|
||||
void SGLineManager::OnExpire(XLine *x)
|
||||
{
|
||||
if (Config.WallAkillExpire)
|
||||
if (Config->WallAkillExpire)
|
||||
ircdproto->SendGlobops(OperServ, "AKILL on %s has expired", x->Mask.c_str());
|
||||
}
|
||||
|
||||
@@ -564,7 +564,7 @@ XLine *SNLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_
|
||||
|
||||
this->AddXLine(x);
|
||||
|
||||
if (Config.KillonSNline && !ircd->sglineenforce)
|
||||
if (Config->KillonSNline && !ircd->sglineenforce)
|
||||
{
|
||||
Anope::string rreason = "G-Lined: " + reason;
|
||||
|
||||
@@ -574,7 +574,7 @@ XLine *SNLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_
|
||||
++it;
|
||||
|
||||
if (!is_oper(user) && Anope::Match(user->realname, x->Mask))
|
||||
kill_user(Config.ServerName, user->nick, rreason);
|
||||
kill_user(Config->ServerName, user->nick, rreason);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -591,12 +591,12 @@ void SNLineManager::OnMatch(User *u, XLine *x)
|
||||
ircdproto->SendSGLine(x);
|
||||
|
||||
Anope::string reason = "G-Lined: " + x->Reason;
|
||||
kill_user(Config.s_OperServ, u->nick, reason);
|
||||
kill_user(Config->s_OperServ, u->nick, reason);
|
||||
}
|
||||
|
||||
void SNLineManager::OnExpire(XLine *x)
|
||||
{
|
||||
if (Config.WallSNLineExpire)
|
||||
if (Config->WallSNLineExpire)
|
||||
ircdproto->SendGlobops(OperServ, "SNLINE on \2%s\2 has expired", x->Mask.c_str());
|
||||
}
|
||||
|
||||
@@ -605,14 +605,14 @@ XLine *SQLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_
|
||||
if (mask.find_first_not_of("*") == Anope::string::npos)
|
||||
{
|
||||
if (bi && u)
|
||||
notice_lang(Config.s_OperServ, u, USERHOST_MASK_TOO_WIDE, mask.c_str());
|
||||
notice_lang(Config->s_OperServ, u, USERHOST_MASK_TOO_WIDE, mask.c_str());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (mask[0] == '#' && !ircd->chansqline)
|
||||
{
|
||||
if (bi && u)
|
||||
notice_lang(Config.s_OperServ, u, OPER_SQLINE_CHANNELS_UNSUPPORTED);
|
||||
notice_lang(Config->s_OperServ, u, OPER_SQLINE_CHANNELS_UNSUPPORTED);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -644,7 +644,7 @@ XLine *SQLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_
|
||||
|
||||
this->AddXLine(x);
|
||||
|
||||
if (Config.KillonSQline)
|
||||
if (Config->KillonSQline)
|
||||
{
|
||||
Anope::string rreason = "Q-Lined: " + reason;
|
||||
|
||||
@@ -675,7 +675,7 @@ XLine *SQLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_
|
||||
++it;
|
||||
|
||||
if (!is_oper(user) && Anope::Match(user->nick, x->Mask))
|
||||
kill_user(Config.ServerName, user->nick, rreason);
|
||||
kill_user(Config->ServerName, user->nick, rreason);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -695,12 +695,12 @@ void SQLineManager::OnMatch(User *u, XLine *x)
|
||||
ircdproto->SendSQLine(x);
|
||||
|
||||
Anope::string reason = "Q-Lined: " + x->Reason;
|
||||
kill_user(Config.s_OperServ, u->nick, reason);
|
||||
kill_user(Config->s_OperServ, u->nick, reason);
|
||||
}
|
||||
|
||||
void SQLineManager::OnExpire(XLine *x)
|
||||
{
|
||||
if (Config.WallSQLineExpire)
|
||||
if (Config->WallSQLineExpire)
|
||||
ircdproto->SendGlobops(OperServ, "SQLINE on \2%s\2 has expired", x->Mask.c_str());
|
||||
}
|
||||
|
||||
@@ -724,13 +724,13 @@ XLine *SZLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_
|
||||
{
|
||||
if (mask.find('!') != Anope::string::npos || mask.find('@') != Anope::string::npos)
|
||||
{
|
||||
notice_lang(Config.s_OperServ, u, OPER_SZLINE_ONLY_IPS);
|
||||
notice_lang(Config->s_OperServ, u, OPER_SZLINE_ONLY_IPS);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (mask.find_first_not_of("*?") == Anope::string::npos)
|
||||
{
|
||||
notice_lang(Config.s_OperServ, u, USERHOST_MASK_TOO_WIDE, mask.c_str());
|
||||
notice_lang(Config->s_OperServ, u, USERHOST_MASK_TOO_WIDE, mask.c_str());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -779,6 +779,6 @@ void SZLineManager::OnMatch(User *u, XLine *x)
|
||||
|
||||
void SZLineManager::OnExpire(XLine *x)
|
||||
{
|
||||
if (Config.WallSZLineExpire)
|
||||
if (Config->WallSZLineExpire)
|
||||
ircdproto->SendGlobops(OperServ, "SZLINE on \2%s\2 has expired", x->Mask.c_str());
|
||||
}
|
||||
|
||||
+6
-6
@@ -2,7 +2,7 @@
|
||||
|
||||
void IRCDProto::SendMessageInternal(const BotInfo *bi, const Anope::string &dest, const Anope::string &buf)
|
||||
{
|
||||
if (Config.NSDefFlags.HasFlag(NI_MSG))
|
||||
if (Config->NSDefFlags.HasFlag(NI_MSG))
|
||||
SendPrivmsgInternal(bi, dest, buf);
|
||||
else
|
||||
SendNoticeInternal(bi, dest, buf);
|
||||
@@ -39,7 +39,7 @@ void IRCDProto::SendGlobopsInternal(const BotInfo *source, const Anope::string &
|
||||
if (source)
|
||||
send_cmd(ircd->ts6 ? source->GetUID() : source->nick, "GLOBOPS :%s", buf.c_str());
|
||||
else
|
||||
send_cmd(Config.ServerName, "GLOBOPS :%s", buf.c_str());
|
||||
send_cmd(Config->ServerName, "GLOBOPS :%s", buf.c_str());
|
||||
}
|
||||
|
||||
void IRCDProto::SendCTCPInternal(const BotInfo *bi, const Anope::string &dest, const Anope::string &buf)
|
||||
@@ -178,9 +178,9 @@ void IRCDProto::SendQuit(const BotInfo *bi, const char *fmt, ...)
|
||||
void IRCDProto::SendPing(const Anope::string &servname, const Anope::string &who)
|
||||
{
|
||||
if (servname.empty())
|
||||
send_cmd(ircd->ts6 ? TS6SID : Config.ServerName, "PING %s", who.c_str());
|
||||
send_cmd(ircd->ts6 ? TS6SID : Config->ServerName, "PING %s", who.c_str());
|
||||
else
|
||||
send_cmd(ircd->ts6 ? TS6SID : Config.ServerName, "PING %s %s", servname.c_str(), who.c_str());
|
||||
send_cmd(ircd->ts6 ? TS6SID : Config->ServerName, "PING %s %s", servname.c_str(), who.c_str());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -192,9 +192,9 @@ void IRCDProto::SendPing(const Anope::string &servname, const Anope::string &who
|
||||
void IRCDProto::SendPong(const Anope::string &servname, const Anope::string &who)
|
||||
{
|
||||
if (servname.empty())
|
||||
send_cmd(ircd->ts6 ? TS6SID : Config.ServerName, "PONG %s", who.c_str());
|
||||
send_cmd(ircd->ts6 ? TS6SID : Config->ServerName, "PONG %s", who.c_str());
|
||||
else
|
||||
send_cmd(ircd->ts6 ? TS6SID : Config.ServerName, "PONG %s %s", servname.c_str(), who.c_str());
|
||||
send_cmd(ircd->ts6 ? TS6SID : Config->ServerName, "PONG %s %s", servname.c_str(), who.c_str());
|
||||
}
|
||||
|
||||
void IRCDProto::SendInvite(const BotInfo *bi, const Anope::string &chan, const Anope::string &nick)
|
||||
|
||||
+5
-5
@@ -39,16 +39,16 @@ ChannelInfo::ChannelInfo(const Anope::string &chname)
|
||||
size_t t;
|
||||
/* Set default channel flags */
|
||||
for (t = CI_BEGIN + 1; t != CI_END; ++t)
|
||||
if (Config.CSDefFlags.HasFlag(static_cast<ChannelInfoFlag>(t)))
|
||||
if (Config->CSDefFlags.HasFlag(static_cast<ChannelInfoFlag>(t)))
|
||||
this->SetFlag(static_cast<ChannelInfoFlag>(t));
|
||||
|
||||
/* Set default bot flags */
|
||||
for (t = BS_BEGIN + 1; t != BS_END; ++t)
|
||||
if (Config.BSDefFlags.HasFlag(static_cast<BotServFlag>(t)))
|
||||
if (Config->BSDefFlags.HasFlag(static_cast<BotServFlag>(t)))
|
||||
this->botflags.SetFlag(static_cast<BotServFlag>(t));
|
||||
|
||||
this->bantype = Config.CSDefBantype;
|
||||
this->memos.memomax = Config.MSMaxMemos;
|
||||
this->bantype = Config->CSDefBantype;
|
||||
this->memos.memomax = Config->MSMaxMemos;
|
||||
this->last_used = this->time_registered = time(NULL);
|
||||
|
||||
this->ttb = new int16[2 * TTB_SIZE];
|
||||
@@ -586,7 +586,7 @@ bool ChannelInfo::CheckKick(User *user)
|
||||
get_idealban(this, user, mask);
|
||||
else
|
||||
mask = autokick->mask;
|
||||
reason = autokick->reason.empty() ? Config.CSAutokickReason : autokick->reason;
|
||||
reason = autokick->reason.empty() ? Config->CSAutokickReason : autokick->reason;
|
||||
do_kick = true;
|
||||
break;
|
||||
}
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ void notice_server(const Anope::string &source, const Server *s, const char *fmt
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
|
||||
if (Config.NSDefFlags.HasFlag(NI_MSG))
|
||||
if (Config->NSDefFlags.HasFlag(NI_MSG))
|
||||
ircdproto->SendGlobalPrivmsg(findbot(source), s, buf);
|
||||
else
|
||||
ircdproto->SendGlobalNotice(findbot(source), s, buf);
|
||||
|
||||
+4
-4
@@ -75,7 +75,7 @@ Server::Server(Server *uplink, const Anope::string &name, unsigned hops, const A
|
||||
|
||||
/* And some IRCds needs Global joined in the logchan */
|
||||
if (LogChan && ircd->join2msg)
|
||||
Global->Join(Config.LogChannel);
|
||||
Global->Join(Config->LogChannel);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -269,7 +269,7 @@ bool Server::IsSynced() const
|
||||
*/
|
||||
bool Server::IsULined() const
|
||||
{
|
||||
for (std::list<Anope::string>::const_iterator it = Config.Ulines.begin(), it_end = Config.Ulines.end(); it != it_end; ++it)
|
||||
for (std::list<Anope::string>::const_iterator it = Config->Ulines.begin(), it_end = Config->Ulines.end(); it != it_end; ++it)
|
||||
if (it->equals_ci(this->GetName()))
|
||||
return true;
|
||||
return false;
|
||||
@@ -341,8 +341,8 @@ void do_server(const Anope::string &source, const Anope::string &servername, uns
|
||||
Server *newserver = new Server(s, servername, hops, descript, numeric);
|
||||
|
||||
/* Announce services being online. */
|
||||
if (Config.GlobalOnCycle && !Config.GlobalOnCycleUP.empty())
|
||||
notice_server(Config.s_GlobalNoticer, newserver, "%s", Config.GlobalOnCycleUP.c_str());
|
||||
if (Config->GlobalOnCycle && !Config->GlobalOnCycleUP.empty())
|
||||
notice_server(Config->s_GlobalNoticer, newserver, "%s", Config->GlobalOnCycleUP.c_str());
|
||||
|
||||
/* Let modules know about the connection */
|
||||
FOREACH_MOD(I_OnNewServer, OnNewServer(newserver));
|
||||
|
||||
+13
-13
@@ -117,14 +117,14 @@ int add_session(const Anope::string &nick, const Anope::string &host, const Anop
|
||||
{
|
||||
exception = find_hostip_exception(host, hostip);
|
||||
|
||||
sessionlimit = exception ? exception->limit : Config.DefSessionLimit;
|
||||
sessionlimit = exception ? exception->limit : Config->DefSessionLimit;
|
||||
|
||||
if (sessionlimit && session->count >= sessionlimit)
|
||||
{
|
||||
if (!Config.SessionLimitExceeded.empty())
|
||||
ircdproto->SendMessage(OperServ, nick, Config.SessionLimitExceeded.c_str(), host.c_str());
|
||||
if (!Config.SessionLimitDetailsLoc.empty())
|
||||
ircdproto->SendMessage(OperServ, nick, "%s", Config.SessionLimitDetailsLoc.c_str());
|
||||
if (!Config->SessionLimitExceeded.empty())
|
||||
ircdproto->SendMessage(OperServ, nick, Config->SessionLimitExceeded.c_str(), host.c_str());
|
||||
if (!Config->SessionLimitDetailsLoc.empty())
|
||||
ircdproto->SendMessage(OperServ, nick, "%s", Config->SessionLimitDetailsLoc.c_str());
|
||||
|
||||
/* Previously on IRCds that send a QUIT (InspIRCD) when a user is killed, the session for a host was
|
||||
* decremented in do_quit, which caused problems and fixed here
|
||||
@@ -134,15 +134,15 @@ int add_session(const Anope::string &nick, const Anope::string &host, const Anop
|
||||
* decremented in do_kill or in do_quit - Adam
|
||||
*/
|
||||
++session->count;
|
||||
kill_user(Config.s_OperServ, nick, "Session limit exceeded");
|
||||
kill_user(Config->s_OperServ, nick, "Session limit exceeded");
|
||||
|
||||
++session->hits;
|
||||
if (Config.MaxSessionKill && session->hits >= Config.MaxSessionKill)
|
||||
if (Config->MaxSessionKill && session->hits >= Config->MaxSessionKill)
|
||||
{
|
||||
Anope::string akillmask = "*@" + host;
|
||||
XLine *x = new XLine(akillmask, Config.s_OperServ, time(NULL) + Config.SessionAutoKillExpiry, "Session limit exceeded");
|
||||
XLine *x = new XLine(akillmask, Config->s_OperServ, time(NULL) + Config->SessionAutoKillExpiry, "Session limit exceeded");
|
||||
if (x)
|
||||
x->By = Config.s_OperServ;
|
||||
x->By = Config->s_OperServ;
|
||||
ircdproto->SendGlobops(OperServ, "Added a temporary AKILL for \2%s\2 due to excessive connections", akillmask.c_str());
|
||||
}
|
||||
return 0;
|
||||
@@ -166,7 +166,7 @@ int add_session(const Anope::string &nick, const Anope::string &host, const Anop
|
||||
|
||||
void del_session(const Anope::string &host)
|
||||
{
|
||||
if (!Config.LimitSessions)
|
||||
if (!Config->LimitSessions)
|
||||
{
|
||||
Alog(LOG_DEBUG) << "del_session called when LimitSessions is disabled";
|
||||
return;
|
||||
@@ -222,7 +222,7 @@ void expire_exceptions()
|
||||
|
||||
if (!e->expires || e->expires > now)
|
||||
continue;
|
||||
if (Config.WallExceptionExpire)
|
||||
if (Config->WallExceptionExpire)
|
||||
ircdproto->SendGlobops(OperServ, "Session limit exception for %s has expired.", e->mask.c_str());
|
||||
delete e;
|
||||
exceptions.erase(curr_it);
|
||||
@@ -272,13 +272,13 @@ int exception_add(User *u, const Anope::string &mask, int limit, const Anope::st
|
||||
{
|
||||
e->limit = limit;
|
||||
if (u)
|
||||
notice_lang(Config.s_OperServ, u, OPER_EXCEPTION_CHANGED, mask.c_str(), e->limit);
|
||||
notice_lang(Config->s_OperServ, u, OPER_EXCEPTION_CHANGED, mask.c_str(), e->limit);
|
||||
return -2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (u)
|
||||
notice_lang(Config.s_OperServ, u, OPER_EXCEPTION_EXISTS, mask.c_str());
|
||||
notice_lang(Config->s_OperServ, u, OPER_EXCEPTION_EXISTS, mask.c_str());
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
+12
-12
@@ -54,7 +54,7 @@ User::User(const Anope::string &snick, const Anope::string &suid)
|
||||
{
|
||||
maxusercnt = usercnt;
|
||||
maxusertime = time(NULL);
|
||||
if (Config.LogMaxUsers)
|
||||
if (Config->LogMaxUsers)
|
||||
Alog() << "user: New maximum user count: "<< maxusercnt;
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ User::~User()
|
||||
|
||||
this->Logout();
|
||||
|
||||
if (Config.LogUsers)
|
||||
if (Config->LogUsers)
|
||||
{
|
||||
Anope::string srealname = normalizeBuffer(this->realname);
|
||||
|
||||
@@ -207,7 +207,7 @@ User::~User()
|
||||
while (!this->chans.empty())
|
||||
this->chans.front()->chan->DeleteUser(this);
|
||||
|
||||
if (Config.LimitSessions && !this->server->IsULined())
|
||||
if (Config->LimitSessions && !this->server->IsULined())
|
||||
del_session(this->host);
|
||||
|
||||
UserListByNick.erase(this->nick);
|
||||
@@ -244,7 +244,7 @@ void User::SendMessage(const Anope::string &source, const Anope::string &msg) co
|
||||
* - The user is not registered and NSDefMsg is enabled
|
||||
* - The user is registered and has set /ns set msg on
|
||||
*/
|
||||
if (Config.UsePrivmsg && ((!this->nc && Config.NSDefFlags.HasFlag(NI_MSG)) || (this->nc && this->nc->HasFlag(NI_MSG))))
|
||||
if (Config->UsePrivmsg && ((!this->nc && Config->NSDefFlags.HasFlag(NI_MSG)) || (this->nc && this->nc->HasFlag(NI_MSG))))
|
||||
ircdproto->SendPrivmsg(findbot(source), this->nick, "%s", msg.c_str());
|
||||
else
|
||||
ircdproto->SendNotice(findbot(source), this->nick, "%s", msg.c_str());
|
||||
@@ -317,14 +317,14 @@ void User::Collide(NickAlias *na)
|
||||
|
||||
do
|
||||
{
|
||||
guestnick = Config.NSGuestNickPrefix + stringify(getrandom16());
|
||||
guestnick = Config->NSGuestNickPrefix + stringify(getrandom16());
|
||||
} while (finduser(guestnick));
|
||||
|
||||
notice_lang(Config.s_NickServ, this, FORCENICKCHANGE_CHANGING, guestnick.c_str());
|
||||
notice_lang(Config->s_NickServ, this, FORCENICKCHANGE_CHANGING, guestnick.c_str());
|
||||
ircdproto->SendForceNickChange(this, guestnick, time(NULL));
|
||||
}
|
||||
else
|
||||
kill_user(Config.s_NickServ, this->nick, "Services nickname-enforcer kill");
|
||||
kill_user(Config->s_NickServ, this->nick, "Services nickname-enforcer kill");
|
||||
}
|
||||
|
||||
/** Check if the user should become identified because
|
||||
@@ -726,7 +726,7 @@ User *do_nick(const Anope::string &source, const Anope::string &nick, const Anop
|
||||
|
||||
Server *serv = Server::Find(server);
|
||||
|
||||
if (Config.LogUsers)
|
||||
if (Config->LogUsers)
|
||||
{
|
||||
/**
|
||||
* Ugly swap routine for Flop's bug :) XXX
|
||||
@@ -770,7 +770,7 @@ User *do_nick(const Anope::string &source, const Anope::string &nick, const Anop
|
||||
if (MOD_RESULT == EVENT_STOP)
|
||||
return finduser(nick);
|
||||
|
||||
if (Config.LimitSessions && !serv->IsULined())
|
||||
if (Config->LimitSessions && !serv->IsULined())
|
||||
add_session(nick, host, ipbuf);
|
||||
|
||||
XLineManager::CheckAll(user);
|
||||
@@ -794,7 +794,7 @@ User *do_nick(const Anope::string &source, const Anope::string &nick, const Anop
|
||||
user->isSuperAdmin = 0; /* Dont let people nick change and stay SuperAdmins */
|
||||
Alog(LOG_DEBUG) << source << " changes nick to " << nick;
|
||||
|
||||
if (Config.LogUsers)
|
||||
if (Config->LogUsers)
|
||||
{
|
||||
Anope::string logrealname = normalizeBuffer(user->realname);
|
||||
Alog() << "LOGUSERS: " << user->nick << " (" << user->GetIdent() << "@" << user->host << (ircd->vhost ? " => " : "") << (ircd->vhost ? user->GetDisplayedHost() : "") << ") (" << logrealname << ") changed nick to "
|
||||
@@ -837,7 +837,7 @@ User *do_nick(const Anope::string &source, const Anope::string &nick, const Anop
|
||||
user->UpdateHost();
|
||||
do_on_id(user);
|
||||
ircdproto->SetAutoIdentificationToken(user);
|
||||
Alog() << Config.s_NickServ << ": " << user->GetMask() << " automatically identified for group " << user->Account()->display;
|
||||
Alog() << Config->s_NickServ << ": " << user->GetMask() << " automatically identified for group " << user->Account()->display;
|
||||
}
|
||||
|
||||
if (ircd->sqline)
|
||||
@@ -1084,7 +1084,7 @@ void UserSetInternalModes(User *user, int ac, const char **av)
|
||||
if (add)
|
||||
{
|
||||
++opcnt;
|
||||
if (Config.WallOper)
|
||||
if (Config->WallOper)
|
||||
ircdproto->SendGlobops(OperServ, "\2%s\2 is now an IRC operator.", user->nick.c_str());
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user