1
0
mirror of https://github.com/anope/anope.git synced 2026-07-07 22:23:14 +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,23 +12,23 @@
/*************************************************************************/
#include "module.h"
#include "hostserv.h"
class CommandHSOff : public Command
{
public:
CommandHSOff() : Command("OFF", 0, 0)
CommandHSOff(Module *creator) : Command(creator, "hostserv/off", 0, 0)
{
this->SetDesc(_("Deactivates 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);
if (!na || !na->hostinfo.HasVhost())
source.Reply(_(HOST_NOT_ASSIGNED));
source.Reply(HOST_NOT_ASSIGNED);
else
{
ircdproto->SendVhostDel(u);
@@ -36,13 +36,14 @@ class CommandHSOff : public Command
source.Reply(_("Your vhost was removed and the normal cloaking restored."));
}
return MOD_CONT;
return;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(_("Syntax: \002OFF\002\n"
"Deactivates the vhost currently assigned to the nick in use.\n"
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Deactivates 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 your real IP address."));
return true;
@@ -54,14 +55,12 @@ class HSOff : public Module
CommandHSOff commandhsoff;
public:
HSOff(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE)
HSOff(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandhsoff(this)
{
this->SetAuthor("Anope");
if (!hostserv)
throw ModuleException("HostServ is not loaded!");
this->AddCommand(hostserv->Bot(), &commandhsoff);
ModuleManager::RegisterService(&commandhsoff);
}
};