From c07c9729f37becb33900a9ff8b0b08ee1e8648a1 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 16 Dec 2005 12:47:09 +0000 Subject: [PATCH] Moved serverstats* stats to InspIRCd class git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2528 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/inspircd.h | 2 ++ src/inspircd.cpp | 28 +++++++++++++++------------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/include/inspircd.h b/include/inspircd.h index 9ed1b0468..bf096272b 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -109,7 +109,9 @@ class InspIRCd ModeParser* ModeGrok; CommandParser* Parser; SocketEngine* SE; + serverstats* stats; + void MakeLowerMap() std::string GetRevision(); std::string GetVersionString(); char* ModuleError(); diff --git a/src/inspircd.cpp b/src/inspircd.cpp index e787da5ae..0b9c5f975 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -89,7 +89,6 @@ SocketEngine* SE = NULL; // by an integer, meaning there is no need for a scan/search operation. userrec* fd_ref_table[65536]; -serverstats* stats = new serverstats; Server* MyServer = new Server; ServerConfig *Config = new ServerConfig; @@ -138,7 +137,19 @@ std::string InspIRCd::GetRevision() return single; } - +void InspIRCd::MakeLowerMap() +{ + // initialize the lowercase mapping table + for (unsigned int cn = 0; cn < 256; cn++) + lowermap[cn] = cn; + // lowercase the uppercase chars + for (unsigned int cn = 65; cn < 91; cn++) + lowermap[cn] = tolower(cn); + // now replace the specific chars for scandanavian comparison + lowermap[(unsigned)'['] = '{'; + lowermap[(unsigned)']'] = '}'; + lowermap[(unsigned)'\\'] = '|'; +} InspIRCd::InspIRCd(int argc, char** argv) { @@ -170,18 +181,8 @@ InspIRCd::InspIRCd(int argc, char** argv) } strlcpy(Config->MyExecutable,argv[0],MAXBUF); - - // initialize the lowercase mapping table - for (unsigned int cn = 0; cn < 256; cn++) - lowermap[cn] = cn; - // lowercase the uppercase chars - for (unsigned int cn = 65; cn < 91; cn++) - lowermap[cn] = tolower(cn); - // now replace the specific chars for scandanavian comparison - lowermap[(unsigned)'['] = '{'; - lowermap[(unsigned)']'] = '}'; - lowermap[(unsigned)'\\'] = '|'; + this->MakeLowerMap(); OpenLog(argv, argc); Config->ClearStack(); @@ -189,6 +190,7 @@ InspIRCd::InspIRCd(int argc, char** argv) CheckRoot(); this->ModeGrok = new ModeParser(); this->Parser = new CommandParser(); + this->stats = new serverstats(); AddServerName(Config->ServerName); CheckDie(); stats->BoundPortCount = BindPorts(); -- 2.39.5