diff options
Diffstat (limited to 'client/networksender.h')
-rw-r--r-- | client/networksender.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/client/networksender.h b/client/networksender.h index 589004b..e752a18 100644 --- a/client/networksender.h +++ b/client/networksender.h @@ -35,13 +35,14 @@ #include <frame.h> -#include "status.h" - -#include "socket.h" +#include "tcp_socket.h" #include "network.h" #include <string> +// How many steps to do avarage calculation over. +#define BUFFERSIZE 100 + class NetworkSender : public QThread { public: @@ -54,10 +55,10 @@ public: void run(); void stop(); - void getServerStatus(Status *status); + double getfps(); private: - Socket *socket; + TCPSocket *socket; Network *network; std::string ip; @@ -72,12 +73,14 @@ private: // Server stats QMutex statusmutex; - unsigned int server_diskspace; - unsigned int server_diskspace_max; - unsigned int server_load; - unsigned int server_load_max; - unsigned int server_ping_ms; - double server_fps; + double fps; + + // Timer stuff (to calc the fps) + long long interval; + unsigned int frametime[BUFFERSIZE]; + struct timeval time; + struct timeval oldtime; + void checkPoint(); }; #endif/*__MIAV_NETWORKSENDER_H__*/ |