summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-05 20:35:33 +0000
committerspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-05 20:35:33 +0000
commit719c1cbcf96a18fc90af6e4ff2ba78d17a968388 (patch)
treeb614cbe6a5705c7fe049cab2951218a397c6d1ec /src
parent506137fa75ec09716a44ecf5fdc2fedeeddc0997 (diff)
Modified the server-to-server TIME command to report the real time (without delta), and display the delta in the output from m_alltime
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5657 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_alltime.cpp9
-rw-r--r--src/modules/m_spanningtree.cpp2
2 files changed, 7 insertions, 4 deletions
diff --git a/src/modules/m_alltime.cpp b/src/modules/m_alltime.cpp
index 4701b1cc1..0ce517886 100644
--- a/src/modules/m_alltime.cpp
+++ b/src/modules/m_alltime.cpp
@@ -21,11 +21,14 @@ class cmd_alltime : public command_t
CmdResult Handle(const char **parameters, int pcnt, userrec *user)
{
char fmtdate[64];
- time_t time = ServerInstance->Time();
- strftime(fmtdate, sizeof(fmtdate), "%F %T", gmtime(&time));
+ 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;
string msg = ":" + string(ServerInstance->Config->ServerName) + " NOTICE " + user->nick + " :Time for " +
- ServerInstance->Config->ServerName + " is: " + fmtdate;
+ ServerInstance->Config->ServerName + " is: " + fmtdate + " (delta " + ConvToStr(delta) + " seconds)";
if (IS_LOCAL(user))
{
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index 46eb8bbba..1751054c8 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -2745,7 +2745,7 @@ class TreeSocket : public InspSocket
userrec* u = this->Instance->FindNick(params[1]);
if (u)
{
- params.push_back(ConvToStr(Instance->Time(true)));
+ params.push_back(ConvToStr(Instance->Time(false)));
params[0] = prefix;
Utils->DoOneToOne(this->Instance->Config->ServerName,"TIME",params,params[0]);
}