mIRC Homepage

Valid +k(ey).

Posted By: Jigsy

Valid +k(ey). - 01/07/21 08:19 PM

So I recently started scripting my IRCd again in mIRC.

Anyway, long story short, I started wondering what constitutes as a valid channel key? What is allowed? What isn't allowed?

The nearest I could conclude is that a key cannot start with : - other than that, I don't know.

And is there a valid regex pattern for one?
Posted By: Brax

Re: Valid +k(ey). - 04/07/21 09:56 PM

This is based on personal observation not on any "official" rfc or other docs.

Key seems to be limited to 23 characters. Some IRCd's truncate longer keys. IRCu responds with numeric 525 (Key is not well formed)
Key cannot start with colon ":" It will be stripped from the actual key that is set.
Key cannot start with space. It will be stripped from the actual key that is set.
Key cannot contain space. Everything after the space is ignored.

Colon being prefix character and space being separator character per rfc1459

Everything else looks to be fair game. However different IRCd's seem to just make up their own rules.
Bahamut seems to allow entire ASCII range even non printable range except few obvious ones like char10 (Line Feed) char13 (Carriage return) and maybe few more.
IRCu throws numeric 525 when you try to use ASCII non printable range.
Solanum seems to silently strip everything but prinatble range and converting unicode.

Unicode characters also take two character spaces. Therefore key that is only unicode range can be only 11 characters long.

Pretty sure there are more quirks down the road but those are things I have discovered while writing my own scripts that deal with channel keys.
Posted By: Jigsy

Re: Valid +k(ey). - 05/07/21 03:16 PM

Yeah, : seems to be primarly the main thing.

bircd allowed : in a key like test:key, but another ircu server truncated everything after test.

Thanks for the reply.
Posted By: Jigsy

Re: Valid +k(ey). - 07/07/21 03:31 PM

I've just realized that comma is probably another one since: /join #chan,#chan,... key,key,...
© 2021 mIRC Discussion Forums