From 2add2b79ca3152201e325ed75c09e0c9bd0fecc4 Mon Sep 17 00:00:00 2001 From: w00t Date: Mon, 7 Jan 2008 12:47:29 +0000 Subject: Fix up some usercounts stuff.. to be tested. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8655 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/main.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/modules/m_spanningtree/main.cpp') diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 6a629b803..34af202fd 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -57,7 +57,7 @@ ModuleSpanningTree::ModuleSpanningTree(InspIRCd* Me) { I_OnPreCommand, I_OnGetServerDescription, I_OnUserInvite, I_OnPostLocalTopicChange, I_OnWallops, I_OnUserNotice, I_OnUserMessage, I_OnBackgroundTimer, - I_OnUserJoin, I_OnChangeHost, I_OnChangeName, I_OnUserPart, I_OnUserConnect, + I_OnUserJoin, I_OnChangeHost, I_OnChangeName, I_OnUserPart, I_OnPostConnect, I_OnUserQuit, I_OnUserPostNick, I_OnUserKick, I_OnRemoteKill, I_OnRehash, I_OnOper, I_OnAddLine, I_OnDelLine, I_ProtoSendMode, I_OnMode, I_OnStats, I_ProtoSendMetaData, I_OnEvent, I_OnSetAway, I_OnCancelAway, I_OnPostCommand @@ -619,7 +619,7 @@ void ModuleSpanningTree::OnUserPart(User* user, Channel* channel, const std::str } } -void ModuleSpanningTree::OnUserConnect(User* user) +void ModuleSpanningTree::OnPostConnect(User* user) { if (IS_LOCAL(user)) { @@ -635,12 +635,12 @@ void ModuleSpanningTree::OnUserConnect(User* user) params.push_back(ConvToStr(user->signon)); params.push_back(":"+std::string(user->fullname)); Utils->DoOneToMany(ServerInstance->Config->GetSID(), "UID", params); - // User is Local, change needs to be reflected! - TreeServer* SourceServer = Utils->FindServer(user->server); - if (SourceServer) - { - SourceServer->AddUserCount(); - } + } + + TreeServer* SourceServer = Utils->FindServer(user->server); + if (SourceServer) + { + SourceServer->SetUserCount(1); // increment by 1 } } @@ -659,11 +659,12 @@ void ModuleSpanningTree::OnUserQuit(User* user, const std::string &reason, const params.push_back(":"+reason); Utils->DoOneToMany(user->uuid,"QUIT",params); } + // Regardless, We need to modify the user Counts.. TreeServer* SourceServer = Utils->FindServer(user->server); if (SourceServer) { - SourceServer->DelUserCount(); + SourceServer->SetUserCount(-1); // decrement by 1 } } -- cgit v1.2.3