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);
}
};
-
class Modulealltime : public Module
{
CommandAlltime mycommand;
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);
}