summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index e7d43edff..1d9aca35f 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -538,9 +538,19 @@ InspIRCd::InspIRCd(int argc, char** argv)
*/
int i;
- for(i = 0; i < 3; i++)
- current_uid[i] = '0';
+ /* 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;
+ current_uid[0] = sid / 100 + 48;
+ current_uid[1] = sid / 10 + 48;
+ current_uid[2] = sid % 10 + 48;
+
+ /* Initialise UID */
for(i = 3; i < UUID_LENGTH - 1; i++)
current_uid[i] = 'A';