Index: code/branches/network64/src/core/CoreIncludes.h
===================================================================
--- code/branches/network64/src/core/CoreIncludes.h	(revision 2307)
+++ code/branches/network64/src/core/CoreIncludes.h	(revision 2309)
@@ -48,4 +48,5 @@
 #include "Functor.h"
 #include "util/Debug.h"
+#include "util/Integers.h"
 
 
Index: code/branches/network64/src/core/Factory.cc
===================================================================
--- code/branches/network64/src/core/Factory.cc	(revision 2307)
+++ code/branches/network64/src/core/Factory.cc	(revision 2309)
@@ -58,7 +58,7 @@
         @return The Identifier
     */
-    Identifier* Factory::getIdentifier(const unsigned int id)
+    Identifier* Factory::getIdentifier(const uint32_t id)
     {
-        std::map<unsigned int, Identifier*>::const_iterator it = getFactoryPointer()->identifierNetworkIDMap_.find(id);
+        std::map<uint32_t, Identifier*>::const_iterator it = getFactoryPointer()->identifierNetworkIDMap_.find(id);
         if (it != getFactoryPointer()->identifierNetworkIDMap_.end())
             return it->second;
@@ -85,5 +85,5 @@
         @param newID The new networkID
     */
-    void Factory::changeNetworkID(Identifier* identifier, const unsigned int oldID, const unsigned int newID)
+    void Factory::changeNetworkID(Identifier* identifier, const uint32_t oldID, const uint32_t newID)
     {
         getFactoryPointer()->identifierNetworkIDMap_.erase(oldID);
Index: code/branches/network64/src/core/Factory.h
===================================================================
--- code/branches/network64/src/core/Factory.h	(revision 2307)
+++ code/branches/network64/src/core/Factory.h	(revision 2309)
@@ -49,4 +49,5 @@
 #include <map>
 #include <string>
+#include "util/Integers.h"
 
 namespace orxonox
@@ -60,7 +61,7 @@
         public:
             static Identifier* getIdentifier(const std::string& name);
-            static Identifier* getIdentifier(const unsigned int id);
+            static Identifier* getIdentifier(const uint32_t id);
             static void add(const std::string& name, Identifier* identifier);
-            static void changeNetworkID(Identifier* identifier, const unsigned int oldID, const unsigned int newID);
+            static void changeNetworkID(Identifier* identifier, const uint32_t oldID, const uint32_t newID);
             static void createClassHierarchy();
 
@@ -83,5 +84,5 @@
 
             std::map<std::string, Identifier*> identifierStringMap_;            //!< The map, mapping the name with the Identifier
-            std::map<unsigned int, Identifier*> identifierNetworkIDMap_;        //!< The map, mapping the network ID with the Identifier
+            std::map<uint32_t, Identifier*> identifierNetworkIDMap_;        //!< The map, mapping the network ID with the Identifier
     };
 
Index: code/branches/network64/src/core/Identifier.cc
===================================================================
--- code/branches/network64/src/core/Identifier.cc	(revision 2307)
+++ code/branches/network64/src/core/Identifier.cc	(revision 2309)
@@ -235,5 +235,5 @@
         @param id The new network ID
     */
-    void Identifier::setNetworkID(unsigned int id)
+    void Identifier::setNetworkID(uint32_t id)
     {
         Factory::changeNetworkID(this, this->classID_, id);
Index: code/branches/network64/src/core/Identifier.h
===================================================================
--- code/branches/network64/src/core/Identifier.h	(revision 2307)
+++ code/branches/network64/src/core/Identifier.h	(revision 2309)
@@ -230,8 +230,8 @@
 
             /** @brief Returns the network ID to identify a class through the network. @return the network ID */
-            inline const unsigned int getNetworkID() const { return this->classID_; }
+            inline const uint32_t getNetworkID() const { return this->classID_; }
 
             /** @brief Sets the network ID to a new value. @param id The new value */
-            void setNetworkID(unsigned int id);
+            void setNetworkID(uint32_t id);
 
             void addConfigValueContainer(const std::string& varname, ConfigValueContainer* container);
@@ -315,5 +315,5 @@
             BaseFactory* factory_;                                         //!< The Factory, able to create new objects of the given class (if available)
             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)
-            unsigned int classID_;                                         //!< The network ID to identify a class through the network
+            uint32_t classID_;                                             //!< The network ID to identify a class through the network
 
             bool bHasConfigValues_;                                        //!< True if this class has at least one assigned config value
Index: code/branches/network64/src/network/GamestateClient.cc
===================================================================
--- code/branches/network64/src/network/GamestateClient.cc	(revision 2307)
+++ code/branches/network64/src/network/GamestateClient.cc	(revision 2309)
@@ -36,4 +36,5 @@
 #include "core/Iterator.h"
 #include "synchronisable/Synchronisable.h"
+#include "synchronisable/NetworkCallbackManager.h"
 #include "packet/Acknowledgement.h"
 
@@ -77,4 +78,8 @@
     packet::Gamestate *processed = processGamestate(tempGamestate_);
 //    assert(processed);
+    
+    //now call the queued callbacks
+    NetworkCallbackManager::callCallbacks();
+    
     if (!processed)
         return false;
Index: code/branches/network64/src/network/GamestateManager.cc
===================================================================
--- code/branches/network64/src/network/GamestateManager.cc	(revision 2307)
+++ code/branches/network64/src/network/GamestateManager.cc	(revision 2309)
@@ -50,4 +50,5 @@
 #include "ClientInformation.h"
 #include "synchronisable/Synchronisable.h"
+#include "synchronisable/NetworkCallbackManager.h"
 
 namespace orxonox
@@ -86,4 +87,6 @@
     // now clear the queue
     gamestateQueue.clear();
+    //and call all queued callbacks
+    NetworkCallbackManager::callCallbacks();
     return true;
   }
Index: code/branches/network64/src/network/NetworkPrereqs.h
===================================================================
--- code/branches/network64/src/network/NetworkPrereqs.h	(revision 2307)
+++ code/branches/network64/src/network/NetworkPrereqs.h	(revision 2309)
@@ -71,4 +71,6 @@
   class GamestateHandler;
   class NetworkCallbackBase;
+  template <class T> class NetworkCallback;
+  class NetworkCallbackManager;
   class PacketBuffer;
   class Server;
Index: code/branches/network64/src/network/packet/Gamestate.cc
===================================================================
--- code/branches/network64/src/network/packet/Gamestate.cc	(revision 2307)
+++ code/branches/network64/src/network/packet/Gamestate.cc	(revision 2309)
@@ -73,7 +73,7 @@
 bool Gamestate::collectData(int id, uint8_t mode)
 {
-  unsigned int tempsize=0, currentsize=0;
+  uint32_t tempsize=0, currentsize=0;
   assert(data_==0);
-  unsigned int size = calcGamestateSize(id, mode);
+  uint32_t size = calcGamestateSize(id, mode);
 
   COUT(4) << "G.ST.Man: producing gamestate with id: " << id << std::endl;
@@ -166,5 +166,5 @@
 }
 
-unsigned int Gamestate::getSize() const
+uint32_t Gamestate::getSize() const
 {
   assert(data_);
@@ -251,7 +251,7 @@
   assert(HEADER->compressed);
   COUT(4) << "GameStateClient: uncompressing gamestate. id: " << HEADER->id << ", baseid: " << HEADER->base_id << ", datasize: " << HEADER->datasize << ", compsize: " << HEADER->compsize << std::endl;
-  unsigned int datasize = HEADER->datasize;
-  unsigned int compsize = HEADER->compsize;
-  unsigned int bufsize;
+  uint32_t datasize = HEADER->datasize;
+  uint32_t compsize = HEADER->compsize;
+  uint32_t bufsize;
 //  assert(compsize<=datasize);
   bufsize = datasize;
@@ -302,6 +302,6 @@
   //unsigned char *basep = base->getGs()/*, *gs = getGs()*/;
   uint8_t *basep = GAMESTATE_START(base->data_), *gs = GAMESTATE_START(this->data_);
-  unsigned int of=0; // pointers offset
-  unsigned int dest_length=0;
+  uint32_t of=0; // pointers offset
+  uint32_t dest_length=0;
   dest_length=HEADER->datasize;
   if(dest_length==0)
@@ -334,5 +334,5 @@
 Gamestate* Gamestate::doSelection(unsigned int clientID){
   assert(data_);
-  std::map<unsigned int, Synchronisable *>::iterator it;
+  std::map<uint32_t, Synchronisable *>::iterator it;
 
   // allocate memory for new data
@@ -347,5 +347,5 @@
 
   synchronisableHeader *oldobjectheader, *newobjectheader;
-  unsigned int objectOffset;
+  uint32_t objectOffset;
 
   //copy in the zeros
@@ -353,5 +353,5 @@
     oldobjectheader = (synchronisableHeader*)origdata;
     newobjectheader = (synchronisableHeader*)newdata;
-    unsigned int objectsize = oldobjectheader->size;
+    uint32_t objectsize = oldobjectheader->size;
     assert(it->second->objectID==oldobjectheader->objectID);
     *newobjectheader = *oldobjectheader;
@@ -382,8 +382,8 @@
 
   //preparations
-  std::map<unsigned int, Synchronisable *>::iterator it;
+  std::map<uint32_t, Synchronisable *>::iterator it;
   uint8_t *origdata, *basedata, *destdata, *ndata;
-  unsigned int objectOffset, streamOffset=0;    //data offset
-  unsigned int minsize = (HEADER->datasize < GAMESTATE_HEADER(base->data_)->datasize) ? HEADER->datasize : GAMESTATE_HEADER(base->data_)->datasize;
+  uint32_t objectOffset, streamOffset=0;    //data offset
+  uint32_t minsize = (HEADER->datasize < GAMESTATE_HEADER(base->data_)->datasize) ? HEADER->datasize : GAMESTATE_HEADER(base->data_)->datasize;
   synchronisableHeader *origheader;
   synchronisableHeader *destheader;
@@ -402,5 +402,5 @@
 
     //copy and partially diff the object header
-    assert(sizeof(synchronisableHeader)==3*sizeof(unsigned int)+sizeof(bool));
+    assert(sizeof(synchronisableHeader)==3*sizeof(uint32_t)+sizeof(bool));
     *(uint32_t*)destdata = *(uint32_t*)origdata; //size (do not diff)
     *(bool*)(destdata+sizeof(uint32_t)) = sendData;
@@ -450,8 +450,8 @@
 
   //preparations
-  std::map<unsigned int, Synchronisable *>::iterator it;
+  std::map<uint32_t, Synchronisable *>::iterator it;
   uint8_t *origdata, *basedata, *destdata, *ndata;
-  unsigned int objectOffset, streamOffset=0;    //data offset
-  unsigned int minsize = (HEADER->datasize < GAMESTATE_HEADER(base->data_)->datasize) ? HEADER->datasize : GAMESTATE_HEADER(base->data_)->datasize;
+  uint32_t objectOffset, streamOffset=0;    //data offset
+  uint32_t minsize = (HEADER->datasize < GAMESTATE_HEADER(base->data_)->datasize) ? HEADER->datasize : GAMESTATE_HEADER(base->data_)->datasize;
   synchronisableHeader *origheader;
   synchronisableHeader *destheader;
@@ -470,14 +470,14 @@
 
     //copy and partially diff the object header
-    assert(sizeof(synchronisableHeader)==3*sizeof(unsigned int)+sizeof(bool));
-    *(unsigned int*)destdata = *(unsigned int*)origdata; //size (do not diff)
-    *(bool*)(destdata+sizeof(unsigned int)) = *(bool*)(origdata+sizeof(unsigned int));
-    sendData = *(bool*)(origdata+sizeof(unsigned int));
+    assert(sizeof(synchronisableHeader)==3*sizeof(uint32_t)+sizeof(bool));
+    *(uint32_t*)destdata = *(uint32_t*)origdata; //size (do not diff)
+    *(bool*)(destdata+sizeof(uint32_t)) = *(bool*)(origdata+sizeof(uint32_t));
+    sendData = *(bool*)(origdata+sizeof(uint32_t));
     if(sendData){
-      *(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)
-      *(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)
+      *(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)
+      *(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)
     }else{
-      *(unsigned int*)(destdata+sizeof(unsigned int)+sizeof(bool)) = 0;
-      *(unsigned int*)(destdata+2*sizeof(unsigned int)+sizeof(bool)) = 0;
+      *(uint32_t*)(destdata+sizeof(uint32_t)+sizeof(bool)) = 0;
+      *(uint32_t*)(destdata+2*sizeof(uint32_t)+sizeof(bool)) = 0;
     }
     objectOffset=sizeof(synchronisableHeader);
@@ -517,6 +517,6 @@
   uint8_t *basep = GAMESTATE_START(base->data_);
   uint8_t *gs = GAMESTATE_START(this->data_);
-  unsigned int of=0; // pointers offset
-  unsigned int dest_length=0;
+  uint32_t of=0; // pointers offset
+  uint32_t dest_length=0;
   dest_length=HEADER->datasize;
   if(dest_length==0)
@@ -548,7 +548,7 @@
 
 
-unsigned int Gamestate::calcGamestateSize(unsigned int id, uint8_t mode)
-{
-  unsigned int size=0;
+uint32_t Gamestate::calcGamestateSize(int32_t id, uint8_t mode)
+{
+  uint32_t size=0;
     // get the start of the Synchronisable list
   ObjectList<Synchronisable>::iterator it;
Index: code/branches/network64/src/network/packet/Gamestate.h
===================================================================
--- code/branches/network64/src/network/packet/Gamestate.h	(revision 2307)
+++ code/branches/network64/src/network/packet/Gamestate.h	(revision 2309)
@@ -85,12 +85,12 @@
     // Packet functions
   private:
-    virtual unsigned int getSize() const;
+    virtual uint32_t getSize() const;
     virtual bool process();
 
     bool operator ==(packet::Gamestate gs);
   private:
-    unsigned int calcGamestateSize(unsigned int id, uint8_t mode=0x0);
+    uint32_t calcGamestateSize(int32_t id, uint8_t mode=0x0);
     void removeObject(ObjectListIterator<Synchronisable> &it);
-    std::map<unsigned int, Synchronisable*> dataMap_;
+    std::map<uint32_t, Synchronisable*> dataMap_;
 };
 
Index: code/branches/network64/src/network/synchronisable/CMakeLists.txt
===================================================================
--- code/branches/network64/src/network/synchronisable/CMakeLists.txt	(revision 2307)
+++ code/branches/network64/src/network/synchronisable/CMakeLists.txt	(revision 2309)
@@ -1,3 +1,4 @@
 SET( SRC_FILES
+  NetworkCallbackManager.cc
   Synchronisable.cc
   SynchronisableSpecialisations.cc
Index: code/branches/network64/src/network/synchronisable/NetworkCallback.h
===================================================================
--- code/branches/network64/src/network/synchronisable/NetworkCallback.h	(revision 2307)
+++ code/branches/network64/src/network/synchronisable/NetworkCallback.h	(revision 2309)
@@ -1,13 +1,45 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Oliver Scheuss, (C) 2008
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
 #ifndef _NETWORK_CALLBACK__
 #define _NETWORK_CALLBACK__
 
 #include "network/NetworkPrereqs.h"
+#include "NetworkCallbackManager.h"
 
 namespace orxonox{
+  
   class _NetworkExport NetworkCallbackBase
   {
     public:
       virtual void call() = 0;
-	  virtual ~NetworkCallbackBase() {}
+      NetworkCallbackBase(){ NetworkCallbackManager::registerCallback( this ); }
+      virtual ~NetworkCallbackBase() {}
   };
 
@@ -26,5 +58,4 @@
   };
 
-
 }
 
Index: code/branches/network64/src/network/synchronisable/Synchronisable.cc
===================================================================
--- code/branches/network64/src/network/synchronisable/Synchronisable.cc	(revision 2307)
+++ code/branches/network64/src/network/synchronisable/Synchronisable.cc	(revision 2309)
@@ -55,6 +55,6 @@
 
 
-  std::map<unsigned int, Synchronisable *> Synchronisable::objectMap_;
-  std::queue<unsigned int> Synchronisable::deletedObjects_;
+  std::map<uint32_t, Synchronisable *> Synchronisable::objectMap_;
+  std::queue<uint32_t> Synchronisable::deletedObjects_;
 
   uint8_t Synchronisable::state_=0x1; // detemines wheter we are server (default) or client
@@ -77,5 +77,5 @@
     else
       objectID=OBJECTID_UNKNOWN;
-    classID = (unsigned int)-1;
+    classID = static_cast<uint32_t>(-1);
 
 
@@ -122,5 +122,5 @@
 //       objectMap_.erase(objectID);
     }
-    std::map<unsigned int, Synchronisable*>::iterator it;
+    std::map<uint32_t, Synchronisable*>::iterator it;
     it = objectMap_.find(objectID);
     if (it != objectMap_.end())
@@ -199,5 +199,5 @@
    * @return true/false
    */
-  bool Synchronisable::deleteObject(unsigned int objectID){
+  bool Synchronisable::deleteObject(uint32_t objectID){
 //     assert(getSynchronisable(objectID));
     if(!getSynchronisable(objectID))
@@ -218,6 +218,6 @@
    * @return pointer to the Synchronisable with the objectID
    */
-  Synchronisable* Synchronisable::getSynchronisable(unsigned int objectID){
-    std::map<unsigned int, Synchronisable*>::iterator it1;
+  Synchronisable* Synchronisable::getSynchronisable(uint32_t objectID){
+    std::map<uint32_t, Synchronisable*>::iterator it1;
     it1 = objectMap_.find(objectID);
     if (it1 != objectMap_.end())
@@ -295,5 +295,5 @@
    * @return true: if !doSync or if everything was successfully saved
    */
-  bool Synchronisable::getData(uint8_t*& mem, unsigned int id, uint8_t mode){
+  bool Synchronisable::getData(uint8_t*& mem, int32_t id, uint8_t mode){
     if(mode==0x0)
       mode=state_;
@@ -302,9 +302,9 @@
       return true;
     //std::cout << "inside getData" << std::endl;
-    unsigned int tempsize = 0;
+    uint32_t tempsize = 0;
     if(classID==0)
       COUT(3) << "classid 0 " << this->getIdentifier()->getName() << std::endl;
 
-    if (this->classID == (unsigned int)-1)
+    if (this->classID == static_cast<uint32_t>(-1))
         this->classID = this->getIdentifier()->getNetworkID();
 
@@ -312,5 +312,5 @@
 //     this->classID=this->getIdentifier()->getNetworkID(); // TODO: correct this
     std::list<SynchronisableVariableBase*>::iterator i;
-    unsigned int size;
+    uint32_t size;
     size=getSize(id, mode);
 
@@ -384,5 +384,5 @@
   * @return amount of bytes
   */
-  uint32_t Synchronisable::getSize(unsigned int id, uint8_t mode){
+  uint32_t Synchronisable::getSize(int32_t id, uint8_t mode){
     int tsize=sizeof(synchronisableHeader);
     if(mode==0x0)
@@ -402,5 +402,5 @@
    * @return true/false
    */
-  bool Synchronisable::doSync(unsigned int id, uint8_t mode){
+  bool Synchronisable::doSync(int32_t id, uint8_t mode){
     if(mode==0x0)
       mode=state_;
@@ -408,5 +408,5 @@
   }
 
-  bool Synchronisable::doSelection(unsigned int id){
+  bool Synchronisable::doSelection(int32_t id){
     return true; //TODO: change this
     //return ( id==0 || id%objectFrequency_==objectID%objectFrequency_ ) && ((objectMode_&state_)!=0);
Index: code/branches/network64/src/network/synchronisable/Synchronisable.h
===================================================================
--- code/branches/network64/src/network/synchronisable/Synchronisable.h	(revision 2307)
+++ code/branches/network64/src/network/synchronisable/Synchronisable.h	(revision 2309)
@@ -53,5 +53,5 @@
 namespace orxonox
 {
-  static const unsigned int OBJECTID_UNKNOWN = (unsigned int)-1;
+  static const uint32_t OBJECTID_UNKNOWN = static_cast<uint32_t>(-1);
 
   namespace objectDirection{
@@ -86,11 +86,11 @@
 
     static Synchronisable *fabricate(uint8_t*& mem, uint8_t mode=0x0);
-    static bool deleteObject(unsigned int objectID);
-    static Synchronisable *getSynchronisable(unsigned int objectID);
+    static bool deleteObject(uint32_t objectID);
+    static Synchronisable *getSynchronisable(uint32_t objectID);
     static unsigned int getNumberOfDeletedObject(){ return deletedObjects_.size(); }
-    static unsigned int popDeletedObject(){ unsigned int i = deletedObjects_.front(); deletedObjects_.pop(); return i; }
+    static uint32_t popDeletedObject(){ uint32_t i = deletedObjects_.front(); deletedObjects_.pop(); return i; }
 
-    inline unsigned int getObjectID(){return objectID;}
-    inline unsigned int getClassID(){return classID;}
+    inline uint32_t getObjectID(){return objectID;}
+    inline uint32_t getClassID(){return classID;}
   protected:
     Synchronisable(BaseObject* creator);
@@ -103,14 +103,14 @@
 
   private:
-    bool getData(uint8_t*& men, unsigned int id, uint8_t mode=0x0);
-    uint32_t getSize(unsigned int id, uint8_t mode=0x0);
+    bool getData(uint8_t*& men, int32_t id, uint8_t mode=0x0);
+    uint32_t getSize(int32_t id, uint8_t mode=0x0);
     bool updateData(uint8_t*& mem, uint8_t mode=0x0, bool forceCallback=false);
     bool isMyData(uint8_t* mem);
-    bool doSelection(unsigned int id);
-    bool doSync(unsigned int id, uint8_t mode=0x0);
+    bool doSelection(int32_t id);
+    bool doSync(int32_t id, uint8_t mode=0x0);
 
-    unsigned int objectID;
-    unsigned int creatorID;
-    unsigned int classID;
+    uint32_t objectID;
+    uint32_t creatorID;
+    uint32_t classID;
 
     std::list<SynchronisableVariableBase*> syncList;
@@ -119,6 +119,6 @@
     unsigned int objectFrequency_;
     int objectMode_;
-    static std::map<unsigned int, Synchronisable *> objectMap_;
-    static std::queue<unsigned int> deletedObjects_;
+    static std::map<uint32_t, Synchronisable *> objectMap_;
+    static std::queue<uint32_t> deletedObjects_;
   };
   
Index: code/branches/network64/src/network/synchronisable/SynchronisableSpecialisations.cc
===================================================================
--- code/branches/network64/src/network/synchronisable/SynchronisableSpecialisations.cc	(revision 2307)
+++ code/branches/network64/src/network/synchronisable/SynchronisableSpecialisations.cc	(revision 2309)
@@ -37,7 +37,7 @@
   template <> void Synchronisable::registerVariable( const ColourValue& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional)
   {
-    registerVariable(variable.r, mode, 0, bidirectional);
-    registerVariable(variable.g, mode, 0, bidirectional);
-    registerVariable(variable.b, mode, 0, bidirectional);
+    registerVariable(variable.r, mode, cb, bidirectional);
+    registerVariable(variable.g, mode, cb, bidirectional);
+    registerVariable(variable.b, mode, cb, bidirectional);
     registerVariable(variable.a, mode, cb, bidirectional);
   }
@@ -49,5 +49,5 @@
   template <> void Synchronisable::registerVariable( const Vector2& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional)
   {
-    registerVariable(variable.x, mode, 0, bidirectional);
+    registerVariable(variable.x, mode, cb, bidirectional);
     registerVariable(variable.y, mode, cb, bidirectional);
   }
@@ -59,6 +59,6 @@
   template <> void Synchronisable::registerVariable( const Vector3& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional)
   {
-    registerVariable(variable.x, mode, 0, bidirectional);
-    registerVariable(variable.y, mode, 0, bidirectional);
+    registerVariable(variable.x, mode, cb, bidirectional);
+    registerVariable(variable.y, mode, cb, bidirectional);
     registerVariable(variable.z, mode, cb, bidirectional);
   }
@@ -70,7 +70,7 @@
   template <> void Synchronisable::registerVariable( const Vector4& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional)
   {
-    registerVariable(variable.x, mode, 0, bidirectional);
-    registerVariable(variable.y, mode, 0, bidirectional);
-    registerVariable(variable.z, mode, 0, bidirectional);
+    registerVariable(variable.x, mode, cb, bidirectional);
+    registerVariable(variable.y, mode, cb, bidirectional);
+    registerVariable(variable.z, mode, cb, bidirectional);
     registerVariable(variable.w, mode, cb, bidirectional);
   }
@@ -87,8 +87,8 @@
   template <> void Synchronisable::registerVariable( const Quaternion& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional)
   {
-    registerVariable(variable.w, mode, 0, bidirectional);
-    registerVariable(variable.x, mode, 0, bidirectional);
-    registerVariable(variable.y, mode, 0, bidirectional);
+    registerVariable(variable.x, mode, cb, bidirectional);
+    registerVariable(variable.y, mode, cb, bidirectional);
     registerVariable(variable.z, mode, cb, bidirectional);
+    registerVariable(variable.w, mode, cb, bidirectional);
   }
   template <> void Synchronisable::registerVariable( Quaternion& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional)
Index: code/branches/network64/src/network/synchronisable/SynchronisableVariable.cc
===================================================================
--- code/branches/network64/src/network/synchronisable/SynchronisableVariable.cc	(revision 2307)
+++ code/branches/network64/src/network/synchronisable/SynchronisableVariable.cc	(revision 2309)
@@ -64,4 +64,28 @@
 }
 
+// =========== char
+
+template <> uint32_t SynchronisableVariable<const char>::returnSize()
+{
+  return sizeof(uint8_t);
+}
+
+template <> void SynchronisableVariable<const char>::setAndIncrease( uint8_t*& mem )
+{
+  *(uint8_t*)(&this->variable_) = *static_cast<uint8_t*>(mem);
+  mem += SynchronisableVariable<const char>::returnSize();
+}
+
+template <> void SynchronisableVariable<const char>::getAndIncrease( uint8_t*& mem )
+{
+  *static_cast<uint8_t*>(mem) = *(uint8_t*)(&this->variable_);
+  mem += SynchronisableVariable<const char>::returnSize();
+}
+
+template <> bool SynchronisableVariable<const char>::checkEquality( uint8_t* mem )
+{
+  return *static_cast<uint8_t*>(mem) == *(uint8_t*)(&this->variable_);
+}
+
 // =========== unsigned char
 
Index: code/branches/network64/src/network/synchronisable/SynchronisableVariable.h
===================================================================
--- code/branches/network64/src/network/synchronisable/SynchronisableVariable.h	(revision 2307)
+++ code/branches/network64/src/network/synchronisable/SynchronisableVariable.h	(revision 2309)
@@ -39,4 +39,5 @@
 #include "core/CoreIncludes.h"
 #include "network/synchronisable/NetworkCallback.h"
+#include "network/synchronisable/NetworkCallbackManager.h"
 
 namespace orxonox{
@@ -119,5 +120,5 @@
   {
     if (this->callback_ != 0)
-      delete this->callback_;
+      NetworkCallbackManager::deleteCallback(this->callback_); //safe call for deletion
   }
 
@@ -146,5 +147,6 @@
   // now do a callback if neccessary
     if ( callback )
-      this->callback_->call();
+      NetworkCallbackManager::triggerCallback( this->callback_ );
+      //this->callback_->call();
   }
 
@@ -299,5 +301,6 @@
   // now do a callback if neccessary
       if ( callback )
-        this->callback_->call();
+        NetworkCallbackManager::triggerCallback( this->callback_ );
+        //this->callback_->call();
     }
 
Index: code/branches/network64/src/orxonox/objects/Test.cc
===================================================================
--- code/branches/network64/src/orxonox/objects/Test.cc	(revision 2307)
+++ code/branches/network64/src/orxonox/objects/Test.cc	(revision 2309)
@@ -61,8 +61,13 @@
 	void Test::setConfigValues()
 	{
-		SetConfigValue ( v1, 1 )/*.callback ( this, &Test::checkV1 )*/;
-    SetConfigValue ( v2, 2 )/*.callback ( this, &Test::checkV2 )*/;
-    SetConfigValue ( v3, 3 )/*.callback ( this, &Test::checkV3 )*/;
-    SetConfigValue ( v4, 4 )/*.callback ( this, &Test::checkV4 )*/;
+		SetConfigValue ( u1, 1 )/*.callback ( this, &Test::checkV1 )*/;
+    SetConfigValue ( u2, 2 )/*.callback ( this, &Test::checkV2 )*/;
+    SetConfigValue ( u3, 3 )/*.callback ( this, &Test::checkV3 )*/;
+    SetConfigValue ( u4, 4 )/*.callback ( this, &Test::checkV4 )*/;
+    
+    SetConfigValue ( s1, 1 )/*.callback ( this, &Test::checkV1 )*/;
+    SetConfigValue ( s2, 2 )/*.callback ( this, &Test::checkV2 )*/;
+    SetConfigValue ( s3, 3 )/*.callback ( this, &Test::checkV3 )*/;
+    SetConfigValue ( s4, 4 )/*.callback ( this, &Test::checkV4 )*/;
 	}
 
@@ -70,26 +75,24 @@
 	void Test::registerVariables()
 	{
-		registerVariable ( v1, variableDirection::toclient, new NetworkCallback<Test> ( this, &Test::checkV1 ));
-    registerVariable ( v2, variableDirection::toserver, new NetworkCallback<Test> ( this, &Test::checkV2 ));
-		registerVariable ( v3, variableDirection::serverMaster, new NetworkCallback<Test> ( this, &Test::checkV3 ), true );
-    registerVariable ( v4, variableDirection::clientMaster, new NetworkCallback<Test> ( this, &Test::checkV4 ), true );
+		registerVariable ( u1, variableDirection::toclient, new NetworkCallback<Test> ( this, &Test::checkU1 ));
+    registerVariable ( u2, variableDirection::toserver, new NetworkCallback<Test> ( this, &Test::checkU2 ));
+		registerVariable ( u3, variableDirection::serverMaster, new NetworkCallback<Test> ( this, &Test::checkU3 ), true );
+    registerVariable ( u4, variableDirection::clientMaster, new NetworkCallback<Test> ( this, &Test::checkU4 ), true );
+    
+    registerVariable ( s1, variableDirection::toclient, new NetworkCallback<Test> ( this, &Test::checkS1 ));
+    registerVariable ( s2, variableDirection::toserver, new NetworkCallback<Test> ( this, &Test::checkS2 ));
+    registerVariable ( s3, variableDirection::serverMaster, new NetworkCallback<Test> ( this, &Test::checkS3 ), true );
+    registerVariable ( s4, variableDirection::clientMaster, new NetworkCallback<Test> ( this, &Test::checkS4 ), true );
 	}
 
-  void Test::checkV1(){
-    COUT(1) << "V1 changed: " << v1 << std::endl;
-  }
+  void Test::checkU1(){ COUT(1) << "U1 changed: " << u1 << std::endl; }
+  void Test::checkU2(){ COUT(1) << "U2 changed: " << u2 << std::endl; }
+  void Test::checkU3(){ COUT(1) << "U3 changed: " << u3 << std::endl; }
+  void Test::checkU4(){ COUT(1) << "U4 changed: " << u4 << std::endl; }
 
-  void Test::checkV2(){
-    COUT(1) << "V2 changed: " << v2 << std::endl;
-  }
-
-  void Test::checkV3(){
-    COUT(1) << "V3 changed: " << v3 << std::endl;
-  }
-  
-  void Test::checkV4(){
-    COUT(1) << "V4 changed: " << v4 << std::endl;
-  }
-
+  void Test::checkS1(){ COUT(1) << "S1 changed: " << s1 << std::endl; }
+  void Test::checkS2(){ COUT(1) << "S2 changed: " << s2 << std::endl; }
+  void Test::checkS3(){ COUT(1) << "S3 changed: " << s3 << std::endl; }
+  void Test::checkS4(){ COUT(1) << "S4 changed: " << s4 << std::endl; }
 
 }
Index: code/branches/network64/src/orxonox/objects/Test.h
===================================================================
--- code/branches/network64/src/orxonox/objects/Test.h	(revision 2307)
+++ code/branches/network64/src/orxonox/objects/Test.h	(revision 2309)
@@ -34,4 +34,9 @@
 #include "network/synchronisable/Synchronisable.h"
 
+
+typedef int TYPE;
+typedef unsigned int UTYPE;
+
+
 namespace orxonox
 {
@@ -45,24 +50,40 @@
       void registerVariables();
 
-      void setV1(unsigned int value){ v1 = value; }
-      void setV2(unsigned int value){ v2 = value; }
-      void setV3(unsigned int value){ v3 = value; }
-      void setV4(unsigned int value){ v4 = value; }
 
-      void checkV1();
-      void checkV2();
-      void checkV3();
-      void checkV4();
+      //unsigned functions
+      void setU1(UTYPE value){ u1 = value; }
+      void setU2(UTYPE value){ u2 = value; }
+      void setU3(UTYPE value){ u3 = value; }
+      void setU4(UTYPE value){ u4 = value; }
+      void checkU1();
+      void checkU2();
+      void checkU3();
+      void checkU4();
       
-      static void printV1(){ instance_->checkV1(); }
-      static void printV2(){ instance_->checkV2(); }
-      static void printV3(){ instance_->checkV3(); }
-      static void printV4(){ instance_->checkV4(); }
+      //signed functions
+      void setS1(TYPE value){ s1 = value; }
+      void setS2(TYPE value){ s2 = value; }
+      void setS3(TYPE value){ s3 = value; }
+      void setS4(TYPE value){ s4 = value; }
+      void checkS1();
+      void checkS2();
+      void checkS3();
+      void checkS4();
+      
+      static void printV1(){ instance_->checkU1(); }
+      static void printV2(){ instance_->checkU2(); }
+      static void printV3(){ instance_->checkU3(); }
+      static void printV4(){ instance_->checkU4(); }
 
     private:
-      unsigned int v1;
-      unsigned int v2;
-      unsigned int v3;
-      unsigned int v4;
+      UTYPE u1;
+      UTYPE u2;
+      UTYPE u3;
+      UTYPE u4;
+      
+      TYPE s1;
+      TYPE s2;
+      TYPE s3;
+      TYPE s4;
       
       static Test* instance_;
