fixing vavaas issues

This commit is contained in:
Kbz-8
2024-02-07 16:58:38 +01:00
parent 699036361b
commit 44d9ec54d6
10 changed files with 122 additions and 58 deletions

View File

@@ -6,14 +6,10 @@
/* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/30 01:54:36 by vvaas #+# #+# */
/* Updated: 2024/02/06 11:52:46 by vvaas ### ########.fr */
/* Updated: 2024/02/07 16:57:53 by maldavid ### ########.fr */
/* */
/******************************************************************************/
#define IP "127.0.0.1"
#define PORT 6667
#define PASSWORD "passwordIRC"
#include <irc.hpp>
#include <vector>
#include <string>
@@ -22,15 +18,18 @@ class Bot
{
public:
Bot();
bool init(const std::string &ip, const std::string &port, const std::string &password);
void connect_to_server(void);
void handle_response(std::string buffer);
void send_message(const std::string &content);
~Bot();
private :
bool _channel_created;
bool _logged;
std::vector<std::string> _connect_commands;
struct sockaddr_in _serv_addr;
int _fd;
std::vector<std::string> _connect_commands;
};
bool _channel_created;
bool _logged;
};

View File

@@ -6,7 +6,7 @@
/* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/21 09:15:24 by maldavid #+# #+# */
/* Updated: 2024/02/06 12:35:38 by vvaas ### ########.fr */
/* Updated: 2024/02/07 16:52:54 by maldavid ### ########.fr */
/* */
/******************************************************************************/
@@ -21,8 +21,7 @@ namespace irc
{
log_message = 0,
log_warning,
log_error,
log_fatal_error
log_error
};
namespace logs

View File

@@ -6,7 +6,7 @@
/* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/21 09:12:28 by maldavid #+# #+# */
/* Updated: 2024/02/06 12:35:48 by vvaas ### ########.fr */
/* Updated: 2024/02/07 16:50:54 by maldavid ### ########.fr */
/* */
/******************************************************************************/
@@ -40,6 +40,7 @@ namespace irc
inline const std::string &getRunDate(void) const { return _run_date; };
inline size_t getClientCount(void) const { return _client.size(); };
inline size_t getChannelCount(void) const { return _channels.size(); };
inline bool hasFailedInit() const { return _init_failed; }
~Server();
@@ -87,6 +88,7 @@ namespace irc
int _port;
int _main_socket;
bool _active;
bool _init_failed;
};
}