fix(server): now compiling with fake method to get list
This commit is contained in:
parent
96ed68e8ca
commit
bd0f57a7ef
2 changed files with 20 additions and 3 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: omoudni <omoudni@student.42paris.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/05/20 21:50:32 by rparodi #+# #+# */
|
||||
/* Updated: 2025/05/25 12:57:29 by rparodi ### ########.fr */
|
||||
/* Updated: 2025/05/26 22:26:04 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
|
|
@ -16,6 +16,7 @@
|
|||
#include "core.hpp"
|
||||
#include "channel.hpp"
|
||||
#include "user.hpp"
|
||||
#include "logs.hpp"
|
||||
|
||||
class User;
|
||||
class Channel;
|
||||
|
|
@ -27,6 +28,7 @@ private:
|
|||
std::string _password;
|
||||
PollManager _pollManager;
|
||||
std::map<int, User *> _users;
|
||||
std::list<Channel *> _channels;
|
||||
|
||||
public:
|
||||
Server(int port, const std::string &password);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: omoudni <omoudni@student.42paris.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/05/13 11:11:07 by rparodi #+# #+# */
|
||||
/* Updated: 2025/05/22 18:45:41 by omoudni ### ########.fr */
|
||||
/* Updated: 2025/05/26 22:30:07 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
|
|
@ -14,6 +14,7 @@
|
|||
#include "server.hpp"
|
||||
#include "core.hpp"
|
||||
#include "PollManager.hpp"
|
||||
#include "logs.hpp"
|
||||
#include <iostream>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
|
|
@ -146,3 +147,17 @@ void Server::printUsers() const
|
|||
std::cout << "Nickname: " << it->second->getName() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
std::list<User *> Server::getUsersList() const {
|
||||
// to_delete when done
|
||||
WARNING_MSG("TO DO FILL")
|
||||
std::list<User*> userList;
|
||||
for (std::map<int, User*>::const_iterator it = _users.begin(); it != _users.end(); ++it) {
|
||||
userList.push_back(it->second);
|
||||
}
|
||||
return userList;
|
||||
}
|
||||
|
||||
std::list<Channel *> Server::getChannelsList() const {
|
||||
return this->_channels;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue