summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-14 18:22:11 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-14 18:22:11 +0000
commitc76bb1695fce08aa75ad6ba706cb203e28b75652 (patch)
tree2c97bda426ddd831f269cc1e4deef3e583ea0eca
parenta51984ba6fe32bde391f961d4ff52628b768d346 (diff)
Shuffling stuff about
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2439 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--include/inspircd.h2
-rw-r--r--src/inspircd.cpp11
-rw-r--r--src/inspircd_io.cpp5
3 files changed, 11 insertions, 7 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index d3c7db549..bb96ae32b 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -101,6 +101,8 @@ class InspIRCd
bool LoadModule(const char* filename);
public:
+ time_t startup_time;
+
InspIRCd(int argc, char** argv);
int Run();
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index baabe90e3..d4a4c85cb 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -62,10 +62,10 @@ using namespace std;
#include "dns.h"
#include "typedefs.h"
+InspIRCd* ServerInstance;
+
int WHOWAS_STALE = 48; // default WHOWAS Entries last 2 days before they go 'stale'
int WHOWAS_MAX = 100; // default 100 people maximum in the WHOWAS list
-int DieDelay = 5;
-time_t startup_time = time(NULL);
extern std::vector<Module*> modules;
extern std::vector<ircd_module*> factory;
@@ -430,6 +430,7 @@ void kill_link_silent(userrec *user,const char* r)
InspIRCd::InspIRCd(int argc, char** argv)
{
Start();
+ this->startup_time = time(NULL);
srand(time(NULL));
log(DEBUG,"*** InspIRCd starting up!");
if (!FileExists(CONFIG_FILE))
@@ -1703,9 +1704,9 @@ int InspIRCd::Run()
int main(int argc, char** argv)
{
- InspIRCd* TittyBiscuits = new InspIRCd(argc, argv);
- TittyBiscuits->Run();
- delete TittyBiscuits;
+ ServerInstance = new InspIRCd(argc, argv);
+ ServerInstance->Run();
+ delete ServerInstance;
return 0;
}
diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp
index 062b45eb6..86dbf5da0 100644
--- a/src/inspircd_io.cpp
+++ b/src/inspircd_io.cpp
@@ -33,6 +33,7 @@ using namespace std;
#include "xline.h"
extern ServerConfig *Config;
+extern InspIRCd* ServerInstance;
extern int openSockfd[MAXSOCKS];
extern time_t TIME;
@@ -297,7 +298,7 @@ void ServerConfig::Read(bool bail, userrec* user)
if (!removed_modules.empty())
for (std::vector<std::string>::iterator removing = removed_modules.begin(); removing != removed_modules.end(); removing++)
{
- if (UnloadModule(removing->c_str()))
+ if (ServerInstance->UnloadModule(removing->c_str()))
{
WriteOpers("*** REHASH UNLOADED MODULE: %s",removing->c_str());
WriteServ(user->fd,"973 %s %s :Module %s successfully unloaded.",user->nick, removing->c_str(), removing->c_str());
@@ -311,7 +312,7 @@ void ServerConfig::Read(bool bail, userrec* user)
if (!added_modules.empty())
for (std::vector<std::string>::iterator adding = added_modules.begin(); adding != added_modules.end(); adding++)
{
- if (LoadModule(adding->c_str()))
+ if (ServerInstance->LoadModule(adding->c_str()))
{
WriteOpers("*** REHASH LOADED MODULE: %s",adding->c_str());
WriteServ(user->fd,"975 %s %s :Module %s successfully loaded.",user->nick, adding->c_str(), adding->c_str());