X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Finspircd.cpp;h=f7f96983572db3da85afb4d8d3b832943ba0398e;hb=2db77cda56947d4ee0f913c8082f6607855ca713;hp=be4bc012eaf8512484429816c19d42121f0fd168;hpb=26057b119fc676f268fa920b6d34ff8371e81183;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/inspircd.cpp b/src/inspircd.cpp index be4bc012e..f7f969835 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -13,6 +13,7 @@ /* $Install: src/inspircd $(BINPATH) */ + #include "inspircd.h" #include @@ -446,13 +447,6 @@ InspIRCd::InspIRCd(int argc, char** argv) this->Modes = new ModeParser(this); - /* set up fake client (uid is incorrect at this point, - * until after config is read. we set up the user again - * at that point - */ - this->FakeClient = new User(this); - this->FakeClient->SetFd(FD_MAGIC_NUMBER); - if (!do_root) this->CheckRoot(); else @@ -515,18 +509,14 @@ InspIRCd::InspIRCd(int argc, char** argv) Config->sid[2] = (char)(sid % 10 + 48); } - this->InitialiseUID(); - /* set up fake client again this time with the correct uid */ - delete FakeClient; - this->FakeClient = new User(this); + this->FakeClient = new User(this, "#INVALID"); this->FakeClient->SetFd(FD_MAGIC_NUMBER); // Get XLine to do it's thing. this->XLines->CheckELines(); this->XLines->ApplyLines(); - CheckDie(); int bounditems = BindPorts(true, found_ports, pl); @@ -591,28 +581,12 @@ InspIRCd::InspIRCd(int argc, char** argv) } #endif - printf("\nInspIRCd is now running as '%s'[%s]\n", Config->ServerName,Config->GetSID().c_str()); - Logs->Log("STARTUP", DEFAULT, "Startup complete as '%s'[%s]", Config->ServerName,Config->GetSID().c_str()); + printf("\nInspIRCd is now running as '%s'[%s] with %d max open sockets\n", Config->ServerName,Config->GetSID().c_str(), SE->GetMaxFds()); + Logs->Log("STARTUP", DEFAULT, "Startup complete as '%s'[%s], %d max open sockets", Config->ServerName,Config->GetSID().c_str(), SE->GetMaxFds()); this->WritePID(Config->PID); } -/* moved to a function, as UID generation can call this also */ -void InspIRCd::InitialiseUID() -{ - int i = 3; - - current_uid[0] = Config->sid[0]; - current_uid[1] = Config->sid[1]; - current_uid[2] = Config->sid[2]; - - /* Initialise UID */ - for(i = 3; i < UUID_LENGTH - 1; i++) - current_uid[i] = 'A'; - - current_uid[UUID_LENGTH] = '\0'; -} - int InspIRCd::Run() { /* See if we're supposed to be running the test suite rather than entering the mainloop */ @@ -677,7 +651,7 @@ int InspIRCd::Run() { if (TIME < OLDTIME) { - SNO->WriteToSnoMask('A', "\002EH?!\002 -- Time is flowing BACKWARDS in this dimension! Clock drifted backwards %d secs.",OLDTIME-TIME); + SNO->WriteToSnoMask('A', "\002EH?!\002 -- Time is flowing BACKWARDS in this dimension! Clock drifted backwards %ld secs.",OLDTIME-TIME); } if ((TIME % 3600) == 0) @@ -764,13 +738,12 @@ int main(int argc, char ** argv) */ bool InspIRCd::AllModulesReportReady(User* user) { - size_t ready = 0; for (EventHandlerIter i = Modules->EventHandlers[I_OnCheckReady].begin(); i != Modules->EventHandlers[I_OnCheckReady].end(); ++i) { - if ((*i)->OnCheckReady(user)) - ready++; + if (!(*i)->OnCheckReady(user)) + return false; } - return (ready == Modules->EventHandlers[I_OnCheckReady].size()); + return true; } time_t InspIRCd::Time()