]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/inspircd.h
Remove InspIRCd* parameters and fields
[user/henk/code/inspircd.git] / include / inspircd.h
index 92e446e033a50946677dee57ea9fa426d66a1916..a5e40102a45e3ad62f276ef805d2830c402eaffc 100644 (file)
@@ -73,8 +73,12 @@ typedef std::vector< KeyVal > KeyValList;
  */
 typedef std::multimap< std::string, KeyValList > ConfigDataHash;
 
+class InspIRCd;
+extern InspIRCd* ServerInstance;
+
 #include "inspircd_config.h"
 #include "inspircd_version.h"
+#include "extensible.h"
 #include "numerics.h"
 #include "uid.h"
 #include "users.h"
@@ -273,7 +277,6 @@ class serverstats : public classbase
 
 class InspIRCd;
 
-DEFINE_HANDLER1(ProcessUserHandler, void, User*);
 DEFINE_HANDLER2(IsNickHandler, bool, const char*, size_t);
 DEFINE_HANDLER1(IsIdentHandler, bool, const char*);
 DEFINE_HANDLER1(FloodQuitUserHandler, void, User*);
@@ -290,13 +293,12 @@ class BanCacheManager;
  */
 class CoreExport ConfigReaderThread : public Thread
 {
-       InspIRCd* ServerInstance;
        ServerConfig* Config;
        bool done;
  public:
        std::string TheUserUID;
-       ConfigReaderThread(InspIRCd* Instance, const std::string &useruid)
-               : Thread(), ServerInstance(Instance), done(false), TheUserUID(useruid)
+       ConfigReaderThread(const std::string &useruid)
+               : Thread(), done(false), TheUserUID(useruid)
        {
        }
 
@@ -382,7 +384,6 @@ class CoreExport InspIRCd : public classbase
 
        /**** Functors ****/
 
-       ProcessUserHandler HandleProcessUser;
        IsNickHandler HandleIsNick;
        IsIdentHandler HandleIsIdent;
        FloodQuitUserHandler HandleFloodQuitUser;
@@ -390,11 +391,6 @@ class CoreExport InspIRCd : public classbase
        IsSIDHandler HandleIsSID;
        RehashHandler HandleRehash;
 
-       /** BufferedSocket classes pending deletion after being closed.
-        * We don't delete these immediately as this may cause a segmentation fault.
-        */
-       std::map<BufferedSocket*,BufferedSocket*> SocketCull;
-
        /** 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
         * Reason for it:
         * kludge alert!
@@ -435,7 +431,7 @@ class CoreExport InspIRCd : public classbase
 
        /** Config file pathname specified on the commandline or via ./configure
         */
-       char ConfigFileName[MAXBUF];
+       std::string ConfigFileName;
 
        /** Mode handler, handles mode setting and removal
         */
@@ -523,13 +519,6 @@ class CoreExport InspIRCd : public classbase
         */
        time_t Time();
 
-       /** Process a user whos socket has been flagged as active
-        * @param cu The user to process
-        * @return There is no actual return value, however upon exit, the user 'cu' may have been
-        * marked for deletion in the global CullList.
-        */
-       caller1<void, User*> ProcessUser;
-
        /** Bind all ports specified in the configuration file.
         * @return The number of ports bound without error
         */
@@ -870,6 +859,14 @@ class CoreExport InspIRCd : public classbase
         */
        void SendWhoisLine(User* user, User* dest, int numeric, const char* format, ...) CUSTOM_PRINTF(5, 6);
 
+       /** Handle /STATS
+        */
+       void DoStats(char statschar, User* user, string_list &results);
+
+       /** Handle /WHOIS
+        */
+       void DoWhois(User* user, User* dest,unsigned long signon, unsigned long idle, const char* nick);
+
        /** Quit a user for excess flood, and if they are not
         * fully registered yet, temporarily zline their IP.
         * @param current user to quit
@@ -912,11 +909,6 @@ class CoreExport InspIRCd : public classbase
         */
        int Run();
 
-       /** Force all BufferedSockets to be removed which are due to
-        * be culled.
-        */
-       void BufferedSocketCull();
-
        /** Adds an extban char to the 005 token.
         */
        void AddExtBanChar(char c);
@@ -929,4 +921,20 @@ class CoreExport InspIRCd : public classbase
 
 ENTRYPOINT;
 
+template<class Cmd>
+class CommandModule : public Module
+{
+       Cmd cmd;
+ public:
+       CommandModule() : cmd(this)
+       {
+               ServerInstance->AddCommand(&cmd);
+       }
+
+       Version GetVersion()
+       {
+               return Version(cmd.command, VF_VENDOR);
+       }
+};
+
 #endif