summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-01-13 03:37:25 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-01-13 03:37:25 +0000
commit2192a9f58aae466a42d60279fb34ee3c5d2950a1 (patch)
tree7c4d2c1047154f7cab1744af9564570fc7045104 /src/modules
parentf56b7d5e861648e5ddc1b766e40779082ebaeff1 (diff)
First UserManager overhaul: Move clone counts out of InspIRCd & User.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8705 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_cgiirc.cpp18
-rw-r--r--src/modules/m_check.cpp2
-rw-r--r--src/modules/m_clones.cpp3
-rw-r--r--src/modules/m_spanningtree/treesocket1.cpp2
4 files changed, 13 insertions, 12 deletions
diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp
index ec91dd559..b971532db 100644
--- a/src/modules/m_cgiirc.cpp
+++ b/src/modules/m_cgiirc.cpp
@@ -295,7 +295,7 @@ public:
if(user->GetExt("cgiirc_webirc_ip", webirc_ip))
{
bool valid=false;
- user->RemoveCloneCounts();
+ ServerInstance->Users->RemoveCloneCounts(user);
#ifdef IPV6
valid = (inet_pton(AF_INET6, webirc_ip->c_str(), &((sockaddr_in6*)user->ip)->sin6_addr) > 0);
@@ -309,8 +309,8 @@ public:
delete webirc_ip;
user->InvalidateCache();
user->Shrink("cgiirc_webirc_ip");
- ServerInstance->AddLocalClone(user);
- ServerInstance->AddGlobalClone(user);
+ ServerInstance->Users->AddLocalClone(user);
+ ServerInstance->Users->AddGlobalClone(user);
user->CheckClass();
}
}
@@ -326,7 +326,7 @@ public:
user->InvalidateCache();
bool valid = false;
- user->RemoveCloneCounts();
+ ServerInstance->Users->RemoveCloneCounts(user);
#ifdef IPV6
if (user->GetProtocolFamily() == AF_INET6)
valid = (inet_pton(AF_INET6, user->password, &((sockaddr_in6*)user->ip)->sin6_addr) > 0);
@@ -336,8 +336,8 @@ public:
if (inet_aton(user->password, &((sockaddr_in*)user->ip)->sin_addr))
valid = true;
#endif
- ServerInstance->AddLocalClone(user);
- ServerInstance->AddGlobalClone(user);
+ ServerInstance->Users->AddLocalClone(user);
+ ServerInstance->Users->AddGlobalClone(user);
user->CheckClass();
if (valid)
@@ -396,15 +396,15 @@ public:
user->Extend("cgiirc_realhost", new std::string(user->host));
user->Extend("cgiirc_realip", new std::string(user->GetIPString()));
- user->RemoveCloneCounts();
+ ServerInstance->Users->RemoveCloneCounts(user);
#ifdef IPV6
if (user->GetProtocolFamily() == AF_INET6)
inet_pton(AF_INET6, newip, &((sockaddr_in6*)user->ip)->sin6_addr);
else
#endif
inet_aton(newip, &((sockaddr_in*)user->ip)->sin_addr);
- ServerInstance->AddLocalClone(user);
- ServerInstance->AddGlobalClone(user);
+ ServerInstance->Users->AddLocalClone(user);
+ ServerInstance->Users->AddGlobalClone(user);
user->CheckClass();
try
{
diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp
index 8c1a63652..cc8c7846b 100644
--- a/src/modules/m_check.cpp
+++ b/src/modules/m_check.cpp
@@ -119,7 +119,7 @@ class CommandCheck : public Command
/*
* Unlike Asuka, I define a clone as coming from the same host. --w00t
*/
- snprintf(tmpbuf, MAXBUF, "%lu %s%s (%s@%s) %s ", i->first->GlobalCloneCount(), targchan->GetAllPrefixChars(i->first), i->first->nick, i->first->ident, i->first->dhost, i->first->fullname);
+ snprintf(tmpbuf, MAXBUF, "%lu %s%s (%s@%s) %s ", ServerInstance->Users->GlobalCloneCount(i->first), targchan->GetAllPrefixChars(i->first), i->first->nick, i->first->ident, i->first->dhost, i->first->fullname);
user->WriteServ(checkstr + " member " + tmpbuf);
}
}
diff --git a/src/modules/m_clones.cpp b/src/modules/m_clones.cpp
index e9f757249..0c1cdff2f 100644
--- a/src/modules/m_clones.cpp
+++ b/src/modules/m_clones.cpp
@@ -44,7 +44,8 @@ class CommandClones : public Command
user->WriteServ(clonesstr + " START");
/* hostname or other */
- for (clonemap::iterator x = ServerInstance->global_clones.begin(); x != ServerInstance->global_clones.end(); x++)
+ // XXX I really don't like marking global_clones public for this. at all. -- w00t
+ for (clonemap::iterator x = ServerInstance->Users->global_clones.begin(); x != ServerInstance->Users->global_clones.end(); x++)
{
if (x->second >= limit)
user->WriteServ(clonesstr + " "+ ConvToStr(x->second) + " " + assign(x->first));
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp
index 169a138e3..407717bde 100644
--- a/src/modules/m_spanningtree/treesocket1.cpp
+++ b/src/modules/m_spanningtree/treesocket1.cpp
@@ -1116,7 +1116,7 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa
#endif
_new->SetSockAddr(AF_INET, params[7].c_str(), 0);
- Instance->AddGlobalClone(_new);
+ Instance->Users->AddGlobalClone(_new);
bool dosend = !(((this->Utils->quiet_bursts) && (this->bursting || Utils->FindRemoteBurstServer(remoteserver))) || (this->Instance->SilentULine(_new->server)));