Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 16, 2008, 6:01:13 PM (16 years ago)
Author:
landauf
Message:

Merged objecthierarchy2 into presentation branch

Couln't merge 2 lines in Gamestate.cc and a whole block of code in GSDedicated.cc (it seems like oli implemented in both branches something like a network-tick-limiter but with different approaches)

Not yet tested in network mode and with bots
The SpaceShips movement is also not yet fully adopted to the new physics (see Engine class)

Location:
code/branches/presentation
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation

  • code/branches/presentation/src/network/synchronisable/Synchronisable.cc

    r2482 r2485  
    119119    if (it != objectMap_.end())
    120120      objectMap_.erase(it);
    121    
     121
    122122    //HACK HACK HACK HACK HACK HACK
    123123    // this hack ensures that childs of this object also get destroyed
     
    166166
    167167    Identifier* id = ClassByID(header->classID);
     168    if (!id)
     169    {
     170        COUT(0) << "Assertion failed: id" << std::endl;
     171        COUT(0) << "Possible reason for this error: Client received a synchronizable object whose class has no factory." << std::endl;
     172        abort();
     173    }
    168174    assert(id);
    169175    BaseObject* creator = 0;
     
    253259
    254260/*  void Synchronisable::registerVariable(void *var, int size, variableType t, uint8_t mode, NetworkCallbackBase *cb){
    255     assert( mode==direction::toclient || mode==direction::toserver || mode==direction::serverMaster || mode==direction::clientMaster);
     261    assert( mode==variableDirection::toclient || mode==variableDirection::toserver || mode==variableDirection::serverMaster || mode==variableDirection::clientMaster);
    256262    // create temporary synch.Var struct
    257263    synchronisableVariable *temp = new synchronisableVariable;
     
    261267    temp->type = t;
    262268    temp->callback = cb;
    263     if( ( mode & direction::bidirectional ) )
     269    if( ( mode & variableDirection::bidirectional ) )
    264270    {
    265271      if(t!=STRING)
     
    286292#endif
    287293  }*/
    288  
     294
    289295
    290296  /**
     
    444450    objectMode_=mode;
    445451  }
    446  
     452
    447453
    448454}
  • code/branches/presentation/src/network/synchronisable/Synchronisable.h

    r2459 r2485  
    6161    };
    6262  }
    63  
     63
    6464  namespace priority{
    6565    enum prio{
     
    100100    static uint32_t popDeletedObject(){ uint32_t i = deletedObjects_.front(); deletedObjects_.pop(); return i; }
    101101
    102     inline uint32_t getObjectID(){return objectID;}
    103     inline unsigned int getCreatorID(){return creatorID;}
    104     inline uint32_t getClassID(){return classID;}
    105     inline unsigned int getPriority(){ return objectFrequency_;}
     102    inline uint32_t getObjectID() const {return objectID;}
     103    inline unsigned int getCreatorID() const {return creatorID;}
     104    inline uint32_t getClassID() const {return classID;}
     105    inline unsigned int getPriority() const { return objectFrequency_;}
    106106
    107107  protected:
     
    134134    static std::queue<uint32_t> deletedObjects_;
    135135  };
    136  
     136
    137137  template <class T> void Synchronisable::registerVariable(T& variable, uint8_t mode, NetworkCallbackBase *cb, bool bidirectional)
    138138  {
     
    158158    // the variable has not been registered before
    159159  }
    160  
     160
    161161  // ================= Specialisation declarations
    162162  template <> _NetworkExport void Synchronisable::registerVariable( const ColourValue& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional);
Note: See TracChangeset for help on using the changeset viewer.