Changeset 1299 for code/branches/merge/src/network/Server.cc
- Timestamp:
- May 15, 2008, 10:08:41 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/merge/src/network/Server.cc
r1264 r1299 117 117 ENetPacket *packet = packet_gen.chatMessage(msg.c_str()); 118 118 //std::cout <<"adding packets" << std::endl; 119 connection->addPacketAll(packet);119 if(connection->addPacketAll(packet)) 120 120 //std::cout <<"added packets" << std::endl; 121 return connection->sendPackets(); 121 return connection->sendPackets(); 122 else 123 return false; 122 124 } 123 125 … … 162 164 //clientID here is a reference to grab clientID from ClientInformation 163 165 packet = connection->getPacket(clientID); 166 if(!packet) 167 continue; 164 168 //if statement to catch case that packetbuffer is empty 165 169 if( !elaborate(packet, clientID) ) 166 COUT( 4) << "Server: PacketBuffer empty" << std::endl;170 COUT(3) << "Server: could not elaborate" << std::endl; 167 171 } 168 172 } … … 238 242 239 243 bool Server::processConnectRequest( connectRequest *con, int clientID ){ 240 COUT( 4) << "processing connectRequest " << std::endl;244 COUT(3) << "processing connectRequest " << std::endl; 241 245 //connection->addPacket(packet_gen.gstate(gamestates->popGameState(clientID)) , clientID); 242 246 connection->createClient(clientID); … … 250 254 COUT(3) << "Could not push gamestate\t\t\t\t=====" << std::endl; 251 255 else 256 if(clients->findClient(clientID)) 252 257 clients->findClient(clientID)->failures_=0; 253 258 } … … 255 260 void Server::disconnectClient(int clientID){ 256 261 ClientInformation *client = clients->findClient(clientID); 257 disconnectClient(client); 262 if(client) 263 disconnectClient(client); 258 264 } 259 265 void Server::disconnectClient( ClientInformation *client){
Note: See TracChangeset
for help on using the changeset viewer.