X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Finspircd.cpp;h=463f9d82fdcbc130a85131d0005c4aa61c79b84f;hb=cbb95cffac2fe5533bae8bf5dc2ce62fb0f17c2f;hp=0efbd293a4cd8df354e69948f348359af0fc66dc;hpb=6a3319c7fcbaaaed52bd776d6d638224875ab331;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 0efbd293a..463f9d82f 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -48,10 +48,6 @@ #include "caller.h" #include "testsuite.h" -using irc::sockets::insp_ntoa; -using irc::sockets::insp_inaddr; -using irc::sockets::insp_sockaddr; - InspIRCd* SI = NULL; int* mysig = NULL; @@ -77,6 +73,10 @@ const char* ExitCodes[] = "Couldn't load module on startup", /* 13 */ "Could not create windows forked process", /* 14 */ "Received SIGTERM", /* 15 */ + "Bad command handler loaded", /* 16 */ + "RegisterServiceCtrlHandler failed", /* 17 */ + "UpdateSCMStatus failed", /* 18 */ + "CreateEvent failed" /* 19 */ }; void InspIRCd::Cleanup() @@ -454,6 +454,7 @@ InspIRCd::InspIRCd(int argc, char** argv) ThreadEngineFactory* tef = new ThreadEngineFactory(); this->Threads = tef->Create(this); delete tef; + this->Mutexes = new MutexFactory(this); /* Default implementation does nothing */ this->PI = new ProtocolInterface(this); @@ -621,7 +622,7 @@ InspIRCd::InspIRCd(int argc, char** argv) /* During startup we don't actually initialize this * in the thread engine. */ - this->ConfigThread = new ConfigReaderThread(this, true, NULL); + this->ConfigThread = new ConfigReaderThread(this, true, ""); ConfigThread->Run(); delete ConfigThread; this->ConfigThread = NULL; @@ -719,6 +720,8 @@ InspIRCd::InspIRCd(int argc, char** argv) WindowsForkKillOwner(this); FreeConsole(); } + /* Set win32 service as running, if we are running as a service */ + SetServiceRunning(); #endif Logs->Log("STARTUP", DEFAULT, "Startup complete as '%s'[%s], %d max open sockets", Config->ServerName,Config->GetSID().c_str(), SE->GetMaxFds()); @@ -771,7 +774,8 @@ int InspIRCd::Run() this->Res->Rehash(); this->ResetMaxBans(); InitializeDisabledCommands(Config->DisabledCommands, this); - FOREACH_MOD_I(this, I_OnRehash, OnRehash(Config->RehashUser, Config->RehashParameter)); + User* user = !Config->RehashUserUID.empty() ? FindNick(Config->RehashUserUID) : NULL; + FOREACH_MOD_I(this, I_OnRehash, OnRehash(user, Config->RehashParameter)); this->BuildISupport(); }