]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
Pull in bancache.h from inspircd.h
[user/henk/code/inspircd.git] / src / inspircd.cpp
index 50899435bceec383a8db27d3763773d37770797f..c878138fe4154475f4cfaf0591439a12aa486cce 100644 (file)
@@ -52,7 +52,6 @@
 #include <fstream>
 #include <iostream>
 #include "xline.h"
-#include "bancache.h"
 #include "socketengine.h"
 #include "socket.h"
 #include "command_parse.h"
@@ -133,14 +132,11 @@ void InspIRCd::Cleanup()
        DeleteZero(this->Modes);
        DeleteZero(this->XLines);
        DeleteZero(this->Parser);
-       DeleteZero(this->stats);
        DeleteZero(this->Modules);
        DeleteZero(this->BanCache);
        DeleteZero(this->SNO);
        DeleteZero(this->Config);
        DeleteZero(this->PI);
-       DeleteZero(this->Threads);
-       DeleteZero(this->Timers);
        SocketEngine::Deinit();
        Logs->CloseLogs();
        DeleteZero(this->Logs);
@@ -237,7 +233,7 @@ void InspIRCd::WritePID(const std::string &filename)
 }
 
 InspIRCd::InspIRCd(int argc, char** argv) :
-        ConfigFileName(CONFIG_PATH "/inspircd.conf"),
+        ConfigFileName(INSPIRCD_CONFIG_PATH "/inspircd.conf"),
 
         /* Functor pointer initialisation.
          *
@@ -262,15 +258,12 @@ InspIRCd::InspIRCd(int argc, char** argv) :
 
        // Initialize so that if we exit before proper initialization they're not deleted
        this->Logs = 0;
-       this->Threads = 0;
        this->PI = 0;
        this->Users = 0;
        this->Config = 0;
        this->SNO = 0;
        this->BanCache = 0;
        this->Modules = 0;
-       this->stats = 0;
-       this->Timers = 0;
        this->Parser = 0;
        this->XLines = 0;
        this->Modes = 0;
@@ -285,8 +278,6 @@ InspIRCd::InspIRCd(int argc, char** argv) :
 
        SocketEngine::Init();
 
-       this->Threads = new ThreadEngine;
-
        /* Default implementation does nothing */
        this->PI = new ProtocolInterface;
 
@@ -298,8 +289,6 @@ InspIRCd::InspIRCd(int argc, char** argv) :
        this->BanCache = new BanCacheManager;
        this->Modules = new ModuleManager();
        dynamic_reference_base::reset_all();
-       this->stats = new serverstats();
-       this->Timers = new TimerManager;
        this->Parser = new CommandParser;
        this->XLines = new XLineManager;
 
@@ -372,7 +361,7 @@ InspIRCd::InspIRCd(int argc, char** argv) :
 
        if (do_version)
        {
-               std::cout << std::endl << VERSION << " " << REVISION << std::endl;
+               std::cout << std::endl << INSPIRCD_VERSION << " " << INSPIRCD_REVISION << std::endl;
                Exit(EXIT_STATUS_NOERROR);
        }
 
@@ -385,7 +374,7 @@ InspIRCd::InspIRCd(int argc, char** argv) :
        /* Set the finished argument values */
        Config->cmdline.nofork = (do_nofork != 0);
        Config->cmdline.forcedebug = (do_debug != 0);
-       Config->cmdline.writelog = (!do_nolog != 0);
+       Config->cmdline.writelog = !do_nolog;
 
        if (do_debug)
        {
@@ -552,7 +541,7 @@ InspIRCd::InspIRCd(int argc, char** argv) :
                FreeConsole();
        }
 
-       QueryPerformanceFrequency(&stats->QPFrequency);
+       QueryPerformanceFrequency(&stats.QPFrequency);
 #endif
 
        Logs->Log("STARTUP", LOG_DEFAULT, "Startup complete as '%s'[%s], %d max open sockets", Config->ServerName.c_str(),Config->GetSID().c_str(), SocketEngine::GetMaxFds());
@@ -686,18 +675,18 @@ void InspIRCd::Run()
                {
 #ifndef _WIN32
                        getrusage(RUSAGE_SELF, &ru);
-                       stats->LastSampled = TIME;
-                       stats->LastCPU = ru.ru_utime;
+                       stats.LastSampled = TIME;
+                       stats.LastCPU = ru.ru_utime;
 #else
-                       if(QueryPerformanceCounter(&stats->LastSampled))
+                       if(QueryPerformanceCounter(&stats.LastSampled))
                        {
                                FILETIME CreationTime;
                                FILETIME ExitTime;
                                FILETIME KernelTime;
                                FILETIME UserTime;
                                GetProcessTimes(GetCurrentProcess(), &CreationTime, &ExitTime, &KernelTime, &UserTime);
-                               stats->LastCPU.dwHighDateTime = KernelTime.dwHighDateTime + UserTime.dwHighDateTime;
-                               stats->LastCPU.dwLowDateTime = KernelTime.dwLowDateTime + UserTime.dwLowDateTime;
+                               stats.LastCPU.dwHighDateTime = KernelTime.dwHighDateTime + UserTime.dwHighDateTime;
+                               stats.LastCPU.dwLowDateTime = KernelTime.dwLowDateTime + UserTime.dwLowDateTime;
                        }
 #endif
 
@@ -719,7 +708,7 @@ void InspIRCd::Run()
                                FOREACH_MOD(OnGarbageCollect, ());
                        }
 
-                       Timers->TickTimers(TIME.tv_sec);
+                       Timers.TickTimers(TIME.tv_sec);
                        Users->DoBackgroundUserStuff();
 
                        if ((TIME.tv_sec % 5) == 0)