Changeset 1261 for code/branches/network3/src/network/ConnectionManager.cc
- Timestamp:
- May 12, 2008, 11:44:01 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network3/src/network/ConnectionManager.cc
r1250 r1261 191 191 //std::cout << "received data" << std::endl; 192 192 COUT(5) << "Con.Man: receive event has occured" << std::endl; 193 processData(event); 193 // only add, if client has connected yet and not been disconnected 194 if(head_->findClient(&event->peer->address)) 195 processData(event); 194 196 break; 195 197 case ENET_EVENT_TYPE_DISCONNECT: … … 354 356 } 355 357 358 bool ConnectionManager::removeShip(ClientInformation *client){ 359 int id=client->getShipID(); 360 orxonox::Iterator<orxonox::SpaceShip> it; 361 for(it = orxonox::ObjectList<orxonox::SpaceShip>::start(); it; ++it){ 362 if(it->objectID!=id) 363 continue; 364 delete *it; 365 } 366 return true; 367 } 368 356 369 bool ConnectionManager::sendWelcome(int clientID, int shipID, bool allowed){ 357 370 addPacket(packet_gen.generateWelcome(clientID, shipID, allowed),clientID); 358 371 sendPackets(); 359 372 return true; 373 } 374 375 void ConnectionManager::disconnectClient(ClientInformation *client){ 376 enet_peer_disconnect(client->getPeer(), 0); 377 removeShip(client); 360 378 } 361 379
Note: See TracChangeset
for help on using the changeset viewer.