X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fserver.cpp;h=d05ece8a45ac2c7f86bce4308dbb3fcc598687c9;hb=748b3a0d89e7ecc9a766471b79fb78f63a5ca2bb;hp=adaaa7d2cbeb767644704f712b70c7a06b013271;hpb=20a91b6bc458a9f5c531a93dbe6b8d5083a3fd0d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/server.cpp b/src/server.cpp index adaaa7d2c..d05ece8a4 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -27,11 +27,15 @@ void InspIRCd::SignalHandler(int signal) { +#ifdef _WIN32 + if (signal == SIGTERM) +#else if (signal == SIGHUP) { Rehash("Caught SIGHUP"); } else if (signal == SIGTERM) +#endif { Exit(signal); } @@ -39,18 +43,13 @@ void InspIRCd::SignalHandler(int signal) void InspIRCd::Exit(int status) { -#ifdef WINDOWS - if (WindowsIPC) - delete WindowsIPC; +#ifdef _WIN32 SetServiceStopped(status); #endif - if (this) - { - this->SendError("Exiting with status " + ConvToStr(status) + " (" + std::string(ExitCodes[status]) + ")"); - this->Cleanup(); - delete this; - ServerInstance = NULL; - } + this->SendError("Exiting with status " + ConvToStr(status) + " (" + std::string(ExitCodes[status]) + ")"); + this->Cleanup(); + delete this; + ServerInstance = NULL; exit (status); } @@ -70,9 +69,12 @@ std::string InspIRCd::GetVersionString(bool operstring) { char versiondata[MAXBUF]; if (operstring) - snprintf(versiondata,MAXBUF,"%s %s :%s [%s,%s,%s]",VERSION,Config->ServerName.c_str(),SYSTEM,REVISION,SE->GetName().c_str(),Config->sid.c_str()); + { + std::string sename = SE->GetName(); + snprintf(versiondata,MAXBUF,"%s %s :%s [%s,%s,%s]",VERSION, Config->ServerName.c_str(), SYSTEM,REVISION, sename.c_str(), Config->sid.c_str()); + } else - snprintf(versiondata,MAXBUF,"InspIRCd-2.0 %s :%s",Config->ServerName.c_str(),Config->CustomVersion.c_str()); + snprintf(versiondata,MAXBUF,"%s %s :%s",BRANCH,Config->ServerName.c_str(),Config->CustomVersion.c_str()); return versiondata; } @@ -86,7 +88,7 @@ void InspIRCd::BuildISupport() std::stringstream v; v << "WALLCHOPS WALLVOICES MODES=" << Config->Limits.MaxModes << " CHANTYPES=# PREFIX=" << this->Modes->BuildPrefixes() << " MAP MAXCHANNELS=" << Config->MaxChans << " MAXBANS=60 VBANLIST NICKLEN=" << Config->Limits.NickMax; v << " CASEMAPPING=rfc1459 STATUSMSG=" << Modes->BuildPrefixes(false) << " CHARSET=ascii TOPICLEN=" << Config->Limits.MaxTopic << " KICKLEN=" << Config->Limits.MaxKick << " MAXTARGETS=" << Config->MaxTargets; - v << " AWAYLEN=" << Config->Limits.MaxAway << " CHANMODES=" << this->Modes->GiveModeList(MASK_CHANNEL) << " FNC NETWORK=" << Config->Network << " MAXPARA=32 ELIST=MU"; + v << " AWAYLEN=" << Config->Limits.MaxAway << " CHANMODES=" << this->Modes->GiveModeList(MASK_CHANNEL) << " FNC NETWORK=" << Config->Network << " MAXPARA=32 ELIST=MU" << " CHANNELLEN=" << Config->Limits.ChanMax; Config->data005 = v.str(); FOREACH_MOD(I_On005Numeric,On005Numeric(Config->data005)); Config->Update005();