diff options
| author | 2005-12-13 16:11:08 +0000 | |
|---|---|---|
| committer | 2005-12-13 16:11:08 +0000 | |
| commit | 8c00f38e5b8efc96504b36ddbdadc12e007a9a13 (patch) | |
| tree | 47a06b96403cfb06b65fcbcd6961f3684ea6c835 /src/inspircd.cpp | |
| parent | Removed some logging that can cause excessively huge logs when select() is be... (diff) | |
Made MAXCHANS growable for opers/ulines (growing of list not implemented yet)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2367 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
| -rw-r--r-- | src/inspircd.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 744a5ece9..3a7695fd2 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -716,7 +716,7 @@ chanrec* add_channel(userrec *user, const char* cn, const char* key, bool overri log(DEBUG,"Passed channel checks"); - for (int index =0; index != MAXCHANS; index++) + for (int index =0; index < user->chans.size(); index++) { log(DEBUG,"Check location %d",index); if (user->chans[index].channel == NULL) @@ -751,6 +751,9 @@ chanrec* add_channel(userrec *user, const char* cn, const char* key, bool overri return Ptr; } } + /* XXX: If the user is an oper here, we can just extend their user->chans vector by one + * and put the channel in here. Otherwise, nope, youre boned. + */ log(DEBUG,"add_channel: user channel max exceeded: %s %s",user->nick,cname); WriteServ(user->fd,"405 %s %s :You are on too many channels",user->nick, cname); return NULL; @@ -784,7 +787,7 @@ chanrec* del_channel(userrec *user, const char* cname, const char* reason, bool FOREACH_MOD OnUserPart(user,Ptr); log(DEBUG,"del_channel: removing: %s %s",user->nick,Ptr->name); - for (int i =0; i != MAXCHANS; i++) + for (int i =0; i < user->chans.size(); i++) { /* zap it from the channel list of the user */ if (user->chans[i].channel == Ptr) @@ -879,7 +882,7 @@ void kick_channel(userrec *src,userrec *user, chanrec *Ptr, char* reason) FOREACH_MOD OnUserKick(src,user,Ptr,reason); - for (int i =0; i != MAXCHANS; i++) + for (int i =0; i < user->chans.size(); i++) { /* zap it from the channel list of the user */ if (user->chans[i].channel) @@ -1443,11 +1446,11 @@ void AddClient(int socket, char* host, int port, bool iscached, char* ip) clientlist[tempnick]->sendqmax = class_sqmax; clientlist[tempnick]->recvqmax = class_rqmax; + ucrec a; + a.channel = NULL; + a.uc_modes = 0; for (int i = 0; i < MAXCHANS; i++) - { - clientlist[tempnick]->chans[i].channel = NULL; - clientlist[tempnick]->chans[i].uc_modes = 0; - } + clientlist[tempnick]->chans.push_back(a); if (clientlist.size() > SoftLimit) { |
