diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-27 19:56:38 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-27 19:56:38 +0000 |
commit | 8c3a4a51ff092a0614e6c9a15e4bd53e4877bc48 (patch) | |
tree | d6f328603ac395238d6cba07f9f173da85b5dfcc /src/inspircd.cpp | |
parent | 6b6db59d5fa3ffbde5f80f2e1b0900974485f145 (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/inspircd.cpp')
-rw-r--r-- | src/inspircd.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 9543ef856..1618266c0 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -544,11 +544,20 @@ InspIRCd::InspIRCd(int argc, char** argv) /* Generate SID */ size_t sid = 0; - for (const char* x = Config->ServerName; *x; ++x) - sid = 5 * sid + *x; - for (const char* y = Config->ServerDesc; *y; ++y) - sid = 5 * sid + *y; - sid = sid % 999; + if (Config->sid) + { + sid = Config->sid; + } + else + { + for (const char* x = Config->ServerName; *x; ++x) + sid = 5 * sid + *x; + for (const char* y = Config->ServerDesc; *y; ++y) + sid = 5 * sid + *y; + sid = sid % 999; + + Config->sid = sid; + } current_uid[0] = sid / 100 + 48; current_uid[1] = ((sid / 10) % 10) + 48; current_uid[2] = sid % 10 + 48; |