summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
authorspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-05 00:47:08 +0000
committerspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-05 00:47:08 +0000
commit1fbd75d645e2b4243ebec65bb8952069b24253b9 (patch)
tree9276881f56aad6641614aa2de6a0f67ee2979a5c /src/inspircd.cpp
parentef6be06f9c0016ac35c2df6bbb0f16ba6b243b2c (diff)
Added time syncing! This is fairly simple - servers exchange timestamps and use the lowest - but should get rid of the annoying bounces for those of us who can't depend on ntpd.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5649 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index dc4986755..cd99e63b6 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -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!");
@@ -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;