From 8dfca4755430209504dac5ed2e03a482342265b3 Mon Sep 17 00:00:00 2001 From: Joursoir Date: Wed, 25 Nov 2020 00:18:43 +0300 Subject: client: remove menu, all actions move to chat, fix chat move --- src/client/user.hpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/client/user.hpp') diff --git a/src/client/user.hpp b/src/client/user.hpp index 45fb5e3..03afb87 100644 --- a/src/client/user.hpp +++ b/src/client/user.hpp @@ -2,21 +2,22 @@ #define USER_H #include "clui.hpp" +#include "../const_vars.hpp" -const int max_line_length = 156; +const int maxlen_inbuf = max_line_len + max_name_len + 1; +const int maxlen_outbuf = max_line_len + 1; class Client { int fd; - char in_buffer[max_line_length]; // мы готовим к отправке + char in_buffer[maxlen_inbuf]; // for input int in_buf_used; - char out_buffer[max_line_length]; // нам пришло - int out_buf_used; + char out_buffer[maxlen_outbuf]; // for message bool exit_flag; Client(int i_fd) - : fd(i_fd), in_buf_used(0), out_buf_used(0) { } + : fd(i_fd), in_buf_used(0) { } public: ~Client() { close(fd); } @@ -27,8 +28,6 @@ public: void AddCharToBuffer(char ch); void RemoveCharFromBuffer(); void SendMessage(); - - int getFd() const { return fd; } // not used }; #endif \ No newline at end of file -- cgit v1.2.3-18-g5258