public:
CommandAlltime(Module* Creator) : Command(Creator, "ALLTIME", 0)
{
- flags_needed = 'o'; syntax.clear();
+ flags_needed = 'o';
translation.push_back(TR_END);
}
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);
Modulealltime()
: mycommand(this)
{
- ServerInstance->AddCommand(&mycommand);
+ }
+
+ void init()
+ {
+ ServerInstance->Modules->AddService(mycommand);
}
virtual ~Modulealltime()