X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_alltime.cpp;h=dac3a4c8e38c0f5ab1e18fa55758197dc6adec32;hb=67de413cad88194972d55a8ff88464370890c5a9;hp=ba7b39421f1d01c9df2d0799a15e9360421e008d;hpb=92974819e3bf1c3a97b83f6f4ccc612283120794;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_alltime.cpp b/src/modules/m_alltime.cpp index ba7b39421..dac3a4c8e 100644 --- a/src/modules/m_alltime.cpp +++ b/src/modules/m_alltime.cpp @@ -1,27 +1,32 @@ -/* +------------------------------------+ - * | Inspire Internet Relay Chat Daemon | - * +------------------------------------+ +/* + * InspIRCd -- Internet Relay Chat Daemon * - * InspIRCd: (C) 2002-2010 InspIRCd Development Team - * See: http://wiki.inspircd.org/Credits + * Copyright (C) 2007 Dennis Friis + * Copyright (C) 2007 Robin Burchell + * Copyright (C) 2006 John Brooks * - * This program is free but copyrighted software; see - * the file COPYING for details. + * This file is part of InspIRCd. InspIRCd is free software: you can + * redistribute it and/or modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation, version 2. * - * --------------------------------------------------- + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ -#include "inspircd.h" -/* $ModDesc: Display timestamps from all servers connected to the network */ +#include "inspircd.h" class CommandAlltime : public Command { public: CommandAlltime(Module* Creator) : Command(Creator, "ALLTIME", 0) { - flags_needed = 'o'; syntax.clear(); - translation.push_back(TR_END); + flags_needed = 'o'; } CmdResult Handle(const std::vector ¶meters, User *user) @@ -30,7 +35,7 @@ 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.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); @@ -44,7 +49,6 @@ class CommandAlltime : public Command } }; - class Modulealltime : public Module { CommandAlltime mycommand; @@ -52,14 +56,14 @@ class Modulealltime : public Module Modulealltime() : mycommand(this) { - ServerInstance->AddCommand(&mycommand); } - virtual ~Modulealltime() + void init() CXX11_OVERRIDE { + ServerInstance->Modules->AddService(mycommand); } - virtual Version GetVersion() + Version GetVersion() CXX11_OVERRIDE { return Version("Display timestamps from all servers connected to the network", VF_OPTCOMMON | VF_VENDOR); }