summaryrefslogtreecommitdiffstats
path: root/pacman-c++/server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pacman-c++/server.cpp')
-rw-r--r--pacman-c++/server.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/pacman-c++/server.cpp b/pacman-c++/server.cpp
index 4715ec6..e7dd943 100644
--- a/pacman-c++/server.cpp
+++ b/pacman-c++/server.cpp
@@ -118,12 +118,11 @@ void Server::waitForClientConnections()
118 118
119#define SINGLE 119#define SINGLE
120 120
121 Color::Color playerColors[3] = { Color::red, Color::blue, Color::green };
122#ifdef SINGLE 121#ifdef SINGLE
123 for (unsigned int i=0; i < 1; ++i) 122 for (unsigned int i = 0; i < 1; ++i)
124 { 123 {
125#else 124#else
126 for (unsigned int i=0; i < Color::max; ++i) 125 for (unsigned int i = 0; Color::order[i] != Color::none; ++i)
127 { 126 {
128#endif 127#endif
129 bool connectionAvailable = tcpSrv->waitForNewConnection(-1); 128 bool connectionAvailable = tcpSrv->waitForNewConnection(-1);
@@ -132,7 +131,7 @@ void Server::waitForClientConnections()
132 connect(socket, SIGNAL(readyRead()), this, SLOT(keyPressUpdate())); 131 connect(socket, SIGNAL(readyRead()), this, SLOT(keyPressUpdate()));
133 132
134 // assign color 133 // assign color
135 Color::Color color = playerColors[i]; 134 Color::Color color = Color::order[i];
136 m_clientConnections[color] = socket; 135 m_clientConnections[color] = socket;
137 // notify player of color 136 // notify player of color
138 ProtoBuf::WhoAmI packet; 137 ProtoBuf::WhoAmI packet;