]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_alltime.cpp
Attach to events and register services in init()
[user/henk/code/inspircd.git] / src / modules / m_alltime.cpp
index 7012fde7ec78698d765da7fd58acf614d17626a0..682e94cd8b2e3e445f1975111ddbcb7f1491c681 100644 (file)
@@ -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);
 
@@ -59,6 +59,10 @@ class Modulealltime : public Module
  public:
        Modulealltime()
                : mycommand(this)
+       {
+       }
+
+       void init()
        {
                ServerInstance->AddCommand(&mycommand);
        }