X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_alltime.cpp;h=075064c62465be4b131cdb9c6a1f647165667f52;hb=43b5073d6f80a8dcb7044ecd127fd5893da033ab;hp=29a0ee42c6ddc63a8959f3994fb2d96585710603;hpb=ba5c0db795824c3fc1ad48ce332d7bdc440cb77f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_alltime.cpp b/src/modules/m_alltime.cpp index 29a0ee42c..075064c62 100644 --- a/src/modules/m_alltime.cpp +++ b/src/modules/m_alltime.cpp @@ -21,24 +21,19 @@ #include "inspircd.h" -/* $ModDesc: Display timestamps from all servers connected to the network */ - class CommandAlltime : public Command { public: CommandAlltime(Module* Creator) : Command(Creator, "ALLTIME", 0) { flags_needed = 'o'; - translation.push_back(TR_END); } CmdResult Handle(const std::vector ¶meters, User *user) { - char fmtdate[64]; - time_t now = ServerInstance->Time(); - strftime(fmtdate, sizeof(fmtdate), "%Y-%m-%d %H:%M:%S", gmtime(&now)); + const std::string fmtdate = InspIRCd::TimeString(ServerInstance->Time(), "%Y-%m-%d %H:%M:%S", true); - std::string msg = ":" + std::string(ServerInstance->Config->ServerName.c_str()) + " NOTICE " + user->nick + " :System time is " + fmtdate + " (" + ConvToStr(ServerInstance->Time()) + ") on " + ServerInstance->Config->ServerName; + std::string msg = ":" + ServerInstance->Config->ServerName + " NOTICE " + user->nick + " :System time is " + fmtdate + " (" + ConvToStr(ServerInstance->Time()) + ") on " + ServerInstance->Config->ServerName; user->SendText(msg); @@ -52,22 +47,16 @@ class CommandAlltime : public Command } }; - class Modulealltime : public Module { CommandAlltime mycommand; public: Modulealltime() : mycommand(this) - { - ServerInstance->AddCommand(&mycommand); - } - - virtual ~Modulealltime() { } - virtual Version GetVersion() + Version GetVersion() CXX11_OVERRIDE { return Version("Display timestamps from all servers connected to the network", VF_OPTCOMMON | VF_VENDOR); }