X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Finspircd.cpp;h=5f50e900cd3cb297136835607740003f6c263215;hb=89fc6ca9c66198fe54cce19d59279cd454fc1bd0;hp=8d7046ef64182425ed726e0d8b8a708b157e0786;hpb=58385dd458e927994957b6d603f7f9da3fc52e14;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 8d7046ef6..5f50e900c 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -309,11 +309,13 @@ InspIRCd::InspIRCd(int argc, char** argv) SE = SEF->Create(this); delete SEF; - ThreadEngineFactory* tef = new ThreadEngineFactory(); this->Threads = tef->Create(this); delete tef; + /* Default implementation does nothing */ + this->PI = new ProtocolInterface(this); + this->s_signal = 0; // Create base manager classes early, so nothing breaks @@ -447,13 +449,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 @@ -516,18 +511,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); @@ -556,6 +547,9 @@ InspIRCd::InspIRCd(int argc, char** argv) printf("%d.\tIP: %s\tPort: %lu\n", j, i->first.empty() ? "" : i->first.c_str(), (unsigned long)i->second); } } + + printf("\nInspIRCd is now running as '%s'[%s] with %d max open sockets\n", Config->ServerName,Config->GetSID().c_str(), SE->GetMaxFds()); + #ifndef WINDOWS if (!Config->nofork) { @@ -592,28 +586,11 @@ 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()); + 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 */ @@ -678,7 +655,7 @@ int InspIRCd::Run() { if (TIME < OLDTIME) { - SNO->WriteToSnoMask('A', "\002EH?!\002 -- Time is flowing BACKWARDS in this dimension! Clock drifted backwards %ld secs.",OLDTIME-TIME); + SNO->WriteToSnoMask('A', "\002EH?!\002 -- Time is flowing BACKWARDS in this dimension! Clock drifted backwards %lu secs.", (unsigned long)OLDTIME-TIME); } if ((TIME % 3600) == 0)