summaryrefslogtreecommitdiff
path: root/client/networksender.h
diff options
context:
space:
mode:
authordeva <deva>2006-08-25 21:20:07 +0000
committerdeva <deva>2006-08-25 21:20:07 +0000
commit8196872e3b240ef93fc17dd3c05a7d97a8015d88 (patch)
treee531edeb1c7178a8e58170c84645ce8eb706624e /client/networksender.h
parent347b1d8ed3a4f780f3a5c0d57a04eab05ca517a2 (diff)
Rearranged the network and socket code.origin
Added status messages sent over the network using udp packets.
Diffstat (limited to 'client/networksender.h')
-rw-r--r--client/networksender.h25
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__*/