]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/inspircd.h
Introduce Server class
[user/henk/code/inspircd.git] / include / inspircd.h
index ccb91070ea50471c54697dbf514006a9a100611c..a2815b8a536560b5fe970d94c8c30c585747aaba 100644 (file)
@@ -54,8 +54,10 @@ CoreExport extern InspIRCd* ServerInstance;
 #include "caller.h"
 #include "cull_list.h"
 #include "extensible.h"
+#include "fileutils.h"
 #include "numerics.h"
 #include "uid.h"
+#include "server.h"
 #include "users.h"
 #include "channels.h"
 #include "timer.h"
@@ -245,7 +247,6 @@ DEFINE_HANDLER1(IsNickHandler, bool, const std::string&);
 DEFINE_HANDLER2(GenRandomHandler, void, char*, size_t);
 DEFINE_HANDLER1(IsIdentHandler, bool, const std::string&);
 DEFINE_HANDLER1(IsChannelHandler, bool, const std::string&);
-DEFINE_HANDLER1(RehashHandler, void, const std::string&);
 DEFINE_HANDLER3(OnCheckExemptionHandler, ModResult, User*, Channel*, const std::string&);
 
 /** The main class of the irc server.
@@ -296,7 +297,6 @@ class CoreExport InspIRCd
        IsIdentHandler HandleIsIdent;
        OnCheckExemptionHandler HandleOnCheckExemption;
        IsChannelHandler HandleIsChannel;
-       RehashHandler HandleRehash;
        GenRandomHandler HandleGenRandom;
 
        /** Globally accessible fake user record. This is used to force mode changes etc across s2s, etc.. bit ugly, but.. better than how this was done in 1.1
@@ -402,7 +402,7 @@ class CoreExport InspIRCd
 
        /** Holds extensible for user operquit
         */
-       LocalStringExt OperQuit;
+       StringExtItem OperQuit;
 
        /** Manages the generation and transmission of ISUPPORT. */
        ISupportManager ISupport;
@@ -483,10 +483,6 @@ class CoreExport InspIRCd
         */
        static bool IsSID(const std::string& sid);
 
-       /** Rehash the local server
-        */
-       caller1<void, const std::string&> Rehash;
-
        /** Handles incoming signals after being set
         * @param signal the signal recieved
         */
@@ -546,8 +542,8 @@ class CoreExport InspIRCd
         * @param mask The glob pattern to match against.
         * @param map The character map to use when matching.
         */
-       static bool Match(const std::string &str, const std::string &mask, unsigned const char *map = NULL);
-       static bool Match(const char *str, const char *mask, unsigned const char *map = NULL);
+       static bool Match(const std::string& str, const std::string& mask, unsigned const char* map = NULL);
+       static bool Match(const char* str, const char* mask, unsigned const char* map = NULL);
 
        /** Match two strings using pattern matching, optionally, with a map
         * to check case against (may be NULL). If map is null, match will be case insensitive.
@@ -556,8 +552,8 @@ class CoreExport InspIRCd
         * @param mask The glob or CIDR pattern to match against.
         * @param map The character map to use when matching.
         */
-       static bool MatchCIDR(const std::string &str, const std::string &mask, unsigned const char *map = NULL);
-       static bool MatchCIDR(const char *str, const char *mask, unsigned const char *map = NULL);
+       static bool MatchCIDR(const std::string& str, const std::string& mask, unsigned const char* map = NULL);
+       static bool MatchCIDR(const char* str, const char* mask, unsigned const char* map = NULL);
 
        /** Matches a hostname and IP against a space delimited list of hostmasks.
         * @param masks The space delimited masks to match against.
@@ -570,7 +566,7 @@ class CoreExport InspIRCd
         * @param mask A nick!user\@host masak to match against
         * @return True i the mask is valid
         */
-       bool IsValidMask(const std::string &mask);
+       static bool IsValidMask(const std::string& mask);
 
        /** Strips all color codes from the given string
         * @param sentence The string to strip from
@@ -583,8 +579,9 @@ class CoreExport InspIRCd
        static void ProcessColors(file_cache& input);
 
        /** Rehash the local server
+        * @param uuid The uuid of the user who started the rehash, can be empty
         */
-       void RehashServer();
+       void Rehash(const std::string& uuid = "");
 
        /** Check if the given nickmask matches too many users, send errors to the given user
         * @param nick A nickmask to match against
@@ -625,18 +622,6 @@ class CoreExport InspIRCd
         */
        int PassCompare(Extensible* ex, const std::string &data, const std::string &input, const std::string &hashtype);
 
-       /** Check if a given server is a uline.
-        * An empty string returns true, this is by design.
-        * @param server The server to check for uline status
-        * @return True if the server is a uline OR the string is empty
-        */
-       bool ULine(const std::string& server);
-
-       /** Returns true if the uline is 'silent' (doesnt generate
-        * remote connect notices etc).
-        */
-       bool SilentULine(const std::string& server);
-
        /** Returns the full version string of this ircd
         * @return The version string
         */
@@ -689,7 +674,7 @@ class CoreExport InspIRCd
 
        /** Return a time_t as a human-readable string.
         */
-       std::string TimeString(time_t curtime);
+       static std::string TimeString(time_t curtime);
 
        /** Begin execution of the server.
         * NOTE: this function NEVER returns. Internally,
@@ -714,11 +699,6 @@ class CommandModule : public Module
        {
        }
 
-       void init()
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion()
        {
                return Version(cmd.name, VF_VENDOR|VF_CORE);