I broke something with displaying the clients input plainly
This commit is contained in:
parent
b2c5e0f5d7
commit
bfe88daf3e
10 changed files with 292 additions and 186 deletions
|
|
@ -1,36 +1,42 @@
|
|||
/* ************************************************************************** */
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* user.hpp :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* By: omoudni <omoudni@student.42paris.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/05/20 21:57:49 by rparodi #+# #+# */
|
||||
/* Updated: 2025/05/20 22:13:41 by rparodi ### ########.fr */
|
||||
/* Updated: 2025/05/21 21:16:56 by omoudni ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
/******************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include "color.hpp"
|
||||
#include "core.hpp"
|
||||
|
||||
class User {
|
||||
private:
|
||||
int _fd;
|
||||
bool _registered;
|
||||
std::string _nickname;
|
||||
std::string _hostname;
|
||||
std::string _read_buffer;
|
||||
std::string _write_buffer;
|
||||
public:
|
||||
int getFd() const;
|
||||
bool isReadyToSend() const;
|
||||
bool isRegistered() const;
|
||||
std::string getNickname() const;
|
||||
std::string extractFullCommand();
|
||||
void appendToReadBuffer(const std::string &data);
|
||||
void appendToWriteBuffer(const std::string &data);
|
||||
void setNickname(const std::string &nickname);
|
||||
class User
|
||||
{
|
||||
private:
|
||||
short unsigned int _fd;
|
||||
bool _registered;
|
||||
std::string _nickname;
|
||||
std::string _hostname;
|
||||
std::string _read_buffer;
|
||||
std::string _write_buffer;
|
||||
std::string _username;
|
||||
bool _hasNick;
|
||||
bool _hasUser;
|
||||
|
||||
public:
|
||||
User(short unsigned fd);
|
||||
short unsigned int getFd() const;
|
||||
bool isReadyToSend() const;
|
||||
bool isRegistered() const;
|
||||
std::string getNickname() const;
|
||||
std::string extractFullCommand();
|
||||
void appendToReadBuffer(const std::string &data);
|
||||
void appendToWriteBuffer(const std::string &data);
|
||||
void setNickname(const std::string &nickname);
|
||||
void setUsername(const std::string &username);
|
||||
void checkRegistration();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue