Merge branch 'master' into raph

This commit is contained in:
Raphaël 2025-05-24 18:03:06 +02:00 committed by GitHub
commit 520814d6bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 357 additions and 225 deletions

View file

@ -1,35 +1,36 @@
/* ************************************************************************** */
/******************************************************************************/
/* */
/* ::: :::::::: */
/* server.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* By: omoudni <omoudni@student.42paris.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/05/20 21:50:32 by rparodi #+# #+# */
/* Updated: 2025/05/24 16:48:04 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
/******************************************************************************/
#pragma once
#include <string>
#include "PollManager.hpp"
#include <list>
#include "user.hpp"
#include "channel.hpp"
#include "core.hpp"
class Server {
private:
int _port;
int _serverFd;
std::string _password;
PollManager _pollManager;
public:
Server(int port, const std::string &password);
~Server();
void start();
std::list<User *> getUsersList() const;
std::list<Channel *> getChannelsList() const;
unsigned short int getPort() const;
void showInfo() const;
class User;
class Server
{
private:
int _port;
int _serverFd;
std::string _password;
PollManager _pollManager;
std::map<int, User *> _users;
public:
Server(int port, const std::string &password);
~Server();
void start();
unsigned short int getPort() const;
std::list<User *> getUsersList() const;
std::list<Channel *> getChannelsList() const;
void showInfo() const;
void printUsers() const;
};