diff -r 09dcaeaa216b -r 33b8f428bacb sources/main.cpp --- a/sources/main.cpp Sat Dec 13 04:50:33 2014 +0200 +++ b/sources/main.cpp Sat Dec 13 07:36:00 2014 +0200 @@ -33,13 +33,7 @@ #include "main.h" #include "network/rconsession.h" #include "huffman/huffman.h" - -// ------------------------------------------------------------------------------------------------- -// -FUNCTION handle_input() -> void -{ - int ch = getch(); -} +#include "interface.h" // ------------------------------------------------------------------------------------------------- // @@ -47,20 +41,15 @@ main (int argc, char* argv[]) -> int { HUFFMAN_Construct(); + Interface::initialize(); + /* - ::initscr(); - ::start_color(); - ::raw(); - ::keypad (stdscr, true); - ::noecho(); - ::refresh(); - ::timeout (0); - */ Vector rconsessions; RCONSession* sess = new RCONSession; sess->set_password ("testpassword"); sess->connect (IPAddress (localhost, 10666)); rconsessions << sess; + */ for (;;) { @@ -70,29 +59,28 @@ timeout.tv_sec = 0; timeout.tv_usec = 250000; // 0.25 seconds FD_ZERO (&fdset); - //FD_SET (0, &fdset); + FD_SET (0, &fdset); + /* for (RCONSession* session : rconsessions) { int fd = session->socket()->file_descriptor(); highest = max (highest, fd); FD_SET (fd, &fdset); } + */ select (highest + 1, &fdset, nullptr, nullptr, &timeout); - /* if (FD_ISSET (0, &fdset)) - { // stdin is ready, what's incoming? - handle_input(); - } - */ + Interface::handle_input(); + /* for (RCONSession* session : rconsessions) session->tick(); + */ } - endwin(); return EXIT_SUCCESS; }