Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 26, 2008, 5:02:14 PM (17 years ago)
Author:
scheusso
Message:

Made various changes to Classes WorldEntity, Model, SpaceShip,
BulletManager and AmmunitionDump in order to make them really
synchronisable.
I hope, that everythings still working now. I only did some small tests
(ie no segfault when running/starting and acting)

Location:
code/branches/network/src/orxonox/objects/weapon
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/orxonox/objects/weapon/AmmunitionDump.cc

    r871 r927  
    4545  {
    4646    RegisterObject(AmmunitionDump);
     47    registerAllVariables();
    4748
    4849    for (int i = 0; i < numberOfAmmos_; i++)
     
    114115    return stock_[id];
    115116  }
     117 
     118  void AmmunitionDump::registerAllVariables(){
     119    registerVar( &numberOfAmmos_, sizeof(int), network::DATA);
     120   
     121    for (int i = 0; i < numberOfAmmos_; i++)
     122    {
     123      registerVar(&stock_[i], sizeof(int), network::DATA);
     124      registerVar(&capacity_[i], sizeof(int), network::DATA);
     125    }
     126  }
    116127}
  • code/branches/network/src/orxonox/objects/weapon/AmmunitionDump.h

    r871 r927  
    6060  protected:
    6161    inline bool create() { return true; }
     62    void registerAllVariables();
    6263
    6364    int numberOfAmmos_;
  • code/branches/network/src/orxonox/objects/weapon/BulletManager.cc

    r871 r927  
    3939  {
    4040    RegisterObject(BulletManager);
     41    registerAllVariables();
    4142    bullets_ = new Bullet*[bulletsSize_];
    4243  }
     
    103104  }
    104105
     106  void BulletManager::registerAllVariables(){
     107    registerVar(&bulletsSize_, sizeof(int), network::DATA);
     108    registerVar(&bulletsIndex_, sizeof(int), network::DATA);
     109    // TODO we got a problem here:
     110    // there is no possibility (so far) to synchronise pointers to objects
     111  }
     112 
    105113}
  • code/branches/network/src/orxonox/objects/weapon/BulletManager.h

    r917 r927  
    6060  protected:
    6161    inline bool create() { return true; }
     62    void registerAllVariables();
    6263
    6364    // Bullet array
Note: See TracChangeset for help on using the changeset viewer.