diff options
author | Joursoir <chat@joursoir.net> | 2020-12-09 19:34:04 +0000 |
---|---|---|
committer | Joursoir <chat@joursoir.net> | 2020-12-09 19:34:04 +0000 |
commit | 4131de177e36b19b20b8bbdb7bd43b18b6e22690 (patch) | |
tree | 7540050cbe152fc1257585f4fd30cf9b020508c0 /src/client/clui/user.hpp | |
parent | 1baf22ad58cc1a9aa9089ca9a09fc80a453cb3c9 (diff) | |
download | want-chat-4131de177e36b19b20b8bbdb7bd43b18b6e22690.tar.gz want-chat-4131de177e36b19b20b8bbdb7bd43b18b6e22690.tar.bz2 want-chat-4131de177e36b19b20b8bbdb7bd43b18b6e22690.zip |
clui: architecture go to base class for clients; fix bugs
Diffstat (limited to 'src/client/clui/user.hpp')
-rw-r--r-- | src/client/clui/user.hpp | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/client/clui/user.hpp b/src/client/clui/user.hpp deleted file mode 100644 index a203320..0000000 --- a/src/client/clui/user.hpp +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef USER_H -#define USER_H - -#include "clui.hpp" -#include "../const_vars.hpp" - -class Client { - int fd; - char in_buffer[max_usermsg_len]; // for input - int in_buf_used; - - char out_buffer[max_msg_len]; // for message - int out_buf_used; - - bool exit_flag; - - Client(int i_fd) : fd(i_fd), in_buf_used(0), - out_buf_used(0), exit_flag(false) {} -public: - ~Client() { close(fd); } - - static Client *Start(const char* ip, int port); - void Run(ChatRoom *room); - void BreakLoop() { exit_flag = true; } - void HandleButton(ChatRoom *room); - - void AddCharToBuffer(char ch); - void RemoveCharFromBuffer(); - void SendMessage(); -}; - -#endif
\ No newline at end of file |