diff options
author | Joursoir <chat@joursoir.net> | 2020-12-07 11:47:44 +0000 |
---|---|---|
committer | Joursoir <chat@joursoir.net> | 2020-12-07 11:47:44 +0000 |
commit | 9457a74c256bdf090667a5b19238cb5dfd7e031e (patch) | |
tree | ceb6fbcff7ec554572c01f43ee3f448682a3b445 /src/client/clui/client.cpp | |
parent | e99a03a838ddcf9eecadc10a7f71837afac3b99c (diff) | |
download | want-chat-9457a74c256bdf090667a5b19238cb5dfd7e031e.tar.gz want-chat-9457a74c256bdf090667a5b19238cb5dfd7e031e.tar.bz2 want-chat-9457a74c256bdf090667a5b19238cb5dfd7e031e.zip |
add gui without functionality
Diffstat (limited to 'src/client/clui/client.cpp')
-rw-r--r-- | src/client/clui/client.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/client/clui/client.cpp b/src/client/clui/client.cpp new file mode 100644 index 0000000..83f8ef0 --- /dev/null +++ b/src/client/clui/client.cpp @@ -0,0 +1,35 @@ +#include <ncurses.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +#include "../config.hpp" +#include "user.hpp" + +int main(int argc, char *argv[]) +{ + initscr(); + noecho(); + + int rows, columns; + getmaxyx(stdscr, rows, columns); + if(rows != 24 || columns != 80) { + endwin(); + printf("Please use terminal with size 24x80\n"); + return 1; + } + + Client *user = Client::Start(SERVER_IP, SERVER_PORT); + if(!user) { + endwin(); + perror("server"); + return 1; + } + + ChatRoom *room = new ChatRoom(); + user->Run(room); + delete room; + + endwin(); + return 0; +}
\ No newline at end of file |