summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/configreader.h29
-rw-r--r--include/hashcomp.h3
-rw-r--r--include/inspircd.h8
3 files changed, 30 insertions, 10 deletions
diff --git a/include/configreader.h b/include/configreader.h
index 7fc60203d..56a2ee698 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -226,6 +226,28 @@ struct operclass_data : public Extensible
typedef std::map<irc::string, operclass_data> operclass_t;
+class ServerLimits : public Extensible
+{
+ public:
+ size_t NickMax;
+ size_t ChanMax;
+ size_t MaxModes;
+ size_t IdentMax;
+ size_t MaxQuit;
+ size_t MaxTopic;
+ size_t MaxKick;
+ size_t MaxGecos;
+ size_t MaxAway;
+
+ /* Creating the class initialises it to the defaults
+ * as in 1.1's ./configure script. Reading other values
+ * from the config will change these values.
+ */
+ ServerLimits() : NickMax(31), ChanMax(64), MaxModes(20), IdentMax(12), MaxQuit(255), MaxTopic(307), MaxKick(255), MaxGecos(128), MaxAway(200)
+ {
+ }
+};
+
/** This class holds the bulk of the runtime configuration for the ircd.
* It allows for reading new config values, accessing configuration files,
* and storage of the configuration data needed to run the ircd, such as
@@ -275,11 +297,6 @@ class CoreExport ServerConfig : public Extensible
std::map<std::string, std::istream*> IncludedFiles;
- std::map<std::string, bool> CompletedFiles;
-
- size_t TotalDownloaded;
- size_t FileErrors;
-
/** Used to indicate who we announce invites to on a channel */
enum InviteAnnounceState { INVITE_ANNOUNCE_NONE, INVITE_ANNOUNCE_ALL, INVITE_ANNOUNCE_OPS, INVITE_ANNOUNCE_DYNAMIC };
@@ -295,6 +312,8 @@ class CoreExport ServerConfig : public Extensible
*/
ConfigDataHash config_data;
+ ServerLimits Limits;
+
/** Max number of WhoWas entries per user.
*/
int WhoWasGroupSize;
diff --git a/include/hashcomp.h b/include/hashcomp.h
index 4eb65823d..928abe809 100644
--- a/include/hashcomp.h
+++ b/include/hashcomp.h
@@ -174,6 +174,7 @@ namespace irc
class CoreExport modestacker : public classbase
{
private:
+ InspIRCd* ServerInstance;
/** The mode sequence and its parameters
*/
std::deque<std::string> sequence;
@@ -187,7 +188,7 @@ namespace irc
* @param add True if the stack is adding modes,
* false if it is removing them
*/
- modestacker(bool add);
+ modestacker(InspIRCd* Instance, bool add);
/** Push a modeletter and its parameter onto the stack.
* No checking is performed as to if this mode actually
* requires a parameter. If you stack invalid mode
diff --git a/include/inspircd.h b/include/inspircd.h
index e729a0b2a..9d7c8e6e1 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -230,11 +230,11 @@ typedef std::vector<std::pair<std::string, long> > FailedPortList;
class InspIRCd;
DEFINE_HANDLER1(ProcessUserHandler, void, User*);
-DEFINE_HANDLER1(IsNickHandler, bool, const char*);
+DEFINE_HANDLER2(IsNickHandler, bool, const char*, size_t);
DEFINE_HANDLER1(IsIdentHandler, bool, const char*);
DEFINE_HANDLER1(FindDescriptorHandler, User*, int);
DEFINE_HANDLER1(FloodQuitUserHandler, void, User*);
-DEFINE_HANDLER1(IsChannelHandler, bool, const char*);
+DEFINE_HANDLER2(IsChannelHandler, bool, const char*, size_t);
DEFINE_HANDLER1(IsSIDHandler, bool, const std::string&);
DEFINE_HANDLER1(RehashHandler, void, const std::string&);
@@ -585,7 +585,7 @@ class CoreExport InspIRCd : public classbase
* @param chname A channel name to verify
* @return True if the name is valid
*/
- caller1<bool, const char*> IsChannel;
+ caller2<bool, const char*, size_t> IsChannel;
/** Return true if str looks like a server ID
* @param string to check against
@@ -633,7 +633,7 @@ class CoreExport InspIRCd : public classbase
* @param n A nickname to verify
* @return True if the nick is valid
*/
- caller1<bool, const char*> IsNick;
+ caller2<bool, const char*, size_t> IsNick;
/** Return true if an ident is valid
* @param An ident to verify