Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 24, 2006, 3:02:19 PM (18 years ago)
Author:
patrick
Message:

network: now every entity gets a network uniqueID

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/network_game_manager.cc

    r6670 r6672  
    5353  this->setClassID(CL_NETWORK_GAME_MANAGER, "NetworkGameManager");
    5454
    55   newUniqueID = MAX_CONNECTIONS + 2;
    56 
    5755  hasRequestedWorld = false;
    5856  this->setSynchronized(true);
     
    215213  if ( this->isServer() )
    216214  {
    217     if ( newUniqueID < 0 )
     215    if ( NetworkManager::getInstance()->getNewUniqueID() < 0 )
    218216    {
    219217      PRINTF(1)("Cannot create entity! There are no more uniqueIDs left!\n");
     
    221219    }
    222220
    223     return this->executeCreateEntity( classID, newUniqueID++, owner );
     221    return this->executeCreateEntity( classID, NetworkManager::getInstance()->getNewUniqueID(), owner );
    224222  }
    225223  else
     
    240238  if ( this->isServer() )
    241239  {
    242     if ( newUniqueID < 0 )
     240    if ( NetworkManager::getInstance()->getNewUniqueID() < 0 )
    243241    {
    244242      PRINTF(1)("Cannot create entity! There are no more uniqueIDs left!\n");
     
    258256    {
    259257      Synchronizeable * s = dynamic_cast<Synchronizeable*>(b);
    260       s->setUniqueID( newUniqueID++ );
     258      s->setUniqueID( NetworkManager::getInstance()->getNewUniqueID() );
    261259      s->setOwner( 0 );
    262260      // all entities created via this function are added automaticaly to the synchronizeable list
Note: See TracChangeset for help on using the changeset viewer.