IRC Protocol

Posted by Treebasher on Oct. 10, 2007, 5:53 p.m.

I am messing with the idea of making something for IRC. I am wondering about various protocol things. First of all, I want to know if MPlay would be efficient enough for an IRC client or something along those lines (no, I am not saying I know nothing about online programming, I am just wondering if it would work for IRC), although I know that something like 39Dll is better. 39Dll, SOC, or something along those lines would be used.

Now onto the protocol questions. To connect to the IRC server, can I simply use something such as tcp_connect("irc://example.com",6667), it seems like I could, but just to be sure. From what I understand, to join a password protected server, do I immediatly have to send a PASS passwordhere string to the server. Then, to set my nickname, the next string sent to the server has to be something like NICK Lukesterspy, and to change my nickname, I have to send a string like :Lukesterspy NICK _Lukesterspy_. To "quit" from a server (disconnect), I must send the server a string like QUIT :By everyone. To join a channel, I must send the server a message saying something like :Lukesterspy JOIN #LukesterChannel. To leave a channel (part), I must send a string like Part #LukesterChannel. And so on for the rest of the commands.

I honestly have no clue if I am completely wrong on this or not. Please tell me if I am wrong or not, it would be of great help to me.

Comments

flashback 17 years, 2 months ago

MPlay can't communicate using IRC.

aeron 17 years, 2 months ago

IRC is connected via sockets. Learn more about the protocol and pick up 39dll or something.

Treebasher 17 years, 2 months ago

I can do 39Dll, I was just wondering if MPlay could do it, which I now know it can't [:P].

flashback 17 years, 2 months ago

Using MPlay to try and make an IRC client is like trying to use a eunuch to make babies.

Dom 17 years, 2 months ago

lol

Tyranic-Moron 17 years, 2 months ago

You're pretty much right for the commands. Once you get it connected, you can just learn from the raw messages the server sends back.

The IRC protocol is pretty simple, anyway.

beam 17 years, 2 months ago

IRC port is 6667, not 0. The only thing that isn't obvious is that you need to send NICK and USER commands to the server before it will let you connect, otherwise it'll keep giving you "you have not registered" errors. Like TM said, everything else can be discovered for yourself.

Treebasher 17 years, 2 months ago

Ok, cool, thanks. Now, just what is the USER commands parameters?

Edit: So, would it be something like :Lukesterspy USER Lukesterspy Hostname irc://example.com Lukesterspy for the USER command? What I don't really understand is what to put for the hostname and the servername. I am guessing the server name is the server I am connected to, like "irc://example.com", but is the hostname like the channel? The above irc links are not real.

Wait, do the hostname and servername paramaters not really need to be the real address, just a name? And can it be anything or what?

Tyranic-Moron 17 years, 2 months ago

USER is:

USER nickname website description :Real name

It doesn't matter what you put in any of the sections other than nickname though… They're all just things to appear on /whois commands.