-InspIRCd::InspIRCd(int argc, char** argv)
- : GlobalCulls(this),
-
- /* Functor initialisation. Note that the ordering here is very important.
- *
- * THIS MUST MATCH ORDER OF DECLARATION OF THE HandleWhateverFunc classes
- * within class InspIRCd.
- */
- HandleProcessUser(this),
- HandleIsNick(this),
- HandleIsIdent(this),
- HandleFindDescriptor(this),
- HandleFloodQuitUser(this),
- HandleIsChannel(this),
- HandleIsSID(this),
- HandleRehash(this),
-
- /* Functor pointer initialisation. Must match the order of the list above
- *
- * THIS MUST MATCH THE ORDER OF DECLARATION OF THE FUNCTORS, e.g. the methods
- * themselves within the class.
- */
- ProcessUser(&HandleProcessUser),
- IsChannel(&HandleIsChannel),
- IsSID(&HandleIsSID),
- Rehash(&HandleRehash),
- IsNick(&HandleIsNick),
- IsIdent(&HandleIsIdent),
- FindDescriptor(&HandleFindDescriptor),
- FloodQuitUser(&HandleFloodQuitUser)
-
-{
-#ifdef WIN32
- // Strict, frequent checking of memory on debug builds
- _CrtSetDbgFlag ( _CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
-
- // Avoid erroneous frees on early exit
- WindowsIPC = 0;
-#endif
- int found_ports = 0;
- FailedPortList pl;
- int do_version = 0, do_nofork = 0, do_debug = 0,
- do_nolog = 0, do_root = 0, do_testsuite = 0; /* flag variables */
- int c = 0;
-
- // 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->chanlist = 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;
- this->Res = 0;
-
- // Initialise TIME
- this->TIME = time(NULL);
-
- memset(&server, 0, sizeof(server));
- memset(&client, 0, sizeof(client));
-
- // This must be created first, so other parts of Insp can use it while starting up
- this->Logs = new LogManager(this);
-
- SocketEngineFactory* SEF = new SocketEngineFactory();
- SE = SEF->Create(this);
- delete SEF;
-
- this->Threads = new ThreadEngine(this);
-
- /* Default implementation does nothing */
- this->PI = new ProtocolInterface(this);
-
- this->s_signal = 0;
-
- // Create base manager classes early, so nothing breaks
- this->Users = new UserManager(this);
-
- this->Users->unregistered_count = 0;
-
- this->Users->clientlist = new user_hash();
- this->Users->uuidlist = new user_hash();
- this->chanlist = new chan_hash();
-
- this->Config = new ServerConfig(this);
- this->SNO = new SnomaskManager(this);
- this->BanCache = new BanCacheManager(this);
- this->Modules = new ModuleManager(this);
- this->stats = new serverstats();
- this->Timers = new TimerManager(this);
- this->Parser = new CommandParser(this);
- this->XLines = new XLineManager(this);
-
- this->Config->argv = argv;
- this->Config->argc = argc;
-
- if (chdir(Config->GetFullProgDir().c_str()))