diff options
author | Joursoir <chat@joursoir.net> | 2020-11-25 00:18:43 +0300 |
---|---|---|
committer | Joursoir <chat@joursoir.net> | 2020-11-25 00:18:43 +0300 |
commit | 8dfca4755430209504dac5ed2e03a482342265b3 (patch) | |
tree | 393265d9d67a18b1bda32ea4f39d6dd4805cb35e /src/client/user.hpp | |
parent | cd2decce51c32b8c0531a87ea849e9f8e80db0d3 (diff) | |
download | want-chat-8dfca4755430209504dac5ed2e03a482342265b3.tar.gz want-chat-8dfca4755430209504dac5ed2e03a482342265b3.tar.bz2 want-chat-8dfca4755430209504dac5ed2e03a482342265b3.zip |
client: remove menu, all actions move to chat, fix chat move
Diffstat (limited to 'src/client/user.hpp')
-rw-r--r-- | src/client/user.hpp | 13 |
1 files changed, 6 insertions, 7 deletions
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 |