X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_alltime.cpp;h=38ae4b254f7c7853ab30d99d7c0d5975e8ffa02b;hb=de4b1863536348520c6498e11d910acd050092a7;hp=aba8fe7fe1489223b5b0b044d7029728e710511b;hpb=44f42a13de52c8025942ddab42f51feb36821782;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_alltime.cpp b/src/modules/m_alltime.cpp index aba8fe7fe..38ae4b254 100644 --- a/src/modules/m_alltime.cpp +++ b/src/modules/m_alltime.cpp @@ -28,7 +28,7 @@ class CommandAlltime : public Command public: CommandAlltime(Module* Creator) : Command(Creator, "ALLTIME", 0) { - flags_needed = 'o'; syntax.clear(); + flags_needed = 'o'; translation.push_back(TR_END); } @@ -38,7 +38,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); @@ -60,7 +60,11 @@ class Modulealltime : public Module Modulealltime() : mycommand(this) { - ServerInstance->AddCommand(&mycommand); + } + + void init() + { + ServerInstance->Modules->AddService(mycommand); } virtual ~Modulealltime()