diff --git a/Client/Client.cpp b/Client/Client.cpp new file mode 100644 index 0000000..84d49c7 --- /dev/null +++ b/Client/Client.cpp @@ -0,0 +1,33 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* Client.cpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: aortigos +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2026/04/13 22:31:44 by aortigos #+# #+# */ +/* Updated: 2026/04/13 22:31:44 by aortigos ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "Client.hpp" + +////////////////// +// Constructors // +////////////////// + +Client::Client() +{ + std::cout << "Client default constructor called" << std::endl; +} + +Client::Client(int fd) : fd(fd), registered(false), authenticated(false) +{ + std::cout << "Client will use fd: " << fd << std::endl; +} + +Client::~Client() +{ + std::cout << "Client destructor called" << std::endl; +} + diff --git a/Client/Client.hpp b/Client/Client.hpp new file mode 100644 index 0000000..e55ae3b --- /dev/null +++ b/Client/Client.hpp @@ -0,0 +1,36 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* Client.hpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: aortigos +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2026/04/13 22:31:44 by aortigos #+# #+# */ +/* Updated: 2026/04/13 22:31:44 by aortigos ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef CLIENT_HPP +# define CLIENT_HPP + +# include +# include + +class Client +{ + private: + int fd; + std::string nick; + std::string username; + std::string realname; + std::string buffer; + bool registered; + bool authenticated; + + public: + Client(); + Client(int fd); + ~Client(); +}; + +#endif diff --git a/Makefile b/Makefile index 19c9bd3..a3478ec 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ NAME = ircserver -SRC = main.cpp Server/Server.cpp +SRC = main.cpp Server/Server.cpp Client/Client.cpp OBJ = $(SRC:.cpp=.o) diff --git a/Server/Server.hpp b/Server/Server.hpp index d310323..92933ee 100644 --- a/Server/Server.hpp +++ b/Server/Server.hpp @@ -21,6 +21,8 @@ # include # include +# include "../Client/Client.hpp" + class Server { private: