1
0
mirror of https://github.com/anope/anope.git synced 2026-07-08 23:43:13 +02:00

Rewrote how commands are handled within Anope.

This allows naming commands and having spaces within command names.
This commit is contained in:
Adam
2011-07-14 02:31:12 -04:00
parent 924f6849fe
commit f858164dee
227 changed files with 8808 additions and 12352 deletions
+11 -12
View File
@@ -12,17 +12,17 @@
/*************************************************************************/
#include "module.h"
#include "hostserv.h"
class CommandHSOn : public Command
{
public:
CommandHSOn() : Command("ON", 0, 0)
CommandHSOn(Module *creator) : Command(creator, "hostserv/on", 0, 0)
{
this->SetDesc(_("Activates your assigned vhost"));
this->SetSyntax("");
}
CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params)
void Execute(CommandSource &source, const std::vector<Anope::string> &params)
{
User *u = source.u;
NickAlias *na = findnick(u->nick);
@@ -44,15 +44,16 @@ class CommandHSOn : public Command
u->UpdateHost();
}
else
source.Reply(_(HOST_NOT_ASSIGNED));
source.Reply(HOST_NOT_ASSIGNED);
return MOD_CONT;
return;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(_("Syntax: \002ON\002\n"
"Activates the vhost currently assigned to the nick in use.\n"
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Activates the vhost currently assigned to the nick in use.\n"
"When you use this command any user who performs a /whois\n"
"on you will see the vhost instead of your real IP address."));
return true;
@@ -64,14 +65,12 @@ class HSOn : public Module
CommandHSOn commandhson;
public:
HSOn(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE)
HSOn(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandhson(this)
{
this->SetAuthor("Anope");
if (!hostserv)
throw ModuleException("HostServ is not loaded!");
this->AddCommand(hostserv->Bot(), &commandhson);
ModuleManager::RegisterService(&commandhson);
}
};