Index: code/branches/objecthierarchy/src/network/CMakeLists.txt
===================================================================
--- code/branches/objecthierarchy/src/network/CMakeLists.txt	(revision 1939)
+++ code/branches/objecthierarchy/src/network/CMakeLists.txt	(revision 1940)
@@ -22,5 +22,5 @@
 
 IF(WIN32)
-  ADD_LIBRARY( network SHARED ${NETWORK_SRC_FILES} )
+  ADD_LIBRARY( network ${NETWORK_SRC_FILES} )
 ELSE(WIN32)
   ADD_LIBRARY( network SHARED ${NETWORK_SRC_FILES} )
Index: code/branches/objecthierarchy/src/network/ClientConnectionListener.h
===================================================================
--- code/branches/objecthierarchy/src/network/ClientConnectionListener.h	(revision 1939)
+++ code/branches/objecthierarchy/src/network/ClientConnectionListener.h	(revision 1940)
@@ -8,11 +8,15 @@
 namespace network{
 
-  class _NetworkExport ClientConnectionListener : public orxonox::OrxonoxClass
+  class _NetworkExport ClientConnectionListener : virtual public orxonox::OrxonoxClass
   {
+    friend class Server;
+
   public:
     ClientConnectionListener();
+    virtual ~ClientConnectionListener() {}
 
     void getConnectedClients();
 
+  protected:
     virtual void clientConnected(unsigned int clientID) = 0;
     virtual void clientDisconnected(unsigned int clientID) = 0;
Index: code/branches/objecthierarchy/src/network/GamestateClient.cc
===================================================================
--- code/branches/objecthierarchy/src/network/GamestateClient.cc	(revision 1939)
+++ code/branches/objecthierarchy/src/network/GamestateClient.cc	(revision 1940)
@@ -77,4 +77,6 @@
     packet::Gamestate *processed = processGamestate(tempGamestate_);
 //    assert(processed);
+    if (!processed)
+        return false;
     //successfully loaded data from gamestate. now save gamestate for diff and delete the old gs
     tempGamestate_=NULL;
Index: code/branches/objecthierarchy/src/network/Synchronisable.cc
===================================================================
--- code/branches/objecthierarchy/src/network/Synchronisable.cc	(revision 1939)
+++ code/branches/objecthierarchy/src/network/Synchronisable.cc	(revision 1940)
@@ -51,5 +51,5 @@
 namespace network
 {
-  
+
 
   std::map<unsigned int, Synchronisable *> Synchronisable::objectMap_;
@@ -68,9 +68,10 @@
     objectMode_=0x1; // by default do not send data to server
     objectID=idCounter++;
+    classID = (unsigned int)-1;
     syncList = new std::list<synchronisableVariable *>;
   }
 
   /**
-   * Destructor: 
+   * Destructor:
    * Delete all callback objects and remove objectID from the objectMap_
    */
@@ -96,5 +97,5 @@
     this->classID = this->getIdentifier()->getNetworkID();
 //     COUT(4) << "creating synchronisable: setting classid from " << this->getIdentifier()->getName() << " to: " << classID << std::endl;
-    
+
 //     COUT(3) << "construct synchronisable +++" << objectID << " | " << classID << std::endl;
 //     objectMap_[objectID]=this;
@@ -145,5 +146,5 @@
   }
 
-  
+
   /**
    * Finds and deletes the Synchronisable with the appropriate objectID
@@ -164,5 +165,5 @@
     return true;
   }
-  
+
   /**
    * This function looks up the objectID in the objectMap_ and returns a pointer to the right Synchronisable
@@ -185,5 +186,5 @@
   }
 
-  
+
   /**
   * This function is used to register a variable to be synchronized
@@ -240,4 +241,8 @@
     if(classID==0)
       COUT(3) << "classid 0 " << this->getIdentifier()->getName() << std::endl;
+
+    if (this->classID == (unsigned int)-1)
+        this->classID = this->getIdentifier()->getNetworkID();
+
     assert(this->classID==this->getIdentifier()->getNetworkID());
 //     this->classID=this->getIdentifier()->getNetworkID(); // TODO: correct this
@@ -314,5 +319,5 @@
     assert(this->objectID==syncHeader->objectID);
 //    assert(this->classID==syncHeader->classID); //TODO: fix this!!! maybe a problem with the identifier ?
-    
+
     COUT(5) << "Synchronisable: objectID " << syncHeader->objectID << ", classID " << syncHeader->classID << " size: " << syncHeader->size << " synchronising data" << std::endl;
     for(i=syncList->begin(); i!=syncList->end() && mem <= data+syncHeader->size; i++){
Index: code/branches/objecthierarchy/src/network/Synchronisable.h
===================================================================
--- code/branches/objecthierarchy/src/network/Synchronisable.h	(revision 1939)
+++ code/branches/objecthierarchy/src/network/Synchronisable.h	(revision 1940)
@@ -41,8 +41,8 @@
 #include "util/Integers.h"
 
-#define REGISTERDATA(varname) registerVar(&varname, sizeof(varname), network::DATA)
-#define REGISTERDATA_WITHDIR(varname, mode) registerVar(&varname, sizeof(varname), network::DATA, mode)
-#define REGISTERSTRING(stringname) registerVar(&stringname, stringname.length()+1, network::STRING)
-#define REGISTERSTRING_WITHDIR(stringname, mode) registerVar(&stringname, stringname.length()+1, network::STRING, mode)
+#define REGISTERDATA(varname, ...) \
+    registerVar((void*)&varname, sizeof(varname), network::DATA, __VA_ARGS__)
+#define REGISTERSTRING(stringname, ...) \
+    registerVar(&stringname, stringname.length()+1, network::STRING, __VA_ARGS__)
 
 namespace network
@@ -112,5 +112,4 @@
     void setObjectMode(int mode);
     void setObjectFrequency(unsigned int freq){ objectFrequency_ = freq; }
-    virtual void registerAllVariables()=0;
 
 
Index: code/branches/objecthierarchy/src/network/packet/Packet.cc
===================================================================
--- code/branches/objecthierarchy/src/network/packet/Packet.cc	(revision 1939)
+++ code/branches/objecthierarchy/src/network/packet/Packet.cc	(revision 1940)
@@ -49,10 +49,10 @@
 
 namespace packet{
-  
+
 #define PACKET_FLAG_DEFAULT ENET_PACKET_FLAG_NO_ALLOCATE
 #define _PACKETID           0
-  
+
 std::map<ENetPacket *, Packet *> Packet::packetMap_;
-  
+
 Packet::Packet(){
   flags_ = PACKET_FLAG_DEFAULT;
@@ -112,5 +112,5 @@
     packetMap_[enetPacket_] = this;
   }
-#ifndef NDEBUG 
+#ifndef NDEBUG
   switch( *(ENUM::Type *)(data_ + _PACKETID) )
   {
