Tue, 16 Dec 2014 03:27:54 +0200
- simplified main() now that RCONSession really cannot ever be null
sources/main.cpp | file | annotate | diff | comparison | revisions |
--- a/sources/main.cpp Tue Dec 16 02:48:18 2014 +0200 +++ b/sources/main.cpp Tue Dec 16 03:27:54 2014 +0200 @@ -64,11 +64,9 @@ timeout.tv_usec = 250000; // 0.25 seconds FD_ZERO (&fdset); FD_SET (0, &fdset); - RCONSession* session = RCONSession::get_session(); - if (session) { - int fd = session->socket()->file_descriptor(); + int fd = RCONSession::get_session()->socket()->file_descriptor(); highest = max (highest, fd); FD_SET (fd, &fdset); } @@ -79,16 +77,12 @@ // stdin is ready, what's incoming? Interface::handle_input(); - if (session) - session->tick(); - + RCONSession::get_session()->tick(); Interface::render(); } } catch (const Exitception&) {} - if (RCONSession::get_session()) - RCONSession::get_session()->disconnect(); - + RCONSession::get_session()->disconnect(); return EXIT_SUCCESS; }