]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/treeserver.h
Remove current time parameter of the Timer constructor
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / treeserver.h
index 8178c87faf0c758112593833b125d75017f7c335..6bd1a4f7ca1a7da184b7fffec7e037b961094852 100644 (file)
  * TreeServer items, deleting and inserting them as they
  * are created and destroyed.
  */
-class TreeServer : public classbase
+class TreeServer : public Server
 {
        TreeServer* Parent;                     /* Parent entry */
        TreeServer* Route;                      /* Route entry */
        std::vector<TreeServer*> Children;      /* List of child objects */
-       std::string ServerName;                 /* Server's name */
-       std::string ServerDesc;                 /* Server's description */
        std::string VersionString;              /* Version string or empty string */
+
+       /** Full version string including patch version and other info
+        */
+       std::string fullversion;
+
        TreeSocket* Socket;                     /* Socket used to communicate with this server */
        time_t NextPing;                        /* After this time, the server should be PINGed*/
        bool LastPingWasGood;                   /* True if the server responded to the last PING with a PONG */
@@ -94,18 +97,15 @@ class TreeServer : public classbase
         */
        bool IsLocal() const { return (this->Route == this); }
 
-       /** Get server name
-        */
-       const std::string& GetName() const { return ServerName; }
-
-       /** Get server description (GECOS)
-        */
-       const std::string& GetDesc();
-
        /** Get server version string
         */
        const std::string& GetVersion();
 
+       /** Get the full version string of this server
+        * @return The full version string of this server, including patch version and other info
+        */
+       const std::string& GetFullVersion() const { return fullversion; }
+
        /** Set time we are next due to ping this server
         */
        void SetNextPingTime(time_t t);
@@ -152,6 +152,17 @@ class TreeServer : public classbase
         */
        void SetVersion(const std::string &Version);
 
+       /** Set the full version string
+        * @param verstr The version string to set
+        */
+       void SetFullVersion(const std::string& verstr) { fullversion = verstr; }
+
+       /** Sets the description of this server. Called when the description of a remote server changes
+        * and we are notified about it.
+        * @param descstr The description to set
+        */
+       void SetDesc(const std::string& descstr) { description = descstr; }
+
        /** Return all child servers
         */
        const ChildServers& GetChildren() const { return Children; }
@@ -180,6 +191,10 @@ class TreeServer : public classbase
        /** Recursive call for child servers */
        void FinishBurstInternal();
 
+       /** (Re)check the uline state of this server
+        */
+       void CheckULine();
+
        CullResult cull();
 
        /** Destructor
@@ -187,4 +202,13 @@ class TreeServer : public classbase
         * hash maps.
         */
        ~TreeServer();
+
+       /** Returns the TreeServer the given user is connected to
+        * @param user The user whose server to return
+        * @return The TreeServer this user is connected to.
+        */
+       static TreeServer* Get(User* user)
+       {
+               return static_cast<TreeServer*>(user->server);
+       }
 };