, MaxQuit(tag->getUInt("maxquit", 255))
, MaxTopic(tag->getUInt("maxtopic", 307))
, MaxKick(tag->getUInt("maxkick", 255))
- , MaxGecos(tag->getUInt("maxgecos", 128))
+ , MaxReal(tag->getUInt("maxreal", tag->getUInt("maxgecos", 128)))
, MaxAway(tag->getUInt("maxaway", 200))
, MaxLine(tag->getUInt("maxline", 512))
, MaxHost(tag->getUInt("maxhost", 64))
delete EmptyTag;
}
-static void ValidHost(const std::string& p, const std::string& msg)
-{
- int num_dots = 0;
- if (p.empty() || p[0] == '.')
- throw CoreException("The value of "+msg+" is not a valid hostname");
- for (unsigned int i=0;i < p.length();i++)
- {
- switch (p[i])
- {
- case ' ':
- throw CoreException("The value of "+msg+" is not a valid hostname");
- case '.':
- num_dots++;
- break;
- }
- }
- if (num_dots == 0)
- throw CoreException("The value of "+msg+" is not a valid hostname");
-}
-
bool ServerConfig::ApplyDisabledCommands()
{
// Enable everything first.
ConfigTag* server = ConfValue("server");
if (sid.empty())
{
- ServerName = server->getString("name", "irc.example.com");
- ValidHost(ServerName, "<server:name>");
+ ServerName = server->getString("name", "irc.example.com", InspIRCd::IsHost);
sid = server->getString("id");
if (!sid.empty() && !InspIRCd::IsSID(sid))