summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-29 22:41:41 +0000
committerspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-29 22:41:41 +0000
commit1abbafc07a53803d72865963907d15232b4fd6c5 (patch)
tree50711d59f81e75f7a8992204e0db3392142e677a /src
parentef314b4206905df4ac08c8ecd3fed1d3871ad2bf (diff)
Added InspIRCd::GetTimeDelta() - previously m_alltime was using a hack to get the delta, which wasn't always reliable
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5827 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/inspircd.cpp5
-rw-r--r--src/modules/m_alltime.cpp3
2 files changed, 6 insertions, 2 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index bd5af2752..12134f3f6 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -830,6 +830,11 @@ int InspIRCd::SetTimeDelta(int delta)
return old;
}
+int InspIRCd::GetTimeDelta()
+{
+ return time_delta;
+}
+
bool FileLogger::Readable()
{
return false;
diff --git a/src/modules/m_alltime.cpp b/src/modules/m_alltime.cpp
index 0ce517886..d207d457e 100644
--- a/src/modules/m_alltime.cpp
+++ b/src/modules/m_alltime.cpp
@@ -24,8 +24,7 @@ class cmd_alltime : public command_t
time_t now = ServerInstance->Time();
strftime(fmtdate, sizeof(fmtdate), "%F %T", gmtime(&now));
- // I'm too lazy to add a function to fetch the delta, so lets just cheat..
- int delta = time(NULL) - now;
+ int delta = ServerInstance->GetTimeDelta();
string msg = ":" + string(ServerInstance->Config->ServerName) + " NOTICE " + user->nick + " :Time for " +
ServerInstance->Config->ServerName + " is: " + fmtdate + " (delta " + ConvToStr(delta) + " seconds)";