Index: code/branches/network3/src/network/PacketGenerator.cc
===================================================================
--- code/branches/network3/src/network/PacketGenerator.cc	(revision 1179)
+++ code/branches/network3/src/network/PacketGenerator.cc	(revision 1180)
@@ -108,5 +108,5 @@
     //std::cout << "states->compsize " << states->compsize << std::endl;
     int gid = GAMESTATE; //first assign the correct enet id
-    int totalLen = 4*sizeof( int ) + sizeof(bool) + states->compsize; //calculate the total size of the datastream memory
+    int totalLen = 5*sizeof( int ) + sizeof(bool) + states->compsize; //calculate the total size of the datastream memory
     //std::cout << "totalLen " << totalLen << std::endl;
     unsigned char *data = (unsigned char*)malloc( totalLen ); //allocate the memory for datastream
@@ -120,4 +120,5 @@
     memcpy( (void*)(data+5*sizeof( int ) + sizeof(bool)), (const void*)states->data, states->compsize );
     //create an enet packet with the generated bytestream
+    COUT(4) << "PacketGenerator generating totalLen " << totalLen << std::endl;
     ENetPacket *packet = enet_packet_create( data , totalLen, reliable );
     //delete data;
Index: code/branches/network3/src/network/Synchronisable.cc
===================================================================
--- code/branches/network3/src/network/Synchronisable.cc	(revision 1179)
+++ code/branches/network3/src/network/Synchronisable.cc	(revision 1180)
@@ -70,5 +70,5 @@
   * @param size size of the datatype the variable consists of
   */
-  void Synchronisable::registerVar(const void *var, int size, variableType t){
+  void Synchronisable::registerVar(void *var, int size, variableType t){
     // create temporary synch.Var struct
     synchronisableVariable *temp = new synchronisableVariable;
@@ -155,11 +155,13 @@
       switch((*i)->type){
       case DATA:
-        std::memcpy( (void *)(retVal.data+n), (const void*)((*i)->var), (*i)->size);
+        std::memcpy( (void *)(retVal.data+n), (void*)((*i)->var), (*i)->size);
         n+=(*i)->size;
         break;
       case STRING:
-        memcpy( (void *)(retVal.data+n), (const void *)&((*i)->size), sizeof(int) );
+        memcpy( (void *)(retVal.data+n), (void *)&((*i)->size), sizeof(int) );
         n+=sizeof(int);
-        std::memcpy( retVal.data+n, (const void*)( ( (std::string *) (*i)->var)->c_str()), (*i)->size);
+        const char *data = ( ( *(std::string *) (*i)->var).c_str());
+        std::memcpy( retVal.data+n, (void*)data, (*i)->size);
+        COUT(4) << "synchronisable: char: " << (const char *)(retVal.data+n) << " data: " << data << " string: " << *(std::string *)((*i)->var) << std::endl;
         n+=(*i)->size;
         break;
@@ -191,6 +193,8 @@
       case STRING:
         (*i)->size = *(int *)data;
+        COUT(4) << "string size: " << (*i)->size << std::endl;
         data+=sizeof(int);
         *((std::string *)((*i)->var)) = std::string((const char*)data);
+        COUT(4) << "synchronisable: char: " << (const char*)data << " string: " << std::string((const char*)data) << std::endl;
         data += (*i)->size;
         break;
@@ -215,4 +219,5 @@
         tsize+=sizeof(int);
         (*i)->size=((std::string *)(*i)->var)->length()+1;
+        COUT(4) << "String size: " << (*i)->size << std::endl;
         tsize+=(*i)->size;
         break;
Index: code/branches/network3/src/network/Synchronisable.h
===================================================================
--- code/branches/network3/src/network/Synchronisable.h	(revision 1179)
+++ code/branches/network3/src/network/Synchronisable.h	(revision 1180)
@@ -62,5 +62,5 @@
   typedef struct synchronisableVariable{
     int size;
-    const void *var;
+    void *var;
     variableType type;
   }SYNCVAR;
@@ -79,5 +79,5 @@
     int classID;
 
-    void registerVar(const void *var, int size, variableType t);
+    void registerVar(void *var, int size, variableType t);
     //  syncData getData();
     syncData getData(unsigned char *mem);
