Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 13, 2008, 3:25:10 PM (16 years ago)
Author:
scheusso
Message:

sdfsdf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/network/ConnectionManager.cc

    r790 r888  
    281281  }
    282282
     283 
     284 
     285  void ConnectionManager::addClientsObjectID( int clientID, int objectID ) {
     286    COUT(4) << "ship of client: " << clientID << ": " << objectID << " mapped" << std::endl;
     287    clientsShip.insert( std::make_pair( clientID, objectID ) );
     288  }
     289
     290  int ConnectionManager::getClientsShipID( int clientID ) {
     291    return clientsShip[clientID];
     292  }
     293
     294  int ConnectionManager::getObjectsClientID( int objectID ) {
     295    std::map<int, int>::iterator iter = clientsShip.begin();
     296    while( iter != clientsShip.end() ) {
     297      if( iter->second == objectID ) return iter->first;
     298    }
     299    return -99;
     300  }
     301
     302  void ConnectionManager::deleteClientIDReg( int clientID ) {
     303    clientsShip.erase( clientID );
     304  }
     305
     306  void ConnectionManager::deleteObjectIDReg( int objectID ) {
     307    std::map<int, int>::iterator iter = clientsShip.begin();
     308    while( iter != clientsShip.end() ) {
     309      if( iter->second == objectID ) break;
     310    }
     311    clientsShip.erase( iter->first );
     312  }
     313 
    283314}
Note: See TracChangeset for help on using the changeset viewer.