]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/configreader.h
CPU Usage percent in stats z! yay!
[user/henk/code/inspircd.git] / include / configreader.h
index e7047b56958ff72d054f4c70f850660440221ab5..622c44d0d9ae61b8138c418c1afb437ec533a5ab 100644 (file)
@@ -30,6 +30,7 @@
 
 class ServerConfig;
 class InspIRCd;
+class InspSocket;
 
 /** Types of data in the core config
  */
@@ -45,56 +46,15 @@ class ValueItem
 {
        std::string v;
  public:
-       ValueItem(int value)
-       {
-               std::stringstream n;
-               n << value;
-               v = n.str();
-       }
-
-       ValueItem(bool value)
-       {
-               std::stringstream n;
-               n << value;
-               v = n.str();
-       }
-
-       ValueItem(char* value)
-       {
-               v = value;
-       }
-
-       void Set(char* value)
-       {
-               v = value;
-       }
-
-       void Set(const char* value)
-       {
-               v = value;
-       }
-
-       void Set(int value)
-       {
-               std::stringstream n;
-               n << value;
-               v = n.str();
-       }
-
-       int GetInteger()
-       {
-               return atoi(v.c_str());
-       }
-
-       char* GetString()
-       {
-               return (char*)v.c_str();
-       }
-
-       bool GetBool()
-       {
-               return (GetInteger() || v == "yes" || v == "true");
-       }
+       ValueItem(int value);
+       ValueItem(bool value);
+       ValueItem(char* value);
+       void Set(char* value);
+       void Set(const char* val);
+       void Set(int value);
+       int GetInteger();
+       char* GetString();
+       bool GetBool();
 };
 
 /** The base class of the container 'ValueContainer'
@@ -103,13 +63,8 @@ class ValueItem
 class ValueContainerBase
 {
  public:
-       ValueContainerBase()
-       {
-       }
-
-       virtual ~ValueContainerBase()
-       {
-       }
+       ValueContainerBase() { }
+       virtual ~ValueContainerBase() { }
 };
 
 /** ValueContainer is used to contain pointers to different
@@ -338,10 +293,6 @@ class ServerConfig : public Extensible
         */
        char ModPath[1024];
 
-       /** The temporary directory where modules are copied
-        */
-       char TempDir[1024];
-
        /** The full pathname to the executable, as
         * given in argv[0] when the program starts.
         */
@@ -495,11 +446,14 @@ class ServerConfig : public Extensible
         */
        std::map<int,Module*> IOHookModule;
 
+       std::map<InspSocket*, Module*> SocketIOHookModule;
+
        /** The 005 tokens of this server (ISUPPORT)
         * populated/repopulated upon loading or unloading
         * modules.
         */
        std::string data005;
+       std::vector<std::string> isupport;
 
        /** STATS characters in this list are available
         * only to operators.
@@ -551,6 +505,14 @@ class ServerConfig : public Extensible
         */
        void ClearStack();
 
+       /** Update the 005 vector
+        */
+       void Update005();
+
+       /** Send the 005 numerics (ISUPPORT) to a user
+        */
+       void Send005(userrec* user);
+
        /** Read the entire configuration into memory
         * and initialize this class. All other methods
         * should be used only by the core.
@@ -610,6 +572,9 @@ class ServerConfig : public Extensible
        Module* GetIOHook(int port);
        bool AddIOHook(int port, Module* iomod);
        bool DelIOHook(int port);
+       Module* GetIOHook(InspSocket* is);
+       bool AddIOHook(Module* iomod, InspSocket* is);
+       bool DelIOHook(InspSocket* is);
 
        static std::string GetFullProgDir(char** argv, int argc);
        static bool DirValid(const char* dirandfile);