+ /** Get server version string
+ */
+ const std::string& GetVersion() const { return VersionString; }
+
+ /** 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; }
+
+ /** Round trip time of last ping
+ */
+ unsigned long rtt;
+
+ /** When we recieved BURST from this server, used to calculate total burst time at ENDBURST.
+ */
+ uint64_t StartBurst;
+
+ /** True if this server is hidden
+ */
+ bool Hidden;
+
+ /** Get the TreeSocket pointer for local servers.
+ * For remote servers, this returns NULL.
+ */
+ TreeSocket* GetSocket() const { return Socket; }
+
+ /** Get the parent server.
+ * For the root node, this returns NULL.
+ */
+ TreeServer* GetParent() const { return Parent; }
+
+ /** Set the server version string
+ */
+ void SetVersion(const std::string& verstr) { VersionString = verstr; }
+
+ /** 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; }
+
+ /** Get server ID
+ */
+ const std::string& GetID() const { return sid; }
+
+ /** Marks a server as having finished bursting and performs appropriate actions.
+ */
+ void FinishBurst();
+ /** Recursive call for child servers */
+ void FinishBurstInternal();
+
+ /** (Re)check the uline state of this server
+ */
+ void CheckULine();
+
+ /** Get the bursting state of this server
+ * @return True if this server is bursting, false if it isn't
+ */
+ bool IsBursting() const { return (StartBurst != 0); }
+
+ /** Check whether this server is behind a bursting server or is itself bursting.
+ * This can tell whether a user is on a part of the network that is still bursting.
+ * @return True if this server is bursting or is behind a server that is bursting, false if it isn't
+ */
+ bool IsBehindBursting() const { return (behind_bursting != 0); }
+
+ /** Set the bursting state of the server
+ * @param startms Time the server started bursting, if 0 or omitted, use current time
+ */
+ void BeginBurst(uint64_t startms = 0);
+
+ /** Register a PONG from the server
+ */
+ void OnPong() { pingtimer.OnPong(); }
+
+ CullResult cull();
+
+ /** Destructor, deletes ServerUser unless IsRoot()
+ */
+ ~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);
+ }
+};