Code Monkey home page Code Monkey logo

42-ft_irc's Introduction

🚀 Description

This project is about creating our own IRC server. We used an actual IRC client to connect to our server and test it. IRC is a protocol for real-time text messaging between internet-connected computers created in 1988. It is mainly used for group discussion in chat rooms called “channels” although it supports private messages between two users, data transfer, and various server-side and client-side commands. As of April 2011, the top 100 IRC networks served over 500,000 users at a time on hundreds of thousands of channels." (source)

Mandatory part

  • We have to develop an IRC server in C++ 98.
  • The server must be capable of handling multiple clients at the same time and never hang.
  • Only 1 poll() (or equivalent) can be used for handling all these operations (read, write, but also listen, and so forth).
  • An IRC client must be able to connect to your server without encountering any error.
  • Communication between client and server has to be done via TCP/IP (v4).
  • Using the IRC client with our server must be similar to using it with any official IRC server. However, we only have to implement the following features:
    • We must be able to authenticate, set a nickname, a username, join a channel, send and receive private messages using the IRC client.
    • All the messages sent from one client to a channel have to be forwarded to every other client that joined the channel.
    • We must have operators and regular users.
    • Then, we have to implement the commands that are specific to operators.

Bonus part

  • Handle file transfer.
  • Create a bot.

💻 Our IRC Commands

These are the available commands in our IRC Server:

  • NICK: /nick nickname, Changes your nickname to a new nickname.
  • PASS: /pass command is used to set a 'connection password'.
  • USER: /user command is used at the beginning of connection to specify the username, hostname and realname of a new user.
  • PING: /ping user, Sends a PING request to a user. Used for checking connection and lag. Servers issue pings on a timed basis to determine if users are still connected.
  • JOIN: /join #channel [key] , Joins the specified channel with or without password.
  • MSG: /msg nickname message, Sends a private message to nickname without opening a query window.
  • MODE: /mode #channel|nickname [[+|-]modechars [parameters]], This is a powerful command that gives channel operators control of a channel and the users on it.
  • QUIT: /quit [message], Disconnects you from IRC and will give the optional message as the reason for your departure. (this message only appears to people who are on the same channels as you).
  • PART: /part command is used when you want to depart/leave a specific channel, or the current active channel. This command also allows you to specify a parting message, which will display to the remaining users a custom message in the server's PART message.
  • TOPIC: /topic #channel newtopic, Changes the topic for a channel that you are on if you're an operator.
  • KICK: /kick #channel nickname, Kicks a nickname off a channel that you are on if you're an operator.
  • INVITE: /invite nickname #channel, Invites a nickname to a channel that you are on.
  • NOTICE: /notice nickname message, Sends a private message to nickname without opening a query window for either you or them.
  • LIST: /list command enables you to find list of channels on the server.
  • WHOIS: /whois nickname, Shows you information about a nickname.

⚙️ Start IRC Server

To compile the program, use:

  • make To start the Server, use:
  • ./ircserv <port> <password>
    • port: The port number on which your IRC server will be listening to for incoming IRC connections.
    • password: The connection password. It will be needed by any IRC client that tries to connect to your server. To connect to the server, you can use:
  • nc <IP ADDRESS> <PORT>
    • IP ADDRESS: Host IP address.
    • PORT: The PORT that the server listening on.
  • You can also use an IRC Client e.g irssi, WeeChat...

🧠 Contributors

Simon Aeby
 42intra profile : saeby

Blaze Kalonda
 42intra profile : btchiman

📚 Ressources

🔬 Schema


42-ft_irc's People

Contributors

laendrun avatar blaisek avatar

Watchers

 avatar

42-ft_irc's Issues

Max online

la réallocation de mémoire ne fonctionne pas et le serveur crash si on dépasse la valeur initialisée

Command LIST

/list command enables you to find a list of channels on the server.

DestructorS

Don't forget to delete everything in the different destructors...

For now we never delete nothing.

I'll quickly create the DIE command to stop the server tonight so that way we can check leaks

Command PART

The /part command is used when you want to depart/leave a specific channel, or the current active channel. This command also allows you to specify a parting message, which will display to the remaining users a custom message in the server's PART message.

Channels can have more than one mode

@blaisek in your current implementation of the channel class, it only supports one mode but a channel, as a user could have multiple modes.

For now I'll create new functions that returns a sample value in the format that I need for use with the commands.

Server crash when wrong password given

If we enter a wrong password when we try to login, irssi thinks we are connected to the server, the problem is that we are not really

when we then try to join a channel, the server crashes because it tries to access a client that is not really a client...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.