]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/inspircd.h
Add <badchan:redirect>: redirects users attempting to join a bad channel to a second...
[user/henk/code/inspircd.git] / include / inspircd.h
index c8acf42408ac939de3ea2195067320fe88578f61..d1e6f4005ac5234754f43a8e77efb26d3474483c 100644 (file)
 #undef ERROR
 #endif
 
+// Required system headers.
 #include <time.h>
-#include <string>
-#include <sstream>
-#include <list>
+#include <stdarg.h>
+
 #include "inspircd_config.h"
 #include "uid.h"
 #include "users.h"
-#include "usermanager.h"
 #include "channels.h"
+#include "timer.h"
+#include "hashcomp.h"
+#include "typedefs.h"
+#include "logger.h"
+#include "usermanager.h"
 #include "socket.h"
+#include "ctables.h"
+#include "command_parse.h"
 #include "mode.h"
 #include "socketengine.h"
-#include "command_parse.h"
 #include "snomasks.h"
 #include "cull_list.h"
 #include "filelogger.h"
 #include "caller.h"
+#include "modules.h"
+#include "configreader.h"
+#include "inspstring.h"
 
 /**
  * Used to define the maximum number of parameters a command may have.
@@ -290,16 +298,12 @@ class CoreExport InspIRCd : public classbase
 
        /** Used when connecting clients
         */
-       insp_sockaddr client, server;
+       irc::sockets::insp_sockaddr client, server;
 
        /** Used when connecting clients
         */
        socklen_t length;
 
-       /** Nonblocking file writer
-        */
-       FileLogger* Logger;
-
        /** Time offset in seconds
         * This offset is added to all calls to Time(). Use SetTimeDelta() to update
         */
@@ -358,11 +362,6 @@ class CoreExport InspIRCd : public classbase
         */
        void BuildISupport();
 
-       /** Number of unregistered users online right now.
-        * (Unregistered means before USER/NICK/dns)
-        */
-       int unregistered_count;
-
        /** List of server names we've seen.
         */
        servernamelist servernames;
@@ -386,6 +385,10 @@ class CoreExport InspIRCd : public classbase
        /** Socket engine, handles socket activity events
         */
        SocketEngine* SE;
+
+       /** LogManager handles logging.
+        */
+       LogManager *Logs;
        
        /** ModuleManager contains everything related to loading/unloading
         * modules.
@@ -410,27 +413,6 @@ class CoreExport InspIRCd : public classbase
         */
        SnomaskManager* SNO;
 
-       /** Client list, a hash_map containing all clients, local and remote
-        */
-       user_hash* clientlist;
-
-       /** Client list stored by UUID. Contains all clients, and is updated
-        * automatically by the constructor and destructor of User.
-        */
-       user_hash* uuidlist;
-
-       /** Channel list, a hash_map containing all channels
-        */
-       chan_hash* chanlist;
-
-       /** Local client list, a vector containing only local clients
-        */
-       std::vector<User*> local_users;
-
-       /** Oper list, a vector containing all local and remote opered users
-        */
-       std::list<User*> all_opers;
-
        /** DNS class, provides resolver facilities to the core and modules
         */
        DNS* Res;
@@ -447,6 +429,10 @@ class CoreExport InspIRCd : public classbase
         */
        UserManager *Users;
 
+       /** Channel list, a hash_map containing all channels XXX move to channel manager class
+        */
+       chan_hash* chanlist;
+
        /** Set to the current signal recieved
         */
        int s_signal;
@@ -466,10 +452,6 @@ class CoreExport InspIRCd : public classbase
         * @return The old time delta
         */
        int SetTimeDelta(int delta);
-       
-       /** Number of users with a certain mode set on them
-        */
-       int ModeCount(const char mode);
 
        /** Get the time offset in seconds
         * @return The current time delta (in seconds)
@@ -525,17 +507,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
@@ -587,32 +558,6 @@ class CoreExport InspIRCd : public classbase
         */
        bool OpenLog(char** argv, int argc);
 
-       /** Close the currently open log file
-        */
-       void CloseLog();
-
-       /** Send a server notice to all local users
-        * @param text The text format string to send
-        * @param ... The format arguments
-        */
-       void ServerNoticeAll(char* text, ...);
-
-       /** Send a server message (PRIVMSG) to all local users
-        * @param text The text format string to send
-        * @param ... The format arguments
-        */
-       void ServerPrivmsgAll(char* text, ...);
-
-       /** Send text to all users with a specific set of modes
-        * @param modes The modes to check against, without a +, e.g. 'og'
-        * @param flags one of WM_OR or WM_AND. If you specify WM_OR, any one of the
-        * mode characters in the first parameter causes receipt of the message, and
-        * if you specify WM_OR, all the modes must be present.
-        * @param text The text format string to send
-        * @param ... The format arguments
-        */
-       void WriteMode(const char* modes, int flags, const char* text, ...);
-
        /** Return true if a channel name is valid
         * @param chname A channel name to verify
         * @return True if the name is valid
@@ -680,24 +625,6 @@ class CoreExport InspIRCd : public classbase
         */
        caller1<User*, int> 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
@@ -778,7 +705,7 @@ class CoreExport InspIRCd : public classbase
         * @param LinePrefix text to prefix each complete line with
         * @param TextStream the text to send to the user
         */
-       void DumpText(User* User, const std::string &LinePrefix, stringstream &TextStream);
+       void DumpText(User* User, const std::string &LinePrefix, std::stringstream &TextStream);
 
        /** Check if the given nickmask matches too many users, send errors to the given user
         * @param nick A nickmask to match against
@@ -808,15 +735,16 @@ class CoreExport InspIRCd : public classbase
         */
        long Duration(const std::string &str);
 
-       /** Attempt to compare an oper password to a string from the config file.
+       /** Attempt to compare a password to a string from the config file.
         * This will be passed to handling modules which will compare the data
         * against possible hashed equivalents in the input string.
+        * @param ex The object (user, server, whatever) causing the comparison.
         * @param data The data from the config file
         * @param input The data input by the oper
-        * @param tagnum the tag number of the oper's tag in the config file
+        * @param hashtype The hash from the config file
         * @return 0 if the strings match, 1 or -1 if they do not
         */
-       int OperPassCompare(const char* data,const char* input, int tagnum);
+       int PassCompare(Extensible* ex, const char* data,const char* input, const char* hashtype);
 
        /** Check if a given server is a uline.
         * An empty string returns true, this is by design.