X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_alltime.cpp;h=79a94c2b6f8114bb9697947092b2cd13c92ff2ce;hb=8cebe2878f3878afce6f643d93668155cb26801d;hp=1ffd7c5b5328fde941cee3c35ef1d98561a30fc2;hpb=2205c65c72f3980be734e0616eb61b7eceb21b8f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_alltime.cpp b/src/modules/m_alltime.cpp index 1ffd7c5b5..79a94c2b6 100644 --- a/src/modules/m_alltime.cpp +++ b/src/modules/m_alltime.cpp @@ -2,8 +2,8 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * InspIRCd: (C) 2002-2009 InspIRCd Development Team + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -25,22 +25,21 @@ class CommandAlltime : public Command translation.push_back(TR_END); } - CmdResult Handle(const char* const* parameters, int pcnt, User *user) + CmdResult Handle(const std::vector ¶meters, User *user) { char fmtdate[64]; time_t now = ServerInstance->Time(); - strftime(fmtdate, sizeof(fmtdate), "%F %T", gmtime(&now)); - - std::string msg = ":" + std::string(ServerInstance->Config->ServerName) + " NOTICE " + user->nick + " :System time for " + - ServerInstance->Config->ServerName + " is: " + fmtdate; - + strftime(fmtdate, sizeof(fmtdate), "%Y-%m-%d %H:%M:%S", gmtime(&now)); + + std::string msg = ":" + std::string(ServerInstance->Config->ServerName) + " NOTICE " + user->nick + " :System time is " + fmtdate + "(" + ConvToStr(ServerInstance->Time()) + ") on " + ServerInstance->Config->ServerName; + if (IS_LOCAL(user)) { user->Write(msg); } else { - ServerInstance->PI->PushToClient(user, msg); + ServerInstance->PI->PushToClient(user, ":" + msg); } /* we want this routed out! */ @@ -51,25 +50,23 @@ class CommandAlltime : public Command class Modulealltime : public Module { - CommandAlltime *mycommand; + CommandAlltime mycommand; public: Modulealltime(InspIRCd *Me) - : Module(Me) + : Module(Me), mycommand(Me) { - mycommand = new CommandAlltime(ServerInstance); - ServerInstance->AddCommand(mycommand); - + ServerInstance->AddCommand(&mycommand); } - + virtual ~Modulealltime() { } - + virtual Version GetVersion() { - return Version(1, 2, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION); + return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION); } - + }; MODULE_INIT(Modulealltime)