From 5d67a5fff127bf95bca69b436ef7f645f2fe3281 Mon Sep 17 00:00:00 2001 From: danieldg Date: Wed, 2 Sep 2009 00:44:40 +0000 Subject: Remove unneeded ProtocolInterface::Introduce git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11600 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/main.cpp | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 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 7f2164f62..c402b145a 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -52,7 +52,7 @@ ModuleSpanningTree::ModuleSpanningTree(InspIRCd* Me) I_OnChangeLocalUserHost, I_OnChangeName, I_OnUserPart, I_OnUnloadModule, I_OnUserQuit, I_OnUserPostNick, I_OnUserKick, I_OnRemoteKill, I_OnRehash, I_OnPreRehash, I_OnOper, I_OnAddLine, I_OnDelLine, I_OnMode, I_OnLoadModule, I_OnStats, I_OnEvent, I_OnSetAway, - I_OnPostCommand + I_OnPostCommand, I_OnUserConnect }; ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); @@ -60,10 +60,8 @@ ModuleSpanningTree::ModuleSpanningTree(InspIRCd* Me) ServerInstance->PI = new SpanningTreeProtocolInterface(this, Utils, ServerInstance); loopCall = false; - for (std::vector::const_iterator i = ServerInstance->Users->local_users.begin(); i != ServerInstance->Users->local_users.end(); i++) - { - ServerInstance->PI->Introduce(*i); - } + // update our local user count + Utils->TreeRoot->SetUserCount(ServerInstance->Users->local_users.size()); } void ModuleSpanningTree::ShowLinks(TreeServer* Current, User* user, int hops) @@ -579,6 +577,27 @@ void ModuleSpanningTree::OnBackgroundTimer(time_t curtime) DoConnectTimeout(curtime); } +void ModuleSpanningTree::OnUserConnect(User* user) +{ + if (user->quitting) + return; + + parameterlist params; + params.push_back(user->uuid); + params.push_back(ConvToStr(user->age)); + params.push_back(user->nick); + params.push_back(user->host); + params.push_back(user->dhost); + params.push_back(user->ident); + params.push_back(user->GetIPString()); + params.push_back(ConvToStr(user->signon)); + params.push_back("+"+std::string(user->FormatModes(true))); + params.push_back(":"+std::string(user->fullname)); + Utils->DoOneToMany(ServerInstance->Config->GetSID(), "UID", params); + + Utils->TreeRoot->SetUserCount(1); // increment by 1 +} + void ModuleSpanningTree::OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created) { // Only do this for local users -- cgit v1.3.1-10-gc9f91