diff options
| author | manuel <manuel@mausz.at> | 2011-04-14 17:29:46 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2011-04-14 17:29:46 +0200 |
| commit | 3fd1334e6d5339cad07ac4e4e23991a73d960a8e (patch) | |
| tree | c9d7dfa80f9951c455d597dff69df1d764ffab80 /pacman-c++/server.h | |
| parent | b18385a95f25e13c767244b494f31bd4fc238143 (diff) | |
| download | foop-3fd1334e6d5339cad07ac4e4e23991a73d960a8e.tar.gz foop-3fd1334e6d5339cad07ac4e4e23991a73d960a8e.tar.bz2 foop-3fd1334e6d5339cad07ac4e4e23991a73d960a8e.zip | |
add commandline options to server (not fully done yet)
fix client crash when sound is not available
Diffstat (limited to 'pacman-c++/server.h')
| -rw-r--r-- | pacman-c++/server.h | 11 |
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 | ||
| 9 | class QTcpSocket; | 10 | class QTcpSocket; |
| 10 | 11 | ||
| @@ -14,6 +15,8 @@ class Server | |||
| 14 | Q_OBJECT | 15 | Q_OBJECT |
| 15 | public: | 16 | public: |
| 16 | Server(QWidget *parent = 0); | 17 | Server(QWidget *parent = 0); |
| 18 | bool parseCommandline(); | ||
| 19 | bool run(); | ||
| 17 | 20 | ||
| 18 | protected slots: | 21 | protected slots: |
| 19 | void tick(); | 22 | void tick(); |
| @@ -23,7 +26,7 @@ protected slots: | |||
| 23 | 26 | ||
| 24 | protected: | 27 | protected: |
| 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 | ||
| 37 | protected: | ||
| 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 |
