summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/netburst.cpp4
-rw-r--r--src/modules/m_spanningtree/override_map.cpp7
-rw-r--r--src/modules/m_spanningtree/treeserver.cpp2
-rw-r--r--src/modules/m_spanningtree/uid.cpp7
4 files changed, 11 insertions, 9 deletions
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)