Posted: Fri Jun 24, 2005 9:34 pm
I've added a new experimental module which I had in the queue for a long time now: TextBan (*NIX only version available currently). What it does is let chanops ban certain words or (part of) sentences by for example: +b ~T:block:*http://*. This module is currently experimental, if I get good feedback it'll get added to the Windows (and *NIX) Module Pack later on.
Feedback is welcomed :)
Code: Select all
ABOUT ====== This module adds a new extban type ~T by which you can block certain text. The syntax is: ~T:<action>:<wildcardexpression> For example: ~T:block:*is_using* A few additional notes: - Currently 'block' is the only supported action. - Regexes are not accepted, so only '*' and '?'. - an underscore ('_') will match both '_' and ' ' (space). - Colors and control codes (underline/bold/reverse) are stripped before we try to match, so they should not (and cannot) be specified in the +b ~T. - Unlike mode +G, the text is matched against the whole sentence and not per-word. This doesn't matter much at the moment, but might be an important aspect in the future. - Only messages from normal and voiced users are blocked/filtered, messages from halfops and higher are not. WARNING: This module is currently EXPERIMENTAL. Although I doubt it will crash, it might have side effects I didn't think of. Additionally, it's work-in-progress, which means new features will be added later on. NOTE ABOUT SPEED ================= The speed impact is usually acceptable (thanks to simple '* and '?' matching it is very fast). On an A1800+ with the default settings of this module, the module is capable of processing ~20.000 (20K) messages per second. Note that messages are only processed (and thus consume CPU) if..: - The channel has any textban - The client the message is from is LOCAL - The client the message is from is not an halfop or higher - The client the message is from is not an IRCOp Also note that this 20K of messages is a PEAK/MAX, it was calculated in a situation with all bans max length and all text said with max length (~500 bytes per message). The average speed impact is usually much lower (<1% CPU). (see the .c file for a bit more complete story) NOTE: max # of bans per channel can be tweaked in the .c file, the default is to allow 15 textbans per channel. REQUIRES ========= This module requires Unreal3.2 or higher, it has been tested on 3.2.3. INSTALL ======== Automatically (recommended) ---------------------------- Just run: ./build Manual ------- Copy textban.c to your src/modules from your UnrealIrcd dir. Run: make custommodule MODULEFILE=textban CONFIG ======= WARNING: THE MODULE IS PERMANENT -- Once loaded it cannot be removed without uncommenting the loadmodule line and restarting the IRCd. Just add the following line to your unrealircd.conf (or whatever): loadmodule "src/modules/textban.so"; Then rehash and you are done.