]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
extern time_t TIME -> InspIRCd::Time()
[user/henk/code/inspircd.git] / src / inspircd.cpp
index 42612fa2de3c3bcbdadad1d492e029d95fbf9320..046b19f8c2359f37535633098b5096e008c1c0ed 100644 (file)
@@ -76,8 +76,6 @@ int iterations = 0;
 insp_sockaddr client, server;
 socklen_t length;
 
-time_t TIME = time(NULL), OLDTIME = time(NULL);
-
 char lowermap[255];
 
 void InspIRCd::AddServerName(const std::string &servername)
@@ -219,8 +217,8 @@ InspIRCd::InspIRCd(int argc, char** argv) : ModCount(-1)
        this->Config = new ServerConfig(this);
        this->Start();
        this->module_sockets.clear();
-       this->startup_time = time(NULL);
-       srand(time(NULL));
+       this->TIME = this->OLDTIME = this->startup_time = time(NULL);
+       srand(this->TIME);
        log(DEBUG,"*** InspIRCd starting up!");
        if (!ServerConfig::FileExists(CONFIG_FILE))
        {
@@ -1039,3 +1037,16 @@ int InspIRCd::GetModuleCount()
        return this->ModCount;
 }
 
+time_t InspIRCd::Time()
+{
+       return TIME;
+}
+
+classbase::classbase()
+{
+       /* This is in here only to make use of ServerInstance
+        * without using an ugly extern
+        */
+       this->age = ServerInstance->Time();
+}
+