summaryrefslogtreecommitdiffstats
path: root/pacman-c++/server.h
diff options
context:
space:
mode:
Diffstat (limited to 'pacman-c++/server.h')
-rw-r--r--pacman-c++/server.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/pacman-c++/server.h b/pacman-c++/server.h
index 8c9e741..dac5d1c 100644
--- a/pacman-c++/server.h
+++ b/pacman-c++/server.h
@@ -5,6 +5,7 @@
5#include "actor.h" 5#include "actor.h"
6#include "pacman.pb.h" 6#include "pacman.pb.h"
7#include <QtGui> 7#include <QtGui>
8#include <QHostAddress>
8 9
9class QTcpSocket; 10class QTcpSocket;
10 11
@@ -14,6 +15,8 @@ class Server
14 Q_OBJECT 15 Q_OBJECT
15public: 16public:
16 Server(QWidget *parent = 0); 17 Server(QWidget *parent = 0);
18 bool parseCommandline();
19 bool run();
17 20
18protected slots: 21protected slots:
19 void tick(); 22 void tick();
@@ -23,7 +26,7 @@ protected slots:
23 26
24protected: 27protected:
25 /* block until we have connections from all clients */ 28 /* block until we have connections from all clients */
26 void waitForClientConnections(); 29 bool waitForClientConnections();
27 30
28 /* calculate updates of current tick for sending to client */ 31 /* calculate updates of current tick for sending to client */
29 Transmission::map_t calculateUpdates(); 32 Transmission::map_t calculateUpdates();
@@ -31,6 +34,7 @@ protected:
31 /* update client maps */ 34 /* update client maps */
32 void sendUpdate(Transmission::map_t map); 35 void sendUpdate(Transmission::map_t map);
33 36
37protected:
34 QMap<Color::Color, QTcpSocket *> m_clientConnections; 38 QMap<Color::Color, QTcpSocket *> m_clientConnections;
35 39
36 /* current movements. required to make pacmans continue their movement */ 40 /* current movements. required to make pacmans continue their movement */
@@ -38,6 +42,11 @@ protected:
38 42
39 /* allocate as member variable as this packet is large and used often */ 43 /* allocate as member variable as this packet is large and used often */
40 ProtoBuf::MapUpdate m_updatepacket; 44 ProtoBuf::MapUpdate m_updatepacket;
45
46 QHostAddress m_bindaddress;
47 unsigned int m_port;
48 unsigned int m_maxplayers;
49 unsigned int m_numbots;
41}; 50};
42 51
43#endif // SERVER_H 52#endif // SERVER_H