From 3fd1334e6d5339cad07ac4e4e23991a73d960a8e Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 14 Apr 2011 17:29:46 +0200 Subject: add commandline options to server (not fully done yet) fix client crash when sound is not available --- pacman-c++/server.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'pacman-c++/server.h') 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 @@ #include "actor.h" #include "pacman.pb.h" #include +#include class QTcpSocket; @@ -14,6 +15,8 @@ class Server Q_OBJECT public: Server(QWidget *parent = 0); + bool parseCommandline(); + bool run(); protected slots: void tick(); @@ -23,7 +26,7 @@ protected slots: protected: /* block until we have connections from all clients */ - void waitForClientConnections(); + bool waitForClientConnections(); /* calculate updates of current tick for sending to client */ Transmission::map_t calculateUpdates(); @@ -31,6 +34,7 @@ protected: /* update client maps */ void sendUpdate(Transmission::map_t map); +protected: QMap m_clientConnections; /* current movements. required to make pacmans continue their movement */ @@ -38,6 +42,11 @@ protected: /* allocate as member variable as this packet is large and used often */ ProtoBuf::MapUpdate m_updatepacket; + + QHostAddress m_bindaddress; + unsigned int m_port; + unsigned int m_maxplayers; + unsigned int m_numbots; }; #endif // SERVER_H -- cgit v1.2.3