X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fserver.cpp;h=a73abcac271e2b06c05c78798bf04b1e7e8827d2;hb=d555db40f4b39f10ad06c2449b42711c1e74105f;hp=041b9f5ddd839ddf7901deb3ca86b9f13ba2f2e7;hpb=9d1b979fbca14013718f29e4e0380bb84b5e5470;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/server.cpp b/src/server.cpp index 041b9f5dd..a73abcac2 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -2,7 +2,7 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2007 InspIRCd Development Team + * InspIRCd: (C) 2002-2008 InspIRCd Development Team * See: http://www.inspircd.org/wiki/index.php/Credits * * This program is free but copyrighted software; see @@ -11,6 +11,8 @@ * --------------------------------------------------- */ +/* $Core: libIRCDserver */ + #include #include "exitcodes.h" #include "inspircd.h" @@ -38,19 +40,19 @@ void InspIRCd::Exit(int status) { this->SendError("Exiting with status " + ConvToStr(status) + " (" + std::string(ExitCodes[status]) + ")"); this->Cleanup(); - } - exit (status); + } + exit (status); } void InspIRCd::Rehash() { - this->WriteOpers("*** Rehashing config file %s due to SIGHUP",ServerConfig::CleanFilename(this->ConfigFileName)); + this->SNO->WriteToSnoMask('A', "Rehashing config file %s due to SIGHUP",ServerConfig::CleanFilename(this->ConfigFileName)); this->CloseLog(); if (!this->OpenLog(this->Config->argv, this->Config->argc)) - this->WriteOpers("*** ERROR: Could not open logfile %s: %s", Config->logpath.c_str(), strerror(errno)); + this->SNO->WriteToSnoMask('A', "ERROR: Could not open logfile %s: %s", Config->logpath.c_str(), strerror(errno)); this->RehashUsersAndChans(); FOREACH_MOD_I(this, I_OnGarbageCollect, OnGarbageCollect()); - this->Config->Read(false,NULL); + /*this->Config->Read(false,NULL);*/ this->ResetMaxBans(); this->Res->Rehash(); FOREACH_MOD_I(this,I_OnRehash,OnRehash(NULL,"")); @@ -59,9 +61,9 @@ void InspIRCd::Rehash() void InspIRCd::RehashServer() { - this->WriteOpers("*** Rehashing config file"); + this->SNO->WriteToSnoMask('A', "Rehashing config file"); this->RehashUsersAndChans(); - this->Config->Read(false,NULL); + /*this->Config->Read(false,NULL);*/ this->ResetMaxBans(); this->Res->Rehash(); } @@ -69,15 +71,13 @@ void InspIRCd::RehashServer() std::string InspIRCd::GetVersionString() { char versiondata[MAXBUF]; - char dnsengine[] = "singlethread-object"; - if (*Config->CustomVersion) { snprintf(versiondata,MAXBUF,"%s %s :%s",VERSION,Config->ServerName,Config->CustomVersion); } else { - snprintf(versiondata,MAXBUF,"%s %s :%s [FLAGS=%s,%s,%s]",VERSION,Config->ServerName,SYSTEM,REVISION,SE->GetName().c_str(),dnsengine); + snprintf(versiondata,MAXBUF,"%s %s :%s [FLAGS=%s,%s,%s]",VERSION,Config->ServerName,SYSTEM,REVISION,SE->GetName().c_str(),Config->sid); } return versiondata; } @@ -87,8 +87,8 @@ void InspIRCd::BuildISupport() // the neatest way to construct the initial 005 numeric, considering the number of configure constants to go in it... std::stringstream v; v << "WALLCHOPS WALLVOICES MODES=" << MAXMODES << " CHANTYPES=# PREFIX=" << this->Modes->BuildPrefixes() << " MAP MAXCHANNELS=" << Config->MaxChans << " MAXBANS=60 VBANLIST NICKLEN=" << NICKMAX-1; - v << " CASEMAPPING=rfc1459 STATUSMSG=@%+ CHARSET=ascii TOPICLEN=" << MAXTOPIC << " KICKLEN=" << MAXKICK << " MAXTARGETS=" << Config->MaxTargets << " AWAYLEN="; - v << MAXAWAY << " CHANMODES=" << this->Modes->ChanModes() << " FNC NETWORK=" << Config->Network << " MAXPARA=32 ELIST=MU"; + v << " CASEMAPPING=rfc1459 STATUSMSG=@" << (this->Config->AllowHalfop ? "%" : "") << "+ CHARSET=ascii TOPICLEN=" << MAXTOPIC << " KICKLEN=" << MAXKICK << " MAXTARGETS=" << Config->MaxTargets; + v << " AWAYLEN=" << MAXAWAY << " CHANMODES=" << this->Modes->ChanModes() << " FNC NETWORK=" << Config->Network << " MAXPARA=32 ELIST=MU"; Config->data005 = v.str(); FOREACH_MOD_I(this,I_On005Numeric,On005Numeric(Config->data005)); Config->Update005(); @@ -175,9 +175,11 @@ std::string InspIRCd::GetUID() if (current_uid[3] == 'Z') { - /* If we get to here, we need to wrap around to AAAA. */ - for(int j = 3; j < UUID_LENGTH - 1; j++) - current_uid[j] = 'A'; + /* + * Ugh. We have run out of room.. roll back around to the + * start of the UUID namespace. -- w00t + */ + this->InitialiseUID(); /* * and now we need to break the inner for () to continue the while (),