- return Version(1,1,0,0,VF_COMMON|VF_VENDOR,API_VERSION);
+ return Version("RLINE: Regexp user banning.", VF_COMMON | VF_VENDOR, rxfactory ? rxfactory->name : "");
+ }
+
+ virtual void OnUserConnect(LocalUser* user)
+ {
+ // Apply lines on user connect
+ XLine *rl = ServerInstance->XLines->MatchesLine("R", user);
+
+ if (rl)
+ {
+ // Bang. :P
+ rl->Apply(user);
+ }
+ }
+
+ virtual void OnRehash(User *user)
+ {
+ ConfigTag* tag = ServerInstance->Config->ConfValue("rline");
+
+ MatchOnNickChange = tag->getBool("matchonnickchange");
+ ZlineOnMatch = tag->getBool("zlineonmatch");
+ std::string newrxengine = tag->getString("engine");
+
+ if (newrxengine.empty())
+ rxfactory.SetProvider("regex");
+ else
+ rxfactory.SetProvider("regex/" + newrxengine);
+ if (!rxfactory)
+ {
+ ServerInstance->SNO->WriteToSnoMask('a', "WARNING: Regex engine '%s' is not loaded - R-Line functionality disabled until this is corrected.", newrxengine.c_str());
+ }
+ }
+
+ virtual ModResult OnStats(char symbol, User* user, string_list &results)
+ {
+ if (symbol != 'R')
+ return MOD_RES_PASSTHRU;
+
+ ServerInstance->XLines->InvokeStats("R", 223, user, results);
+ return MOD_RES_DENY;