Things to know
2021-12-03
3 min read
Before starting the project please at least read this
This is an non exhaustive list of things you need to take care of before starting the projet
It will also anwser a lot of question we have seen over the past.
- Store all your users in a list / map (as user * if possible);
- Don’t do multiserver
- If you have time, do TLS, it’s worth it
- Make a Message class (with sender, receiver, payload, command called etc) it will be useful.
- PASS
must be send before any other paquet, yell a message only if the user is registered (nick and password was successfuly completed) and refuse the connection at this moment (you can do it on bad PASS directly if you wish) - USER may be called before NICK
- To complete a registration, you need to send RPL 1 to 4
- If a client send a CAP command, ignore it, don’t throw an error
- To get what command to call, do a map with a string as a key (command name) and a pointer to function (it’s cool)
- To test ipv6 you can use irssi and add -6 during the /connect
- IRC default port is 6667 (6697 for tls), while submiting your work please use them, it’s annoying to specify it while testing in a defense (when using irssi for example, specifying 6667 every time at the end is boring)
- If you have time, do REHASH, it’s really cool to see it working
- If you have time and did start the projet well, do STATS
- RFC 1459 is outdated, use 2812, 2813 is for multiserver
- Subject is broken, you should start your executable like this:
./ircserv <port> <password>
but handle the other form:
./ircserv [host:port_network:password_network] <port> <password>
otherwise some people may get angry for no reason - Buffer every output, you only are allowed to do 1 (one) send() per select()
- Add
MSG_NOSIGNAL
as a 4th argument for send, it will prevent your programm from crashing under certain condition - Implement RPL along the way, you won’t need all of them at all
- Implement RPL and ERR as macro
- Don’t use libera.chat as a testing server, it’s a great irc server but it use a lot of ircv3.0 features, instead use self hostable one (ngirc, oragono etc…) you can even use our one, irc.ircgod.com:6667/6697
- You can hardcode operator
- Operator password is not the same thing as server password
- Oper name is not the same thing as your nickname / username etc, oper is like using
sudo -u
- bircd.tar.gz is just a basic tcp server, not an irc server, you may use it the first day to have some fun but it’s not useful
- Use wireshark / a custom proxy etc… to inspect communication between your reference server (or your server) and you your client
Thanks mboivin for some ideas :D