]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
Modified the server-to-server TIME command to report the real time (without delta...
[user/henk/code/inspircd.git] / src / inspircd.cpp
index dc49867556435617cfd4c5745b1efed1f55b1411..e7e6c9aadb0317ca5c55b1c387e02c3e3a4d283c 100644 (file)
@@ -193,6 +193,7 @@ InspIRCd::InspIRCd(int argc, char** argv)
        this->SNO = new SnomaskManager(this);
        this->Start();
        this->TIME = this->OLDTIME = this->startup_time = time(NULL);
+       this->time_delta = 0;
        this->next_call = this->TIME + 3;
        srand(this->TIME);
        this->Log(DEBUG,"*** InspIRCd starting up!");
@@ -298,7 +299,7 @@ InspIRCd::InspIRCd(int argc, char** argv)
        
        if (stats->BoundPortCount != (unsigned int)found_ports)
        {
-               printf("\nWARNING: Not all your ports could be bound -- starting anyway with %ld of %d ports bound.\n", stats->BoundPortCount, found_ports);
+               printf("\nWARNING: Not all your client ports could be bound --\n         starting anyway with %ld of %d client ports bound.\n", stats->BoundPortCount, found_ports);
        }
 
        /* Add the listening sockets used for client inbound connections
@@ -804,11 +805,21 @@ int InspIRCd::GetModuleCount()
        return this->ModCount;
 }
 
-time_t InspIRCd::Time()
+time_t InspIRCd::Time(bool delta)
 {
+       if (delta)
+               return TIME + time_delta;
        return TIME;
 }
 
+int InspIRCd::SetTimeDelta(int delta)
+{
+       int old = time_delta;
+       time_delta += delta;
+       this->Log(DEBUG, "Time delta set to %d (was %d)", time_delta, old);
+       return old;
+}
+
 bool FileLogger::Readable()
 {
        return false;