summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-11-11 18:27:25 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-11-11 18:27:25 +0000
commitd1323ef03f90dc0a4b82137f2573b60a85cc965c (patch)
tree90a69ba836d5eb05c193bc1a8441d23b62861b8a
parent461e4aef03d8d0f4570d878ef1656a574e1b791d (diff)
This works properly now. Files in the file:// schema are loaded by the core.
Anything else will be loaded by a module, this isnt done yet. For remote includes to work, your <module> tags for the remote includes modules must be in the base inspircd.conf file. This is the only file gauranteed to be avaialble in pass 1 of the two pass config read. At the end of pass 1, all files are opened/downloaded and placed into a map. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8568 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/configreader.cpp17
-rw-r--r--src/modules.cpp2
2 files changed, 12 insertions, 7 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 2852dc727..72f1d3203 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -1208,6 +1208,9 @@ void ServerConfig::Read(bool bail, User* user, int pass)
{
for (std::vector<std::string>::iterator adding = added_modules.begin(); adding != added_modules.end(); adding++)
{
+ if (bail)
+ printf_c("[\033[1;32m*\033[0m] Loading module:\t\033[1;32m%s\033[0m\n", adding->c_str());
+
if (ServerInstance->Modules->Load(adding->c_str()))
{
ServerInstance->WriteOpers("*** REHASH LOADED MODULE: %s",adding->c_str());
@@ -1220,14 +1223,17 @@ void ServerConfig::Read(bool bail, User* user, int pass)
{
if (user)
user->WriteServ("974 %s %s :%s",user->nick, adding->c_str(), ServerInstance->Modules->LastError().c_str());
+
+ if (bail)
+ {
+ printf_c("\n[\033[1;31m*\033[0m] %s\n\n", ServerInstance->Modules->LastError().c_str());
+ ServerInstance->Exit(EXIT_STATUS_MODULE);
+ }
}
}
}
- ServerInstance->Log(DEFAULT,"Successfully unloaded %lu of %lu modules and loaded %lu of %lu modules in pass 2.",(unsigned long)rem,(unsigned long)removed_modules.size(),(unsigned long)add,(unsigned long)added_modules.size());
-
- /** Note: This is safe, the method checks for user == NULL */
- /*ServerInstance->Parser->SetupCommandTable(user);*/
+ ServerInstance->Log(DEFAULT,"Successfully unloaded %lu of %lu modules and loaded %lu of %lu modules.",(unsigned long)rem,(unsigned long)removed_modules.size(),(unsigned long)add,(unsigned long)added_modules.size());
if (user)
user->WriteServ("NOTICE %s :*** Successfully rehashed server.", user->nick);
@@ -1237,8 +1243,9 @@ void ServerConfig::Read(bool bail, User* user, int pass)
bool ServerConfig::Downloading()
{
+ ServerInstance->Log(DEBUG, "ServerConfig::Downloading() TotalDownloaded %u of %u", TotalDownloaded, IncludedFiles.size());
/* Returns true if there are still files in the process of downloading */
- return (TotalDownloaded >= IncludedFiles.size());
+ return (TotalDownloaded < IncludedFiles.size());
}
void ServerConfig::StartDownloads()
diff --git a/src/modules.cpp b/src/modules.cpp
index 00265dc07..d04b0e243 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -557,8 +557,6 @@ void ModuleManager::LoadAll()
Instance->Exit(EXIT_STATUS_MODULE);
}
}
- printf_c("\nA total of \033[1;32m%d\033[0m module%s been loaded.\n", (this->GetCount()), (this->GetCount()) == 1 ? " has" : "s have");
- Instance->Log(DEFAULT,"Total loaded modules: %d", this->GetCount());
}
bool ModuleManager::PublishFeature(const std::string &FeatureName, Module* Mod)