How assanfakou/ft_irc works
ft_irc is a C++98 IRC server for standard IRC clients. A client connects over TCP, registers with a password and identity, then uses IRC commands for private messaging and channel membership, messaging, and moderation; the server returns protocol replies. The main runtime uses a poll-based server loop and stores client and channel state. The tree and excerpts support the server entry point, client state, protocol types, reply generation, command implementations, and a separate IRC bot client. Some internal dispatch links are dashed because their implementation was not shown.
Main entry points: Server.cpp Poll server · botClient.cpp Bot connection · Parser.cpp Command parser · main.cpp Server entry
Components 21
Server runtime
- Server entry
src/main.cpp - Poll server
src/Server.cpp
Protocol state
- Client state
src/Client.cpp - IRC message
src/Message.cpp - Command parser
src/Parser.cpp - Channel state
src/Channel.cpp - Protocol replies
src/Reply.cpp
IRC commands
- Registration
src/cmds/PASS.cpp - User identity
src/cmds/USER.cpp - Nickname changes
src/cmds/NICK.cpp - Join channels
src/cmds/JOIN.cpp - Leave channels
src/cmds/PART.cpp - Private and channel messaging
src/cmds/MsgCommands.cpp - Invite users
src/cmds/INVITE.cpp - Remove members
src/cmds/KICK.cpp - Channel topics
src/cmds/TOPIC.cpp - Channel modes
src/cmds/MODE.cpp - Channel listing
src/cmds/LIST.cpp
Bot client
- Bot connection
src/bot/botClient.cpp - Bot commands
src/bot/bot.cpp
Other components
- IRC client
Connections 21
- IRC client → Poll server: sends IRC commands
README.md - Server entry → Poll server: starts
src/main.cpp - Poll server → IRC client: sends replies
README.md - Poll server → Command parser: parses input
- Command parser → IRC message: creates messages
- Poll server → Client state: tracks clients
- Poll server → Channel state: tracks channels
- Poll server → Protocol replies: formats responses
- Poll server → Registration: dispatches registration
- Poll server → User identity: dispatches registration
- Poll server → Nickname changes: dispatches commands
- Poll server → Join channels: dispatches commands
- Poll server → Leave channels: dispatches commands
- Poll server → Private and channel messaging: dispatches commands
- Poll server → Invite users: dispatches commands
- Poll server → Remove members: dispatches commands
- Poll server → Channel topics: dispatches commands
- Poll server → Channel modes: dispatches commands
- Poll server → Channel listing: dispatches commands
- Bot connection → IRC client: connects to server
src/bot/botClient.cpp - Bot connection → Bot commands: handles received commands