One file per command

This commit is contained in:
2026-04-17 12:01:16 +02:00
parent 00a08b4f30
commit bb66fcc097
8 changed files with 169 additions and 4 deletions

View File

@@ -23,6 +23,14 @@
# include "../Client/Client.hpp"
# include <map>
# include <sstream>
const std::string ERR_PASSWORD = "ERROR :Password incorrect\r\n";
const std::string ERR_NONICK = "ERROR :No nick given\r\n";
const std::string ERR_NOPASS = "ERROR :Authenticate first\r\n";
const std::string ERR_REREGISTER = "462 :You may not reregister\r\n";
const std::string ERR_NOUSER = "ERROR :No username given\r\n";
class Server
{
@@ -37,6 +45,12 @@ class Server
void readClient(int fd);
void removeClient(int fd);
void parseCommand(int fd, std::string line);
void cmd_pass(int fd, std::istringstream &ss);
void cmd_nick(int fd, std::istringstream &ss);
void cmd_user(int fd, std::istringstream &ss);
public:
Server();
Server(int port, std::string password);