diff options
author | B00mX0r <b00mx0r@aureus.pw> | 2017-12-19 09:21:14 -0800 |
---|---|---|
committer | B00mX0r <b00mx0r@aureus.pw> | 2017-12-19 10:23:21 -0800 |
commit | 6d4b4f7bf707c8b8270054120e6c7b6f1f2b9834 (patch) | |
tree | 42bd0a4b2da062eb60eb6cb406a9c601e284269c /src | |
parent | 5f40dce0345e9fa39b3e00c34d550ea6cd202e8e (diff) |
Show server versions in /MAP for opers
This resolves #1203
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_spanningtree/netburst.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_spanningtree/override_map.cpp | 8 | ||||
-rw-r--r-- | src/modules/m_spanningtree/sinfo.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treeserver.cpp | 1 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treeserver.h | 9 |
5 files changed, 24 insertions, 1 deletions
diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp index 5115c7aa8..30a37baee 100644 --- a/src/modules/m_spanningtree/netburst.cpp +++ b/src/modules/m_spanningtree/netburst.cpp @@ -137,6 +137,9 @@ void TreeSocket::SendServerInfo(TreeServer* from) // Send full version string that contains more information and is shown to opers this->WriteLine(CommandSInfo::Builder(from, "fullversion", from->GetFullVersion())); + + // Send the raw version string that just contains the base info + this->WriteLine(CommandSInfo::Builder(from, "rawversion", from->GetRawVersion())); } /** Recursively send the server tree. diff --git a/src/modules/m_spanningtree/override_map.cpp b/src/modules/m_spanningtree/override_map.cpp index a22fa48ac..d1a00ed84 100644 --- a/src/modules/m_spanningtree/override_map.cpp +++ b/src/modules/m_spanningtree/override_map.cpp @@ -76,7 +76,13 @@ static std::vector<std::string> GetMap(User* user, TreeServer* current, unsigned std::string buffer = current->GetName(); if (user->IsOper()) { - buffer += " (" + current->GetID() + ")"; + buffer += " (" + current->GetID(); + + const std::string& cur_vers = current->GetRawVersion(); + if (!cur_vers.empty()) + buffer += " " + cur_vers; + + buffer += ")"; } // Pad with spaces until its at max len, max_len must always be >= my names length diff --git a/src/modules/m_spanningtree/sinfo.cpp b/src/modules/m_spanningtree/sinfo.cpp index 0989ea9a5..7f175bafb 100644 --- a/src/modules/m_spanningtree/sinfo.cpp +++ b/src/modules/m_spanningtree/sinfo.cpp @@ -34,6 +34,10 @@ CmdResult CommandSInfo::HandleServer(TreeServer* server, std::vector<std::string { server->SetVersion(value); } + else if (key == "rawversion") + { + server->SetRawVersion(value); + } else if (key == "desc") { // Only sent when the description of a server changes because of a rehash; not sent on burst diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp index be8660e42..ca7959ea7 100644 --- a/src/modules/m_spanningtree/treeserver.cpp +++ b/src/modules/m_spanningtree/treeserver.cpp @@ -37,6 +37,7 @@ TreeServer::TreeServer() , Parent(NULL), Route(NULL) , VersionString(ServerInstance->GetVersionString()) , fullversion(ServerInstance->GetVersionString(true)) + , rawversion(INSPIRCD_VERSION) , Socket(NULL), sid(ServerInstance->Config->GetSID()), behind_bursting(0), isdead(false) , pingtimer(this) , ServerUser(ServerInstance->FakeClient) diff --git a/src/modules/m_spanningtree/treeserver.h b/src/modules/m_spanningtree/treeserver.h index f75adf54c..037edd194 100644 --- a/src/modules/m_spanningtree/treeserver.h +++ b/src/modules/m_spanningtree/treeserver.h @@ -48,6 +48,7 @@ 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 */ @@ -144,6 +145,10 @@ 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; @@ -175,6 +180,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 |