anope

- supernets anope source code & configuration
git clone git://git.acid.vegas/anope.git
Log | Files | Refs | Archive | README

os_update.cpp (1213B)

      1 /* OperServ core functions
      2  *
      3  * (C) 2003-2022 Anope Team
      4  * Contact us at team@anope.org
      5  *
      6  * Please read COPYING and README for further details.
      7  *
      8  * Based on the original code of Epona by Lara.
      9  * Based on the original code of Services by Andy Church.
     10  */
     11 
     12 #include "module.h"
     13 
     14 class CommandOSUpdate : public Command
     15 {
     16  public:
     17 	CommandOSUpdate(Module *creator) : Command(creator, "operserv/update", 0, 0)
     18 	{
     19 		this->SetDesc(_("Force the Services databases to be updated immediately"));
     20 	}
     21 
     22 	void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
     23 	{
     24 		Log(LOG_ADMIN, source, this);
     25 		source.Reply(_("Updating databases."));
     26 		Anope::SaveDatabases();
     27 		return;
     28 	}
     29 
     30 	bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override
     31 	{
     32 		this->SendSyntax(source);
     33 		source.Reply(" ");
     34 		source.Reply(_("Causes Services to update all database files as soon as you\n"
     35 				"send the command."));
     36 		return true;
     37 	}
     38 };
     39 
     40 class OSUpdate : public Module
     41 {
     42 	CommandOSUpdate commandosupdate;
     43 
     44  public:
     45 	OSUpdate(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR),
     46 		commandosupdate(this)
     47 	{
     48 
     49 	}
     50 };
     51 
     52 MODULE_INIT(OSUpdate)