- printf("\n");
- }
-
- ConfigTagList tags = ServerInstance->Config->ConfTags("module");
- for(ConfigIter i = tags.first; i != tags.second; ++i)
- {
- ConfigTag* tag = i->second;
- std::string name = tag->getString("name");
- printf_c("[\033[1;32m*\033[0m] Loading module:\t\033[1;32m%s\033[0m\n",name.c_str());
-
- if (!this->Load(name.c_str()))
- {
- ServerInstance->Logs->Log("MODULE", DEFAULT, this->LastError());
- printf_c("\n[\033[1;31m*\033[0m] %s\n\n", this->LastError().c_str());
- ServerInstance->Exit(EXIT_STATUS_MODULE);
- }
- }
-}
-
-void ModuleManager::UnloadAll()
-{
- /* We do this more than once, so that any service providers get a
- * chance to be unhooked by the modules using them, but then get
- * a chance to be removed themsleves.
- *
- * Note: this deliberately does NOT delete the DLLManager objects
- */
- for (int tries = 0; tries < 4; tries++)
- {
- std::map<std::string, Module*>::iterator i = Modules.begin();
- while (i != Modules.end())
- {
- std::map<std::string, Module*>::iterator me = i++;
- if (CanUnload(me->second))
- {
- DoSafeUnload(me->second);
- }
- }
- ServerInstance->GlobalCulls.Apply();