Files
ft_irc/tasks.md
2026-05-25 09:48:11 +02:00

65 lines
2.0 KiB
Markdown

# Tasks for IRC
### Useful info
You can try connect IRC server with
```bash
nc localhost <port>
```
---
### User
Represents a connected IRC client.
| Attribute | Type | Description |
|-----------------|----------|------------------------------------------------|
| `fd` | `int` | TCP s-ocket file descriptor |
| `nick` | `string` | IRC nickname |
| `username` | `string` | Username |
| `realname` | `string` | Real name |
| `buffer` | `string` | Incoming data buffer, accumulates until `\r\n` |
| `authenticated` | `bool` | `true` after correct `PASS` |
| `registered` | `bool` | `true` after `NICK` + `USER` received |
**Registration flow:** `PASS` → authenticated → `NICK` + `USER` → registered → client ready
---
### First stage
- [✓] Server starts
- [✓] It accepts two params, ./ircserv <port> <password>
- [✓] The server accepts one user, user can send messages and we can see from server
- [✓] Only 1 poll()
### Second stage
- [✓] Server can handle multiple clients simultaneously
- [✓] Manage SO_REUSEADDR (restarting server fails to bind same port)
### Third stage
- [✓] Dispatcher (select function for each command)
- [✓] Implement generic parser (extract command and pass args to command function)
- [✓] Client has nickname and username
- [✓] PASS command for authenticate
### Fourth stage
- [✓] Client can create/connect to channels
- [✓] JOIN command (user can create channel)
- [✓] PRIVMSG command (send message to a channel)
- [✓] QUIT command
- [✓] PRIVMSG difference between channels (#) and users
### Fifth stage
- [ ] PART command (user leaves a channel)
- [✓] KICK command (operator removes a user from channel)
- [ ] INVITE command (operator invites a user to channel)
- [ ] TOPIC command (view or set channel topic)
*It will continue...*