1
0
mirror of https://github.com/anope/anope.git synced 2026-07-08 11:03:14 +02:00

Added userkey[123] directives to options block in new config.

Added ValueContainerLUInt specialization of ValueContainer for the above directives.

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1701 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
cyberbotx
2008-11-15 17:52:23 +00:00
parent 7fde7771aa
commit a5eb22efd8
3 changed files with 31 additions and 4 deletions
+15
View File
@@ -237,6 +237,21 @@ options {
* - enc_sha1 (SHA1 encryption)
*/
encryption = "enc_none"
/*
* These keys are used to initiate the random number generator. These numbers
* MUST be random as you want your passcodes to be random. Don't give these
* keys to anyone! Keep them private!
*
* NOTE: If you don't uncomment these or keep their default values, any talented
* programmer would be able to easily "guess" random strings used to mask
* information. Be safe, and come up with three different 7-digit numbers.
*
* These directives are optional, but highly recommended.
*/
#userkey1 = 9866235
#userkey2 = 8362013
#userkey3 = 2362899
}
/*
+6
View File
@@ -29,6 +29,7 @@ enum ConfigDataType {
DT_NOTHING, // No data
DT_INTEGER, // Integer
DT_UINTEGER, // Unsigned Integer
DT_LUINTEGER, // Long Unsigned Integer
DT_CHARPTR, // Char pointer
DT_STRING, // std::string
DT_BOOLEAN, // Boolean
@@ -189,6 +190,11 @@ typedef ValueContainer<bool *> ValueContainerBool;
*/
typedef ValueContainer<unsigned *> ValueContainerUInt;
/** A specialization of ValueContainer to hold a pointer to
* a long unsigned int
*/
typedef ValueContainer<long unsigned *> ValueContainerLUInt;
/** A specialization of ValueContainer to hold a pointer to
* a char array.
*/
+10 -4
View File
@@ -635,6 +635,9 @@ int ServerConfig::Read(bool bail)
{"networkinfo", "networkname", "", new ValueContainerChar(&NetworkName), DT_CHARPTR, ValidateNotEmpty},
{"networkinfo", "nicklen", "0", new ValueContainerInt(&NickLen), DT_INTEGER | DT_NORELOAD, ValidateNickLen},
{"options", "encryption", "", new ValueContainerChar(&EncModule), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty},
{"options", "userkey1", "0", new ValueContainerLUInt(&UserKey1), DT_LUINTEGER, NoValidation},
{"options", "userkey2", "0", new ValueContainerLUInt(&UserKey2), DT_LUINTEGER, NoValidation},
{"options", "userkey3", "0", new ValueContainerLUInt(&UserKey3), DT_LUINTEGER, NoValidation},
{"nickserv", "nick", "NickServ", new ValueContainerChar(&s_NickServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty},
{"nickserv", "description", "Nickname Registration Service", new ValueContainerChar(&desc_NickServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty},
{"nickserv", "database", "nick.db", new ValueContainerChar(&NickDBName), DT_CHARPTR, ValidateNotEmpty},
@@ -836,7 +839,13 @@ int ServerConfig::Read(bool bail)
case DT_UINTEGER: {
unsigned val = vi.GetInteger();
ValueContainerUInt *vci = dynamic_cast<ValueContainerUInt *>(Values[Index].val);
vci->Set(&val, sizeof(int));
vci->Set(&val, sizeof(unsigned));
}
break;
case DT_LUINTEGER: {
long unsigned val = vi.GetInteger();
ValueContainerLUInt *vci = dynamic_cast<ValueContainerLUInt *>(Values[Index].val);
vci->Set(&val, sizeof(long unsigned));
}
break;
case DT_TIME: {
@@ -1382,9 +1391,6 @@ Directive directives[] = {
{"UpdateTimeout", {{PARAM_TIME, PARAM_RELOAD, &UpdateTimeout}}},
{"UsePrivmsg", {{PARAM_SET, PARAM_RELOAD, &UsePrivmsg}}},
{"UseStrictPrivMsg", {{PARAM_SET, PARAM_RELOAD, &UseStrictPrivMsg}}},
{"UserKey1", {{PARAM_POSINT, PARAM_RELOAD, &UserKey1}}},
{"UserKey2", {{PARAM_POSINT, PARAM_RELOAD, &UserKey2}}},
{"UserKey3", {{PARAM_POSINT, PARAM_RELOAD, &UserKey3}}},
{"UseSVSHOLD", {{PARAM_SET, PARAM_RELOAD, &UseSVSHOLD}}},
{"UseTS6", {{PARAM_SET, 0, &UseTS6}}},
{"UnRestrictSAdmin", {{PARAM_SET, PARAM_RELOAD, &UnRestrictSAdmin}}},