mirror of
https://github.com/Ladebeze66/ft_irc.git
synced 2026-11-09 13:17:13 +01:00
fef
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/15 12:17:42 by fgras-ca #+# #+# */
|
||||
/* Updated: 2024/05/28 14:10:21 by fgras-ca ### ########.fr */
|
||||
/* Updated: 2024/05/28 14:32:11 by fgras-ca ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -15,51 +15,97 @@
|
||||
Client::Client(int fd, const std::string &nickname, const std::string &user, const std::string &host, const std::string &password, const std::string &realname)
|
||||
: _fd(fd), _nickname(nickname), _user(user), _host(host), _password(password), _realname(realname), _authenticated(false), _operator(false), _away(false) {}
|
||||
|
||||
int Client::getFd() const { return _fd; }
|
||||
const std::string &Client::getNickname() const { return _nickname; }
|
||||
void Client::setNickname(const std::string &nickname) { _nickname = nickname; }
|
||||
const std::string &Client::getUser() const { return _user; }
|
||||
void Client::setUser(const std::string &user) { _user = user; }
|
||||
const std::string &Client::getHost() const { return _host; }
|
||||
void Client::setHost(const std::string &host) { _host = host; }
|
||||
const std::string &Client::getPassword() const { return _password; }
|
||||
void Client::setPassword(const std::string &password) { _password = password; }
|
||||
const std::string &Client::getRealName() const { return _realname; }
|
||||
void Client::setRealName(const std::string &realname) { _realname = realname; }
|
||||
bool Client::isAuthenticated() const { return _authenticated; }
|
||||
void Client::authenticate() { _authenticated = true; }
|
||||
bool Client::isOperator() const { return _operator; }
|
||||
void Client::setOperator(bool isOperator) { _operator = isOperator; }
|
||||
|
||||
bool Client::isAway() const { return _away; }
|
||||
const std::string &Client::getAwayMessage() const { return _awayMessage; }
|
||||
void Client::setAwayMessage(const std::string &message) { _awayMessage = message; }
|
||||
void Client::setAway(bool away) { _away = away; }
|
||||
|
||||
/*Client::Client(int fd)
|
||||
|
||||
Description: Constructeur de la classe Client. Initialise le client avec le descripteur de fichier fourni.
|
||||
Paramètres:
|
||||
int fd: Le descripteur de fichier du client.
|
||||
Client::~Client()
|
||||
|
||||
Description: Destructeur de la classe Client. Gère la destruction de l'objet.
|
||||
int Client::getFd() const
|
||||
{
|
||||
return _fd;
|
||||
}
|
||||
|
||||
const std::string &Client::getNickname() const
|
||||
{
|
||||
return _nickname;
|
||||
}
|
||||
|
||||
void Client::setNickname(const std::string &nickname)
|
||||
{
|
||||
_nickname = nickname;
|
||||
}
|
||||
|
||||
const std::string &Client::getUser() const
|
||||
{
|
||||
return _user;
|
||||
}
|
||||
|
||||
void Client::setUser(const std::string &user)
|
||||
{
|
||||
_user = user;
|
||||
}
|
||||
|
||||
const std::string &Client::getHost() const
|
||||
{
|
||||
return _host;
|
||||
}
|
||||
|
||||
void Client::setHost(const std::string &host)
|
||||
{
|
||||
_host = host;
|
||||
}
|
||||
|
||||
const std::string &Client::getPassword() const
|
||||
{
|
||||
return _password;
|
||||
}
|
||||
|
||||
Description: Renvoie le descripteur de fichier du client.
|
||||
Retourne: Le descripteur de fichier du client.
|
||||
void Client::setPassword(const std::string &password)
|
||||
{
|
||||
_password = password;
|
||||
}
|
||||
|
||||
const std::string &Client::getRealName() const
|
||||
{
|
||||
return _realname;
|
||||
}
|
||||
|
||||
void Client::setRealName(const std::string &realname)
|
||||
{
|
||||
_realname = realname;
|
||||
}
|
||||
|
||||
Description: Définit le mot de passe du client et le marque comme authentifié.
|
||||
Paramètres:
|
||||
const std::string &password: Le mot de passe à définir.
|
||||
bool Client::isAuthenticated() const
|
||||
{
|
||||
return _authenticated;
|
||||
}
|
||||
|
||||
Description: Vérifie si le client est authentifié.
|
||||
Retourne: true si le client est authentifié, false sinon.
|
||||
void logMessage(const std::string &message, const std::string &color)
|
||||
void Client::authenticate()
|
||||
{
|
||||
_authenticated = true;
|
||||
}
|
||||
|
||||
Description: Enregistre un message dans les logs et l'affiche avec des couleurs dans la console.
|
||||
Paramètres:
|
||||
const std::string &message: Le message à enregistrer.
|
||||
const std::string &color: La couleur du message.*/
|
||||
bool Client::isOperator() const
|
||||
{
|
||||
return _operator;
|
||||
}
|
||||
|
||||
void Client::setOperator(bool isOperator)
|
||||
{
|
||||
_operator = isOperator;
|
||||
}
|
||||
|
||||
bool Client::isAway() const
|
||||
{
|
||||
return _away;
|
||||
}
|
||||
|
||||
const std::string &Client::getAwayMessage() const
|
||||
{
|
||||
return _awayMessage;
|
||||
}
|
||||
|
||||
void Client::setAwayMessage(const std::string &message)
|
||||
{
|
||||
_awayMessage = message;
|
||||
}
|
||||
|
||||
void Client::setAway(bool away)
|
||||
{
|
||||
_away = away;
|
||||
}
|
||||
|
||||
@@ -6,126 +6,126 @@
|
||||
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/15 18:32:23 by fgras-ca #+# #+# */
|
||||
/* Updated: 2024/05/21 20:28:41 by fgras-ca ### ########.fr */
|
||||
/* Updated: 2024/05/28 14:32:28 by fgras-ca ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "ClientManager.hpp"
|
||||
|
||||
ClientManager::ClientManager(Server *server)
|
||||
: _server(server)
|
||||
: _server(server)
|
||||
{
|
||||
}
|
||||
|
||||
void ClientManager::acceptClient()
|
||||
{
|
||||
int client_fd = accept(_server->_server_fd, NULL, NULL);
|
||||
if (client_fd < 0)
|
||||
{
|
||||
_server->log("Failed to accept client.", RED);
|
||||
return;
|
||||
}
|
||||
int client_fd = accept(_server->_server_fd, NULL, NULL);
|
||||
if (client_fd < 0)
|
||||
{
|
||||
_server->log("Failed to accept client.", RED);
|
||||
return;
|
||||
}
|
||||
|
||||
Client *newClient = new Client(client_fd, "", "", "", "", ""); // Fournir six arguments
|
||||
_server->_clients[client_fd] = newClient;
|
||||
struct pollfd client_pollfd;
|
||||
client_pollfd.fd = client_fd;
|
||||
client_pollfd.events = POLLIN;
|
||||
_server->_poll_fds.push_back(client_pollfd);
|
||||
Client *newClient = new Client(client_fd, "", "", "", "", ""); // Fournir six arguments
|
||||
_server->_clients[client_fd] = newClient;
|
||||
struct pollfd client_pollfd;
|
||||
client_pollfd.fd = client_fd;
|
||||
client_pollfd.events = POLLIN;
|
||||
_server->_poll_fds.push_back(client_pollfd);
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "Client attempting connection: " << client_fd;
|
||||
_server->log(ss.str(), YELLOW);
|
||||
std::stringstream ss;
|
||||
ss << "Client attempting connection: " << client_fd;
|
||||
_server->log(ss.str(), YELLOW);
|
||||
}
|
||||
|
||||
void ClientManager::handleClient(int client_fd)
|
||||
{
|
||||
char buffer[1024];
|
||||
std::memset(buffer, 0, sizeof(buffer));
|
||||
int bytes_received = recv(client_fd, buffer, sizeof(buffer), 0);
|
||||
char buffer[1024];
|
||||
std::memset(buffer, 0, sizeof(buffer));
|
||||
int bytes_received = recv(client_fd, buffer, sizeof(buffer), 0);
|
||||
|
||||
if (bytes_received <= 0)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "Client disconnected: " << client_fd;
|
||||
_server->log(oss.str(), RED);
|
||||
removeClient(client_fd);
|
||||
return;
|
||||
}
|
||||
if (bytes_received <= 0)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "Client disconnected: " << client_fd;
|
||||
_server->log(oss.str(), RED);
|
||||
removeClient(client_fd);
|
||||
return;
|
||||
}
|
||||
|
||||
std::string message(buffer, bytes_received);
|
||||
std::ostringstream oss;
|
||||
oss << "Received from client " << client_fd << ": " << message;
|
||||
_server->log(oss.str(), BLUE);
|
||||
std::string message(buffer, bytes_received);
|
||||
std::ostringstream oss;
|
||||
oss << "Received from client " << client_fd << ": " << message;
|
||||
_server->log(oss.str(), BLUE);
|
||||
|
||||
Client* client = _server->getClients()[client_fd];
|
||||
if (!client)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "Client not found for fd: " << client_fd;
|
||||
_server->log(oss.str(), RED);
|
||||
return;
|
||||
}
|
||||
Client* client = _server->getClients()[client_fd];
|
||||
if (!client)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "Client not found for fd: " << client_fd;
|
||||
_server->log(oss.str(), RED);
|
||||
return;
|
||||
}
|
||||
|
||||
std::istringstream message_stream(message);
|
||||
std::string line;
|
||||
std::istringstream message_stream(message);
|
||||
std::string line;
|
||||
|
||||
while (std::getline(message_stream, line))
|
||||
{
|
||||
// Remove trailing '\r' and '\n'
|
||||
line.erase(std::remove(line.begin(), line.end(), '\r'), line.end());
|
||||
line.erase(std::remove(line.begin(), line.end(), '\n'), line.end());
|
||||
while (std::getline(message_stream, line))
|
||||
{
|
||||
// Remove trailing '\r' and '\n'
|
||||
line.erase(std::remove(line.begin(), line.end(), '\r'), line.end());
|
||||
line.erase(std::remove(line.begin(), line.end(), '\n'), line.end());
|
||||
|
||||
if (!line.empty())
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "Processing command from client " << client_fd << ": " << line;
|
||||
_server->log(oss.str(), BLUE);
|
||||
_server->_commandHandler->handleCommand(client, line);
|
||||
}
|
||||
}
|
||||
if (!line.empty())
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "Processing command from client " << client_fd << ": " << line;
|
||||
_server->log(oss.str(), BLUE);
|
||||
_server->_commandHandler->handleCommand(client, line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ClientManager::removeClient(int clientFd)
|
||||
{
|
||||
Client* client = _server->_clients[clientFd];
|
||||
if (client)
|
||||
{
|
||||
// Log the nickname being freed
|
||||
_server->log("Removing client: " + client->getNickname(), YELLOW);
|
||||
Client* client = _server->_clients[clientFd];
|
||||
if (client)
|
||||
{
|
||||
// Log the nickname being freed
|
||||
_server->log("Removing client: " + client->getNickname(), YELLOW);
|
||||
|
||||
std::map<std::string, Channel*>::iterator it = _server->_channels.begin();
|
||||
while (it != _server->_channels.end())
|
||||
{
|
||||
it->second->removeClient(client);
|
||||
if (it->second->isEmpty())
|
||||
{
|
||||
delete it->second;
|
||||
std::map<std::string, Channel*>::iterator it_to_delete = it++;
|
||||
_server->_channels.erase(it_to_delete);
|
||||
}
|
||||
else
|
||||
{
|
||||
++it;
|
||||
}
|
||||
}
|
||||
delete client;
|
||||
_server->_clients.erase(clientFd);
|
||||
}
|
||||
std::map<std::string, Channel*>::iterator it = _server->_channels.begin();
|
||||
while (it != _server->_channels.end())
|
||||
{
|
||||
it->second->removeClient(client);
|
||||
if (it->second->isEmpty())
|
||||
{
|
||||
delete it->second;
|
||||
std::map<std::string, Channel*>::iterator it_to_delete = it++;
|
||||
_server->_channels.erase(it_to_delete);
|
||||
}
|
||||
else
|
||||
{
|
||||
++it;
|
||||
}
|
||||
}
|
||||
delete client;
|
||||
_server->_clients.erase(clientFd);
|
||||
}
|
||||
|
||||
std::vector<struct pollfd>::iterator it_poll = _server->_poll_fds.begin();
|
||||
while (it_poll != _server->_poll_fds.end())
|
||||
{
|
||||
if (it_poll->fd == clientFd)
|
||||
{
|
||||
_server->_poll_fds.erase(it_poll);
|
||||
break;
|
||||
}
|
||||
++it_poll;
|
||||
}
|
||||
std::vector<struct pollfd>::iterator it_poll = _server->_poll_fds.begin();
|
||||
while (it_poll != _server->_poll_fds.end())
|
||||
{
|
||||
if (it_poll->fd == clientFd)
|
||||
{
|
||||
_server->_poll_fds.erase(it_poll);
|
||||
break;
|
||||
}
|
||||
++it_poll;
|
||||
}
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "Client disconnected: " << clientFd;
|
||||
_server->log(ss.str(), YELLOW);
|
||||
std::stringstream ss;
|
||||
ss << "Client disconnected: " << clientFd;
|
||||
_server->log(ss.str(), YELLOW);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/21 19:51:31 by fgras-ca #+# #+# */
|
||||
/* Updated: 2024/05/28 13:07:53 by fgras-ca ### ########.fr */
|
||||
/* Updated: 2024/05/28 14:33:01 by fgras-ca ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -14,66 +14,66 @@
|
||||
|
||||
void JoinHandler::handleJoinCommand(Client *client, const std::string &channelName, Server *server)
|
||||
{
|
||||
if (channelName.empty()) {
|
||||
server->sendToClient(client->getFd(), ERR_NEEDMOREPARAMS(client, "JOIN"));
|
||||
return;
|
||||
}
|
||||
if (channelName.empty()) {
|
||||
server->sendToClient(client->getFd(), ERR_NEEDMOREPARAMS(client, "JOIN"));
|
||||
return;
|
||||
}
|
||||
|
||||
std::map<std::string, Channel *> &channels = server->getChannels();
|
||||
Channel *channel;
|
||||
std::map<std::string, Channel *> &channels = server->getChannels();
|
||||
Channel *channel;
|
||||
|
||||
if (channels.find(channelName) == channels.end()) {
|
||||
channel = new Channel(channelName);
|
||||
channels[channelName] = channel;
|
||||
} else {
|
||||
channel = channels[channelName];
|
||||
}
|
||||
if (channels.find(channelName) == channels.end()) {
|
||||
channel = new Channel(channelName);
|
||||
channels[channelName] = channel;
|
||||
} else {
|
||||
channel = channels[channelName];
|
||||
}
|
||||
|
||||
if (channel->isBanned(client)) {
|
||||
server->sendToClient(client->getFd(), ERR_BANNEDFROMCHAN(client, channelName));
|
||||
return;
|
||||
}
|
||||
if (channel->isBanned(client)) {
|
||||
server->sendToClient(client->getFd(), ERR_BANNEDFROMCHAN(client, channelName));
|
||||
return;
|
||||
}
|
||||
|
||||
if (channel->isFull()) {
|
||||
server->sendToClient(client->getFd(), ERR_CHANNELISFULL(client, channelName));
|
||||
return;
|
||||
}
|
||||
if (channel->isFull()) {
|
||||
server->sendToClient(client->getFd(), ERR_CHANNELISFULL(client, channelName));
|
||||
return;
|
||||
}
|
||||
|
||||
if (channel->isInviteOnly() && !channel->isInvited(client)) {
|
||||
server->sendToClient(client->getFd(), ERR_INVITEONLYCHAN(client, channelName));
|
||||
return;
|
||||
}
|
||||
if (channel->isInviteOnly() && !channel->isInvited(client)) {
|
||||
server->sendToClient(client->getFd(), ERR_INVITEONLYCHAN(client, channelName));
|
||||
return;
|
||||
}
|
||||
|
||||
channel->addClient(client);
|
||||
sendJoinSuccess(client, channel, server);
|
||||
channel->addClient(client);
|
||||
sendJoinSuccess(client, channel, server);
|
||||
}
|
||||
|
||||
void JoinHandler::sendJoinSuccess(Client *client, Channel *channel, Server *server)
|
||||
{
|
||||
std::string joinMessage = ":" + client->getNickname() + " JOIN " + channel->getName() + "\r\n";
|
||||
server->sendToClient(client->getFd(), joinMessage);
|
||||
std::string joinMessage = ":" + client->getNickname() + " JOIN " + channel->getName() + "\r\n";
|
||||
server->sendToClient(client->getFd(), joinMessage);
|
||||
|
||||
if (!channel->getTopic().empty()) {
|
||||
server->sendToClient(client->getFd(), RPL_TOPIC(client, channel->getName(), channel->getTopic()));
|
||||
server->sendToClient(client->getFd(), RPL_TOPICWHOTIME(client, channel->getName(), channel->getTopicSetter(), channel->getTopicTime()));
|
||||
}
|
||||
if (!channel->getTopic().empty()) {
|
||||
server->sendToClient(client->getFd(), RPL_TOPIC(client, channel->getName(), channel->getTopic()));
|
||||
server->sendToClient(client->getFd(), RPL_TOPICWHOTIME(client, channel->getName(), channel->getTopicSetter(), channel->getTopicTime()));
|
||||
}
|
||||
|
||||
std::string usersList = getUsersList(channel);
|
||||
server->sendToClient(client->getFd(), usersList);
|
||||
std::string usersList = getUsersList(channel);
|
||||
server->sendToClient(client->getFd(), usersList);
|
||||
|
||||
channel->broadcast(joinMessage, client, server);
|
||||
channel->broadcast(joinMessage, client, server);
|
||||
}
|
||||
|
||||
std::string JoinHandler::getUsersList(Channel *channel)
|
||||
{
|
||||
std::vector<Client *> clients = channel->getClients();
|
||||
std::string users;
|
||||
for (std::vector<Client *>::iterator it = clients.begin(); it != clients.end(); ++it) {
|
||||
users += (*it)->getNickname() + " ";
|
||||
}
|
||||
std::vector<Client *> clients = channel->getClients();
|
||||
std::string users;
|
||||
for (std::vector<Client *>::iterator it = clients.begin(); it != clients.end(); ++it) {
|
||||
users += (*it)->getNickname() + " ";
|
||||
}
|
||||
|
||||
std::ostringstream oss;
|
||||
oss << RPL_NAMREPLY(clients[0], channel->getName(), users);
|
||||
oss << RPL_ENDOFNAMES(clients[0], channel->getName());
|
||||
return oss.str();
|
||||
std::ostringstream oss;
|
||||
oss << RPL_NAMREPLY(clients[0], channel->getName(), users);
|
||||
oss << RPL_ENDOFNAMES(clients[0], channel->getName());
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
@@ -6,66 +6,66 @@
|
||||
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/17 16:09:20 by fgras-ca #+# #+# */
|
||||
/* Updated: 2024/05/28 13:08:30 by fgras-ca ### ########.fr */
|
||||
/* Updated: 2024/05/28 14:33:29 by fgras-ca ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "Who.hpp"
|
||||
|
||||
WhoHandler::WhoHandler(Server *server)
|
||||
: _server(server)
|
||||
: _server(server)
|
||||
{
|
||||
}
|
||||
|
||||
void WhoHandler::handleWhoCommand(Client *client, const std::string &command)
|
||||
{
|
||||
std::istringstream iss(command);
|
||||
std::string cmd, mask;
|
||||
iss >> cmd >> mask;
|
||||
std::istringstream iss(command);
|
||||
std::string cmd, mask;
|
||||
iss >> cmd >> mask;
|
||||
|
||||
std::map<std::string, Channel *> &channels = _server->getChannels();
|
||||
if (channels.find(mask) != channels.end())
|
||||
{
|
||||
Channel *channel = channels[mask];
|
||||
std::vector<Client *> channelClients = channel->getClients();
|
||||
std::map<std::string, Channel *> &channels = _server->getChannels();
|
||||
if (channels.find(mask) != channels.end())
|
||||
{
|
||||
Channel *channel = channels[mask];
|
||||
std::vector<Client *> channelClients = channel->getClients();
|
||||
|
||||
for (size_t i = 0; i < channelClients.size(); ++i)
|
||||
{
|
||||
_server->sendToClient(client->getFd(), RPL_WHOREPLY(mask, channelClients[i]));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Client *targetClient = _server->getClientByName(mask);
|
||||
if (targetClient)
|
||||
{
|
||||
_server->sendToClient(client->getFd(), RPL_WHOREPLY("*", targetClient));
|
||||
}
|
||||
}
|
||||
for (size_t i = 0; i < channelClients.size(); ++i)
|
||||
{
|
||||
_server->sendToClient(client->getFd(), RPL_WHOREPLY(mask, channelClients[i]));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Client *targetClient = _server->getClientByName(mask);
|
||||
if (targetClient)
|
||||
{
|
||||
_server->sendToClient(client->getFd(), RPL_WHOREPLY("*", targetClient));
|
||||
}
|
||||
}
|
||||
|
||||
_server->sendToClient(client->getFd(), RPL_ENDOFWHO(client->getFd(), mask));
|
||||
_server->sendToClient(client->getFd(), RPL_ENDOFWHO(client->getFd(), mask));
|
||||
}
|
||||
|
||||
void WhoHandler::handleWhoisCommand(Client *client, const std::string &command)
|
||||
{
|
||||
std::istringstream iss(command);
|
||||
std::string cmd, target;
|
||||
iss >> cmd >> target;
|
||||
std::istringstream iss(command);
|
||||
std::string cmd, target;
|
||||
iss >> cmd >> target;
|
||||
|
||||
if (target.empty())
|
||||
{
|
||||
_server->sendToClient(client->getFd(), ERR_NONICKNAMEGIVEN(client));
|
||||
return;
|
||||
}
|
||||
if (target.empty())
|
||||
{
|
||||
_server->sendToClient(client->getFd(), ERR_NONICKNAMEGIVEN(client));
|
||||
return;
|
||||
}
|
||||
|
||||
Client *targetClient = _server->getClientByName(target);
|
||||
if (!targetClient)
|
||||
{
|
||||
_server->sendToClient(client->getFd(), ERR_NOSUCHNICK(client->getFd(), target));
|
||||
return;
|
||||
}
|
||||
Client *targetClient = _server->getClientByName(target);
|
||||
if (!targetClient)
|
||||
{
|
||||
_server->sendToClient(client->getFd(), ERR_NOSUCHNICK(client->getFd(), target));
|
||||
return;
|
||||
}
|
||||
|
||||
_server->sendToClient(client->getFd(), RPL_WHOISUSER(client->getFd(), targetClient));
|
||||
_server->sendToClient(client->getFd(), RPL_WHOISSERVER(client->getFd(), target, "IRC server info"));
|
||||
_server->sendToClient(client->getFd(), RPL_ENDOFWHOIS(client->getFd(), target));
|
||||
_server->sendToClient(client->getFd(), RPL_WHOISUSER(client->getFd(), targetClient));
|
||||
_server->sendToClient(client->getFd(), RPL_WHOISSERVER(client->getFd(), target, "IRC server info"));
|
||||
_server->sendToClient(client->getFd(), RPL_ENDOFWHOIS(client->getFd(), target));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user