+ return CMD_SUCCESS;
+ }
+
+ RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+ {
+ if (IS_LOCAL(user))
+ return ROUTE_LOCALONLY; // spanningtree will send ADDLINE
+
+ return ROUTE_BROADCAST;
+ }
+};
+
+class ModuleRLine : public Module
+{
+ dynamic_reference<RegexFactory> rxfactory;
+ RLineFactory f;
+ CommandRLine r;
+ bool MatchOnNickChange;
+
+ public:
+ ModuleRLine() : rxfactory(this, "regex"), f(rxfactory), r(this, f)
+ {
+ }
+
+ void init()
+ {
+ OnRehash(NULL);
+
+ ServerInstance->Modules->AddService(r);
+ ServerInstance->XLines->RegisterFactory(&f);
+
+ Implementation eventlist[] = { I_OnUserConnect, I_OnRehash, I_OnUserPostNick, I_OnStats, I_OnBackgroundTimer };
+ ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
+ }
+
+ virtual ~ModuleRLine()
+ {
+ ServerInstance->XLines->DelAll("R");
+ ServerInstance->XLines->UnregisterFactory(&f);
+ }
+
+ virtual Version GetVersion()
+ {
+ return Version("RLINE: Regexp user banning.", VF_COMMON | VF_VENDOR, rxfactory ? rxfactory->name : "");