From edb126e57fb28314f2460a7832018c005344c876 Mon Sep 17 00:00:00 2001 From: w00t Date: Thu, 3 Jan 2008 13:17:51 +0000 Subject: SID generation should(?) now work again as well. NOTE: no error checking on SID from config yet, we may wish to do that sometime.. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8620 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/inspircd.cpp') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index c50d2cb6f..114d38969 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -483,12 +483,15 @@ InspIRCd::InspIRCd(int argc, char** argv) * -- w00t */ /* Generate SID */ - if (Config->sid) + printf("\nSID is %s\n\n", Config->sid); + if (*Config->sid) { // already defined, don't bother - } + printf("\nAlready defined!\n\n"); + } else { + printf("\nGenerating..\n\n"); // Generate one size_t sid = 0; @@ -498,10 +501,14 @@ InspIRCd::InspIRCd(int argc, char** argv) sid = 5 * sid + *y; sid = sid % 999; + printf("\nGenerated %u\n\n", sid); + printf("\n0 %c\n\n", (sid / 100 + 48)); + printf("\n1 %c\n\n", (((sid / 10) % 10) + 48)); + printf("\n2 %c\n\n", (sid % 10 + 48)); + Config->sid[0] = (char)(sid / 100 + 48); Config->sid[1] = (char)(((sid / 10) % 10) + 48); Config->sid[2] = (char)(sid % 10 + 48); - //Config->sid = sprintf("%u", sid); } this->InitialiseUID(); -- cgit v1.2.3