Page 1 of 1

[DONE] Looking for delaylist.c port for unreal4

Posted: Fri Mar 17, 2017 2:03 am
by HeXiLeD
/*
* ==================================================================
* Module: delaylist.c
* Author: w00t <[email protected]>
* Version: 1.0.0
* Written For: Stskeeps
* Licence: GPL
* Description: Delays list for newly connected clients.
* ==================================================================
*/
*/
Original code here

If anyone could port it, it would be great.

====================

[Gottem EDIT 20181104] Current information should probably be displayed in the first post and not somewhere down the thread. :>


k4be made some contributions in regards to the newly added fake channel listing functionality. I added a gline-on-join-fakechan thing myself afterwards. =]

The config block is a lil different than you described, but it does the same. Add a new top level block (so not within set):

Code: Select all

listrestrict {
	connectdelay 60; // How long a client must have been online for
	needauth 1; // Besides connectdelay, also require authentication w/ services
	authisenough 1; // Don't check connectdelay if user is identified OR exempt from authentication entirely
	fakechans 1; // Send a fake channel list if connectdelay and/or needauth checks fail
	glinetime 7d; // For channels with gline set to 1, use 0 for permanent bans

	fakechannel {
		// Only the name is required
		name "#honeypot";
		//topic "ayy lmao"; // Defaults to "DO NOT JOIN"
		//users 50; // Defaults to 2 users, must be >= 1
		//gline 0; // Defaults to 0
	};

	fakechannel {
		name "#fakelol";
		topic "top kek";
		users 10;
		gline 1; // G:Line won't kick in if connectdelay and needauth checks are satisfied, or if the user has a 'fakechans' exception
	};

	exceptions {
		all "user@*";
		connect "[email protected]"; // Only require auth
		auth "*@123.123.123.*"; // Only require connectdelay
		fakechans "ayy@lmao"; // Don't send a fake channel list, just prevent sending of the legit one

		// You can also specify multiple types for the same mask:
		auth "need@moar";
		fakechans "need@moar";
		// This user would only need to wait <connectdelay> seconds and won't get a fake channel list at all
	};
};
Omitting a directive entirely will make it default to off. If connectdelay is specified, the minimum required value is (still) 10 as anything below seems pretty damn useless to me. =] The exceptions block should be pretty self explanatory. ;]

As usual with my mods, U:Lines, opers and servers are exempt from any restrictions.

Get it here

Re: [DONE] Looking for delaylist.c port for unreal4

Posted: Fri Mar 17, 2017 6:42 pm
by Gottem
Saw your request in the channel before I headed off to work and made a note. ;] Decided not to port this one but instead use my m_pmdelay as base (since it's very similar anyways), as such the same restrictions apply (delay must be >= 10). Also renamed it slightly to m_listdelay to be consistent with m_pmdelay. =]

Change the delay with:

Code: Select all

set {
	listdelay 60;
};
Checkem here

Re: [DONE] Looking for delaylist.c port for unreal4

Posted: Sat Sep 02, 2017 10:29 am
by HeXiLeD
In the past (u3.2*) we also had m_listreg.c which also has it's usefulness and although i was thinking about requesting a port of for for u4.*, I thought maybe adding it's functionalities to delaylist.c,. given the use a it's specific configuration file.

Original code here.

example:

Code: Select all

set {
			list_delay yes|no;
			delay_time 60;
			require_reg yes|no; 
};
notes:
* list_delay no; should obviously ignore delay_time
* require_reg yes; should not bypass delay_time

This would mean merging two modules in one and thus making it more versatile and perhaps the module could e renamed to, list_options.c or something similar.

I do not really see the point of having to separate modules, but should there be a technical good reason not to merge the modules, it would still be nice to have m_listreg.c ported to urealircd4.

Part 2: (optional but nice to have)

Always /list based on mask/ip/host that is white listed:

Code: Select all

set {
			list_delay yes|no;	# it set to yes, it should still obey bypass white list option for white listed people
			delay_time 60;
			require_reg yes|no;
			bypass_options yes|no;	# if set to no, it will ignore bypass options bellow
						# if set to yes, it will activate white listed people
};

# Bypass white list options will have the last word in regards to list_delay and require_reg:

Code: Select all

set {
	bypass_delay { 
				some@ip|mask;
				user@localhost;
				etc... };

        bypass_reg { 
				some@ip|mask;
				user@localhost; 
				etc... };
};
Note: identified opers should never should never be affected by this module

Re: [DONE] Looking for delaylist.c port for unreal4

Posted: Sat Sep 02, 2017 3:05 pm
by Gottem
We good. =] I moved all relevant information to the OP to keep it in one place and easily accessible [20181104].

Re: [DONE] Looking for delaylist.c port for unreal4

Posted: Thu Dec 28, 2017 12:11 pm
by HeXiLeD
So far the module looks great 8)
I was wondering if it would be easy to implement the possibility of customizing the replies send by the module:
You have to be connected for at least 60 seconds before being able to /LIST
You have to be identified with services before being able to /LIST
The customization would be done in the module config file.

Example:

Code: Select all

listrestrict {
	connectdelay 60; // How long a client must have been online for
        delay_msg "blah blab blah /list";

	needauth 1; // Besides connectdelay, also require authentication w/ services
        auth_msg "blah blab blah /list";

exceptions {
		all "user@*";
		auth "*@123.123.123.*";
		connect "[email protected]";
		connect "need@moar";
	};
};
Reason being to provide specific information on how to proceed next and or services details without have to edit the code every time the module gets compiled.

8)

Re: [DONE] Looking for delaylist.c port for unreal4

Posted: Thu Dec 28, 2017 6:33 pm
by Gottem
I don't really see a reason why you would need to edit those. =] It already sends both those messages (as you mentioned) and they should be pretty clear anyways.

Re: [DONE] Looking for delaylist.c port for unreal4

Posted: Thu Aug 09, 2018 9:51 am
by Amiga00
Well being able to set the messages themselves (and perhaps use a default if not set), would enable different languages to be used as well, for example, perhaps the server does not use English as its first language, therefore, they could set that instead of using the English version.

Re: [DONE] Looking for delaylist.c port for unreal4

Posted: Sun Aug 12, 2018 10:11 pm
by Gottem
Maybe I can hack up something like m_localisation which would export some functions so my other mods can use it (if it's not loaded then every mod would just use the English defaults). Then unrealircd.conf could contain something like:

Code: Select all

localisation {
    listrestrict {
        delay "You have to be connected for at least %d seconds before being able to /LIST";
        auth "You have to be identified with services before being able to /LIST";
    };
    message_commonchans {
        deny "You need to be on a common channel with %s to privately message them";
    };
    // etcetctetctetcetcetcectttece
};
Cuz right now, only some of the modules have configurable messages and only for user-facing shit. I'd imagine opers would want their debug messages in their own language too, in which case it makes more sense to have a localisation module instead of having configurables for each module separately.

Would need to figure out a clean/efficient way for handling template vars such as %d and %s in above example though. :>