diff options
author | Naram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-10-19 19:55:32 +0000 |
---|---|---|
committer | Naram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-10-19 19:55:32 +0000 |
commit | 9ca710a2a0aabd528514908f8f68f71021be5592 (patch) | |
tree | afc5b24e87f9f9440431b03ea3889fd85877ac74 /src | |
parent | f91f5005e42f9809359c90e46c426f4116fcbf5f (diff) |
Added defaults directive to botserv block in new config.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1453 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/config.c | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/src/config.c b/src/config.c index c822ec990..abfd6b627 100644 --- a/src/config.c +++ b/src/config.c @@ -161,11 +161,7 @@ time_t MSSendDelay; bool MSNotifyAll; int MSMemoReceipt; -int BSDefDontKickOps; -int BSDefDontKickVoices; -int BSDefFantasy; -int BSDefGreet; -int BSDefSymbiosis; +static std::string BSDefaults; int BSDefFlags; int BSKeepData; int BSMinUsers; @@ -613,6 +609,7 @@ int ServerConfig::Read(bool bail) {"botserv", "nick", "", new ValueContainerChar(&s_BotServ), DT_CHARPTR, NoValidation}, {"botserv", "description", "Bot Service", new ValueContainerChar(&desc_BotServ), DT_CHARPTR, ValidateBotServ}, {"botserv", "database", "bot.db", new ValueContainerChar(&BotDBName), DT_CHARPTR, ValidateBotServ}, + {"botserv", "defaults", "", new ValueContainerString(&BSDefaults), DT_STRING, NoValidation}, {NULL, NULL, NULL, NULL, DT_NOTHING, NoValidation} }; /* These tags can occur multiple times, and therefore they have special code to read them @@ -1194,12 +1191,6 @@ Directive directives[] = { {"BadPassTimeout", {{PARAM_TIME, PARAM_RELOAD, &BadPassTimeout}}}, {"BotCoreModules", {{PARAM_STRING, PARAM_RELOAD, &BotCoreModules}}}, {"BSBadWordsMax", {{PARAM_POSINT, PARAM_RELOAD, &BSBadWordsMax}}}, - {"BSDefDontKickOps", {{PARAM_SET, PARAM_RELOAD, &BSDefDontKickOps}}}, - {"BSDefDontKickVoices", - {{PARAM_SET, PARAM_RELOAD, &BSDefDontKickVoices}}}, - {"BSDefGreet", {{PARAM_SET, PARAM_RELOAD, &BSDefGreet}}}, - {"BSDefFantasy", {{PARAM_SET, PARAM_RELOAD, &BSDefFantasy}}}, - {"BSDefSymbiosis", {{PARAM_SET, PARAM_RELOAD, &BSDefSymbiosis}}}, {"BSCaseSensitive", {{PARAM_SET, PARAM_RELOAD, &BSCaseSensitive}}}, {"BSFantasyCharacter", {{PARAM_STRING, PARAM_RELOAD, &BSFantasyCharacter}}}, @@ -1814,17 +1805,18 @@ int read_config(int reload) } } - BSDefFlags = 0; - if (BSDefDontKickOps) - BSDefFlags |= BS_DONTKICKOPS; - if (BSDefDontKickVoices) - BSDefFlags |= BS_DONTKICKVOICES; - if (BSDefGreet) - BSDefFlags |= BS_GREET; - if (BSDefFantasy) - BSDefFlags |= BS_FANTASY; - if (BSDefSymbiosis) - BSDefFlags |= BS_SYMBIOSIS; + BSDefFlags = 0; + if (!BSDefaults.empty()) { + spacesepstream options(BSDefaults); + std::string option; + while (options.GetToken(option)) { + if (option == "dontkickops") BSDefFlags |= BS_DONTKICKOPS; + else if (option == "dontkickvoices") BSDefFlags |= BS_DONTKICKVOICES; + else if (option == "greet") BSDefFlags |= BS_GREET; + else if (option == "fantasy") BSDefFlags |= BS_FANTASY; + else if (option == "symbiosis") BSDefFlags |= BS_SYMBIOSIS; + } + } /* Services Root building */ |