Index: branches/std/src/lib/lang/base_object.cc
===================================================================
--- branches/std/src/lib/lang/base_object.cc	(revision 7226)
+++ branches/std/src/lib/lang/base_object.cc	(revision 7228)
@@ -186,21 +186,9 @@
 int BaseObject::writeState( const byte * data, int length, int sender )
 {
-  /// FIXME STD
-
-  /*  SYNCHELP_READ_BEGIN();
-
-  if ( !objectName.empty() )
-  {
-    delete[] objectName;
-    objectName = NULL;
-  }
-  SYNCHELP_READ_STRINGM( this->objectName, NWT_BO_NAME );
-  if ( this->objectName && !strcmp(this->objectName, "") )
-  {
-    delete[] this->objectName;
-    this->objectName = NULL;
-  }
-
-  return SYNCHELP_READ_N;*/
+  SYNCHELP_READ_BEGIN();
+
+  SYNCHELP_READ_STRING( this->objectName, NWT_BO_NAME );
+
+  return SYNCHELP_READ_N;
 }
 
@@ -213,10 +201,9 @@
 int BaseObject::readState( byte * data, int maxLength )
 {
-///FIXME STD
-  /*  SYNCHELP_WRITE_BEGIN();
+  SYNCHELP_WRITE_BEGIN();
 
   //PRINTF(0)("objectname = %s\n", this->objectName);
   SYNCHELP_WRITE_STRING( this->objectName, NWT_BO_NAME );
 
-  return SYNCHELP_WRITE_N;*/
-}
+  return SYNCHELP_WRITE_N;
+}
Index: branches/std/src/lib/network/converter.cc
===================================================================
--- branches/std/src/lib/network/converter.cc	(revision 7226)
+++ branches/std/src/lib/network/converter.cc	(revision 7228)
@@ -159,5 +159,5 @@
   if ( length< INTSIZE )
   {
-    PRINTF(1)("Byte Array to small\n");
+    PRINTF(1)("Byte Array to small : %d\n", length);
     return 0;
   }
@@ -457,17 +457,17 @@
  * @return: the used number of bytes in byte array
  */
-int Converter::stringToByteArray( const char * s, byte * a, int length, int maxLength )
-{
-  if ( length+INTSIZE > maxLength )
-  {
-    PRINTF(1)("Byte array is too small (%d) to store %d bytes\n", maxLength, length+INTSIZE);
+int Converter::stringToByteArray( const std::string & s, byte * a, int maxLength )
+{
+  if ( s.length()+INTSIZE > maxLength )
+  {
+    PRINTF(1)("Byte array is too small (%d) to store %d bytes\n", maxLength, s.length()+INTSIZE);
     return -1;
   }
 
-  int n = Converter::intToByteArray( length, a, maxLength );
-
-  memcpy( a+INTSIZE, s, length );
-
-  return length + INTSIZE;
+  int n = Converter::intToByteArray( s.length(), a, maxLength );
+
+  memcpy( a+INTSIZE, s.c_str(), s.length() );
+
+  return s.length() + INTSIZE;
 }
 
@@ -479,5 +479,5 @@
  * @return: the number of read bytes in byte array
  */
-int Converter::byteArrayToString( const byte * a, char * s, int maxLength )
+int Converter::byteArrayToString( const byte * a, std::string&s, int maxLength )
 {
   int length;
@@ -488,15 +488,16 @@
   if ( length+1 > maxLength )
   {
-    PRINTF(1)("There is not enough space in string (%d) to store %d bytes\n", maxLength, length+1 );
-    strncpy(s,"",maxLength);
+    PRINTF(1)("something went wrong length > remaining bytes in buffer\n" );
+    s = "";
     return -1;
   }
 
-  memcpy( s, a+n, length );
-  s[length] = '\0';
+  s[0] = '\0';
+  s.append( (char*)a+n, length );
 
   return n+length;
 }
 
+#if 0
 /**
  * reads a string out of a byte array and allocates memory for string
@@ -525,5 +526,5 @@
   return n+length;
 }
-
+#endif
 
 
Index: branches/std/src/lib/network/converter.h
===================================================================
--- branches/std/src/lib/network/converter.h	(revision 7226)
+++ branches/std/src/lib/network/converter.h	(revision 7228)
@@ -34,7 +34,7 @@
     static int _byteArrayToInt(const byte* a, int* x);
 
-    static int stringToByteArray(const char* s, byte* a, int length, int maxLength);
-    static int byteArrayToString(const byte* a, char* s, int maxLength);
-    static int byteArrayToStringM(const byte* a, char*& s );
+    static int stringToByteArray(const std::string & s, byte* a, int maxLength);
+    static int byteArrayToString(const byte* a, std::string&s, int maxLength);
+//    static int byteArrayToStringM(const byte* a, char*& s );
 
     //Test
Index: branches/std/src/lib/network/synchronizeable.h
===================================================================
--- branches/std/src/lib/network/synchronizeable.h	(revision 7226)
+++ branches/std/src/lib/network/synchronizeable.h	(revision 7228)
@@ -199,12 +199,7 @@
 }
 #define SYNCHELP_WRITE_STRING(s,n) { SYNCHELP_WRITE_DEBUG(n); \
-                                if (s!=NULL) {\
                                 __synchelp_write_n = \
-                                Converter::stringToByteArray( s, data+__synchelp_write_i, strlen(s), maxLength-__synchelp_write_i ); \
-                                assert( __synchelp_write_n == strlen(s)+INTSIZE ); \
-                                } else {\
-                                __synchelp_write_n = \
-                                Converter::stringToByteArray( "", data+__synchelp_write_i, strlen(""), maxLength-__synchelp_write_i ); \
-                                assert( __synchelp_write_n == strlen("")+INTSIZE ); } \
+                                Converter::stringToByteArray( s, data+__synchelp_write_i, maxLength-__synchelp_write_i ); \
+                                assert( __synchelp_write_n == ((std::string)s).length()+INTSIZE ); \
                                 if ( __synchelp_write_n <= 0) \
 { \
@@ -216,6 +211,16 @@
 #define SYNCHELP_WRITE_N        __synchelp_write_i
 #define SYNCHELP_WRITE_FKT(f,n)   { SYNCHELP_WRITE_DEBUG(n); \
-                                  __synchelp_write_i += \
+                                  PRINTF(0)("calling %s with %d left\n", #f, maxLength - __synchelp_write_i);  \
+                                  byte * spos = data+__synchelp_write_i;  \
+                                  if (maxLength - __synchelp_write_i < INTSIZE) \
+{ \
+                                    PRINTF(1)("Buffer is too small to store more data\n"); \
+                                    return 0; \
+} \
+                                  __synchelp_write_i += INTSIZE; \
+                                  __synchelp_write_n = \
                                   f( data+__synchelp_write_i, maxLength-__synchelp_write_i ); \
+                                  __synchelp_write_i += __synchelp_write_n;  \
+                                  Converter::intToByteArray( __synchelp_write_n, spos, INTSIZE ); \
                                 }
 
@@ -244,7 +249,7 @@
                                     __synchelp_read_i += __synchelp_read_n; \
 }
-#define SYNCHELP_READ_STRING(s,l,n)    {SYNCHELP_READ_DEBUG(n); \
-                                    __synchelp_read_n = Converter::byteArrayToString( data+__synchelp_read_i, s, l );  \
-                                    assert( __synchelp_read_n == strlen(s)+INTSIZE ) ;\
+#define SYNCHELP_READ_STRING(s,n)    {SYNCHELP_READ_DEBUG(n); \
+                                    __synchelp_read_n = Converter::byteArrayToString( data+__synchelp_read_i, s, length-__synchelp_read_i );  \
+                                    assert( __synchelp_read_n == s.length()+INTSIZE ) ;\
                                     if ( __synchelp_read_n <0 )  \
 { \
@@ -254,4 +259,5 @@
                                     __synchelp_read_i += __synchelp_read_n; \
 }
+#if 0 //not needed any more
 #define SYNCHELP_READ_STRINGM(s,n)    { SYNCHELP_READ_DEBUG(n); \
                                     __synchelp_read_n = Converter::byteArrayToStringM( data+__synchelp_read_i, s );  \
@@ -264,4 +270,5 @@
                                     __synchelp_read_i += __synchelp_read_n; \
 }
+#endif
 #define SYNCHELP_READ_BYTE(b,n)      { SYNCHELP_READ_DEBUG(n); \
                                     if ( length-__synchelp_read_i < 1 ) \
@@ -274,6 +281,15 @@
 }
 #define SYNCHELP_READ_FKT(f,n)   { SYNCHELP_READ_DEBUG(n); \
+                                  int s; \
+                                  if ( length-__synchelp_read_i < INTSIZE ) \
+{ \
+                                      PRINTF(1)("There is not enough data to read an int\n");  \
+                                      return 0; \
+} \
+                                    __synchelp_read_n = Converter::byteArrayToInt( data+__synchelp_read_i, &s );  \
+                                    assert( __synchelp_read_n == INTSIZE ); \
+                                    __synchelp_read_i += __synchelp_read_n; \
                                   __synchelp_read_i += \
-                                  f( data+__synchelp_read_i, length-__synchelp_read_i, sender); \
+                                  f( data+__synchelp_read_i, s, sender); \
                                   }
 #define SYNCHELP_READ_REMAINING() ( length-__synchelp_read_i )
Index: branches/std/src/world_entities/skybox.cc
===================================================================
--- branches/std/src/world_entities/skybox.cc	(revision 7226)
+++ branches/std/src/world_entities/skybox.cc	(revision 7228)
@@ -300,6 +300,6 @@
     textureName = "";
   }
-  char* texName;
-  SYNCHELP_READ_STRINGM( texName, NWT_SB_TEXTURENAME );
+  std::string texName;
+  SYNCHELP_READ_STRING( texName, NWT_SB_TEXTURENAME );
 
   this->setSize( size );
@@ -330,5 +330,5 @@
 
     SYNCHELP_WRITE_FLOAT(this->size, NWT_SB_SIZE);
-    SYNCHELP_WRITE_STRING(this->textureName.c_str(), NWT_SB_TEXTURENAME);
+    SYNCHELP_WRITE_STRING(this->textureName, NWT_SB_TEXTURENAME);
 
     return SYNCHELP_WRITE_N;
Index: branches/std/src/world_entities/world_entity.cc
===================================================================
--- branches/std/src/world_entities/world_entity.cc	(revision 7226)
+++ branches/std/src/world_entities/world_entity.cc	(revision 7228)
@@ -519,22 +519,21 @@
 int WorldEntity::writeState( const byte * data, int length, int sender )
 {
-  char* modelFileName;
+  std::string modelFileName;
   SYNCHELP_READ_BEGIN();
 
   SYNCHELP_READ_FKT( PNode::writeState, NWT_WE_PN_WRITESTATE );
 
-  SYNCHELP_READ_STRINGM( modelFileName, NWT_WE_PN_MODELFILENAME );
+  SYNCHELP_READ_STRING( modelFileName, NWT_WE_PN_MODELFILENAME );
   SYNCHELP_READ_FLOAT( scaling, NWT_WE_PN_SCALING );
   //check if modelFileName is relative to datadir or absolute
 
 
-  PRINTF(0)("================ LOADING MODEL %s, %f\n", modelFileName, scaling);
-
-  if ( strcmp(modelFileName, "") )
+  PRINTF(0)("================ LOADING MODEL %s, %f\n", modelFileName.c_str(), scaling);
+
+  if ( modelFileName != "" )
   {
     loadModel( modelFileName, scaling);
     PRINTF(0)("modelfilename: %s\n", getModel( 0 )->getName());
   }
-  delete[] modelFileName;
 
   /*SYNCHELP_READ_STRINGM( modelFileName );
@@ -568,11 +567,11 @@
   SYNCHELP_WRITE_FKT( PNode::readState, NWT_WE_PN_WRITESTATE );
 
-  if ( getModel(0) && getModel(0)->getName() )
-  {
-    char* name = (char*)(getModel( 0 )->getName());
-
-    if (  ResourceManager::getInstance()->getDataDir() == name ) /// FIXME (do not know what to do here.)
-    {
-      name += ResourceManager::getInstance()->getDataDir().size();
+  if ( getModel(0) && getModel(0)->getName() != "" )
+  {
+    std::string name = getModel( 0 )->getName();
+
+    if (  name.find( ResourceManager::getInstance()->getDataDir() ) == 0 ) 
+    {
+      name.erase(ResourceManager::getInstance()->getDataDir().size());
     }
 
