diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_check.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_httpd_stats.cpp | 7 | ||||
-rw-r--r-- | src/modules/m_spanningtree/netburst.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_spanningtree/override_map.cpp | 7 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treeserver.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/uid.cpp | 7 | ||||
-rw-r--r-- | src/modules/m_tline.cpp | 5 |
7 files changed, 20 insertions, 15 deletions
diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index ba20f9445..d7cfe74bd 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -248,7 +248,8 @@ class CommandCheck : public Command long x = 0; /* hostname or other */ - for (user_hash::const_iterator a = ServerInstance->Users->clientlist->begin(); a != ServerInstance->Users->clientlist->end(); a++) + const user_hash& users = ServerInstance->Users->GetUsers(); + for (user_hash::const_iterator a = users.begin(); a != users.end(); ++a) { if (InspIRCd::Match(a->second->host, parameters[0], ascii_case_insensitive_map) || InspIRCd::Match(a->second->dhost, parameters[0], ascii_case_insensitive_map)) { diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index 75be402be..2dcf1e1cf 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -104,7 +104,7 @@ class ModuleHttpStats : public Module << Sanitize(ServerInstance->GetVersionString()) << "</version></server>"; data << "<general>"; - data << "<usercount>" << ServerInstance->Users->clientlist->size() << "</usercount>"; + data << "<usercount>" << ServerInstance->Users->GetUsers().size() << "</usercount>"; data << "<channelcount>" << ServerInstance->GetChans().size() << "</channelcount>"; data << "<opercount>" << ServerInstance->Users->all_opers.size() << "</opercount>"; data << "<socketcount>" << (SocketEngine::GetUsedFds()) << "</socketcount><socketmax>" << SocketEngine::GetMaxFds() << "</socketmax><socketengine>" INSPIRCD_SOCKETENGINE_NAME "</socketengine>"; @@ -182,9 +182,10 @@ class ModuleHttpStats : public Module data << "</channellist><userlist>"; - for (user_hash::const_iterator a = ServerInstance->Users->clientlist->begin(); a != ServerInstance->Users->clientlist->end(); ++a) + const user_hash& users = ServerInstance->Users->GetUsers(); + for (user_hash::const_iterator i = users.begin(); i != users.end(); ++i) { - User* u = a->second; + User* u = i->second; data << "<user>"; data << "<nickname>" << u->nick << "</nickname><uuid>" << u->uuid << "</uuid><realhost>" diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp index 93b4d72f4..a33cf8a13 100644 --- a/src/modules/m_spanningtree/netburst.cpp +++ b/src/modules/m_spanningtree/netburst.cpp @@ -271,7 +271,9 @@ void TreeSocket::SyncChannel(Channel* chan) void TreeSocket::SendUsers(BurstState& bs) { ProtocolInterface::Server& piserver = bs.server; - for (user_hash::iterator u = ServerInstance->Users->clientlist->begin(); u != ServerInstance->Users->clientlist->end(); u++) + + const user_hash& users = ServerInstance->Users->GetUsers(); + for (user_hash::const_iterator u = users.begin(); u != users.end(); ++u) { User* user = u->second; if (user->registered != REG_ALL) diff --git a/src/modules/m_spanningtree/override_map.cpp b/src/modules/m_spanningtree/override_map.cpp index 216fd4d66..68551e84f 100644 --- a/src/modules/m_spanningtree/override_map.cpp +++ b/src/modules/m_spanningtree/override_map.cpp @@ -66,10 +66,11 @@ static std::vector<std::string> GetMap(User* user, TreeServer* current, unsigned { float percent = 0; - if (!ServerInstance->Users->clientlist->empty()) + const user_hash& users = ServerInstance->Users->GetUsers(); + if (!users.empty()) { // If there are no users, WHO THE HELL DID THE /MAP?!?!?! - percent = current->UserCount * 100.0 / ServerInstance->Users->clientlist->size(); + percent = current->UserCount * 100.0 / users.size(); } std::string buffer = current->GetName(); @@ -201,7 +202,7 @@ CmdResult CommandMap::Handle(const std::vector<std::string>& parameters, User* u user->SendText(":%s %03d %s :%s", ServerInstance->Config->ServerName.c_str(), RPL_MAP, user->nick.c_str(), i->c_str()); - size_t totusers = ServerInstance->Users->clientlist->size(); + size_t totusers = ServerInstance->Users->GetUsers().size(); float avg_users = (float) totusers / Utils->serverlist.size(); user->SendText(":%s %03d %s :%u server%s and %u user%s, average %.2f users per server", diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp index b51c21db6..3d57b1314 100644 --- a/src/modules/m_spanningtree/treeserver.cpp +++ b/src/modules/m_spanningtree/treeserver.cpp @@ -144,7 +144,7 @@ int TreeServer::QuitUsers(const std::string &reason) { std::string publicreason = ServerInstance->Config->HideSplits ? "*.net *.split" : reason; - const user_hash& users = *ServerInstance->Users->clientlist; + const user_hash& users = ServerInstance->Users->GetUsers(); unsigned int original_size = users.size(); for (user_hash::const_iterator i = users.begin(); i != users.end(); ) { diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp index 0d96167b9..37c54ae60 100644 --- a/src/modules/m_spanningtree/uid.cpp +++ b/src/modules/m_spanningtree/uid.cpp @@ -48,14 +48,13 @@ CmdResult CommandUID::HandleServer(TreeServer* remoteserver, std::vector<std::st return CMD_INVALID; /* check for collision */ - user_hash::iterator iter = ServerInstance->Users->clientlist->find(params[2]); - - if (iter != ServerInstance->Users->clientlist->end()) + User* collideswith = ServerInstance->FindNickOnly(params[2]); + if (collideswith) { /* * Nick collision. */ - int collide = Utils->DoCollision(iter->second, remoteserver, age_t, params[5], params[6], params[0]); + int collide = Utils->DoCollision(collideswith, remoteserver, age_t, params[5], params[6], params[0]); ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "*** Collision on %s, collide=%d", params[2].c_str(), collide); if (collide != 1) diff --git a/src/modules/m_tline.cpp b/src/modules/m_tline.cpp index 64beb3120..77ec0e26c 100644 --- a/src/modules/m_tline.cpp +++ b/src/modules/m_tline.cpp @@ -36,7 +36,8 @@ class CommandTline : public Command unsigned int n_match_host = 0; unsigned int n_match_ip = 0; - for (user_hash::const_iterator u = ServerInstance->Users->clientlist->begin(); u != ServerInstance->Users->clientlist->end(); u++) + const user_hash& users = ServerInstance->Users->GetUsers(); + for (user_hash::const_iterator u = users.begin(); u != users.end(); ++u) { if (InspIRCd::Match(u->second->GetFullRealHost(),parameters[0])) { @@ -54,7 +55,7 @@ class CommandTline : public Command } } - unsigned long n_counted = ServerInstance->Users->clientlist->size(); + unsigned long n_counted = users.size(); if (n_matched) { float p = (n_matched / (float)n_counted) * 100; |