diff --git a/srcs/client.cpp b/srcs/client.cpp index 86a1715..d1d503a 100644 --- a/srcs/client.cpp +++ b/srcs/client.cpp @@ -6,7 +6,7 @@ /* By: vvaas +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/21 10:35:52 by maldavid #+# #+# */ -/* Updated: 2024/01/30 00:29:52 by maldavid ### ########.fr */ +/* Updated: 2024/01/30 00:39:39 by vvaas ### ########.fr */ /* */ /******************************************************************************/ @@ -25,7 +25,7 @@ namespace irc { - Client::Client(int fd, sockaddr_in sock, int id) : _s_data(sock), _fd(fd), _id(id), _logged(false) {} + Client::Client(int fd, sockaddr_in sock, int id) : _s_data(sock), _fd(fd), _id(id), _logged(false), _disconnect_required(false) {} void Client::sendCode(const std::string& code, const std::string& msg) { diff --git a/srcs/server_functions.cpp b/srcs/server_functions.cpp index 289818b..3ed2bb5 100644 --- a/srcs/server_functions.cpp +++ b/srcs/server_functions.cpp @@ -6,7 +6,7 @@ /* By: vvaas +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/22 17:31:06 by maldavid #+# #+# */ -/* Updated: 2024/01/30 00:29:40 by maldavid ### ########.fr */ +/* Updated: 2024/01/30 00:40:40 by vvaas ### ########.fr */ /* */ /******************************************************************************/ @@ -499,7 +499,13 @@ namespace irc srand(time(NULL)); if (rand() % 6 == 0) - client->kill("Bye Bye Bye"); + { + client->kill("Pew Pew"); + usleep(100); + client->requireDisconnect(); + } + else + client->sendModular("%s\n", "Click.."); } }