1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2007 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
18 void InspIRCd::SignalHandler(int signal)
28 void InspIRCd::Rehash()
30 this->WriteOpers("*** Rehashing config file %s due to SIGHUP",ServerConfig::CleanFilename(this->ConfigFileName));
32 this->OpenLog(this->Config->argv, this->Config->argc);
33 this->RehashUsersAndChans();
34 FOREACH_MOD_I(this, I_OnGarbageCollect, OnGarbageCollect());
35 this->Config->Read(false,NULL);
38 FOREACH_MOD_I(this,I_OnRehash,OnRehash(NULL,""));
39 this->BuildISupport();
42 void InspIRCd::RehashServer()
44 this->WriteOpers("*** Rehashing config file");
45 this->RehashUsersAndChans();
46 this->Config->Read(false,NULL);
51 std::string InspIRCd::GetVersionString()
53 char versiondata[MAXBUF];
54 char dnsengine[] = "singlethread-object";
56 if (*Config->CustomVersion)
58 snprintf(versiondata,MAXBUF,"%s %s :%s",VERSION,Config->ServerName,Config->CustomVersion);
62 snprintf(versiondata,MAXBUF,"%s %s :%s [FLAGS=%s,%s,%s]",VERSION,Config->ServerName,SYSTEM,REVISION,SE->GetName().c_str(),dnsengine);
67 void InspIRCd::BuildISupport()
69 // the neatest way to construct the initial 005 numeric, considering the number of configure constants to go in it...
71 v << "WALLCHOPS WALLVOICES MODES=" << MAXMODES-1 << " CHANTYPES=# PREFIX=" << this->Modes->BuildPrefixes() << " MAP MAXCHANNELS=" << Config->MaxChans << " MAXBANS=60 VBANLIST NICKLEN=" << NICKMAX-1;
72 v << " CASEMAPPING=rfc1459 STATUSMSG=@%+ CHARSET=ascii TOPICLEN=" << MAXTOPIC << " KICKLEN=" << MAXKICK << " MAXTARGETS=" << Config->MaxTargets << " AWAYLEN=";
73 v << MAXAWAY << " CHANMODES=" << this->Modes->ChanModes() << " FNC NETWORK=" << Config->Network << " MAXPARA=32 ELIST=MU";
74 Config->data005 = v.str();
75 FOREACH_MOD_I(this,I_On005Numeric,On005Numeric(Config->data005));
79 std::string InspIRCd::GetRevision()
84 void InspIRCd::AddServerName(const std::string &servername)
86 servernamelist::iterator itr = servernames.begin();
87 for(; itr != servernames.end(); ++itr)
88 if(**itr == servername)
91 string * ns = new string(servername);
92 servernames.push_back(ns);
95 const char* InspIRCd::FindServerNamePtr(const std::string &servername)
97 servernamelist::iterator itr = servernames.begin();
98 for(; itr != servernames.end(); ++itr)
99 if(**itr == servername)
100 return (*itr)->c_str();
102 servernames.push_back(new string(servername));
103 itr = --servernames.end();
104 return (*itr)->c_str();
107 bool InspIRCd::FindServerName(const std::string &servername)
109 servernamelist::iterator itr = servernames.begin();
110 for(; itr != servernames.end(); ++itr)
111 if(**itr == servername)