summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-11-02 14:29:40 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-11-02 14:29:40 +0000
commit0d2b6637ca369166629576f160ef1fd376078e5a (patch)
tree542bb6a239bf42a372e79c0c3b0aa0c624cfe8c4 /src
parent7901c49c541860a6c120b9220bf6196e4d3672f7 (diff)
This was never supposed to be invoked on /rehash, only startup.. so move it to startup only. Also remove (redundant) user arg.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10792 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/command_parse.cpp41
-rw-r--r--src/configreader.cpp12
-rw-r--r--src/inspircd.cpp3
3 files changed, 15 insertions, 41 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index 3373f714f..e6b38242c 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -591,21 +591,12 @@ const char* CommandParser::LoadCommand(const char* name)
return NULL;
}
-void CommandParser::SetupCommandTable(User* user)
+/** This is only invoked on startup
+ */
+void CommandParser::SetupCommandTable()
{
- for (SharedObjectList::iterator command = RFCCommands.begin(); command != RFCCommands.end(); command++)
- {
- Command *cmdptr = cmdlist.find(command->first)->second;
- cmdlist.erase(cmdlist.find(command->first));
- RFCCommands.erase(command);
- delete cmdptr;
- }
-
- if (!user)
- {
- printf("\nLoading core commands");
- fflush(stdout);
- }
+ printf("\nLoading core commands");
+ fflush(stdout);
DIR* library = opendir(LIBRARYDIR);
if (library)
@@ -615,29 +606,19 @@ void CommandParser::SetupCommandTable(User* user)
{
if (InspIRCd::Match(entry->d_name, "cmd_*.so"))
{
- if (!user)
- {
- printf(".");
- fflush(stdout);
- }
+ printf(".");
+ fflush(stdout);
+
const char* err = this->LoadCommand(entry->d_name);
if (err)
{
- if (user)
- {
- user->WriteServ("NOTICE %s :*** Failed to load core command %s: %s", user->nick.c_str(), entry->d_name, err);
- }
- else
- {
- printf("Error loading %s: %s", entry->d_name, err);
- exit(EXIT_STATUS_BADHANDLER);
- }
+ printf("Error loading %s: %s", entry->d_name, err);
+ exit(EXIT_STATUS_BADHANDLER);
}
}
}
closedir(library);
- if (!user)
- printf("\n");
+ printf("\n");
}
if (cmdlist.find("RELOAD") == cmdlist.end())
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 7f211084c..3be7d5945 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -1330,17 +1330,7 @@ void ServerConfig::Read(bool bail, const std::string &useruid)
}
- if (bail)
- {
- /** Note: This is safe, the method checks for user == NULL */
- ServerInstance->Threads->Lock();
- User* user = NULL;
- if (!useruid.empty())
- user = ServerInstance->FindNick(useruid);
- ServerInstance->Parser->SetupCommandTable(user);
- ServerInstance->Threads->Unlock();
- }
- else
+ if (!bail)
{
if (!useruid.empty())
{
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index c0391b679..1b173e56e 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -632,6 +632,9 @@ InspIRCd::InspIRCd(int argc, char** argv)
delete ConfigThread;
this->ConfigThread = NULL;
+ /** Note: This is safe, the method checks for user == NULL */
+ this->Parser->SetupCommandTable();
+
this->Res = new DNS(this);
this->AddServerName(Config->ServerName);