From 719c1cbcf96a18fc90af6e4ff2ba78d17a968388 Mon Sep 17 00:00:00 2001 From: special Date: Sun, 5 Nov 2006 20:35:33 +0000 Subject: 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 --- src/modules/m_alltime.cpp | 9 ++++++--- src/modules/m_spanningtree.cpp | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src') 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]); } -- cgit v1.2.3