Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 10, 2008, 12:50:05 PM (16 years ago)
Author:
scheusso
Message:

merged network branch to presentation branch

Location:
code/branches/presentation
Files:
3 deleted
95 edited
12 copied

Legend:

Unmodified
Added
Removed
  • code/branches/presentation

  • code/branches/presentation/src/core/Factory.cc

    r2171 r2371  
    5858        @return The Identifier
    5959    */
    60     Identifier* Factory::getIdentifier(const unsigned int id)
     60    Identifier* Factory::getIdentifier(const uint32_t id)
    6161    {
    62         std::map<unsigned int, Identifier*>::const_iterator it = getFactoryPointer()->identifierNetworkIDMap_.find(id);
     62        std::map<uint32_t, Identifier*>::const_iterator it = getFactoryPointer()->identifierNetworkIDMap_.find(id);
    6363        if (it != getFactoryPointer()->identifierNetworkIDMap_.end())
    6464            return it->second;
     
    8585        @param newID The new networkID
    8686    */
    87     void Factory::changeNetworkID(Identifier* identifier, const unsigned int oldID, const unsigned int newID)
     87    void Factory::changeNetworkID(Identifier* identifier, const uint32_t oldID, const uint32_t newID)
    8888    {
    8989        getFactoryPointer()->identifierNetworkIDMap_.erase(oldID);
  • code/branches/presentation/src/core/Factory.h

    r2171 r2371  
    4949#include <map>
    5050#include <string>
     51#include "util/Integers.h"
    5152
    5253namespace orxonox
     
    6061        public:
    6162            static Identifier* getIdentifier(const std::string& name);
    62             static Identifier* getIdentifier(const unsigned int id);
     63            static Identifier* getIdentifier(const uint32_t id);
    6364            static void add(const std::string& name, Identifier* identifier);
    64             static void changeNetworkID(Identifier* identifier, const unsigned int oldID, const unsigned int newID);
     65            static void changeNetworkID(Identifier* identifier, const uint32_t oldID, const uint32_t newID);
    6566            static void createClassHierarchy();
    6667
     
    8384
    8485            std::map<std::string, Identifier*> identifierStringMap_;            //!< The map, mapping the name with the Identifier
    85             std::map<unsigned int, Identifier*> identifierNetworkIDMap_;        //!< The map, mapping the network ID with the Identifier
     86            std::map<uint32_t, Identifier*> identifierNetworkIDMap_;        //!< The map, mapping the network ID with the Identifier
    8687    };
    8788
  • code/branches/presentation/src/core/Identifier.cc

    r2171 r2371  
    235235        @param id The new network ID
    236236    */
    237     void Identifier::setNetworkID(unsigned int id)
     237    void Identifier::setNetworkID(uint32_t id)
    238238    {
    239239        Factory::changeNetworkID(this, this->classID_, id);
  • code/branches/presentation/src/core/Identifier.h

    r2171 r2371  
    6868#include "Super.h"
    6969#include "Functor.h"
     70#include "util/Integers.h"
    7071#include "util/Debug.h"
    7172#include "util/String.h"
     
    230231
    231232            /** @brief Returns the network ID to identify a class through the network. @return the network ID */
    232             inline const unsigned int getNetworkID() const { return this->classID_; }
     233            inline const uint32_t getNetworkID() const { return this->classID_; }
    233234
    234235            /** @brief Sets the network ID to a new value. @param id The new value */
    235             void setNetworkID(unsigned int id);
     236            void setNetworkID(uint32_t id);
    236237
    237238            void addConfigValueContainer(const std::string& varname, ConfigValueContainer* container);
     
    315316            BaseFactory* factory_;                                         //!< The Factory, able to create new objects of the given class (if available)
    316317            static int hierarchyCreatingCounter_s;                         //!< Bigger than zero if at least one Identifier stores its parents (its an int instead of a bool to avoid conflicts with multithreading)
    317             unsigned int classID_;                                         //!< The network ID to identify a class through the network
     318            uint32_t classID_;                                             //!< The network ID to identify a class through the network
    318319
    319320            bool bHasConfigValues_;                                        //!< True if this class has at least one assigned config value
  • code/branches/presentation/src/core/Template.cc

  • code/branches/presentation/src/core/Template.h

  • code/branches/presentation/src/core/XMLFile.h

  • code/branches/presentation/src/core/XMLIncludes.h

  • code/branches/presentation/src/network/CMakeLists.txt

    r2131 r2371  
    1111  PacketBuffer.cc
    1212  Server.cc
    13   Synchronisable.cc
     13  TrafficControl.cc
    1414  Host.cc
    1515)
    1616
    1717ADD_SOURCE_DIRECTORY(NETWORK_SRC_FILES packet)
     18ADD_SOURCE_DIRECTORY(NETWORK_SRC_FILES synchronisable)
     19
    1820
    1921IF(WIN32)
  • code/branches/presentation/src/network/Client.cc

    r2171 r2371  
    4343#include "Client.h"
    4444#include "Host.h"
    45 #include "Synchronisable.h"
     45#include "synchronisable/Synchronisable.h"
    4646#include "core/CoreIncludes.h"
    4747#include "packet/Packet.h"
  • code/branches/presentation/src/network/ClientInformation.cc

    r2171 r2371  
    4545namespace orxonox
    4646{
     47 
    4748
    4849  ClientInformation *ClientInformation::head_=0;
  • code/branches/presentation/src/network/ClientInformation.h

    r2171 r2371  
    4646#include <boost/thread/recursive_mutex.hpp>
    4747
     48
    4849// WATCH OUT: THE CLIENTINFORMATION LIST IS NOT THREADSAFE ANYMORE
    4950
    5051namespace orxonox
    5152{
    52   static const unsigned int GAMESTATEID_INITIAL = (unsigned int)-1;
    53   static const unsigned int CLIENTID_UNKNOWN = (unsigned int)-2;
    5453
    5554  /**
  • code/branches/presentation/src/network/ConnectionManager.cc

    r2171 r2371  
    5252#include "util/Sleep.h"
    5353#include "ClientInformation.h"
    54 #include "Synchronisable.h"
     54#include "synchronisable/Synchronisable.h"
    5555#include "packet/ClassID.h"
    5656
  • code/branches/presentation/src/network/GamestateClient.cc

    r2171 r2371  
    3535#include "core/BaseObject.h"
    3636#include "core/Iterator.h"
    37 #include "Synchronisable.h"
     37#include "synchronisable/Synchronisable.h"
     38#include "synchronisable/NetworkCallbackManager.h"
    3839#include "packet/Acknowledgement.h"
    3940
     
    7778    packet::Gamestate *processed = processGamestate(tempGamestate_);
    7879//    assert(processed);
     80   
     81    //now call the queued callbacks
     82    NetworkCallbackManager::callCallbacks();
     83   
    7984    if (!processed)
    8085        return false;
  • code/branches/presentation/src/network/GamestateManager.cc

    r2171 r2371  
    4949#include "core/BaseObject.h"
    5050#include "ClientInformation.h"
    51 #include "Synchronisable.h"
     51#include "synchronisable/Synchronisable.h"
     52#include "synchronisable/NetworkCallbackManager.h"
    5253
    5354namespace orxonox
     
    8687    // now clear the queue
    8788    gamestateQueue.clear();
     89    //and call all queued callbacks
     90    NetworkCallbackManager::callCallbacks();
    8891    return true;
    8992  }
     
    134137    if(!reference)
    135138      return 0;
    136     gs = reference->doSelection(clientID);
    137 //     gs = new packet::Gamestate(*reference);
     139    gs = reference->doSelection(clientID, 10000);
    138140//     gs = new packet::Gamestate(*reference);
    139141    // save the (undiffed) gamestate in the clients gamestate map
  • code/branches/presentation/src/network/NetworkPrereqs.h

    r2171 r2371  
    5757
    5858//-----------------------------------------------------------------------
     59// Includes
     60//-----------------------------------------------------------------------
     61#include "util/Math.h"
     62
     63
     64//-----------------------------------------------------------------------
    5965// Forward declarations
    6066//-----------------------------------------------------------------------
    6167namespace orxonox
    6268{
     69
     70// Constants definition
     71
     72  static const unsigned int GAMESTATEID_INITIAL = (unsigned int)-1;
     73  static const unsigned int CLIENTID_UNKNOWN = (unsigned int)-2;
     74  static const uint32_t OBJECTID_UNKNOWN = static_cast<uint32_t>(-1);
     75  static const unsigned int SCHED_PRIORITY_OFFSET = -5;
     76
     77 
     78
     79 
    6380  class Client;
    6481  class ClientConnection;
     
    7087  class GamestateManager;
    7188  class GamestateHandler;
     89  class NetworkCallbackBase;
     90  template <class T> class NetworkCallback;
     91  class NetworkCallbackManager;
    7292  class PacketBuffer;
    7393  class Server;
    7494  class ServerFrameListener;
    7595  class Synchronisable;
     96  class SynchronisableVariableBase;
     97  template <class T> class SynchronisableVariable;
     98  template <class T> class SynchronisableVariableBidirectional;
    7699  struct ClientList;
    77100  struct PacketEnvelope;
    78101  struct QueueItem;
    79102  struct syncData;
    80   struct synchronisableVariable;
     103  class obj;
     104  class objInfo;
    81105  namespace packet{
    82106    class Gamestate;
  • code/branches/presentation/src/network/packet/DeleteObjects.cc

    r2171 r2371  
    3030#include "DeleteObjects.h"
    3131#include <enet/enet.h>
    32 #include "network/Synchronisable.h"
     32#include "network/synchronisable/Synchronisable.h"
    3333#include "core/CoreIncludes.h"
    3434#include <assert.h>
  • code/branches/presentation/src/network/packet/Gamestate.cc

    r2171 r2371  
    2828
    2929#include "Gamestate.h"
    30 #include "network/ClientInformation.h"
    31 #include "network/GamestateHandler.h"
     30#include "../GamestateHandler.h"
     31#include "../synchronisable/Synchronisable.h"
     32#include "../TrafficControl.h"
    3233#include "core/CoreIncludes.h"
    3334#include "core/Iterator.h"
     
    4849
    4950#define PACKET_FLAG_GAMESTATE  ENET_PACKET_FLAG_RELIABLE
     51 
     52TrafficControl Gamestate::trafficControl_;
    5053
    5154Gamestate::Gamestate()
     
    7376bool Gamestate::collectData(int id, uint8_t mode)
    7477{
    75   unsigned int tempsize=0, currentsize=0;
     78  uint32_t tempsize=0, currentsize=0;
    7679  assert(data_==0);
    77   unsigned int size = calcGamestateSize(id, mode);
     80  uint32_t size = calcGamestateSize(id, mode);
    7881
    7982  COUT(4) << "G.ST.Man: producing gamestate with id: " << id << std::endl;
     
    109112
    110113    //if(it->doSelection(id))
    111     dataMap_[mem-data_]=(*it);  // save the mem location of the synchronisable data
     114    if(tempsize!=0)
     115      dataMap_.push_back( obj(it->getObjectID(), it->getCreatorID(), tempsize, mem-data_) );
     116//     dataMap_[mem-data_]=(*it);  // save the mem location of the synchronisable data
    112117    if(!it->getData(mem, id, mode))
    113118      return false; // mem pointer gets automatically increased because of call by reference
     
    148153    if(!s)
    149154    {
    150       Synchronisable::fabricate(mem, mode);
     155      s = Synchronisable::fabricate(mem, mode);
     156      if(s==0)
     157        assert(0);
     158//         COUT(0) << "could not fabricate synchronisable: " << objectheader->objectID << " classid: " << objectheader->classID << " creator: " << objectheader->creatorID << endl;
     159//       else
     160//         COUT(0) << "fabricated: " << objectheader->objectID << " classid: " << objectheader->classID << " creator: "  << objectheader->creatorID << endl;
    151161    }
    152162    else
     
    166176}
    167177
    168 unsigned int Gamestate::getSize() const
     178uint32_t Gamestate::getSize() const
    169179{
    170180  assert(data_);
     
    251261  assert(HEADER->compressed);
    252262  COUT(4) << "GameStateClient: uncompressing gamestate. id: " << HEADER->id << ", baseid: " << HEADER->base_id << ", datasize: " << HEADER->datasize << ", compsize: " << HEADER->compsize << std::endl;
    253   unsigned int datasize = HEADER->datasize;
    254   unsigned int compsize = HEADER->compsize;
    255   unsigned int bufsize;
     263  uint32_t datasize = HEADER->datasize;
     264  uint32_t compsize = HEADER->compsize;
     265  uint32_t bufsize;
    256266//  assert(compsize<=datasize);
    257267  bufsize = datasize;
     
    302312  //unsigned char *basep = base->getGs()/*, *gs = getGs()*/;
    303313  uint8_t *basep = GAMESTATE_START(base->data_), *gs = GAMESTATE_START(this->data_);
    304   unsigned int of=0; // pointers offset
    305   unsigned int dest_length=0;
     314  uint32_t of=0; // pointers offset
     315  uint32_t dest_length=0;
    306316  dest_length=HEADER->datasize;
    307317  if(dest_length==0)
     
    332342}
    333343
    334 Gamestate* Gamestate::doSelection(unsigned int clientID){
     344Gamestate* Gamestate::doSelection(unsigned int clientID, unsigned int targetSize){
    335345  assert(data_);
    336   std::map<unsigned int, Synchronisable *>::iterator it;
     346  std::list<obj>::iterator it;
    337347
    338348  // allocate memory for new data
     
    341351  Gamestate *gs = new Gamestate(gdata);
    342352  uint8_t *newdata = gdata + sizeof(GamestateHeader);
    343   uint8_t *origdata = GAMESTATE_START(data_);
     353//   uint8_t *origdata = GAMESTATE_START(data_);
    344354
    345355  //copy the GamestateHeader
     
    347357
    348358  synchronisableHeader *oldobjectheader, *newobjectheader;
    349   unsigned int objectOffset;
    350 
     359  uint32_t objectOffset;
     360  unsigned int objectsize, destsize=0;
     361  Synchronisable *object;
     362
     363  //call TrafficControl
     364  trafficControl_.processObjectList( clientID, HEADER->id, &dataMap_ );
     365 
    351366  //copy in the zeros
    352367  for(it=dataMap_.begin(); it!=dataMap_.end(); it++){
    353     oldobjectheader = (synchronisableHeader*)origdata;
     368    oldobjectheader = (synchronisableHeader*)(data_ + (*it).objDataOffset);
    354369    newobjectheader = (synchronisableHeader*)newdata;
    355     unsigned int objectsize = oldobjectheader->size;
    356     assert(it->second->objectID==oldobjectheader->objectID);
     370    object = Synchronisable::getSynchronisable( (*it).objID );
     371    assert(object->objectID == oldobjectheader->objectID);
     372    objectsize = oldobjectheader->size;
    357373    *newobjectheader = *oldobjectheader;
    358374    objectOffset=sizeof(synchronisableHeader); //skip the size and the availableData variables in the objectheader
    359     if(it->second->doSelection(HEADER->id)){
     375    if ( /*object->doSelection(HEADER->id)*/true ){
    360376      assert(newobjectheader->dataAvailable==true);
    361       memcpy(newdata+objectOffset, origdata+objectOffset, objectsize-objectOffset);
     377      memcpy(newdata+objectOffset, data_ + (*it).objDataOffset + objectOffset, objectsize-objectOffset);
    362378    }else{
    363379      newobjectheader->dataAvailable=false;
     
    366382    }
    367383    newdata += objectsize;
    368     origdata += objectsize;
    369   }
     384    destsize += objectsize;
     385//     origdata += objectsize;
     386  }
     387  ((GamestateHeader*)gdata)->datasize = destsize;
     388  assert(destsize!=0);
    370389  return gs;
    371390}
     
    382401
    383402  //preparations
    384   std::map<unsigned int, Synchronisable *>::iterator it;
     403  std::list<obj>::iterator it;
    385404  uint8_t *origdata, *basedata, *destdata, *ndata;
    386   unsigned int objectOffset, streamOffset=0;    //data offset
    387   unsigned int minsize = (HEADER->datasize < GAMESTATE_HEADER(base->data_)->datasize) ? HEADER->datasize : GAMESTATE_HEADER(base->data_)->datasize;
     405  uint32_t objectOffset, streamOffset=0;    //data offset
     406  uint32_t minsize = (HEADER->datasize < GAMESTATE_HEADER(base->data_)->datasize) ? HEADER->datasize : GAMESTATE_HEADER(base->data_)->datasize;
    388407  synchronisableHeader *origheader;
    389408  synchronisableHeader *destheader;
     409  Synchronisable *object;
    390410
    391411  origdata = GAMESTATE_START(this->data_);
     
    397417  for(it=dataMap_.begin(); it!=dataMap_.end(); it++){
    398418    assert(streamOffset<HEADER->datasize);
    399     bool sendData = it->second->doSelection(HEADER->id);
    400419    origheader = (synchronisableHeader *)(origdata+streamOffset);
    401420    destheader = (synchronisableHeader *)(destdata+streamOffset);
     421    object = Synchronisable::getSynchronisable(origheader->objectID);
     422    bool sendData = object->doSelection(HEADER->id);
    402423
    403424    //copy and partially diff the object header
    404     assert(sizeof(synchronisableHeader)==3*sizeof(unsigned int)+sizeof(bool));
     425    assert(sizeof(synchronisableHeader)==3*sizeof(uint32_t)+sizeof(bool));
    405426    *(uint32_t*)destdata = *(uint32_t*)origdata; //size (do not diff)
    406427    *(bool*)(destdata+sizeof(uint32_t)) = sendData;
     
    450471
    451472  //preparations
    452   std::map<unsigned int, Synchronisable *>::iterator it;
     473  std::list<obj>::iterator it;
    453474  uint8_t *origdata, *basedata, *destdata, *ndata;
    454   unsigned int objectOffset, streamOffset=0;    //data offset
    455   unsigned int minsize = (HEADER->datasize < GAMESTATE_HEADER(base->data_)->datasize) ? HEADER->datasize : GAMESTATE_HEADER(base->data_)->datasize;
     475  uint32_t objectOffset, streamOffset=0;    //data offset
     476  uint32_t minsize = (HEADER->datasize < GAMESTATE_HEADER(base->data_)->datasize) ? HEADER->datasize : GAMESTATE_HEADER(base->data_)->datasize;
    456477  synchronisableHeader *origheader;
    457478  synchronisableHeader *destheader;
     479  Synchronisable *object;
    458480
    459481  origdata = GAMESTATE_START(this->data_);
     
    467489    origheader = (synchronisableHeader *)(origdata+streamOffset);
    468490    destheader = (synchronisableHeader *)(destdata+streamOffset);
     491    object = Synchronisable::getSynchronisable( origheader->objectID );
    469492    bool sendData;
    470493
    471494    //copy and partially diff the object header
    472     assert(sizeof(synchronisableHeader)==3*sizeof(unsigned int)+sizeof(bool));
    473     *(unsigned int*)destdata = *(unsigned int*)origdata; //size (do not diff)
    474     *(bool*)(destdata+sizeof(unsigned int)) = *(bool*)(origdata+sizeof(unsigned int));
    475     sendData = *(bool*)(origdata+sizeof(unsigned int));
     495    assert(sizeof(synchronisableHeader)==3*sizeof(uint32_t)+sizeof(bool));
     496    *(uint32_t*)destdata = *(uint32_t*)origdata; //size (do not diff)
     497    *(bool*)(destdata+sizeof(uint32_t)) = *(bool*)(origdata+sizeof(uint32_t));
     498    sendData = *(bool*)(origdata+sizeof(uint32_t));
    476499    if(sendData){
    477       *(unsigned int*)(destdata+sizeof(unsigned int)+sizeof(bool)) = *(unsigned int*)(basedata+sizeof(unsigned int)+sizeof(bool)) ^ *(unsigned int*)(origdata+sizeof(unsigned int)+sizeof(bool)); //objectid (diff it)
    478       *(unsigned int*)(destdata+2*sizeof(unsigned int)+sizeof(bool)) = *(unsigned int*)(basedata+2*sizeof(unsigned int)+sizeof(bool)) ^ *(unsigned int*)(origdata+2*sizeof(unsigned int)+sizeof(bool)); //classid (diff it)
     500      *(uint32_t*)(destdata+sizeof(uint32_t)+sizeof(bool)) = *(uint32_t*)(basedata+sizeof(uint32_t)+sizeof(bool)) ^ *(uint32_t*)(origdata+sizeof(uint32_t)+sizeof(bool)); //objectid (diff it)
     501      *(uint32_t*)(destdata+2*sizeof(uint32_t)+sizeof(bool)) = *(uint32_t*)(basedata+2*sizeof(uint32_t)+sizeof(bool)) ^ *(uint32_t*)(origdata+2*sizeof(uint32_t)+sizeof(bool)); //classid (diff it)
    479502    }else{
    480       *(unsigned int*)(destdata+sizeof(unsigned int)+sizeof(bool)) = 0;
    481       *(unsigned int*)(destdata+2*sizeof(unsigned int)+sizeof(bool)) = 0;
     503      *(uint32_t*)(destdata+sizeof(uint32_t)+sizeof(bool)) = 0;
     504      *(uint32_t*)(destdata+2*sizeof(uint32_t)+sizeof(bool)) = 0;
    482505    }
    483506    objectOffset=sizeof(synchronisableHeader);
     
    517540  uint8_t *basep = GAMESTATE_START(base->data_);
    518541  uint8_t *gs = GAMESTATE_START(this->data_);
    519   unsigned int of=0; // pointers offset
    520   unsigned int dest_length=0;
     542  uint32_t of=0; // pointers offset
     543  uint32_t dest_length=0;
    521544  dest_length=HEADER->datasize;
    522545  if(dest_length==0)
     
    548571
    549572
    550 unsigned int Gamestate::calcGamestateSize(unsigned int id, uint8_t mode)
    551 {
    552   unsigned int size=0;
     573uint32_t Gamestate::calcGamestateSize(int32_t id, uint8_t mode)
     574{
     575  uint32_t size=0;
    553576    // get the start of the Synchronisable list
    554577  ObjectList<Synchronisable>::iterator it;
  • code/branches/presentation/src/network/packet/Gamestate.h

    r2171 r2371  
    3131#define NETWORK_PACKETGAMESTATE_H
    3232
    33 #include "../NetworkPrereqs.h"
     33#include "network/NetworkPrereqs.h"
    3434
    3535#include "Packet.h"
    36 #include "network/Synchronisable.h"
     36#include "network/TrafficControl.h"
     37#include "core/CoreIncludes.h"
    3738#include <map>
     39#include <list>
    3840#ifndef NDEBUG
    3941#include "util/CRC32.h"
     
    7981    Gamestate *undiff(Gamestate *base);
    8082    Gamestate* intelligentUnDiff(Gamestate *base);
    81     Gamestate* doSelection(unsigned int clientID);
     83    Gamestate* doSelection(unsigned int clientID, unsigned int targetSize);
    8284    bool compressData();
    8385    bool decompressData();
     
    8587    // Packet functions
    8688  private:
    87     virtual unsigned int getSize() const;
     89    virtual uint32_t getSize() const;
    8890    virtual bool process();
    8991
    9092    bool operator ==(packet::Gamestate gs);
    9193  private:
    92     unsigned int calcGamestateSize(unsigned int id, uint8_t mode=0x0);
     94    uint32_t calcGamestateSize(int32_t id, uint8_t mode=0x0);
    9395    void removeObject(ObjectListIterator<Synchronisable> &it);
    94     std::map<unsigned int, Synchronisable*> dataMap_;
     96    std::list<obj> dataMap_;
     97    static TrafficControl trafficControl_;
    9598};
    9699
  • code/branches/presentation/src/network/packet/Welcome.cc

    r2171 r2371  
    3232#include "Welcome.h"
    3333#include "network/Host.h"
    34 #include "network/Synchronisable.h"
     34#include "network/synchronisable/Synchronisable.h"
    3535#include "core/CoreIncludes.h"
    3636#include <assert.h>
     
    4343#define _CLIENTID             _PACKETID + sizeof(ENUM::Type)
    4444#define _SHIPID               _CLIENTID + sizeof(uint32_t)
     45#define _ENDIANTEST           _SHIPID + sizeof(uint32_t)
    4546 
    4647  Welcome::Welcome( unsigned int clientID, unsigned int shipID )
     
    5253  assert(data_);
    5354  *(packet::ENUM::Type *)(data_ + _PACKETID ) = packet::ENUM::Welcome;
    54   *(uint32_t *)&data_[ _CLIENTID ] = clientID;
    55   *(uint32_t *)&data_[ _SHIPID ] = shipID;
     55  *(uint32_t *)(data_ + _CLIENTID ) = clientID;
     56  *(uint32_t *)(data_ + _SHIPID ) = shipID;
     57  *(uint32_t *)(data_ + _ENDIANTEST ) = 0xFEDC4321;
    5658}
    5759
     
    7072
    7173unsigned int Welcome::getSize() const{
    72   return sizeof(packet::ENUM::Type) + 2*sizeof(uint32_t);
     74  return sizeof(packet::ENUM::Type) + 3*sizeof(uint32_t);
    7375}
    7476
     
    7779  clientID = *(uint32_t *)&data_[ _CLIENTID ];
    7880  shipID = *(uint32_t *)&data_[ _SHIPID ];
     81  assert(*(uint32_t *)(data_ + _ENDIANTEST ) == 0xFEDC4321);
    7982  Host::setClientID(clientID);
    8083  Host::setShipID(shipID);
  • code/branches/presentation/src/network/synchronisable/NetworkCallback.h

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

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

  • code/branches/presentation/src/orxonox/CameraManager.cc

  • code/branches/presentation/src/orxonox/CameraManager.h

  • code/branches/presentation/src/orxonox/OrxonoxStableHeaders.h

    r2087 r2371  
    9595#include "core/input/InputManager.h"
    9696
    97 #include "network/Synchronisable.h"
     97#include "network/synchronisable/Synchronisable.h"
    9898
    9999#include "Settings.h"
  • code/branches/presentation/src/orxonox/objects/Level.cc

    r2261 r2371  
    8383    void Level::registerVariables()
    8484    {
    85         REGISTERSTRING(this->xmlfilename_, direction::toclient, new NetworkCallback<Level>(this, &Level::networkcallback_applyXMLFile));
    86         REGISTERSTRING(this->name_,        direction::toclient, new NetworkCallback<Level>(this, &Level::changedName));
    87         REGISTERSTRING(this->description_, direction::toclient);
     85        registerVariable(this->xmlfilename_, variableDirection::toclient, new NetworkCallback<Level>(this, &Level::networkcallback_applyXMLFile));
     86        registerVariable(this->name_,        variableDirection::toclient, new NetworkCallback<Level>(this, &Level::changedName));
     87        registerVariable(this->description_, variableDirection::toclient);
    8888    }
    8989
  • code/branches/presentation/src/orxonox/objects/Level.h

    r2261 r2371  
    3232#include "OrxonoxPrereqs.h"
    3333
    34 #include "network/Synchronisable.h"
     34#include "network/synchronisable/Synchronisable.h"
    3535#include "core/BaseObject.h"
    3636
  • code/branches/presentation/src/orxonox/objects/Scene.cc

    r2171 r2371  
    114114    void Scene::registerVariables()
    115115    {
    116         REGISTERSTRING(this->skybox_,     direction::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applySkybox));
    117         REGISTERDATA(this->ambientLight_, direction::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applyAmbientLight));
     116        registerVariable(this->skybox_,     variableDirection::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applySkybox));
     117        registerVariable(this->ambientLight_, variableDirection::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applyAmbientLight));
    118118    }
    119119
  • code/branches/presentation/src/orxonox/objects/Scene.h

    r2171 r2371  
    3232#include "OrxonoxPrereqs.h"
    3333
    34 #include "network/Synchronisable.h"
     34#include "network/synchronisable/Synchronisable.h"
    3535#include "core/BaseObject.h"
    3636#include "util/Math.h"
  • code/branches/presentation/src/orxonox/objects/Test.cc

    r2171 r2371  
    6161        void Test::setConfigValues()
    6262        {
    63                 SetConfigValue ( v1, 1 )/*.callback ( this, &Test::checkV1 )*/;
    64     SetConfigValue ( v2, 2 )/*.callback ( this, &Test::checkV2 )*/;
    65     SetConfigValue ( v3, 3 )/*.callback ( this, &Test::checkV3 )*/;
    66     SetConfigValue ( v4, 4 )/*.callback ( this, &Test::checkV4 )*/;
     63                SetConfigValue ( u1, 1 )/*.callback ( this, &Test::checkV1 )*/;
     64    SetConfigValue ( u2, 2 )/*.callback ( this, &Test::checkV2 )*/;
     65    SetConfigValue ( u3, 3 )/*.callback ( this, &Test::checkV3 )*/;
     66    SetConfigValue ( u4, 4 )/*.callback ( this, &Test::checkV4 )*/;
     67   
     68    SetConfigValue ( s1, 1 )/*.callback ( this, &Test::checkV1 )*/;
     69    SetConfigValue ( s2, 2 )/*.callback ( this, &Test::checkV2 )*/;
     70    SetConfigValue ( s3, 3 )/*.callback ( this, &Test::checkV3 )*/;
     71    SetConfigValue ( s4, 4 )/*.callback ( this, &Test::checkV4 )*/;
    6772        }
    6873
     
    7075        void Test::registerVariables()
    7176        {
    72                 REGISTERDATA ( v1,direction::toclient, new NetworkCallback<Test> ( this, &Test::checkV1 ) );
    73     REGISTERDATA ( v2,direction::toserver, new NetworkCallback<Test> ( this, &Test::checkV2 ) );
    74                 REGISTERDATA ( v3,direction::serverMaster, new NetworkCallback<Test> ( this, &Test::checkV3 ) );
    75     REGISTERDATA ( v4,direction::clientMaster, new NetworkCallback<Test> ( this, &Test::checkV4 ) );
     77                registerVariable ( u1, variableDirection::toclient, new NetworkCallback<Test> ( this, &Test::checkU1 ));
     78    registerVariable ( u2, variableDirection::toserver, new NetworkCallback<Test> ( this, &Test::checkU2 ));
     79                registerVariable ( u3, variableDirection::serverMaster, new NetworkCallback<Test> ( this, &Test::checkU3 ), true );
     80    registerVariable ( u4, variableDirection::clientMaster, new NetworkCallback<Test> ( this, &Test::checkU4 ), true );
     81   
     82    registerVariable ( s1, variableDirection::toclient, new NetworkCallback<Test> ( this, &Test::checkS1 ));
     83    registerVariable ( s2, variableDirection::toserver, new NetworkCallback<Test> ( this, &Test::checkS2 ));
     84    registerVariable ( s3, variableDirection::serverMaster, new NetworkCallback<Test> ( this, &Test::checkS3 ), true );
     85    registerVariable ( s4, variableDirection::clientMaster, new NetworkCallback<Test> ( this, &Test::checkS4 ), true );
    7686        }
    7787
    78   void Test::checkV1(){
    79     COUT(1) << "V1 changed: " << v1 << std::endl;
    80   }
     88  void Test::checkU1(){ COUT(1) << "U1 changed: " << u1 << std::endl; }
     89  void Test::checkU2(){ COUT(1) << "U2 changed: " << u2 << std::endl; }
     90  void Test::checkU3(){ COUT(1) << "U3 changed: " << u3 << std::endl; }
     91  void Test::checkU4(){ COUT(1) << "U4 changed: " << u4 << std::endl; }
    8192
    82   void Test::checkV2(){
    83     COUT(1) << "V2 changed: " << v2 << std::endl;
    84   }
    85 
    86   void Test::checkV3(){
    87     COUT(1) << "V3 changed: " << v3 << std::endl;
    88   }
    89  
    90   void Test::checkV4(){
    91     COUT(1) << "V4 changed: " << v4 << std::endl;
    92   }
    93 
     93  void Test::checkS1(){ COUT(1) << "S1 changed: " << s1 << std::endl; }
     94  void Test::checkS2(){ COUT(1) << "S2 changed: " << s2 << std::endl; }
     95  void Test::checkS3(){ COUT(1) << "S3 changed: " << s3 << std::endl; }
     96  void Test::checkS4(){ COUT(1) << "S4 changed: " << s4 << std::endl; }
    9497
    9598}
  • code/branches/presentation/src/orxonox/objects/Test.h

    r2171 r2371  
    3232#include "OrxonoxPrereqs.h"
    3333#include "core/BaseObject.h"
    34 #include "network/Synchronisable.h"
     34#include "network/synchronisable/Synchronisable.h"
     35
     36
     37typedef int TYPE;
     38typedef unsigned int UTYPE;
     39
    3540
    3641namespace orxonox
     
    4550      void registerVariables();
    4651
    47       void setV1(unsigned int value){ v1 = value; }
    48       void setV2(unsigned int value){ v2 = value; }
    49       void setV3(unsigned int value){ v3 = value; }
    50       void setV4(unsigned int value){ v4 = value; }
    5152
    52       void checkV1();
    53       void checkV2();
    54       void checkV3();
    55       void checkV4();
     53      //unsigned functions
     54      void setU1(UTYPE value){ u1 = value; }
     55      void setU2(UTYPE value){ u2 = value; }
     56      void setU3(UTYPE value){ u3 = value; }
     57      void setU4(UTYPE value){ u4 = value; }
     58      void checkU1();
     59      void checkU2();
     60      void checkU3();
     61      void checkU4();
    5662     
    57       void printV1(){ instance_->checkV1(); }
    58       void printV2(){ instance_->checkV2(); }
    59       void printV3(){ instance_->checkV3(); }
    60       void printV4(){ instance_->checkV4(); }
     63      //signed functions
     64      void setS1(TYPE value){ s1 = value; }
     65      void setS2(TYPE value){ s2 = value; }
     66      void setS3(TYPE value){ s3 = value; }
     67      void setS4(TYPE value){ s4 = value; }
     68      void checkS1();
     69      void checkS2();
     70      void checkS3();
     71      void checkS4();
     72     
     73      static void printV1(){ instance_->checkU1(); }
     74      static void printV2(){ instance_->checkU2(); }
     75      static void printV3(){ instance_->checkU3(); }
     76      static void printV4(){ instance_->checkU4(); }
    6177
    6278    private:
    63       unsigned int v1;
    64       unsigned int v2;
    65       unsigned int v3;
    66       unsigned int v4;
     79      UTYPE u1;
     80      UTYPE u2;
     81      UTYPE u3;
     82      UTYPE u4;
     83     
     84      TYPE s1;
     85      TYPE s2;
     86      TYPE s3;
     87      TYPE s4;
    6788     
    6889      static Test* instance_;
  • code/branches/presentation/src/orxonox/objects/infos/HumanPlayer.cc

    r2171 r2371  
    6767    void HumanPlayer::registerVariables()
    6868    {
    69         REGISTERSTRING(this->synchronize_nick_, direction::toserver, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_changednick));
     69        registerVariable(this->synchronize_nick_, variableDirection::toserver, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_changednick));
    7070
    71         REGISTERDATA(this->clientID_,     direction::toclient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_clientIDchanged));
    72         REGISTERDATA(this->server_initialized_, direction::toclient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_server_initialized));
    73         REGISTERDATA(this->client_initialized_, direction::toserver, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_client_initialized));
     71        registerVariable(this->clientID_,     variableDirection::toclient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_clientIDchanged));
     72        registerVariable(this->server_initialized_, variableDirection::toclient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_server_initialized));
     73        registerVariable(this->client_initialized_, variableDirection::toserver, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_client_initialized));
    7474    }
    7575
     
    9999
    100100            if (!Core::isMaster())
    101                 this->setObjectMode(direction::bidirectional);
     101                this->setObjectMode(objectDirection::bidirectional);
    102102            else
    103103                this->setName(this->nick_);
  • code/branches/presentation/src/orxonox/objects/infos/Info.h

    r2171 r2371  
    3232#include "OrxonoxPrereqs.h"
    3333
    34 #include "network/Synchronisable.h"
     34#include "network/synchronisable/Synchronisable.h"
    3535#include "core/BaseObject.h"
    3636
  • code/branches/presentation/src/orxonox/objects/infos/PlayerInfo.cc

    r2171 r2371  
    6969    void PlayerInfo::registerVariables()
    7070    {
    71         REGISTERSTRING(this->name_,                 direction::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::changedName));
    72         REGISTERDATA  (this->controllableEntityID_, direction::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedcontrollableentityID));
    73         REGISTERDATA  (this->bReadyToSpawn_,        direction::toserver);
     71        registerVariable(this->name_,                 variableDirection::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::changedName));
     72        registerVariable(this->controllableEntityID_, variableDirection::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedcontrollableentityID));
     73        registerVariable(this->bReadyToSpawn_,        variableDirection::toserver);
    7474    }
    7575
  • code/branches/presentation/src/orxonox/objects/pickup/Usable.h

  • code/branches/presentation/src/orxonox/objects/quest/AddQuest.cc

  • code/branches/presentation/src/orxonox/objects/quest/AddQuest.h

  • code/branches/presentation/src/orxonox/objects/quest/AddQuestHint.cc

  • code/branches/presentation/src/orxonox/objects/quest/AddQuestHint.h

  • code/branches/presentation/src/orxonox/objects/quest/AddReward.cc

  • code/branches/presentation/src/orxonox/objects/quest/AddReward.h

  • code/branches/presentation/src/orxonox/objects/quest/ChangeQuestStatus.cc

  • code/branches/presentation/src/orxonox/objects/quest/ChangeQuestStatus.h

  • code/branches/presentation/src/orxonox/objects/quest/CompleteQuest.cc

  • code/branches/presentation/src/orxonox/objects/quest/CompleteQuest.h

  • code/branches/presentation/src/orxonox/objects/quest/FailQuest.cc

  • code/branches/presentation/src/orxonox/objects/quest/FailQuest.h

  • code/branches/presentation/src/orxonox/objects/quest/GlobalQuest.cc

  • code/branches/presentation/src/orxonox/objects/quest/GlobalQuest.h

  • code/branches/presentation/src/orxonox/objects/quest/LocalQuest.cc

  • code/branches/presentation/src/orxonox/objects/quest/LocalQuest.h

  • code/branches/presentation/src/orxonox/objects/quest/Quest.cc

  • code/branches/presentation/src/orxonox/objects/quest/Quest.h

  • code/branches/presentation/src/orxonox/objects/quest/QuestDescription.cc

  • code/branches/presentation/src/orxonox/objects/quest/QuestDescription.h

  • code/branches/presentation/src/orxonox/objects/quest/QuestEffect.cc

  • code/branches/presentation/src/orxonox/objects/quest/QuestEffect.h

  • code/branches/presentation/src/orxonox/objects/quest/QuestHint.cc

  • code/branches/presentation/src/orxonox/objects/quest/QuestHint.h

  • code/branches/presentation/src/orxonox/objects/quest/QuestItem.cc

  • code/branches/presentation/src/orxonox/objects/quest/QuestItem.h

  • code/branches/presentation/src/orxonox/objects/quest/QuestManager.cc

  • code/branches/presentation/src/orxonox/objects/quest/QuestManager.h

  • code/branches/presentation/src/orxonox/objects/quest/Rewardable.cc

  • code/branches/presentation/src/orxonox/objects/quest/Rewardable.h

  • code/branches/presentation/src/orxonox/objects/weaponSystem/WeaponSystem.cc

  • code/branches/presentation/src/orxonox/objects/weaponSystem/WeaponSystem.h

  • code/branches/presentation/src/orxonox/objects/worldentities/Backlight.cc

  • code/branches/presentation/src/orxonox/objects/worldentities/Backlight.h

  • code/branches/presentation/src/orxonox/objects/worldentities/Billboard.cc

    r2171 r2371  
    6464    void Billboard::registerVariables()
    6565    {
    66         REGISTERSTRING(this->material_, direction::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedMaterial));
    67         REGISTERDATA  (this->colour_,   direction::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedColour));
     66        registerVariable(this->material_, variableDirection::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedMaterial));
     67        registerVariable(this->colour_,   variableDirection::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedColour));
    6868    }
    6969
  • code/branches/presentation/src/orxonox/objects/worldentities/Camera.cc

  • code/branches/presentation/src/orxonox/objects/worldentities/Camera.h

  • code/branches/presentation/src/orxonox/objects/worldentities/ControllableEntity.cc

    r2171 r2371  
    165165                this->client_overwrite_ = this->server_overwrite_;
    166166COUT(0) << "CE: bidirectional synchronization" << std::endl;
    167                 this->setObjectMode(direction::bidirectional);
     167                this->setObjectMode(objectDirection::bidirectional);
    168168            }
    169169        }
     
    178178        this->playerID_ = OBJECTID_UNKNOWN;
    179179        this->bControlled_ = false;
    180         this->setObjectMode(direction::toclient);
     180        this->setObjectMode(objectDirection::toclient);
    181181
    182182        if (this->bDestroyWhenPlayerLeft_)
     
    248248    void ControllableEntity::registerVariables()
    249249    {
    250         REGISTERSTRING(this->cameraPositionTemplate_, direction::toclient);
    251 
    252         REGISTERDATA(this->client_overwrite_,   direction::toserver);
    253        
    254         REGISTERDATA(this->server_position_,    direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition));
    255         REGISTERDATA(this->server_velocity_,    direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerVelocity));
    256         REGISTERDATA(this->server_orientation_, direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation));
    257         REGISTERDATA(this->server_overwrite_,   direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite));
    258 
    259         REGISTERDATA(this->client_position_,    direction::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition));
    260         REGISTERDATA(this->client_velocity_,    direction::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientVelocity));
    261         REGISTERDATA(this->client_orientation_, direction::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation));
    262 
    263 
    264         REGISTERDATA(this->playerID_, direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID));
     250        registerVariable(this->cameraPositionTemplate_, variableDirection::toclient);
     251 
     252        registerVariable(this->client_overwrite_,   variableDirection::toserver);
     253         
     254        registerVariable(this->server_position_,    variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition));
     255        registerVariable(this->server_velocity_,    variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerVelocity));
     256        registerVariable(this->server_orientation_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation));
     257        registerVariable(this->server_overwrite_,   variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite));
     258 
     259        registerVariable(this->client_position_,    variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition));
     260        registerVariable(this->client_velocity_,    variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientVelocity));
     261        registerVariable(this->client_orientation_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation));
     262 
     263 
     264        registerVariable(this->playerID_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID));
    265265    }
    266266
  • code/branches/presentation/src/orxonox/objects/worldentities/Light.cc

    r2171 r2371  
    7979    void Light::registerVariables()
    8080    {
    81         REGISTERDATA(this->type_, direction::toclient, new NetworkCallback<Light>(this, &Light::changedType));
    82         REGISTERDATA(this->light_->getDiffuseColour(), direction::toclient);
    83         REGISTERDATA(this->light_->getSpecularColour(), direction::toclient);
    84         REGISTERDATA(this->light_->getDirection(), direction::toclient);
     81        registerVariable((int &)this->type_, variableDirection::toclient, new NetworkCallback<Light>(this, &Light::changedType));
     82        registerVariable(this->light_->getDiffuseColour(), variableDirection::toclient);
     83        registerVariable(this->light_->getSpecularColour(), variableDirection::toclient);
     84        registerVariable(this->light_->getDirection(), variableDirection::toclient);
    8585    }
    8686
  • code/branches/presentation/src/orxonox/objects/worldentities/Model.cc

    r2171 r2371  
    4040    Model::Model(BaseObject* creator) : PositionableEntity(creator)
    4141    {
     42        static unsigned int i=10;
    4243        RegisterObject(Model);
    4344
    4445        this->registerVariables();
     46        this->setObjectPriority(i++);
    4547    }
    4648
     
    6163    void Model::registerVariables()
    6264    {
    63         REGISTERSTRING(this->meshSrc_,    direction::toclient, new NetworkCallback<Model>(this, &Model::changedMesh));
    64         REGISTERDATA(this->bCastShadows_, direction::toclient, new NetworkCallback<Model>(this, &Model::changedShadows));
     65        registerVariable(this->meshSrc_,    variableDirection::toclient, new NetworkCallback<Model>(this, &Model::changedMesh));
     66        registerVariable(this->bCastShadows_, variableDirection::toclient, new NetworkCallback<Model>(this, &Model::changedShadows));
    6567    }
    6668
  • code/branches/presentation/src/orxonox/objects/worldentities/MovableEntity.cc

    r2171 r2371  
    8484    void MovableEntity::registerVariables()
    8585    {
    86         REGISTERDATA(this->velocity_.x, direction::toclient);
    87         REGISTERDATA(this->velocity_.y, direction::toclient);
    88         REGISTERDATA(this->velocity_.z, direction::toclient);
    89 
    90         REGISTERDATA(this->rotationAxis_.x, direction::toclient);
    91         REGISTERDATA(this->rotationAxis_.y, direction::toclient);
    92         REGISTERDATA(this->rotationAxis_.z, direction::toclient);
    93 
    94         REGISTERDATA(this->rotationRate_, direction::toclient);
    95 
    96         REGISTERDATA(this->overwrite_position_,    direction::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwritePosition));
    97         REGISTERDATA(this->overwrite_orientation_, direction::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwriteOrientation));
     86        registerVariable(this->velocity_.x, variableDirection::toclient);
     87        registerVariable(this->velocity_.y, variableDirection::toclient);
     88        registerVariable(this->velocity_.z, variableDirection::toclient);
     89 
     90        registerVariable(this->rotationAxis_.x, variableDirection::toclient);
     91        registerVariable(this->rotationAxis_.y, variableDirection::toclient);
     92        registerVariable(this->rotationAxis_.z, variableDirection::toclient);
     93 
     94        registerVariable(this->rotationRate_, variableDirection::toclient);
     95 
     96        registerVariable(this->overwrite_position_,    variableDirection::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwritePosition));
     97        registerVariable(this->overwrite_orientation_, variableDirection::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwriteOrientation));
    9898    }
    9999
  • code/branches/presentation/src/orxonox/objects/worldentities/ParticleEmitter.cc

    r2171 r2371  
    7575    void ParticleEmitter::registerVariables()
    7676    {
    77         REGISTERSTRING(this->source_, direction::toclient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::sourceChanged));
    78         REGISTERDATA  (this->LOD_,    direction::toclient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::LODchanged));
     77        registerVariable(this->source_, variableDirection::toclient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::sourceChanged));
     78        registerVariable((int&)(this->LOD_),    variableDirection::toclient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::LODchanged));
    7979    }
    8080
  • code/branches/presentation/src/orxonox/objects/worldentities/ParticleSpawner.cc

  • code/branches/presentation/src/orxonox/objects/worldentities/ParticleSpawner.h

  • code/branches/presentation/src/orxonox/objects/worldentities/PositionableEntity.cc

    r2171 r2371  
    4848    void PositionableEntity::registerVariables()
    4949    {
    50         REGISTERDATA(this->getPosition().x, direction::toclient);
    51         REGISTERDATA(this->getPosition().y, direction::toclient);
    52         REGISTERDATA(this->getPosition().z, direction::toclient);
     50        registerVariable(this->getPosition().x, variableDirection::toclient);
     51        registerVariable(this->getPosition().y, variableDirection::toclient);
     52        registerVariable(this->getPosition().z, variableDirection::toclient);
    5353
    54         REGISTERDATA(this->getOrientation().w, direction::toclient);
    55         REGISTERDATA(this->getOrientation().x, direction::toclient);
    56         REGISTERDATA(this->getOrientation().y, direction::toclient);
    57         REGISTERDATA(this->getOrientation().z, direction::toclient);
     54        registerVariable(this->getOrientation().w, variableDirection::toclient);
     55        registerVariable(this->getOrientation().x, variableDirection::toclient);
     56        registerVariable(this->getOrientation().y, variableDirection::toclient);
     57        registerVariable(this->getOrientation().z, variableDirection::toclient);
    5858    }
    5959}
  • code/branches/presentation/src/orxonox/objects/worldentities/WorldEntity.cc

    r2171 r2371  
    9696    void WorldEntity::registerVariables()
    9797    {
    98         REGISTERDATA(this->bActive_,  direction::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedActivity));
    99         REGISTERDATA(this->bVisible_, direction::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility));
    100 
    101         REGISTERDATA(this->getScale3D().x, direction::toclient);
    102         REGISTERDATA(this->getScale3D().y, direction::toclient);
    103         REGISTERDATA(this->getScale3D().z, direction::toclient);
    104 
    105         REGISTERDATA(this->parentID_, direction::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::updateParent));
     98        registerVariable(this->bActive_,  variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedActivity));
     99        registerVariable(this->bVisible_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility));
     100 
     101        registerVariable(this->getScale3D().x, variableDirection::toclient);
     102        registerVariable(this->getScale3D().y, variableDirection::toclient);
     103        registerVariable(this->getScale3D().z, variableDirection::toclient);
     104 
     105        registerVariable(this->parentID_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::updateParent));
    106106    }
    107107
  • code/branches/presentation/src/orxonox/objects/worldentities/WorldEntity.h

    r2171 r2371  
    3636#include <OgreSceneNode.h>
    3737
    38 #include "network/Synchronisable.h"
     38#include "network/synchronisable/Synchronisable.h"
    3939#include "core/BaseObject.h"
    4040#include "util/Math.h"
  • code/branches/presentation/src/orxonox/objects/worldentities/pawns/Pawn.cc

    r2171 r2371  
    8080    void Pawn::registerVariables()
    8181    {
    82         REGISTERDATA(this->bAlive_, direction::toclient);
    83         REGISTERDATA(this->health_, direction::toclient);
     82        registerVariable(this->bAlive_, variableDirection::toclient);
     83        registerVariable(this->health_, variableDirection::toclient);
    8484    }
    8585
  • code/branches/presentation/src/orxonox/objects/worldentities/pawns/SpaceShip.cc

    r2171 r2371  
    8282    void SpaceShip::registerVariables()
    8383    {
    84         REGISTERDATA(this->maxSpeed_,                direction::toclient);
    85         REGISTERDATA(this->maxSecondarySpeed_,       direction::toclient);
    86         REGISTERDATA(this->maxRotation_,             direction::toclient);
    87         REGISTERDATA(this->translationAcceleration_, direction::toclient);
    88         REGISTERDATA(this->rotationAcceleration_,    direction::toclient);
    89         REGISTERDATA(this->translationDamping_,      direction::toclient);
     84        registerVariable(this->maxSpeed_,                variableDirection::toclient);
     85        registerVariable(this->maxSecondarySpeed_,       variableDirection::toclient);
     86        registerVariable(this->maxRotation_,             variableDirection::toclient);
     87        registerVariable(this->translationAcceleration_, variableDirection::toclient);
     88        registerVariable(this->rotationAcceleration_,    variableDirection::toclient);
     89        registerVariable(this->translationDamping_,      variableDirection::toclient);
    9090    }
    9191
  • code/branches/presentation/src/orxonox/objects/worldentities/pawns/Spectator.cc

    r2171 r2371  
    8686    void Spectator::registerVariables()
    8787    {
    88         REGISTERDATA(this->bGreetingFlareVisible_, direction::toclient, new NetworkCallback<Spectator>(this, &Spectator::changedFlareVisibility));
    89         REGISTERDATA(this->bGreeting_,             direction::toserver, new NetworkCallback<Spectator>(this, &Spectator::changedGreeting));
    90         REGISTERDATA(this->hudmode_,               direction::toclient);
     88        registerVariable(this->bGreetingFlareVisible_, variableDirection::toclient, new NetworkCallback<Spectator>(this, &Spectator::changedFlareVisibility));
     89        registerVariable(this->bGreeting_,             variableDirection::toserver, new NetworkCallback<Spectator>(this, &Spectator::changedGreeting));
     90        registerVariable(this->hudmode_,               variableDirection::toclient);
    9191    }
    9292
  • code/branches/presentation/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc

  • code/branches/presentation/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h

  • code/branches/presentation/src/orxonox/objects/worldentities/triggers/Trigger.cc

  • code/branches/presentation/src/orxonox/objects/worldentities/triggers/Trigger.h

  • code/branches/presentation/src/tolua/tolua-5.1.pkg

  • code/branches/presentation/src/util

  • code/branches/presentation/src/util/Exception.cc

  • code/branches/presentation/src/util/Exception.h

  • code/branches/presentation/src/util/SignalHandler.cc

  • code/branches/presentation/src/util/SignalHandler.h

  • code/branches/presentation/src/util/mbool.h

    r2171 r2371  
    3636    struct _UtilExport mbool
    3737    {
     38//        friend Synchronisable::registerVariable<>()
    3839        public:
    3940            inline mbool(bool value = false)
     
    6768            inline bool operator!() const
    6869                { return (!this->value_.bool_); }
     70           
     71            inline unsigned char& getMemory(){ return value_.memory_; }
    6972
    7073        private:
Note: See TracChangeset for help on using the changeset viewer.