Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 4, 2015, 9:12:21 PM (9 years ago)
Author:
landauf
Message:

merged branch core7 back to trunk

Location:
code/trunk
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/network/synchronisable/CMakeLists.txt

    r7314 r10624  
    22  NetworkCallbackManager.cc
    33  Synchronisable.cc
    4   SynchronisableVariable.cc
    54)
    65
  • code/trunk/src/libraries/network/synchronisable/Serialise.h

    r9667 r10624  
    7878    }
    7979
    80     // These functions implement loading / saving / etc. for SmartPtr<T>
     80    // These functions implement loading / saving / etc. for StrongPtr<T>
    8181
    8282    /** @brief returns the size of the objectID needed to synchronise the pointer */
    83     template <class T> inline uint32_t returnSize( const SmartPtr<T>& )
     83    template <class T> inline uint32_t returnSize( const StrongPtr<T>& )
    8484    {
    8585        return sizeof(uint32_t);
     
    8787
    8888    /** @brief reads the objectID of a pointer out of the bytestream and increases the mem pointer */
    89     template <class T> inline void loadAndIncrease( const SmartPtr<T>& variable, uint8_t*& mem )
     89    template <class T> inline void loadAndIncrease( const StrongPtr<T>& variable, uint8_t*& mem )
    9090    {
    9191//         *const_cast<typename Loki::TypeTraits<T*>::UnqualifiedType*>(&variable) = dynamic_cast<T*>(variable->getSynchronisable( *(uint32_t*)(mem) ));
    92         *const_cast<typename Loki::TypeTraits<SmartPtr<T> >::UnqualifiedType*>(&variable) = orxonox_cast<T*>(T::getSynchronisable(*(uint32_t*)(mem)));
     92        *const_cast<typename Loki::TypeTraits<StrongPtr<T> >::UnqualifiedType*>(&variable) = orxonox_cast<T*>(T::getSynchronisable(*(uint32_t*)(mem)));
    9393        mem += returnSize( variable );
    9494    }
    9595
    9696    /** @brief saves the objectID of a pointer into the bytestream and increases the mem pointer */
    97     template <class T> inline void saveAndIncrease( const SmartPtr<T>& variable, uint8_t*& mem )
     97    template <class T> inline void saveAndIncrease( const StrongPtr<T>& variable, uint8_t*& mem )
    9898    {
    9999        if ( variable.get() )
     
    105105
    106106    /** @brief checks whether the objectID of the variable is the same as in the bytestream */
    107     template <class T> inline  bool checkEquality( const SmartPtr<T>& variable, uint8_t* mem )
     107    template <class T> inline  bool checkEquality( const StrongPtr<T>& variable, uint8_t* mem )
    108108    {
    109109        if ( variable.get() )
     
    125125    {
    126126        //         *const_cast<typename Loki::TypeTraits<T*>::UnqualifiedType*>(&variable) = dynamic_cast<T*>(variable->getSynchronisable( *(uint32_t*)(mem) ));
    127         *const_cast<typename Loki::TypeTraits<SmartPtr<T> >::UnqualifiedType*>(&variable) = orxonox_cast<T*>(T::getSynchronisable(*(uint32_t*)(mem)));
     127        *const_cast<typename Loki::TypeTraits<WeakPtr<T> >::UnqualifiedType*>(&variable) = orxonox_cast<T*>(T::getSynchronisable(*(uint32_t*)(mem)));
    128128        mem += returnSize( variable );
    129129    }
  • code/trunk/src/libraries/network/synchronisable/Synchronisable.cc

    r9667 r10624  
    4545  uint8_t Synchronisable::state_=0x1; // detemines wheter we are server (default) or client
    4646
    47   RegisterAbstractClass(Synchronisable).inheritsFrom(Class(OrxonoxInterface));
     47  RegisterAbstractClass(Synchronisable).inheritsFrom<OrxonoxInterface>();
    4848
    4949  /**
     
    151151        for(int i = 0; i<160; i++)
    152152            orxout(user_error, context::network) << "classid: " << i << " identifier: " << ClassByID(i) << endl;
    153         orxout(user_error, context::network) << "Assertion failed: id" << endl;
     153        orxout(user_error, context::network) << "Assertion failed: Could not find Identifier for ClassID " << header.getClassID() << endl;
    154154        orxout(user_error, context::network) << "Possible reason for this error: Client received a synchronizable object whose class has no factory." << endl;
    155155        abort();
     
    182182    no->setClassID(header.getClassID());
    183183    assert(no->contextID_ == header.getContextID());
    184     if( context )
    185     {
    186       BaseObject* boContext = orxonox_cast<BaseObject*>(context);
    187       if (boContext)
    188           bo->setLevel(boContext->getLevel()); // Note: this ensures that the level is known on the client for child objects of the scene (and the scene itself)
    189     }
    190184    //assert(no->classID_ == header.getClassID());
    191185    orxout(verbose, context::network) << "fabricate objectID_: " << no->objectID_ << " classID_: " << no->classID_ << endl;
  • code/trunk/src/libraries/network/synchronisable/SynchronisableVariable.h

    r8858 r10624  
    6565      virtual uint8_t getMode()=0;
    6666      virtual ~SynchronisableVariableBase() {}
    67     protected:
    68       static uint8_t state_;
    6967  };
    7068
     
    108106      variable_( variable ), mode_( syncDirection ), callback_( cb )
    109107  {
    110     if ( state_ == 0x0 )
    111     {
    112       state_ = GameMode::isMaster() ? 0x1 : 0x2;  // set the appropriate mode here
    113     }
    114108  }
    115109
Note: See TracChangeset for help on using the changeset viewer.