Changeset 1747 for code/trunk/src/network/ConnectionManager.cc
- Timestamp:
- Sep 9, 2008, 4:25:52 AM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/core3 (added) merged: 1573-1574,1583-1586,1591-1594,1596-1597,1603,1606-1607,1610-1611,1655,1658,1676-1679,1681-1685,1687,1716-1723,1725-1729,1736
- Property svn:mergeinfo changed
-
code/trunk/src/network/ConnectionManager.cc
r1735 r1747 45 45 #include "core/CoreIncludes.h" 46 46 #include "core/BaseObject.h" 47 #include "core/Iterator.h" 47 48 #include "objects/SpaceShip.h" 48 49 #include "util/Math.h" … … 66 67 { 67 68 //boost::thread_group network_threads; 68 69 69 70 ConnectionManager *ConnectionManager::instance_=0; 70 71 71 72 ConnectionManager::ConnectionManager():receiverThread_(0){ 72 73 assert(instance_==0); … … 77 78 } 78 79 boost::recursive_mutex ConnectionManager::enet_mutex; 79 80 80 81 // ConnectionManager::ConnectionManager(ClientInformation *head) : receiverThread_(0) { 81 82 // assert(instance_==0); … … 85 86 // bindAddress.port = NETWORK_PORT; 86 87 // } 87 88 88 89 ConnectionManager::ConnectionManager(int port){ 89 90 assert(instance_==0); … … 109 110 bindAddress.port = NETWORK_PORT; 110 111 } 111 112 112 113 ConnectionManager::~ConnectionManager(){ 113 114 instance_=0; … … 135 136 return packet; 136 137 }*/ 137 138 138 139 ENetEvent *ConnectionManager::getEvent(){ 139 140 if(!buffer.isEmpty()) … … 160 161 return true; 161 162 } 162 163 163 164 // bool ConnectionManager::addPacket(Packet::Packet *packet){ 164 165 // ClientInformation *temp = instance_->head_->findClient(packet->getClientID()); … … 170 171 // // TODO: finish implementation 171 172 // } 172 // 173 173 // 174 174 175 bool ConnectionManager::addPacket(ENetPacket *packet, ENetPeer *peer) { 175 176 boost::recursive_mutex::scoped_lock lock(instance_->enet_mutex); … … 276 277 } 277 278 } 278 279 279 280 //### added some bugfixes here, but we cannot test them because 280 281 //### the server crashes everytime because of some gamestates … … 335 336 336 337 /** 337 * 338 * @param clientID 338 * 339 * @param clientID 339 340 */ 340 341 void ConnectionManager::syncClassid(unsigned int clientID) { … … 364 365 } 365 366 366 367 367 368 368 369 bool ConnectionManager::removeShip(ClientInformation *client){ 369 370 unsigned int id=client->getShipID(); 370 orxonox:: Iterator<orxonox::SpaceShip>it;371 for(it = orxonox::ObjectList<orxonox::SpaceShip>:: start(); it; ++it){371 orxonox::ObjectList<orxonox::SpaceShip>::iterator it; 372 for(it = orxonox::ObjectList<orxonox::SpaceShip>::begin(); it; ++it){ 372 373 if(it->objectID!=id) 373 374 continue; … … 376 377 return true; 377 378 } 378 379 379 380 380 381 void ConnectionManager::disconnectClient(ClientInformation *client){ 381 382 { … … 386 387 removeShip(client); 387 388 } 388 389 389 390 390 391 }
Note: See TracChangeset
for help on using the changeset viewer.