X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Finspircd.h;h=325b4c8fe9c0aee549171d6f4c62751de8db052d;hb=ece985ccb3210a132d67381511642edfb359f5c4;hp=ee1a5120a4b1461e67c6b7e8100484a149906619;hpb=4840d5e77572f42b710501912d59b5dbb6d2c2af;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/inspircd.h b/include/inspircd.h index ee1a5120a..325b4c8fe 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -2,7 +2,7 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2007 InspIRCd Development Team + * InspIRCd: (C) 2002-2008 InspIRCd Development Team * See: http://www.inspircd.org/wiki/index.php/Credits * * This program is free but copyrighted software; see @@ -32,6 +32,7 @@ #include "inspircd_config.h" #include "uid.h" #include "users.h" +#include "usermanager.h" #include "channels.h" #include "socket.h" #include "mode.h" @@ -56,14 +57,6 @@ */ #define ETIREDHAMSTERS EAGAIN -/** Delete a pointer, and NULL its value - */ -template inline void DELETE(T* x) -{ - delete x; - x = NULL; -} - /** Template function to convert any input type to std::string */ template inline std::string ConvNumeric(const T &in) @@ -219,9 +212,6 @@ class serverstats : public classbase /** A list of failed port bindings, used for informational purposes on startup */ typedef std::vector > FailedPortList; -/** A list of ip addresses cross referenced against clone counts */ -typedef std::map clonemap; - class InspIRCd; DEFINE_HANDLER1(ProcessUserHandler, void, User*); @@ -232,6 +222,7 @@ DEFINE_HANDLER1(FloodQuitUserHandler, void, User*); /* Forward declaration - required */ class XLineManager; +class BanCacheManager; /** The main class of the irc server. * This class contains instances of all the other classes @@ -401,6 +392,11 @@ class CoreExport InspIRCd : public classbase */ ModuleManager* Modules; + /** BanCacheManager is used to speed up checking of restrictions on connection + * to the IRCd. + */ + BanCacheManager *BanCache; + /** Stats class, holds miscellaneous stats counters */ serverstats* stats; @@ -435,14 +431,6 @@ class CoreExport InspIRCd : public classbase */ std::list all_opers; - /** Map of local ip addresses for clone counting - */ - clonemap local_clones; - - /** Map of global ip addresses for clone counting - */ - clonemap global_clones; - /** DNS class, provides resolver facilities to the core and modules */ DNS* Res; @@ -455,6 +443,10 @@ class CoreExport InspIRCd : public classbase */ XLineManager* XLines; + /** User manager. Various methods and data associated with users. + */ + UserManager *Users; + /** Set to the current signal recieved */ int s_signal; @@ -474,16 +466,6 @@ class CoreExport InspIRCd : public classbase * @return The old time delta */ int SetTimeDelta(int delta); - - /** Add a user to the local clone map - * @param user The user to add - */ - void AddLocalClone(User* user); - - /** Add a user to the global clone map - * @param user The user to add - */ - void AddGlobalClone(User* user); /** Number of users with a certain mode set on them */ @@ -543,17 +525,6 @@ class CoreExport InspIRCd : public classbase */ std::string GetServerDescription(const char* servername); - /** Write text to all opers connected to this server - * @param text The text format string - * @param ... Format args - */ - void WriteOpers(const char* text, ...); - - /** Write text to all opers connected to this server - * @param text The text to send - */ - void WriteOpers(const std::string &text); - /** Find a user in the nick hash. * If the user cant be found in the nick hash check the uuid hash * @param nick The nickname to find @@ -637,6 +608,11 @@ class CoreExport InspIRCd : public classbase */ bool IsChannel(const char *chname); + /** Return true if str looks like a server ID + * @param string to check against + */ + bool IsSID(const std::string &str); + /** Rehash the local server */ void Rehash(); @@ -664,36 +640,11 @@ class CoreExport InspIRCd : public classbase */ static void QuickExit(int status); - /** Return a count of users, unknown and known connections - * @return The number of users - */ - int UserCount(); - - /** Return a count of fully registered connections only - * @return The number of registered users - */ - int RegisteredUserCount(); - - /** Return a count of opered (umode +o) users only - * @return The number of opers - */ - int OperCount(); - - /** Return a count of unregistered (before NICK/USER) users only - * @return The number of unregistered (unknown) connections - */ - int UnregisteredUserCount(); - /** Return a count of channels on the network * @return The number of channels */ long ChannelCount(); - /** Return a count of local users on this server only - * @return The number of local users - */ - long LocalUserCount(); - /** Send an error notice to all local users, opered and unopered * @param s The error string to send */ @@ -718,24 +669,6 @@ class CoreExport InspIRCd : public classbase */ caller1 FindDescriptor; - /** Add a new mode to this server's mode parser - * @param mh The modehandler to add - * @return True if the mode handler was added - */ - bool AddMode(ModeHandler* mh); - - /** Add a new mode watcher to this server's mode parser - * @param mw The modewatcher to add - * @return True if the modewatcher was added - */ - bool AddModeWatcher(ModeWatcher* mw); - - /** Delete a mode watcher from this server's mode parser - * @param mw The modewatcher to delete - * @return True if the modewatcher was deleted - */ - bool DelModeWatcher(ModeWatcher* mw); - /** Add a dns Resolver class to this server's active set * @param r The resolver to add * @param cached If this value is true, then the cache will