--- a/sources/main.cpp Sat Dec 13 07:36:00 2014 +0200 +++ b/sources/main.cpp Sun Dec 14 17:53:24 2014 +0200 @@ -43,13 +43,9 @@ HUFFMAN_Construct(); Interface::initialize(); - /* - Vector<RCONSession*> rconsessions; - RCONSession* sess = new RCONSession; - sess->set_password ("testpassword"); - sess->connect (IPAddress (localhost, 10666)); - rconsessions << sess; - */ + new RCONSession; + RCONSession::get_session()->set_password ("testpassword"); + RCONSession::get_session()->connect (IPAddress (localhost, 10666)); for (;;) { @@ -60,15 +56,14 @@ timeout.tv_usec = 250000; // 0.25 seconds FD_ZERO (&fdset); FD_SET (0, &fdset); + RCONSession* session = RCONSession::get_session(); - /* - for (RCONSession* session : rconsessions) + if (session) { int fd = session->socket()->file_descriptor(); highest = max (highest, fd); FD_SET (fd, &fdset); } - */ select (highest + 1, &fdset, nullptr, nullptr, &timeout); @@ -76,10 +71,8 @@ // stdin is ready, what's incoming? Interface::handle_input(); - /* - for (RCONSession* session : rconsessions) + if (session) session->tick(); - */ } return EXIT_SUCCESS;