mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2003
Posts: 2,812
Raccoon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
I've always wondered the exact specifics of how $mask() chooses wildcards for portions of a fulladdress. It's obviously aware when it's working with a hostname versus an IP address (v4 and v6), or something that is neither. It also seems to treat different domain names with different subdomain names differently, such as those ending with .co.uk ccTLD instead of a .net TLD.

Could you explain each mask for us, and all of those little case conditions that ultimately decides on a wildcard and its positioning?


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
The $mask() routine consists of 160 lines of code that have evolved over the past twenty years based on user feedback. It includes umpteen tweaks and special cases. Ye gods, there is even code in there that caters for different ircd address formats! Please excuse me a moment while I hyperventilate. Am I going to spend my time going through each line of code and converting it into readable pseudo-code that explains in excruciating detail how it all works? Hmm :-) Seriously, as with most features, the only real way to know how $mask() works is to create test cases for it in a script and to /echo the result.

Joined: Feb 2003
Posts: 2,812
Raccoon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Lol, well good to know!

Maybe we can hold one of those scripting competition things to suss out the definition(s) of each $mask(,N) via brute force.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!

Link Copied to Clipboard