diff options
| author | 2007-08-27 19:56:38 +0000 | |
|---|---|---|
| committer | 2007-08-27 19:56:38 +0000 | |
| commit | 8c3a4a51ff092a0614e6c9a15e4bd53e4877bc48 (patch) | |
| tree | d6f328603ac395238d6cba07f9f173da85b5dfcc /src/configreader.cpp | |
| parent | Remove check for duplicate UUID, constructor of userrec throws for us instead (diff) | |
Add <server:id> - this is optional, as stated in the example conf,
and should only be set if you are getting collisions. The comment also points out that ids where either of the last two letters are numeric are reserved for services use (e.g. 0ZZ or 5CQ)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7917 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/configreader.cpp')
| -rw-r--r-- | src/configreader.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp index ec15db3a1..c5f37a1e4 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -367,6 +367,18 @@ bool ValidateInvite(ServerConfig* conf, const char* tag, const char* value, Valu return true; } +bool ValidateSID(ServerConfig* conf, const char* tag, const char* value, ValueItem &data) +{ + int sid = data.GetInteger(); + if ((sid > 999) || (sid < 0)) + { + sid = sid % 1000; + data.Set(sid); + conf->GetInstance()->Log(DEFAULT,"WARNING: Server ID is less than 0 or greater than 999. Set to %d", sid); + } + return true; +} + bool ValidateWhoWas(ServerConfig* conf, const char* tag, const char* value, ValueItem &data) { conf->WhoWasMaxKeep = conf->GetInstance()->Duration(data.GetString()); @@ -634,6 +646,7 @@ void ServerConfig::Read(bool bail, userrec* user) {"server", "name", "", new ValueContainerChar (this->ServerName), DT_CHARPTR, ValidateServerName}, {"server", "description", "Configure Me", new ValueContainerChar (this->ServerDesc), DT_CHARPTR, NoValidation}, {"server", "network", "Network", new ValueContainerChar (this->Network), DT_CHARPTR, NoValidation}, + {"server", "id", "0", new ValueContainerInt (&this->sid), DT_INTEGER, ValidateSID}, {"admin", "name", "", new ValueContainerChar (this->AdminName), DT_CHARPTR, NoValidation}, {"admin", "email", "Mis@configu.red", new ValueContainerChar (this->AdminEmail), DT_CHARPTR, NoValidation}, {"admin", "nick", "Misconfigured", new ValueContainerChar (this->AdminNick), DT_CHARPTR, NoValidation}, |
