diff options
author | Peter Powell <petpow@saberuk.com> | 2017-12-19 18:41:55 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-19 18:41:55 +0000 |
commit | 4f3aaaef9f8b111452ffa4498aaefeae3fcb6675 (patch) | |
tree | d2f9c363afd6de96d564ee6d59205c5ec9b238cd /src/modules | |
parent | c4e7b532055909e303f6ddb1a6e6f2dd073fcf3e (diff) | |
parent | 6d4b4f7bf707c8b8270054120e6c7b6f1f2b9834 (diff) |
Merge pull request #1442 from B00mX0r/master+map_version
Show server versions in /MAP for opers
Diffstat (limited to 'src/modules')
-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 |