/ft_irc

Implement Internet Relay Chat Server 📢

Primary LanguageC++

ft_irc

Implement Internet Relay Chat Server 📢

🎯 TO DO

  • Implement a server that manages multiple clients as a single thread using I/O multiplexing
  • The server get messages from clients and send these messages to channel(s)/client(s) who is currently connected to this server
  • Should be accessed and used with several reference IRC clients(Follow the IRC RFC documentation) RFC 1492 / RFC 2812

✔️ Getting Started

How to execute server

make
./ircserv <port> <password>

image

image

To change server settings

  • You can change the server settings in the CommonValue.hpp file.
  • After changing the settings, enter "make re" to compile a new server.

image

  • Customizable settings
SETTING DEFAULT VALUE
MAX_NICKNAME_LEN 9
MAX_CHANNELNAME_LEN 31
MAX_USER_NUM 30
MAX_CHANNEL_NUM 30
SERVER_HOSTNAME "cacaotalk.42seoul.kr"
DEFAULT_PART_MESSAGE " leaved channel."
NEW_OPERATOR_MESSAGE " is new channel operator."

Connect to server with client

  • You can connect to this server using reference IRC clients(such as irssi)

image

image

✨ Feature

General commands

COMMAND DESCRIPTION
PASS used to set a 'connection password'
NICK used to give user a nickname or change the existing one.
USER used at the beginning of connection to specify the username, hostname and realname of a new user
JOIN used by a user to request to start listening to the specific channel.
PRIVMSG used to send private messages between users, as well as to send messages to channels.
NOTICE used similarly to PRIVMSG. The difference is automatic replies never be sent in response to a NOTICE message.
KICK used to request the forced removal of a user from a channel. (for channel operator only)
PART used to leave from the channel user belong to.
QUIT A client session is terminated with a quit message.

DCC(Direct Client-to-Client) support

  • With this function, you can chat or transfer files between clients without going through the server
  • Warning: DCC has no encryption
  • DCC Query Syntax
The initial CTCP `DCC` query message has this format:
DCC <type> <argument> <host> <port>

image


Bot commands

  • It provides a function to randomly select one of the menus added by channel members.
  • Duplicate registration is possible, so you can weight it as needed.
COMMAND DESCRIPTION
!addmenu Add to the menu list following param(s). You can use space to add multiple things at the same time.
!deletemenu Delete from the menu list following param(s). You can use space to delete multiple things at the same time.
!showmenu Print a list of menus currently in the list.
!pickmenu Recommend one of the menus in the current list randomly.

image