diff --git a/Server/Server.cpp b/Server/Server.cpp index aa61cb6..5f73f43 100644 --- a/Server/Server.cpp +++ b/Server/Server.cpp @@ -6,7 +6,7 @@ /* By: iherman- > command; - std::map commands; - // TEMP - commands["echo"] = &echo; - - std::map::iterator it = commands.find(command); - if (it == commands.end()) + std::map::iterator it = commands_.find(command); + if (it == commands_.end()) { - std::string message = "Error: command not found!"; + std::string message = "Error: command not found!\n"; send(client.getFd(), message.c_str(), message.size(), 0); client.clearBuffer(); return ; } - it->second(client); + it->second(client, args); client.clearBuffer(); } diff --git a/Server/Server.hpp b/Server/Server.hpp index b21fb29..c8cbc88 100644 --- a/Server/Server.hpp +++ b/Server/Server.hpp @@ -6,7 +6,7 @@ /* By: iherman- sockets_; std::map clients_; + std::map commands_; + bool handleClient(User& client); void addClient();