patates
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/01/21 10:34:25 by maldavid #+# #+# */
|
||||
/* Updated: 2024/01/24 00:42:16 by vvaas ### ########.fr */
|
||||
/* Updated: 2024/01/24 15:34:26 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
@@ -37,8 +37,7 @@ namespace irc
|
||||
inline const std::string& getName() const { return _name; }
|
||||
inline const std::string& getPassword() const { return _password; }
|
||||
|
||||
void addClient(unstd::SharedPtr<Client> client);
|
||||
void addClient(unstd::SharedPtr<Client> client, bool op);
|
||||
void addClient(unstd::SharedPtr<Client> client, bool op = false);
|
||||
bool removeClient(unstd::SharedPtr<Client> client);
|
||||
|
||||
inline std::size_t getNumberOfClients() const { return _clients.size(); }
|
||||
@@ -46,7 +45,7 @@ namespace irc
|
||||
inline void addOperator(unstd::SharedPtr<Client> op) { _operators.insert(op); }
|
||||
inline bool removeOperator(unstd::SharedPtr<Client> op) { return _operators.erase(op); }
|
||||
|
||||
void handleMessage(const std::string& msg, unstd::SharedPtr<Client> client) const;
|
||||
void handleMessage(const std::string& msg, unstd::SharedPtr<Client> client, bool notice = false) const;
|
||||
|
||||
inline bool isInviteOnly() const { return _invite_only; }
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/01/21 10:33:17 by maldavid #+# #+# */
|
||||
/* Updated: 2024/01/24 00:11:46 by vvaas ### ########.fr */
|
||||
/* Updated: 2024/01/24 15:00:39 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
@@ -27,8 +27,6 @@ namespace irc
|
||||
|
||||
inline int getFD() const { return _fd; }
|
||||
inline int getID() const { return _id; }
|
||||
inline int getLogged() const { return _logged; }
|
||||
inline int getDisconnect() const { return _to_disconnect; }
|
||||
inline sockaddr_in getSockAddr() const { return _s_data; }
|
||||
inline const std::string& getMsgInFlight() const { return _msg_in_flight; }
|
||||
|
||||
@@ -37,8 +35,12 @@ namespace irc
|
||||
inline void setNewNickName(const std::string& name) { _nickname = name; }
|
||||
inline void setNewUserName(const std::string& name) { _username = name; }
|
||||
inline void setNewRealName(const std::string& name) { _realname = name; }
|
||||
inline void setLogged(void) { _logged = true; }
|
||||
inline void setDisconnect(void) { _to_disconnect = true; }
|
||||
|
||||
inline void login() { _logged = true; }
|
||||
inline void requireDisconnect() { _disconnect_required = true; }
|
||||
|
||||
inline bool isLogged() const { return _logged; }
|
||||
inline bool disconnectRequired() const { return _disconnect_required; }
|
||||
|
||||
inline const std::string& getNickName() const { return _nickname; }
|
||||
inline const std::string& getUserName() const { return _username; }
|
||||
@@ -48,6 +50,7 @@ namespace irc
|
||||
|
||||
inline void setFd(int new_fd) { _fd = new_fd; }
|
||||
|
||||
void sendPlainText(const std::string& str);
|
||||
void sendCode(const std::string& code, const std::string& msg);
|
||||
void sendMsg(const std::string& sender, const std::string& cmd, const std::string& trailing);
|
||||
|
||||
@@ -62,7 +65,7 @@ namespace irc
|
||||
int _fd;
|
||||
int _id;
|
||||
bool _logged;
|
||||
bool _to_disconnect;
|
||||
bool _disconnect_required;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/01/21 09:12:28 by maldavid #+# #+# */
|
||||
/* Updated: 2024/01/23 23:29:00 by vvaas ### ########.fr */
|
||||
/* Updated: 2024/01/24 15:14:05 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
@@ -57,7 +57,6 @@ namespace irc
|
||||
void handlePrivMsg(unstd::SharedPtr<class Client> client, const class Message& msg);
|
||||
void handleNotice(unstd::SharedPtr<class Client> client, const class Message& msg);
|
||||
void handleKick(unstd::SharedPtr<class Client> client, const class Message& msg);
|
||||
void handleMotD(unstd::SharedPtr<class Client> client, const class Message& msg);
|
||||
void handleTopic(unstd::SharedPtr<class Client> client, const class Message& msg);
|
||||
void handlePing(unstd::SharedPtr<class Client> client, const class Message& msg);
|
||||
void handleMode(unstd::SharedPtr<class Client> client, const class Message& msg);
|
||||
|
||||
Reference in New Issue
Block a user