X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fconfigreader.h;h=9fcb9c6a333f72a12fed7dfc08a1201c91092c53;hb=7f7ffef3b4d5dc6242918a48713d6fab96928a80;hp=4d70d8510ac25660258f2d4092da6d66fd69b0ab;hpb=e191f0ed6cdca421407ebc67c28fafabc6cc63f7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/configreader.h b/include/configreader.h index 4d70d8510..9fcb9c6a3 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -42,7 +42,7 @@ class CoreExport ConfigTag : public refcountbase const int src_line; /** Get the value of an option, using def if it does not exist */ - std::string getString(const std::string& key, const std::string& def = ""); + std::string getString(const std::string& key, const std::string& def = "", size_t minlen = 0, size_t maxlen = UINT32_MAX); /** Get the value of an option, using def if it does not exist */ long getInt(const std::string& key, long def = 0, long min = LONG_MIN, long max = LONG_MAX); /** Get the value of an option, using def if it does not exist */ @@ -122,7 +122,7 @@ class ServerLimits */ ServerLimits(ConfigTag* tag); - /** Maximum length of a n!u@h mask */ + /** Maximum length of a n!u\@h mask */ size_t GetMaxMask() const { return NickMax + 1 + IdentMax + 1 + MaxHost; } }; @@ -184,6 +184,11 @@ class CoreExport OperInfo : public refcountbase /** Name of the oper type; i.e. the one shown in WHOIS */ std::string name; + /** Creates a new OperInfo with the specified oper type name. + * @param Name The name of the oper type. + */ + OperInfo(const std::string& Name); + /** Get a configuration item, searching in the oper, type, and class blocks (in that order) */ std::string getConfig(const std::string& key); void init(); @@ -216,11 +221,7 @@ class CoreExport ServerConfig /** Module path */ std::string Module; - ServerPaths() - : Config(INSPIRCD_CONFIG_PATH) - , Data(INSPIRCD_DATA_PATH) - , Log(INSPIRCD_LOG_PATH) - , Module(INSPIRCD_MODULE_PATH) { } + ServerPaths(ConfigTag* tag); std::string PrependConfig(const std::string& fn) const { return FileSystem::ExpandPath(Config, fn); } std::string PrependData(const std::string& fn) const { return FileSystem::ExpandPath(Data, fn); } @@ -315,19 +316,13 @@ class CoreExport ServerConfig */ bool DisabledDontExist; - /** This variable contains a space-seperated list - * of commands which are disabled by the - * administrator of the server for non-opers. - */ - std::string DisabledCommands; - /** This variable identifies which usermodes have been diabled. */ - char DisabledUModes[64]; + std::bitset<64> DisabledUModes; /** This variable identifies which chanmodes have been disabled. */ - char DisabledCModes[64]; + std::bitset<64> DisabledCModes; /** If set to true, then all opers on this server are * shown with a generic 'is an IRC operator' line rather @@ -340,11 +335,6 @@ class CoreExport ServerConfig */ bool RestrictBannedUsers; - /** The number of seconds the DNS subsystem - * will wait before timing out any request. - */ - int dns_timeout; - /** The size of the read() buffer in the user * handling code, used to read data into a user's * recvQ. @@ -433,6 +423,10 @@ class CoreExport ServerConfig */ bool SyntaxHints; + /** The name of the casemapping method used by this server. + */ + std::string CaseMapping; + /** If set to true, the CycleHosts mode change will be sourced from the user, * rather than the server */ @@ -489,7 +483,8 @@ class CoreExport ServerConfig void Fill(); - bool ApplyDisabledCommands(const std::string& data); + /** Disables the commands specified in . */ + bool ApplyDisabledCommands(); /** Escapes a value for storage in a configuration key. * @param str The string to escape.