X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fconfigreader.cpp;h=d52f3de13fdc3f03690947555f0f4a6d92b6337e;hb=21e25f7aa9091821e24447784d08d8fdd905f1c3;hp=df58ec812a4fc0a223883e2acc267b2bb0d15d5c;hpb=94b3599a48f3b53683327be3703a8471f81b916b;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/configreader.cpp b/src/configreader.cpp index df58ec812..d52f3de13 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -29,6 +29,21 @@ #include "configparser.h" #include +ServerLimits::ServerLimits(ConfigTag* tag) + : NickMax(tag->getInt("maxnick", 32)) + , ChanMax(tag->getInt("maxchan", 64)) + , MaxModes(tag->getInt("maxmodes", 20)) + , IdentMax(tag->getInt("maxident", 11)) + , MaxQuit(tag->getInt("maxquit", 255)) + , MaxTopic(tag->getInt("maxtopic", 307)) + , MaxKick(tag->getInt("maxkick", 255)) + , MaxGecos(tag->getInt("maxgecos", 128)) + , MaxAway(tag->getInt("maxaway", 200)) + , MaxLine(tag->getInt("maxline", 512)) + , MaxHost(tag->getInt("maxhost", 64)) +{ +} + static ConfigTag* CreateEmptyTag() { std::vector* items; @@ -37,6 +52,7 @@ static ConfigTag* CreateEmptyTag() ServerConfig::ServerConfig() : EmptyTag(CreateEmptyTag()) + , Limits(EmptyTag) { RawLog = HideBans = HideSplits = UndernetMsgPrefix = false; WildcardIPv6 = InvBypassModes = true; @@ -405,17 +421,7 @@ void ServerConfig::Fill() OperMaxChans = ConfValue("channels")->getInt("opers"); c_ipv4_range = ConfValue("cidr")->getInt("ipv4clone", 32); c_ipv6_range = ConfValue("cidr")->getInt("ipv6clone", 128); - Limits.NickMax = ConfValue("limits")->getInt("maxnick", 32); - Limits.ChanMax = ConfValue("limits")->getInt("maxchan", 64); - Limits.MaxModes = ConfValue("limits")->getInt("maxmodes", 20); - Limits.IdentMax = ConfValue("limits")->getInt("maxident", 11); - Limits.MaxHost = ConfValue("limits")->getInt("maxhost", 64); - Limits.MaxQuit = ConfValue("limits")->getInt("maxquit", 255); - Limits.MaxTopic = ConfValue("limits")->getInt("maxtopic", 307); - Limits.MaxKick = ConfValue("limits")->getInt("maxkick", 255); - Limits.MaxGecos = ConfValue("limits")->getInt("maxgecos", 128); - Limits.MaxAway = ConfValue("limits")->getInt("maxaway", 200); - Limits.MaxLine = ConfValue("limits")->getInt("maxline", 512); + Limits = ServerLimits(ConfValue("limits")); Paths.Config = ConfValue("path")->getString("configdir", INSPIRCD_CONFIG_PATH); Paths.Data = ConfValue("path")->getString("datadir", INSPIRCD_DATA_PATH); Paths.Log = ConfValue("path")->getString("logdir", INSPIRCD_LOG_PATH);