mirror of
https://github.com/anope/anope.git
synced 2026-07-04 16:13:13 +02:00
Don't dynamically allocate commands in modules anymore, instead made them members of modules. This means the commands are automatically destructed when the module is unloaded. Cleans up some old ugly code.
This commit is contained in:
@@ -368,15 +368,19 @@ class CommandNSResend : public Command
|
||||
|
||||
class NSRegister : public Module
|
||||
{
|
||||
CommandNSRegister commandnsregister;
|
||||
CommandNSConfirm commandnsconfirm;
|
||||
CommandNSResend commandnsrsend;
|
||||
|
||||
public:
|
||||
NSRegister(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator)
|
||||
NSRegister(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator), commandnsconfirm("CONFIRM", 1, 1)
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
this->SetType(CORE);
|
||||
|
||||
this->AddCommand(NickServ, new CommandNSRegister());
|
||||
this->AddCommand(NickServ, new CommandNSConfirm("CONFIRM", 1, 1));
|
||||
this->AddCommand(NickServ, new CommandNSResend());
|
||||
this->AddCommand(NickServ, &commandnsregister);
|
||||
this->AddCommand(NickServ, &commandnsconfirm);
|
||||
this->AddCommand(NickServ, &commandnsrsend);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user