diff options
author | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-15 15:22:20 +0000 |
---|---|---|
committer | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-15 15:22:20 +0000 |
commit | 83243793468c7af887404ca30c34146436682610 (patch) | |
tree | 11f6fb7ffd31bd3b2b6aab1a817d907db017f452 /src/init.c | |
parent | 855847f428412e85087384df73096d9056526937 (diff) |
Can now correctly tie users to opertypes.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2063 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/init.c')
-rw-r--r-- | src/init.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/init.c b/src/init.c index f8d664548..a70f883ee 100644 --- a/src/init.c +++ b/src/init.c @@ -547,6 +547,38 @@ int init_secondary(int ac, char **av) } alog("Databases loaded"); + // XXX: this is duplicated in type loading. + for (std::list<std::pair<std::string, std::string> >::iterator it = svsopers_in_config.begin(); it != svsopers_in_config.end(); it++) + { + std::string nick = it->first; + std::string type = it->second; + + NickAlias *na = findnick(nick); + if (!na) + { + // Nonexistant nick + alog("Oper nick %s is not registered", nick.c_str()); + continue; + } + + if (!na->nc) + { + // Nick with no core (wtf?) + abort(); + } + + for (std::list<OperType *>::iterator tit = MyOperTypes.begin(); tit != MyOperTypes.end(); tit++) + { + OperType *ot = *tit; + if (ot->GetName() == type) + { + alog("Tied oper %s to type %s", na->nc->display, type.c_str()); + na->nc->ot = ot; + } + } + } + // END DUPLICATION + /* this is only used on the first run of Anope. */ BotInfo *bi = findbot("NickServ"); |