The IRC protocol was developed over the last 4 years since it was first implemented as a means for users on a BBS to chat amongst themselves. The IRC protocol is a text-based protocol, with the simplest client being any socket program capable of connecting to the server. The IRC protocol has been developed on systems using the TCP/IP network protocol, although there is no requirement that this remain the only sphere in which it operates.
- the goal of the project is to create an irc server, where users (Clients) can exchange direct messages, and join group channels.
- IRC server's are connected together, and has there own rules (Server to Server communication), but we dont have to think about it because we are gonna be making a one server that is able to receive incomming connection from other Clients.
Server :
- As what've been told before, the Server can connecte multiple Client with each other, and keep the other servers in touch, but we will not be handling the DSS communication.
- Creating a server is basiclly creating a
Socket
with some specific rules :socket :
Socket programming is a way of connecting two nodes on a network to communicate with each other.
One socket(node) listens on a particular port at an IP, while the other socket reaches out to the other to form a connection.
The server forms the listener socket while the client reaches out to the server.
- to be able to accept an incomming connection, our socket must have an
IP Adresse
, and an assignedPORT
, which is one of our programme's paramaeters. - After having the two args, the type of the network protocol must be selected
TCP(v4 or v6)
, the rest be nothing more than a puzzle, all functions that we need are availble, easy to understand and maintain.
- With this the Server is ready to go.
Client :
- At this point we are waiting for any connection from a Client.
- Several IRC clients exist. You have to choose one of them as a reference(
for 1337-kh students there is the LimeChat
). - Using your reference client with your server must be similar to using it with any official IRC server, which means the replays must be displayed correctly and clearly .
- each action in made by the Client has it's reaply/result in the server like an asnwer to the request to which could be and error or a command's result .
- While building the replays it would be better to use the terminal as a client, it makes the follow of the commands much better,
you can use the
nc -c
command with the server IP_Adresse and PORT : - Using the terminal make it more easy when it comes to the what the Server sends and what the Client receives
- And that's it, it's up to you now, using the RFC, you will find everything you need to know and to do, so you can create your own IRC server.
- Following the subject, there are some specific things that much be done as a mandaroty parts:
- You must be able to :
set a nickname, a username, join a channel, send and receive private messages using your reference client.
- All the messages sent from one client to a channel have to be forwarded to every other client that joined the channel.
- You must have operators and regular users.
- Then, you have to implement the commands that are specific to operators.
- You must be able to :
- it may be too littel compared to the RFC, but there is no limit to what we can add to the project, from all the channel's mode + the use's mode and the other command that make the server more usable.
- simply
make
the code, and run./ircserv localhost port
(you can change the ip and the port) and use your Client to connect :
- And Done you can communicate with others using the commands you created .
- For the bonus part there is two tasks :
BOT .
FILE TRANSFER .
BOT :
- there is no limit nor a specific thing to do, you are free to make the bot do anything you like, from a normal commands to some bigger task.
- Our bot main job is a user tracker, each user connect to the server will be tracked and tranfered into a player with a LEVEL, RANK, POINTS and more.
- so that the more the user is active with the logtime and the number for commands used, he gain some point that level up him.
- some levels gives the user a specific rules in the server, or a special channel with the user's nickname, where he is it's operator, even more when a player reach the max level, he becomes a server operator.
- we names our littel bot /lily, a pertty name for a littel prety bot (^_^)/.
- using the limeChat or any other Client, you can send
profile
command to her, she will answer with the player's data.
- And finally a location or search command that gives the location of a player in the Cluster
whereis
:
> File Transfer :