]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/server.h
Make BindPorts return size_t instead of int.
[user/henk/code/inspircd.git] / include / server.h
index e6e96593d8546b6a35dee9af1a2e12797911bfb1..491754e1337f2465131c0ba0440adac931e22b73 100644 (file)
 class CoreExport Server : public classbase
 {
  protected:
+       /** The unique identifier for this server. */
+       const std::string id;
+
        /** The name of this server
         */
        const std::string name;
 
+       /** The description of this server.
+        * This can be updated by the protocol module (for remote servers) or by a rehash (for the local server).
+        */
+       std::string description;
+
        /** True if this server is ulined
         */
        bool uline;
@@ -34,9 +42,30 @@ class CoreExport Server : public classbase
         */
        bool silentuline;
 
+       /** Allow ConfigReaderThread to update the description on a rehash
+        */
+       friend class ConfigReaderThread;
+
  public:
-       Server(const std::string& srvname)
-               : name(srvname), uline(false), silentuline(false) { }
+       Server(const std::string& srvid, const std::string& srvname, const std::string& srvdesc)
+               : id(srvid)
+               , name(srvname)
+               , description(srvdesc)
+               , uline(false)
+               , silentuline(false)
+       {
+       }
+
+       DEPRECATED_METHOD(Server(const std::string& srvname, const std::string& srvdesc))
+               : name(srvname)
+               , description(srvdesc)
+               , uline(false)
+               , silentuline(false)
+       {
+       }
+
+       /** Retrieves the unique identifier for this server (e.g. 36C). */
+       const std::string& GetId() const { return id; }
 
        /**
         * Returns the name of this server
@@ -44,6 +73,11 @@ class CoreExport Server : public classbase
         */
        const std::string& GetName() const { return name; }
 
+       /** Returns the description of this server
+        * @return The description of this server
+        */
+       const std::string& GetDesc() const { return description; }
+
        /**
         * Checks whether this server is ulined
         * @return True if this server is ulined, false otherwise.