Skip to content

davfront/42_ft_irc

Repository files navigation

ft_irc

Capture d'écran 2024-01-05 130819

Getting started

Compile:

# without debug mode
make

# with debug mode
make debug

Launch the program:

# Usage
./ircserv <port> <password>

# Example
./ircserv 6667 !Lov3!rcS3rv

Resources

IRC clients:

IRC Protocols:

Miscellaneous:

Structure

Server Class

Server class represents the IRC server itself.

Attributes:

  • name
  • address (IP or hostname)
  • Port number
  • List of connected clients
  • List of available channels

Methods:

  • Start: Initialize the server and begin listening for incoming connections.
  • AcceptClient: Accept and handle incoming client connections.
  • BroadcastMessage: Send a message to all connected clients.
  • ManageChannels: Create, delete, and manage IRC channels.
  • HandleCommands: Parse and process IRC commands received from clients.

User Class

User class represents a connected user client.

Attributes:

  • Client socket
  • Nickname
  • User modes (e.g., operator status)
  • List of joined channels

Methods:

  • Connect: Establish a connection to the server.
  • Authenticate: Authenticate the client (e.g., with a password).
  • JoinChannel: Join an IRC channel.
  • SendMessage: Send a message to a channel or another user.
  • LeaveChannel: Leave an IRC channel.
  • Disconnect: Close the client's connection to the server.

Operator Class (inherits from User):

Operator class represents IRC operators with elevated privileges.

Inherits from Client and adds additional operator-specific attributes and methods.

Channel operator commands:

  • To be defined...

Channel operator commands:

  • KICK - Eject a client from the channel
  • INVITE - Invite a client to a channel
  • TOPIC - Change or view the channel topic
  • MODE - Change the channel’s mode:
    • i: Set/remove Invite-only channel
    • t: Set/remove the restrictions of the TOPIC command to channel operators
    • k: Set/remove the channel key (password)
    • o: Give/take channel operator privilege 5 ft_irc Internet Relay Chat
    • l: Set/remove the user limit to channel

Channel Class

Channel class represents an IRC channel (chat room).

Attributes:

  • Channel name
  • List of clients/users in the channel
  • Channel modes (e.g., invite-only, moderated)

Methods:

  • AddClient: Add a client to the channel.
  • RemoveClient: Remove a client from the channel.
  • SendChannelMessage: Send a message to all clients in the channel.
  • SetChannelModes: Set or modify channel-specific modes.

Message Class

Message class can be used to encapsulate and parse IRC messages. You can create instances of this class to represent messages sent between clients and the server.

CommandParser Class

CommandParser class can be used to parse incoming IRC commands and route them to the appropriate handlers (e.g., join, part, privmsg).

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •