X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_alltime.cpp;h=37f6a5fd245a08f841e7d9176fb5b1bf3f7368d8;hb=6d03943426dcce76ba66567a9b18425a5ebb4c0c;hp=b0ccd2886cb9faf85ab70c8be0e11120e0cc2a0b;hpb=d185decae97752368d5cf62311cbc0d1a52aa22c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_alltime.cpp b/src/modules/m_alltime.cpp index b0ccd2886..37f6a5fd2 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. @@ -18,10 +18,9 @@ class CommandAlltime : public Command { public: - CommandAlltime(InspIRCd *Instance) : Command(Instance, "ALLTIME", "o", 0) + CommandAlltime(Module* Creator) : Command(Creator, "ALLTIME", 0) { - this->source = "m_alltime.so"; - syntax.clear(); + flags_needed = 'o'; syntax.clear(); translation.push_back(TR_END); } @@ -31,34 +30,29 @@ class CommandAlltime : public Command time_t now = ServerInstance->Time(); 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 for " + - ServerInstance->Config->ServerName + " is: " + fmtdate; + 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->DumpText(user, msg); /* we want this routed out! */ return CMD_SUCCESS; } + + RouteDescriptor GetRouting(User* user, const std::vector& parameters) + { + return ROUTE_BROADCAST; + } }; class Modulealltime : public Module { - CommandAlltime *mycommand; + CommandAlltime mycommand; public: - Modulealltime(InspIRCd *Me) - : Module(Me) + Modulealltime() + : mycommand(this) { - mycommand = new CommandAlltime(ServerInstance); - ServerInstance->AddCommand(mycommand); - + ServerInstance->AddCommand(&mycommand); } virtual ~Modulealltime() @@ -67,7 +61,7 @@ class Modulealltime : public Module virtual Version GetVersion() { - return Version(1, 2, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION); + return Version("Display timestamps from all servers connected to the network", VF_COMMON | VF_VENDOR, API_VERSION); } };