summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp19
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;