1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2007 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
16 /* $ModDesc: Display timestamps from all servers connected to the network */
18 class CommandAlltime : public Command
21 CommandAlltime(InspIRCd *Instance) : Command(Instance, "ALLTIME", 'o', 0)
23 this->source = "m_alltime.so";
25 translation.push_back(TR_END);
28 CmdResult Handle(const char **parameters, int pcnt, User *user)
32 time_t now = ServerInstance->Time(false);
33 strftime(fmtdate, sizeof(fmtdate), "%F %T", gmtime(&now));
34 now = ServerInstance->Time(true);
35 strftime(fmtdate2, sizeof(fmtdate2), "%F %T", gmtime(&now));
37 int delta = ServerInstance->GetTimeDelta();
39 string msg = ":" + string(ServerInstance->Config->ServerName) + " NOTICE " + user->nick + " :System time for " +
40 ServerInstance->Config->ServerName + " is: " + fmtdate + " (delta " + ConvToStr(delta) + " seconds): Time with delta: "+ fmtdate2;
49 params.push_back(user->nick);
50 params.push_back(msg);
51 Event ev((char *) ¶ms, NULL, "send_push");
52 ev.Send(ServerInstance);
55 /* we want this routed out! */
61 class Modulealltime : public Module
63 CommandAlltime *mycommand;
65 Modulealltime(InspIRCd *Me)
68 mycommand = new CommandAlltime(ServerInstance);
69 ServerInstance->AddCommand(mycommand);
72 virtual ~Modulealltime()
76 virtual Version GetVersion()
78 return Version(1, 0, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
83 MODULE_INIT(Modulealltime)