From 5fce1272e509520b91fb89cffc25727968a424b0 Mon Sep 17 00:00:00 2001 From: Bartosz Kostrzewa Date: Sun, 8 May 2011 19:19:13 +0200 Subject: [PATCH] added some more comments and "clearscreen" to clients view of console --- frameserver/Server.cpp | 6 +++++- frameserver/defines.h | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/frameserver/Server.cpp b/frameserver/Server.cpp index c972562..c3ed208 100644 --- a/frameserver/Server.cpp +++ b/frameserver/Server.cpp @@ -99,6 +99,7 @@ void Server::listen() packetcounter++; + // copy frame information into the buffer frame.z = recv_buf[0]; for(int i = 0; i < HEIGHT; i++) { @@ -438,13 +439,16 @@ void Server::console_printframe_values(frame_t _frame) } } +// print the list of clients connected to the server void Server::console_printclients() { int rows, cols, offset=0; getmaxyx(stdscr,rows,cols); + clrtobot(); for(int i = 0; i < buffers.size(); i++) { - if(i >= 1 && i%(rows-2)==0) + // rows-2 because there is a header + if(i > 0 && i%(rows-2)==0) offset += 27; if( offset + 27 < cols ) mvprintw(i%(rows-2)+2,offset,"(%3d) %s\n", i,buffers[i]->get_id().c_str() ); diff --git a/frameserver/defines.h b/frameserver/defines.h index 64de35f..6f6a483 100644 --- a/frameserver/defines.h +++ b/frameserver/defines.h @@ -1,7 +1,8 @@ #ifndef __DEFINES_H_ #define __DEFINES_H_ -// four minutes should be enough +// four minutes should be enough (seconds) +// timeout set to two seconds for testing purposes #define BUFTIMEOUT 2 #define NUMBUFS 1000