]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/treeserver.h
Add an event provider class for the event/messagetag event.
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / treeserver.h
index 1a0203ba09384b9ba989de4818141cb5ba760be7..14413cd924041b6d5eccc57a20db427f8cc809ed 100644 (file)
@@ -48,9 +48,9 @@ class TreeServer : public Server
        /** Full version string including patch version and other info
         */
        std::string fullversion;
+       std::string rawversion;
 
        TreeSocket* Socket;                     /* Socket used to communicate with this server */
-       std::string sid;                        /* Server ID */
 
        /** Counter counting how many servers are bursting in front of this server, including
         * this server. Set to parents' value on construction then it is increased if the
@@ -74,7 +74,7 @@ class TreeServer : public Server
 
        /** Used by SQuit logic to recursively remove servers
         */
-       void SQuitInternal(unsigned int& num_lost_servers);
+       void SQuitInternal(unsigned int& num_lost_servers, bool error);
 
        /** Remove the reference to this server from the hash maps
         */
@@ -103,15 +103,17 @@ class TreeServer : public Server
        /** SQuit a server connected to this server, removing the given server and all servers behind it
         * @param server Server to squit, must be directly below this server
         * @param reason Reason for quitting the server, sent to opers and other servers
+        * @param error Whether the server is being squit because of an error.
         */
-       void SQuitChild(TreeServer* server, const std::string& reason);
+       void SQuitChild(TreeServer* server, const std::string& reason, bool error = false);
 
        /** SQuit this server, removing this server and all servers behind it
         * @param reason Reason for quitting the server, sent to opers and other servers
+        * @param error Whether the server is being squit because of an error.
         */
-       void SQuit(const std::string& reason)
+       void SQuit(const std::string& reason, bool error = false)
        {
-               GetParent()->SQuitChild(this, reason);
+               GetParent()->SQuitChild(this, reason, error);
        }
 
        static unsigned int QuitUsers(const std::string& reason);
@@ -144,13 +146,17 @@ class TreeServer : public Server
         */
        const std::string& GetFullVersion() const { return fullversion; }
 
+       /** Get the raw version string of this server
+        */
+       const std::string& GetRawVersion() const { return rawversion; }
+
        /** Round trip time of last ping
         */
        unsigned long rtt;
 
-       /** When we recieved BURST from this server, used to calculate total burst time at ENDBURST.
+       /** When we received BURST from this server, used to calculate total burst time at ENDBURST.
         */
-       unsigned long StartBurst;
+       uint64_t StartBurst;
 
        /** True if this server is hidden
         */
@@ -175,6 +181,10 @@ class TreeServer : public Server
         */
        void SetFullVersion(const std::string& verstr) { fullversion = verstr; }
 
+       /** Set the raw version string
+        */
+       void SetRawVersion(const std::string& verstr) { rawversion = 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
@@ -185,10 +195,6 @@ class TreeServer : public Server
         */
        const ChildServers& GetChildren() const { return Children; }
 
-       /** Get server ID
-        */
-       const std::string& GetID() const { return sid; }
-
        /** Marks a server as having finished bursting and performs appropriate actions.
         */
        void FinishBurst();
@@ -213,13 +219,13 @@ class TreeServer : public Server
        /** Set the bursting state of the server
         * @param startms Time the server started bursting, if 0 or omitted, use current time
         */
-       void BeginBurst(unsigned long startms = 0);
+       void BeginBurst(uint64_t startms = 0);
 
        /** Register a PONG from the server
         */
        void OnPong() { pingtimer.OnPong(); }
 
-       CullResult cull();
+       CullResult cull() CXX11_OVERRIDE;
 
        /** Destructor, deletes ServerUser unless IsRoot()
         */