diff options
author | om <om@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-28 23:32:41 +0000 |
---|---|---|
committer | om <om@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-28 23:32:41 +0000 |
commit | 8394be69a0e3b5fea617c69b69aa27daf547fc4e (patch) | |
tree | ccf40646d8ed2145d9c6a3693e073434fe33bc4c /src/modules/m_spanningtree | |
parent | aa953912596e5fae066804ac6afbe9c44ceae50d (diff) |
Move everything module-related out of InspIRCd and into ModuleManager, there is a ModuleManager instantiated as InspIRCd::Modules. Several of the function names have changed slightly as well. e.g. Instance->FindModule(m_foobar.so); is now Instance->Modules->Find(m_foobar.so);
All modules in the core distribution should also be updated in line with these changes.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7985 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 5 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket1.cpp | 11 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket2.cpp | 6 | ||||
-rw-r--r-- | src/modules/m_spanningtree/utils.cpp | 3 |
4 files changed, 11 insertions, 14 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 9d7b7db79..f0ba16cbb 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -36,7 +36,7 @@ ModuleSpanningTree::ModuleSpanningTree(InspIRCd* Me) : Module(Me), max_local(0), max_global(0) { - ServerInstance->UseInterface("InspSocketHook"); + ServerInstance->Modules->UseInterface("InspSocketHook"); Utils = new SpanningTreeUtilities(Me, this); command_rconnect = new cmd_rconnect(ServerInstance, this, Utils); ServerInstance->AddCommand(command_rconnect); @@ -1449,7 +1449,7 @@ ModuleSpanningTree::~ModuleSpanningTree() ServerInstance->Timers->DelTimer(RefreshTimer); - ServerInstance->DoneWithInterface("InspSocketHook"); + ServerInstance->Modules->DoneWithInterface("InspSocketHook"); } Version ModuleSpanningTree::GetVersion() @@ -1481,4 +1481,3 @@ Priority ModuleSpanningTree::Prioritize() } MODULE_INIT(ModuleSpanningTree) - diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index fcfb21f68..8a413ab8d 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -125,7 +125,7 @@ std::string TreeSocket::MakePass(const std::string &password, const std::string * Note: If m_sha256.so is not loaded, we MUST fall back to plaintext with no * HMAC challenge/response. */ - Module* sha256 = Instance->FindModule("m_sha256.so"); + Module* sha256 = Instance->Modules->Find("m_sha256.so"); if (Utils->ChallengeResponse && sha256 && !challenge.empty()) { /* XXX: This is how HMAC is supposed to be done: @@ -279,9 +279,9 @@ std::string TreeSocket::MyCapabilities() { std::vector<std::string> modlist; std::string capabilities; - for (int i = 0; i <= this->Instance->GetModuleCount(); i++) + for (int i = 0; i <= this->Instance->Modules->GetCount(); i++) { - if (this->Instance->modules[i]->GetVersion().Flags & VF_COMMON) + if (this->Instance->Modules->modules[i]->GetVersion().Flags & VF_COMMON) modlist.push_back(this->Instance->Config->module_names[i]); } sort(modlist.begin(),modlist.end()); @@ -365,7 +365,7 @@ void TreeSocket::SendCapabilities() #endif std::string extra; /* Do we have sha256 available? If so, we send a challenge */ - if (Utils->ChallengeResponse && (Instance->FindModule("m_sha256.so"))) + if (Utils->ChallengeResponse && (Instance->Modules->Find("m_sha256.so"))) { this->SetOurChallenge(RandString(20)); extra = " CHALLENGE=" + this->GetOurChallenge(); @@ -495,7 +495,7 @@ bool TreeSocket::Capab(const std::deque<std::string> ¶ms) /* Challenge response, store their challenge for our password */ std::map<std::string,std::string>::iterator n = this->CapKeys.find("CHALLENGE"); - if (Utils->ChallengeResponse && (n != this->CapKeys.end()) && (Instance->FindModule("m_sha256.so"))) + if (Utils->ChallengeResponse && (n != this->CapKeys.end()) && (Instance->Modules->Find("m_sha256.so"))) { /* Challenge-response is on now */ this->SetTheirChallenge(n->second); @@ -1400,4 +1400,3 @@ bool TreeSocket::OnDataReady() */ return (data && !*data); } - diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 7172656ee..dedf76786 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -73,7 +73,7 @@ bool TreeSocket::Modules(const std::string &prefix, std::deque<std::string> &par for (unsigned int i = 0; i < Instance->Config->module_names.size(); i++) { - Version V = Instance->modules[i]->GetVersion(); + Version V = Instance->Modules->modules[i]->GetVersion(); char modulename[MAXBUF]; char flagstate[MAXBUF]; *flagstate = 0; @@ -90,7 +90,7 @@ bool TreeSocket::Modules(const std::string &prefix, std::deque<std::string> &par strlcpy(modulename,Instance->Config->module_names[i].c_str(),256); if (*source->oper) { - snprintf(strbuf, MAXBUF, "::%s 900 %s :0x%08lx %d.%d.%d.%d %s (%s)",Instance->Config->ServerName,source->nick,(long unsigned int)Instance->modules[i],V.Major,V.Minor,V.Revision,V.Build,ServerConfig::CleanFilename(modulename),flagstate+2); + snprintf(strbuf, MAXBUF, "::%s 900 %s :0x%08lx %d.%d.%d.%d %s (%s)",Instance->Config->ServerName,source->nick,(long unsigned int)Instance->Modules->modules[i],V.Major,V.Minor,V.Revision,V.Build,ServerConfig::CleanFilename(modulename),flagstate+2); } else { @@ -849,7 +849,7 @@ bool TreeSocket::ComparePass(const std::string &ours, const std::string &theirs) /* One or both of us specified hmac sha256, but we don't have sha256 module loaded! * We can't allow this password as valid. */ - if (!Instance->FindModule("m_sha256.so") || !Utils->ChallengeResponse) + if (!Instance->Modules->Find("m_sha256.so") || !Utils->ChallengeResponse) return false; else /* Straight string compare of hashes */ diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp index dcce230ac..705566d44 100644 --- a/src/modules/m_spanningtree/utils.cpp +++ b/src/modules/m_spanningtree/utils.cpp @@ -179,7 +179,7 @@ SpanningTreeUtilities::SpanningTreeUtilities(InspIRCd* Instance, ModuleSpanningT this->TreeRoot = new TreeServer(this, ServerInstance, ServerInstance->Config->ServerName, ServerInstance->Config->ServerDesc, ServerInstance->Config->GetSID()); - modulelist* ml = ServerInstance->FindInterface("InspSocketHook"); + modulelist* ml = ServerInstance->Modules->FindInterface("InspSocketHook"); /* Did we find any modules? */ if (ml) @@ -664,4 +664,3 @@ Link* SpanningTreeUtilities::FindLink(const std::string& name) } return NULL; } - |