+ std::string buffer = current->GetName();
+ if (user->IsOper())
+ {
+ 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
+ buffer.append(max_len - current->GetName().length(), ' ');
+
+ buffer += InspIRCd::Format("%5d [%5.2f%%]", current->UserCount, percent);
+
+ if (user->IsOper())
+ {
+ time_t secs_up = ServerInstance->Time() - current->age;
+ buffer += " [Up: " + InspIRCd::DurationString(secs_up) + (current->rtt == 0 ? "]" : " Lag: " + ConvToStr(current->rtt) + "ms]");
+ }
+
+ std::vector<std::string> map;
+ map.push_back(buffer);
+
+ const TreeServer::ChildServers& servers = current->GetChildren();
+ for (TreeServer::ChildServers::const_iterator i = servers.begin(); i != servers.end(); ++i)
+ {
+ TreeServer* child = *i;
+
+ if (IsHidden(user, child))
+ continue;
+
+ bool last = true;
+ for (TreeServer::ChildServers::const_iterator j = i + 1; last && j != servers.end(); ++j)
+ if (!IsHidden(user, *j))
+ last = false;
+
+ unsigned int next_len;
+
+ if (user->IsOper() || !Utils->FlatLinks)