nerd emoji
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
/* ************************************************************************** */
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* client.hpp :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/01/21 10:33:17 by maldavid #+# #+# */
|
||||
/* Updated: 2024/01/21 10:34:13 by maldavid ### ########.fr */
|
||||
/* Updated: 2024/01/21 16:32:05 by vvaas ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef __CLIENT__
|
||||
#define __CLIENT__
|
||||
@@ -18,11 +18,12 @@ namespace irc
|
||||
class Client
|
||||
{
|
||||
public:
|
||||
Client();
|
||||
Client(int fd);
|
||||
|
||||
~Client();
|
||||
|
||||
private:
|
||||
int _fd;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
/* ************************************************************************** */
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* irc.hpp :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: vvaas <vvaas@student.42.fr> +#+ +:+ +#+ */
|
||||
/* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/29 13:24:01 by vvaas #+# #+# */
|
||||
/* Updated: 2023/11/29 16:32:34 by vvaas ### ########.fr */
|
||||
/* Updated: 2024/01/21 14:20:31 by vvaas ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef IRC_H
|
||||
# define IRC_H
|
||||
@@ -20,5 +20,5 @@
|
||||
# include <unistd.h>
|
||||
# include <cstdlib>
|
||||
# include <sys/socket.h>
|
||||
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
@@ -1,21 +1,24 @@
|
||||
/* ************************************************************************** */
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* server.hpp :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/01/21 09:12:28 by maldavid #+# #+# */
|
||||
/* Updated: 2024/01/21 10:37:58 by maldavid ### ########.fr */
|
||||
/* Updated: 2024/01/21 17:18:17 by vvaas ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef __SERVER_IRC__
|
||||
#define __SERVER_IRC__
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <irc.hpp>
|
||||
#include <unstd/shared_ptr.hpp>
|
||||
|
||||
#define MAX_USERS 20
|
||||
namespace irc
|
||||
{
|
||||
class Server
|
||||
@@ -24,12 +27,24 @@ namespace irc
|
||||
Server(int port, const std::string& password);
|
||||
|
||||
~Server();
|
||||
inline unsigned long get_port(void) { return (htons(_port)); }
|
||||
|
||||
private:
|
||||
void init_socket(void);
|
||||
void wait(void);
|
||||
|
||||
private:
|
||||
sockaddr_in _s_data;
|
||||
socklen_t _s_len;
|
||||
fd_set _fd_set;
|
||||
|
||||
std::vector<class Channel> _channels;
|
||||
std::vector<unstd::SharedPtr<class Client> > _client;
|
||||
const std::string _password;
|
||||
const std::string _ip;
|
||||
const int _port;
|
||||
int _socket;
|
||||
int _main_socket;
|
||||
bool _active;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user