- // this test command just accepts:
- // /woot :<text>
- // and sends <text> to all opers with +s mode.
- // NB: The ':' is *REQUIRED* otherwise the parser will
- // split the line into multiple parameters[]!
- Srv->SendOpers(parameters[0]);
-}
+ Module* Creator;
+ public:
+ /* Command 'woot', takes no parameters and needs no special modes */
+ cmd_woot (InspIRCd* Instance, Module* maker) : command_t(Instance,"WOOT", 0, 0), Creator(maker)
+ {
+ this->source = "m_testcommand.so";
+ }
+
+ CmdResult Handle (const char** parameters, int pcnt, userrec *user)
+ {
+ /* We dont have to worry about deleting 'r', the core will
+ * do it for us as required.*/
+ try
+ {
+ MyV6Resolver* r = new MyV6Resolver(Creator, "shake.stacken.kth.se", true);
+ ServerInstance->AddResolver(r);
+ r = new MyV6Resolver(Creator, "2001:6b0:1:ea:202:a5ff:fecd:13a6", false);
+ ServerInstance->AddResolver(r);
+ }
+ catch (ModuleException& e)
+ {
+ ServerInstance->Log(DEBUG,"Danger, will robinson! There was an exception: %s",e.GetReason());
+ }
+
+ return CMD_FAILURE;
+ }
+};