Parser accept server functions, and first stage for implementing client.send function

This commit is contained in:
2026-05-14 17:24:23 +02:00
parent 9093ac3511
commit 300d489365
3 changed files with 16 additions and 20 deletions

View File

@@ -3,10 +3,10 @@
/* ::: :::::::: */
/* Server.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: iherman- <iherman-@student.42malaga.com +#+ +:+ +#+ */
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/05/06 17:18:11 by iherman- #+# #+# */
/* Updated: 2026/05/12 19:57:32 by iherman- ### ########.fr */
/* Updated: 2026/05/14 16:58:31 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
@@ -39,7 +39,7 @@ class Server
std::vector<struct pollfd> sockets_;
std::map<int, User> clients_;
std::map<std::string, void (*)(User&, std::istringstream&)> commands_;
std::map<std::string, void (Server::*)(User&, std::istringstream&)> commands_;
bool handleClient(User& client);
@@ -51,6 +51,10 @@ class Server
Server(const Server& other);
Server &operator=(const Server& other);
// Commands
void pass_cmd(User &client, std::istringstream &ss);
public:
Server();
Server(int port, const std::string& password);