diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-02-19 19:57:41 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-02-19 19:57:41 +0000 |
commit | c1f88cfa9c653c0df9574edb6995a7385543be83 (patch) | |
tree | f7a63f36b05e72de2a76913b93e61d990eebfd84 /src | |
parent | 5d03b5379f474a70f40f165707dde93161fb3d59 (diff) |
Addition of feature request outlined in bug #195, suggested by Bricker
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6602 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/channels.cpp | 12 | ||||
-rw-r--r-- | src/configreader.cpp | 4 | ||||
-rw-r--r-- | src/inspircd.cpp | 2 |
3 files changed, 11 insertions, 7 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 5383f4aba..366169dd6 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -296,22 +296,22 @@ chanrec* chanrec::JoinUser(InspIRCd* Instance, userrec *user, const char* cn, bo } /* NOTE: If the user is an oper here, we can extend their user->chans by up to - * OPERMAXCHANS. For remote users which are not bound by the channel limits, - * we can extend infinitely. Otherwise, nope, youre restricted to MAXCHANS. + * OperMaxchans. For remote users which are not bound by the channel limits, + * we can extend infinitely. Otherwise, nope, youre restricted to MaxChans. */ - if (!IS_LOCAL(user) || override == true) /* was a check on fd < 0 */ + if (!IS_LOCAL(user) || override == true) { return chanrec::ForceChan(Instance, Ptr, user, privs); } else if (*user->oper) { - /* Oper allows extension up to the OPERMAXCHANS value */ - if (user->chans.size() < OPERMAXCHANS) + /* Oper allows extension up to the OperMaxchans value */ + if (user->chans.size() < Instance->Config->OperMaxChans) { return chanrec::ForceChan(Instance, Ptr, user, privs); } } - else if (user->chans.size() < MAXCHANS) + else if (user->chans.size() < Instance->Config->MaxChans) { return chanrec::ForceChan(Instance, Ptr, user, privs); } diff --git a/src/configreader.cpp b/src/configreader.cpp index 90719afa7..9d920dc8c 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -39,6 +39,8 @@ ServerConfig::ServerConfig(InspIRCd* Instance) : ServerInstance(Instance) MaxConn = SOMAXCONN; MaxWhoResults = 100; debugging = 0; + MaxChans = 20; + OperMaxChans = 30; LogLevel = DEFAULT; maxbans.clear(); } @@ -594,6 +596,8 @@ void ServerConfig::Read(bool bail, userrec* user) {"whowas", "maxgroups", "10240", new ValueContainerInt (&this->WhoWasMaxGroups), DT_INTEGER, NoValidation}, {"whowas", "maxkeep", "3600", new ValueContainerChar (maxkeep), DT_CHARPTR, ValidateWhoWas}, {"die", "value", "", new ValueContainerChar (this->DieValue), DT_CHARPTR, NoValidation}, + {"channels", "users", "20", new ValueContainerUInt (&this->MaxChans), DT_INTEGER, NoValidation}, + {"channels", "opers", "60", new ValueContainerUInt (&this->OperMaxChans), DT_INTEGER, NoValidation}, {NULL} }; diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 354befcb3..a259bf349 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -577,7 +577,7 @@ void InspIRCd::BuildISupport() { // the neatest way to construct the initial 005 numeric, considering the number of configure constants to go in it... std::stringstream v; - v << "WALLCHOPS WALLVOICES MODES=" << MAXMODES << " CHANTYPES=# PREFIX=" << this->Modes->BuildPrefixes() << " MAP MAXCHANNELS=" << MAXCHANS << " MAXBANS=60 VBANLIST NICKLEN=" << NICKMAX-1; + v << "WALLCHOPS WALLVOICES MODES=" << MAXMODES << " CHANTYPES=# PREFIX=" << this->Modes->BuildPrefixes() << " MAP MAXCHANNELS=" << Config->MaxChans << " MAXBANS=60 VBANLIST NICKLEN=" << NICKMAX-1; v << " CASEMAPPING=rfc1459 STATUSMSG=@%+ CHARSET=ascii TOPICLEN=" << MAXTOPIC << " KICKLEN=" << MAXKICK << " MAXTARGETS=" << Config->MaxTargets << " AWAYLEN="; v << MAXAWAY << " CHANMODES=" << this->Modes->ChanModes() << " FNC NETWORK=" << Config->Network << " MAXPARA=32"; Config->data005 = v.str(); |