os_update.cpp

Go to the documentation of this file.
00001 /* OperServ core functions
00002  *
00003  * (C) 2003-2013 Anope Team
00004  * Contact us at team@anope.org
00005  *
00006  * Please read COPYING and README for further details.
00007  *
00008  * Based on the original code of Epona by Lara.
00009  * Based on the original code of Services by Andy Church.
00010  */
00011 
00012 /*************************************************************************/
00013 
00014 #include "module.h"
00015 
00016 class CommandOSUpdate : public Command
00017 {
00018  public:
00019         CommandOSUpdate(Module *creator) : Command(creator, "operserv/update", 0, 0)
00020         {
00021                 this->SetDesc(_("Force the Services databases to be updated immediately"));
00022                 this->SetSyntax("");
00023         }
00024 
00025         void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
00026         {
00027                 source.Reply(_("Updating databases."));
00028                 Anope::SaveDatabases();
00029                 return;
00030         }
00031 
00032         bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override
00033         {
00034                 this->SendSyntax(source);
00035                 source.Reply(" ");
00036                 source.Reply(_("Causes Services to update all database files as soon as you\n"
00037                                 "send the command."));
00038                 return true;
00039         }
00040 };
00041 
00042 class OSUpdate : public Module
00043 {
00044         CommandOSUpdate commandosupdate;
00045 
00046  public:
00047         OSUpdate(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
00048                 commandosupdate(this)
00049         {
00050                 this->SetAuthor("Anope");
00051 
00052         }
00053 };
00054 
00055 MODULE_INIT(OSUpdate)