Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6673 in orxonox.OLD for branches/network/src


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

newtork: now only entities created on the server get a valiable uniqueID

Location:
branches/network/src/lib/network
Files:
3 edited

Legend:

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

    r6672 r6673  
    211211int NetworkGameManager::createEntity( ClassID classID, int owner )
    212212{
    213   if ( this->isServer() )
     213  if ( this->isServer())
    214214  {
    215215    if ( NetworkManager::getInstance()->getNewUniqueID() < 0 )
     
    218218      return -1;
    219219    }
    220 
    221220    return this->executeCreateEntity( classID, NetworkManager::getInstance()->getNewUniqueID(), owner );
    222221  }
  • branches/network/src/lib/network/network_manager.h

    r6672 r6673  
    5454
    5555    /** @returns the next uniqueID free for an object */
    56     inline int getNewUniqueID() { return this->newUniqueID++; }
     56    inline int getNewUniqueID() { return ( this->bGameServer)?this->newUniqueID++:-1; }
    5757
    5858    void debug();
  • branches/network/src/lib/network/network_stream.cc

    r6672 r6673  
    439439  for (SynchronizeableList::iterator it = synchronizeables.begin(); it!=synchronizeables.end(); it++)
    440440  {
    441     //if( (*it)->beSynchronized() == true)
     441    if( (*it)->beSynchronized() == true)
    442442      PRINT(0)("  Synchronizeable of class: %s::%s, with unique ID: %i, Synchronize: %i\n", (*it)->getClassName(), (*it)->getName(),
    443443               (*it)->getUniqueID(), (*it)->beSynchronized());
Note: See TracChangeset for help on using the changeset viewer.