Index: /branches/network/src/lib/coord/p_node.cc
===================================================================
--- /branches/network/src/lib/coord/p_node.cc	(revision 6783)
+++ /branches/network/src/lib/coord/p_node.cc	(revision 6784)
@@ -1077,5 +1077,5 @@
   SYNCHELP_READ_BEGIN();
 
-  SYNCHELP_READ_FKT( BaseObject::writeState );
+  SYNCHELP_READ_FKT( BaseObject::writeState, NWT_PN_BO_WRITESTATE );
 
 //   char * parentName = NULL;
@@ -1094,19 +1094,19 @@
 
   int parentMode;
-  SYNCHELP_READ_INT( parentMode );
+  SYNCHELP_READ_INT( parentMode, NWT_PN_PARENTMODE );
   this->setParentMode((PARENT_MODE)parentMode);
 
   float f1, f2, f3, f4;
 
-  SYNCHELP_READ_FLOAT( f1 );
-  SYNCHELP_READ_FLOAT( f2 );
-  SYNCHELP_READ_FLOAT( f3 );
+  SYNCHELP_READ_FLOAT( f1, NWT_PN_COORX );
+  SYNCHELP_READ_FLOAT( f2, NWT_PN_COORY );
+  SYNCHELP_READ_FLOAT( f3, NWT_PN_COORZ );
   this->setRelCoor( f1, f2, f3 );
 
 
-  SYNCHELP_READ_FLOAT( f1 );
-  SYNCHELP_READ_FLOAT( f2 );
-  SYNCHELP_READ_FLOAT( f3 );
-  SYNCHELP_READ_FLOAT( f4 );
+  SYNCHELP_READ_FLOAT( f1, NWT_PN_ROTV );
+  SYNCHELP_READ_FLOAT( f2, NWT_PN_ROTX );
+  SYNCHELP_READ_FLOAT( f3, NWT_PN_ROTY );
+  SYNCHELP_READ_FLOAT( f4, NWT_PN_ROTZ );
   this->setRelDir( Quaternion( Vector(f2, f3, f4), f1 ) );
 
@@ -1140,5 +1140,5 @@
   SYNCHELP_WRITE_BEGIN();
 
-  SYNCHELP_WRITE_FKT( BaseObject::readState );
+  SYNCHELP_WRITE_FKT( BaseObject::readState, NWT_PN_BO_WRITESTATE );
 
 //   if ( this->parent )
@@ -1151,14 +1151,14 @@
 //   }
 
-  SYNCHELP_WRITE_INT( this->parentMode );
-
-  SYNCHELP_WRITE_FLOAT( this->relCoordinate.x );
-  SYNCHELP_WRITE_FLOAT( this->relCoordinate.y );
-  SYNCHELP_WRITE_FLOAT( this->relCoordinate.z );
-
-  SYNCHELP_WRITE_FLOAT( this->relDirection.w );
-  SYNCHELP_WRITE_FLOAT( this->relDirection.v.x );
-  SYNCHELP_WRITE_FLOAT( this->relDirection.v.y );
-  SYNCHELP_WRITE_FLOAT( this->relDirection.v.z );
+  SYNCHELP_WRITE_INT( this->parentMode, NWT_PN_PARENTMODE );
+
+  SYNCHELP_WRITE_FLOAT( this->relCoordinate.x, NWT_PN_COORX );
+  SYNCHELP_WRITE_FLOAT( this->relCoordinate.y, NWT_PN_COORY );
+  SYNCHELP_WRITE_FLOAT( this->relCoordinate.z, NWT_PN_COORZ );
+
+  SYNCHELP_WRITE_FLOAT( this->relDirection.w, NWT_PN_ROTV );
+  SYNCHELP_WRITE_FLOAT( this->relDirection.v.x, NWT_PN_ROTX );
+  SYNCHELP_WRITE_FLOAT( this->relDirection.v.y, NWT_PN_ROTY );
+  SYNCHELP_WRITE_FLOAT( this->relDirection.v.z, NWT_PN_ROTZ );
 
 //   int n = children.size();
@@ -1209,5 +1209,5 @@
 
   byte flags = 0;
-  SYNCHELP_READ_BYTE( flags );
+  SYNCHELP_READ_BYTE( flags, NWT_PN_FLAGS );
   //PRINTF(0)("%s::FLAGS = %d\n", this->getName(), flags);
 
@@ -1216,7 +1216,7 @@
   if ( flags & __FLAG_COOR )
   {
-    SYNCHELP_READ_FLOAT( f1 );
-    SYNCHELP_READ_FLOAT( f2 );
-    SYNCHELP_READ_FLOAT( f3 );
+    SYNCHELP_READ_FLOAT( f1, NWT_PN_SCOORX );
+    SYNCHELP_READ_FLOAT( f2, NWT_PN_SCOORY );
+    SYNCHELP_READ_FLOAT( f3, NWT_PN_SCOORZ );
     PRINTF(0)("RCVD COOR: %f %f %f\n", f1, f2, f3);
     this->setRelCoor( f1, f2, f3 );
@@ -1225,8 +1225,8 @@
   if ( flags & __FLAG_ROT )
   {
-    SYNCHELP_READ_FLOAT( f1 );
-    SYNCHELP_READ_FLOAT( f2 );
-    SYNCHELP_READ_FLOAT( f3 );
-    SYNCHELP_READ_FLOAT( f4 );
+    SYNCHELP_READ_FLOAT( f1, NWT_PN_SROTV );
+    SYNCHELP_READ_FLOAT( f2, NWT_PN_SROTX );
+    SYNCHELP_READ_FLOAT( f3, NWT_PN_SROTY );
+    SYNCHELP_READ_FLOAT( f4, NWT_PN_SROTZ );
     PRINTF(0)("RCVD QUAT: %f %f %f %f\n", f1, f2, f3, f4);
     //this->setRelDir( Quaternion( Vector(f2, f3, f4), f1 ) );
@@ -1270,5 +1270,5 @@
 
 
-  SYNCHELP_WRITE_BYTE( flags );
+  SYNCHELP_WRITE_BYTE( flags, NWT_PN_FLAGS );
   //PRINTF(0)("FLAGS = %d\n", flags);
 
@@ -1278,7 +1278,7 @@
     PRINTF(0)("SEND COOR: %f %f %f\n", this->relCoordinate.x, this->relCoordinate.y, this->relCoordinate.z);
 
-    SYNCHELP_WRITE_FLOAT( this->relCoordinate.x );
-    SYNCHELP_WRITE_FLOAT( this->relCoordinate.y );
-    SYNCHELP_WRITE_FLOAT( this->relCoordinate.z );
+    SYNCHELP_WRITE_FLOAT( this->relCoordinate.x, NWT_PN_SCOORX );
+    SYNCHELP_WRITE_FLOAT( this->relCoordinate.y, NWT_PN_SCOORY );
+    SYNCHELP_WRITE_FLOAT( this->relCoordinate.z, NWT_PN_SCOORZ );
 
     coorx = relCoordinate.x;
@@ -1292,8 +1292,8 @@
     PRINTF(0)("SEND QUAT: %f %f %f %f\n", this->absDirection.w, this->absDirection.v.x, this->absDirection.v.y, this->absDirection.v.z);
 
-    SYNCHELP_WRITE_FLOAT( this->absDirection.w );
-    SYNCHELP_WRITE_FLOAT( this->absDirection.v.x );
-    SYNCHELP_WRITE_FLOAT( this->absDirection.v.y );
-    SYNCHELP_WRITE_FLOAT( this->absDirection.v.z );
+    SYNCHELP_WRITE_FLOAT( this->absDirection.w, NWT_PN_SROTV );
+    SYNCHELP_WRITE_FLOAT( this->absDirection.v.x, NWT_PN_SROTX );
+    SYNCHELP_WRITE_FLOAT( this->absDirection.v.y, NWT_PN_SROTY );
+    SYNCHELP_WRITE_FLOAT( this->absDirection.v.z, NWT_PN_SROTZ );
 
     rotw = absDirection.w;
Index: /branches/network/src/lib/lang/base_object.cc
===================================================================
--- /branches/network/src/lib/lang/base_object.cc	(revision 6783)
+++ /branches/network/src/lib/lang/base_object.cc	(revision 6784)
@@ -204,5 +204,5 @@
     objectName = NULL;
   }
-  SYNCHELP_READ_STRINGM( this->objectName );
+  SYNCHELP_READ_STRINGM( this->objectName, NWT_BO_NAME );
   if ( this->objectName && !strcmp(this->objectName, "") )
   {
@@ -225,5 +225,5 @@
 
   //PRINTF(0)("objectname = %s\n", this->objectName);
-  SYNCHELP_WRITE_STRING( this->objectName );
+  SYNCHELP_WRITE_STRING( this->objectName, NWT_BO_NAME );
 
   return SYNCHELP_WRITE_N;
Index: /branches/network/src/lib/network/handshake.cc
===================================================================
--- /branches/network/src/lib/network/handshake.cc	(revision 6783)
+++ /branches/network/src/lib/network/handshake.cc	(revision 6784)
@@ -95,16 +95,16 @@
   if ( !isServer() && hasState( HS_RECVD_VER ) && !hasState( HS_RECVD_HID ) )
   {
-    if ( length != INTSIZE+INTSIZE )
-    {
-      PRINTF(0)("hostID packet has wrong size %d instead of %d\n", length, 1);
-      setState( HS_COMPLETED );
-      return 0;
-    }
+    /*if ( length != INTSIZE+INTSIZE )
+    {
+      PRINTF(0)("hostID packet has wrong size %d instead of %d\n", length, INTSIZE+INTSIZE);
+      setState( HS_COMPLETED );
+      return 0;
+  }*/
 
     setState( HS_COMPLETED );
     setState( HS_RECVD_HID );
     this->isOk = true;
-    SYNCHELP_READ_INT( this->newHostId );
-    SYNCHELP_READ_INT( this->newNetworkGameManagerId );
+    SYNCHELP_READ_INT( this->newHostId, NWT_HS_HOST_ID );
+    SYNCHELP_READ_INT( this->newNetworkGameManagerId, NWT_HS_NGM_ID );
 
     if ( newHostId == 0 )
@@ -180,6 +180,6 @@
       isOk = false;
       //memcpy(data, (byte*)0, 4);
-      SYNCHELP_WRITE_INT( 0 );
-      SYNCHELP_WRITE_INT( 0 );
+      SYNCHELP_WRITE_INT( 0, NWT_HS_HOST_ID);
+      SYNCHELP_WRITE_INT( 0, NWT_HS_NGM_ID);
     }
     else
@@ -187,6 +187,6 @@
       isOk = true;
       //memcpy(data, &clientId, 4);
-      SYNCHELP_WRITE_INT( clientId );
-      SYNCHELP_WRITE_INT( networkGameManagerId );
+      SYNCHELP_WRITE_INT( clientId, NWT_HS_HOST_ID );
+      SYNCHELP_WRITE_INT( networkGameManagerId, NWT_HS_NGM_ID );
     }
     *reciever = clientId;
Index: /branches/network/src/lib/network/network_game_manager.cc
===================================================================
--- /branches/network/src/lib/network/network_game_manager.cc	(revision 6783)
+++ /branches/network/src/lib/network/network_game_manager.cc	(revision 6784)
@@ -167,9 +167,8 @@
   if ( !isServer() && !hasRequestedWorld )
   {
-    SYNCHELP_WRITE_BEGIN();
-    byte b = NET_REQUEST_ENTITY_LIST;
-    SYNCHELP_WRITE_BYTE( b );
+    assert( maxLength >= 1 );
+    data[0] = NET_REQUEST_ENTITY_LIST;
     hasRequestedWorld = true;
-    return SYNCHELP_WRITE_N;
+    return 1;
   }
 
Index: /branches/network/src/lib/network/synchronizeable.h
===================================================================
--- /branches/network/src/lib/network/synchronizeable.h	(revision 6783)
+++ /branches/network/src/lib/network/synchronizeable.h	(revision 6784)
@@ -20,4 +20,73 @@
 #define STATE_OUTOFSYNC 2
 #define STATE_REQUESTEDSYNC 4
+
+enum {
+  NWT_SS_WE_STATE = 1000000,
+  NWT_SS_B,
+  NWT_SS_FLAGS,
+  NWT_SS_MOUSEDIRX,
+  NWT_SS_MOUSEDIRY,
+  NWT_SS_MOUSEDIRZ,
+  NWT_SS_MOUSEDIRW,
+  NWT_SS_PN_SYNC,
+  
+  NWT_HS_HOST_ID,
+  NWT_HS_NGM_ID,
+  
+  NWT_PN_BO_WRITESTATE,
+  NWT_PN_PARENTMODE,
+  NWT_PN_COORX,
+  NWT_PN_COORY,
+  NWT_PN_COORZ,
+  NWT_PN_ROTX,
+  NWT_PN_ROTY,
+  NWT_PN_ROTZ,
+  NWT_PN_ROTV,
+  
+  NWT_PN_FLAGS,
+  NWT_PN_SCOORX,
+  NWT_PN_SCOORY,
+  NWT_PN_SCOORZ,
+  NWT_PN_SROTX,
+  NWT_PN_SROTY,
+  NWT_PN_SROTZ,
+  NWT_PN_SROTV,
+  
+  NWT_BO_NAME,
+  
+  NWT_WE_PN_WRITESTATE,
+  NWT_WE_PN_MODELFILENAME,
+  NWT_WE_PN_SCALING,
+  
+  NWT_GT_WE_STATE,
+  
+  NWT_SB_WE_STATE,
+  NWT_SB_SIZE,
+  NWT_SB_TEXTURENAME,
+  
+  NWT_TER_WE_STATE,
+  
+  NWT_PU_WE_STATE,
+  
+  NWT_TPU_WE_STATE,
+  
+  NWT_LPU_WE_STATE,
+  
+  NWT_WPU_WE_STATE,
+  
+  NWT_PPU_WE_STATE,
+  NWT_PPU_TYPE,
+  NWT_PPU_VALUE,
+  NWT_PPU_MINVALUE,
+  NWT_PPU_MAXVALUE,
+
+  NWT_WAT_STATE,
+  NWT_WAT_WE_STATE,
+  NWT_WAT_SIZEX,
+  NWT_WAT_SIZEY,
+  NWT_WAT_RESX,
+  NWT_WAT_RESY,
+  NWT_WAT_HEIGHT
+};
 
 
@@ -58,7 +127,25 @@
  *
  */
+#define SYNCHELP_WRITE_DEBUG(n) {\
+  __synchelp_write_n = Converter::intToByteArray( n, data+__synchelp_write_i, maxLength-__synchelp_write_i ); \
+  assert( __synchelp_write_n == INTSIZE ); \
+  __synchelp_write_i += __synchelp_write_n; \
+}
+
+#define SYNCHELP_READ_DEBUG(n) {  \
+  int nn; \
+  __synchelp_read_n = Converter::byteArrayToInt( data+__synchelp_read_i, &nn );  \
+  assert( __synchelp_read_n == INTSIZE ); \
+  if ( n != nn ) { \
+    PRINTF(1)("Check your code! read/writes not in right order! read %d instead of %d\n", nn, n); \
+    assert( false ); \
+  } \
+  __synchelp_read_i += __synchelp_read_n; \
+}
+
 #define SYNCHELP_WRITE_BEGIN()    int __synchelp_write_i = 0; \
                                   int __synchelp_write_n
-#define SYNCHELP_WRITE_INT(i) { __synchelp_write_n = \
+#define SYNCHELP_WRITE_INT(i,n) { SYNCHELP_WRITE_DEBUG(n); \
+                                __synchelp_write_n = \
                                 Converter::intToByteArray( i, data+__synchelp_write_i, maxLength-__synchelp_write_i ); \
                                 assert( __synchelp_write_n == INTSIZE ); \
@@ -70,5 +157,6 @@
                                 __synchelp_write_i += __synchelp_write_n; \
 }
-#define SYNCHELP_WRITE_FLOAT(f) { __synchelp_write_n = \
+#define SYNCHELP_WRITE_FLOAT(f,n) { SYNCHELP_WRITE_DEBUG(n); \
+                                __synchelp_write_n = \
                                 Converter::floatToByteArray( f, data+__synchelp_write_i, maxLength-__synchelp_write_i ); \
                                 assert( __synchelp_write_n == FLOATSIZE ); \
@@ -80,5 +168,6 @@
                                 __synchelp_write_i += __synchelp_write_n; \
 }
-#define SYNCHELP_WRITE_BYTE(b) { \
+#define SYNCHELP_WRITE_BYTE(b,n) { SYNCHELP_WRITE_DEBUG(n); \
+                                \
                                 if (maxLength - __synchelp_write_i < 1) \
 { \
@@ -89,5 +178,6 @@
                                 __synchelp_write_i++; \
 }
-#define SYNCHELP_WRITE_STRING(s) { if (s!=NULL) {\
+#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 ); \
@@ -105,5 +195,5 @@
 }
 #define SYNCHELP_WRITE_N        __synchelp_write_i
-#define SYNCHELP_WRITE_FKT(f)   { \
+#define SYNCHELP_WRITE_FKT(f,n)   { \
                                   __synchelp_write_i += \
                                   f( data+__synchelp_write_i, maxLength-__synchelp_write_i ); \
@@ -114,5 +204,5 @@
                                   int __synchelp_read_n
 
-#define SYNCHELP_READ_INT(i)       { \
+#define SYNCHELP_READ_INT(i,n)       { SYNCHELP_READ_DEBUG(n); \
                                     if ( length-__synchelp_read_i < INTSIZE ) \
 { \
@@ -124,5 +214,5 @@
                                     __synchelp_read_i += __synchelp_read_n; \
 }
-#define SYNCHELP_READ_FLOAT(f)    { \
+#define SYNCHELP_READ_FLOAT(f,n)    { SYNCHELP_READ_DEBUG(n); \
                                     if ( length-__synchelp_read_i < FLOATSIZE ) \
 { \
@@ -134,5 +224,5 @@
                                     __synchelp_read_i += __synchelp_read_n; \
 }
-#define SYNCHELP_READ_STRING(s,l)    { \
+#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 ) ;\
@@ -144,5 +234,5 @@
                                     __synchelp_read_i += __synchelp_read_n; \
 }
-#define SYNCHELP_READ_STRINGM(s)    { \
+#define SYNCHELP_READ_STRINGM(s,n)    { SYNCHELP_READ_DEBUG(n); \
                                     __synchelp_read_n = Converter::byteArrayToStringM( data+__synchelp_read_i, s );  \
                                     assert( __synchelp_read_n == strlen(s)+INTSIZE ) ;\
@@ -154,5 +244,5 @@
                                     __synchelp_read_i += __synchelp_read_n; \
 }
-#define SYNCHELP_READ_BYTE(b)      { \
+#define SYNCHELP_READ_BYTE(b,n)      { SYNCHELP_READ_DEBUG(n); \
                                     if ( length-__synchelp_read_i < 1 ) \
 { \
@@ -163,8 +253,10 @@
                                     __synchelp_read_i ++;  \
 }
-#define SYNCHELP_READ_FKT(f)   { \
+#define SYNCHELP_READ_FKT(f,n)   { SYNCHELP_READ_DEBUG(n); \
                                   __synchelp_read_i += \
                                   f( data+__synchelp_read_i, length-__synchelp_read_i, sender); \
                                   }
+#define SYNCHELP_READ_REMAINING() ( length-__synchelp_read_i )
+#define SYNCHELP_READ_NEXTBYTE() ( data[__synchelp_read_i] )
 #define SYNCHELP_READ_N           __synchelp_read_i
 
Index: /branches/network/src/world_entities/environments/water.cc
===================================================================
--- /branches/network/src/world_entities/environments/water.cc	(revision 6783)
+++ /branches/network/src/world_entities/environments/water.cc	(revision 6784)
@@ -298,5 +298,5 @@
   SYNCHELP_READ_BEGIN();
 
-  SYNCHELP_READ_FKT( Water::writeState );
+  SYNCHELP_READ_FKT( Water::writeState, NWT_WAT_STATE );
 
   return SYNCHELP_READ_N;
@@ -324,5 +324,5 @@
   {
     *reciever = rec;
-    SYNCHELP_WRITE_FKT( Water::readState );
+    SYNCHELP_WRITE_FKT( Water::readState, NWT_WAT_STATE );
   }
 
@@ -343,16 +343,16 @@
   SYNCHELP_WRITE_BEGIN();
 
-  SYNCHELP_WRITE_FKT( WorldEntity::readState );
+  SYNCHELP_WRITE_FKT( WorldEntity::readState, NWT_WAT_WE_STATE );
 
   // sync the size
-  SYNCHELP_WRITE_FLOAT( this->sizeX );
-  SYNCHELP_WRITE_FLOAT( this->sizeY );
+  SYNCHELP_WRITE_FLOAT( this->sizeX, NWT_WAT_SIZEX );
+  SYNCHELP_WRITE_FLOAT( this->sizeY, NWT_WAT_SIZEY );
 
   //sync resolution
-  SYNCHELP_WRITE_INT( this->resX );
-  SYNCHELP_WRITE_INT( this->resY );
+  SYNCHELP_WRITE_INT( this->resX, NWT_WAT_RESX );
+  SYNCHELP_WRITE_INT( this->resY, NWT_WAT_RESY );
 
   //sync the height
-  SYNCHELP_WRITE_FLOAT( this->height );
+  SYNCHELP_WRITE_FLOAT( this->height, NWT_WAT_HEIGHT );
 
   return SYNCHELP_WRITE_N;
@@ -370,5 +370,5 @@
   SYNCHELP_READ_BEGIN();
 
-  SYNCHELP_READ_FKT( WorldEntity::writeState );
+  SYNCHELP_READ_FKT( WorldEntity::writeState, NWT_WAT_WE_STATE );
 
   float f1, f2;
@@ -376,6 +376,6 @@
 
   //read the size
-  SYNCHELP_READ_FLOAT( f1 );
-  SYNCHELP_READ_FLOAT( f2 );
+  SYNCHELP_READ_FLOAT( f1, NWT_WAT_SIZEX );
+  SYNCHELP_READ_FLOAT( f2, NWT_WAT_SIZEY );
   this->sizeX = f1;
   this->sizeY = f2;
@@ -383,6 +383,6 @@
 
   //read the resolution
-  SYNCHELP_READ_INT( i1 );
-  SYNCHELP_READ_INT( i2 );
+  SYNCHELP_READ_INT( i1, NWT_WAT_RESX );
+  SYNCHELP_READ_INT( i2, NWT_WAT_RESY );
   this->resX = i1;
   this->resY = i2;
@@ -390,5 +390,5 @@
 
   //read the height
-  SYNCHELP_READ_FLOAT( f1 );
+  SYNCHELP_READ_FLOAT( f1, NWT_WAT_HEIGHT );
   this->height = f1;
 
Index: /branches/network/src/world_entities/npcs/ground_turret.cc
===================================================================
--- /branches/network/src/world_entities/npcs/ground_turret.cc	(revision 6783)
+++ /branches/network/src/world_entities/npcs/ground_turret.cc	(revision 6784)
@@ -181,5 +181,5 @@
   SYNCHELP_READ_BEGIN();
 
-  SYNCHELP_READ_FKT( WorldEntity::writeState );
+  SYNCHELP_READ_FKT( WorldEntity::writeState, NWT_GT_WE_STATE );
 
   return SYNCHELP_READ_N;
@@ -207,5 +207,5 @@
     *reciever = rec;
 
-    SYNCHELP_WRITE_FKT( WorldEntity::readState );
+    SYNCHELP_WRITE_FKT( WorldEntity::readState, NWT_GT_WE_STATE );
 
   }
Index: /branches/network/src/world_entities/power_ups/laser_power_up.cc
===================================================================
--- /branches/network/src/world_entities/power_ups/laser_power_up.cc	(revision 6783)
+++ /branches/network/src/world_entities/power_ups/laser_power_up.cc	(revision 6784)
@@ -126,5 +126,5 @@
   SYNCHELP_READ_BEGIN();
 
-  SYNCHELP_READ_FKT( PowerUp::writeState );
+  SYNCHELP_READ_FKT( PowerUp::writeState, NWT_LPU_WE_STATE );
 
   return SYNCHELP_READ_N;
@@ -148,5 +148,5 @@
     SYNCHELP_WRITE_BEGIN();
 
-    SYNCHELP_WRITE_FKT( PowerUp::readState );
+    SYNCHELP_WRITE_FKT( PowerUp::readState, NWT_LPU_WE_STATE );
 
     return SYNCHELP_WRITE_N;
Index: /branches/network/src/world_entities/power_ups/param_power_up.cc
===================================================================
--- /branches/network/src/world_entities/power_ups/param_power_up.cc	(revision 6783)
+++ /branches/network/src/world_entities/power_ups/param_power_up.cc	(revision 6784)
@@ -131,15 +131,15 @@
   SYNCHELP_READ_BEGIN();
 
-  SYNCHELP_READ_FKT( PowerUp::writeState );
+  SYNCHELP_READ_FKT( PowerUp::writeState, NWT_PPU_WE_STATE );
 
   int i;
-  SYNCHELP_READ_INT( i );
+  SYNCHELP_READ_INT( i, NWT_PPU_TYPE );
   this->type = (EnumParamPowerUpType)i;
-  SYNCHELP_READ_FLOAT( this->value );
+  SYNCHELP_READ_FLOAT( this->value, NWT_PPU_VALUE );
 
   if ( this->value != 0 )
   {
-    SYNCHELP_READ_FLOAT( this->min_value );
-    SYNCHELP_READ_FLOAT( this->max_value );
+    SYNCHELP_READ_FLOAT( this->min_value, NWT_PPU_MINVALUE );
+    SYNCHELP_READ_FLOAT( this->max_value, NWT_PPU_MAXVALUE );
     respawn();
   }
@@ -165,14 +165,14 @@
     SYNCHELP_WRITE_BEGIN();
 
-    SYNCHELP_WRITE_FKT( PowerUp::readState );
+    SYNCHELP_WRITE_FKT( PowerUp::readState, NWT_PPU_WE_STATE );
 
     int i = (int)this->type;
-    SYNCHELP_WRITE_INT( i );
-    SYNCHELP_WRITE_FLOAT( this->value );
+    SYNCHELP_WRITE_INT( i, NWT_PPU_TYPE );
+    SYNCHELP_WRITE_FLOAT( this->value, NWT_PPU_VALUE );
 
     if ( this->value != 0 )
     {
-      SYNCHELP_WRITE_FLOAT( this->min_value );
-      SYNCHELP_WRITE_FLOAT( this->max_value );
+      SYNCHELP_WRITE_FLOAT( this->min_value, NWT_PPU_MINVALUE );
+      SYNCHELP_WRITE_FLOAT( this->max_value, NWT_PPU_MAXVALUE );
     }
 
Index: /branches/network/src/world_entities/power_ups/power_up.cc
===================================================================
--- /branches/network/src/world_entities/power_ups/power_up.cc	(revision 6783)
+++ /branches/network/src/world_entities/power_ups/power_up.cc	(revision 6784)
@@ -124,5 +124,5 @@
 {
   SYNCHELP_WRITE_BEGIN();
-  SYNCHELP_WRITE_FKT( WorldEntity::readState );
+  SYNCHELP_WRITE_FKT( WorldEntity::readState, NWT_PU_WE_STATE );
   return SYNCHELP_WRITE_N;
 }
@@ -138,5 +138,5 @@
 {
   SYNCHELP_READ_BEGIN();
-  SYNCHELP_READ_FKT( WorldEntity::writeState );
+  SYNCHELP_READ_FKT( WorldEntity::writeState, NWT_PU_WE_STATE );
   return SYNCHELP_READ_N;
 }
Index: /branches/network/src/world_entities/power_ups/turret_power_up.cc
===================================================================
--- /branches/network/src/world_entities/power_ups/turret_power_up.cc	(revision 6783)
+++ /branches/network/src/world_entities/power_ups/turret_power_up.cc	(revision 6784)
@@ -135,5 +135,5 @@
   SYNCHELP_READ_BEGIN();
 
-  SYNCHELP_READ_FKT( PowerUp::writeState );
+  SYNCHELP_READ_FKT( PowerUp::writeState, NWT_TPU_WE_STATE );
 
   return SYNCHELP_READ_N;
@@ -156,5 +156,5 @@
     SYNCHELP_WRITE_BEGIN();
 
-    SYNCHELP_WRITE_FKT( PowerUp::readState );
+    SYNCHELP_WRITE_FKT( PowerUp::readState, NWT_TPU_WE_STATE );
 
     return SYNCHELP_WRITE_N;
Index: /branches/network/src/world_entities/power_ups/weapon_power_up.cc
===================================================================
--- /branches/network/src/world_entities/power_ups/weapon_power_up.cc	(revision 6783)
+++ /branches/network/src/world_entities/power_ups/weapon_power_up.cc	(revision 6784)
@@ -100,5 +100,5 @@
   SYNCHELP_READ_BEGIN();
 
-  SYNCHELP_READ_FKT( PowerUp::writeState );
+  SYNCHELP_READ_FKT( PowerUp::writeState, NWT_WPU_WE_STATE );
 
   //TODO: sync weapon class ( see loadParams )
@@ -124,5 +124,5 @@
     SYNCHELP_WRITE_BEGIN();
 
-    SYNCHELP_WRITE_FKT( PowerUp::readState );
+    SYNCHELP_WRITE_FKT( PowerUp::readState, NWT_WPU_WE_STATE );
 
     //TODO: sync weapon class ( see loadParams )
Index: /branches/network/src/world_entities/skybox.cc
===================================================================
--- /branches/network/src/world_entities/skybox.cc	(revision 6783)
+++ /branches/network/src/world_entities/skybox.cc	(revision 6784)
@@ -297,7 +297,7 @@
   SYNCHELP_READ_BEGIN();
 
-  SYNCHELP_READ_FKT( WorldEntity::writeState );
-
-  SYNCHELP_READ_FLOAT( size );
+  SYNCHELP_READ_FKT( WorldEntity::writeState, NWT_SB_WE_STATE );
+
+  SYNCHELP_READ_FLOAT( size, NWT_SB_SIZE );
   if ( textureName )
   {
@@ -305,5 +305,5 @@
     textureName = NULL;
   }
-  SYNCHELP_READ_STRINGM( textureName );
+  SYNCHELP_READ_STRINGM( textureName, NWT_SB_TEXTURENAME );
 
   this->setSize( size );
@@ -331,8 +331,8 @@
     SYNCHELP_WRITE_BEGIN();
 
-    SYNCHELP_WRITE_FKT( WorldEntity::readState );
-
-    SYNCHELP_WRITE_FLOAT(this->size);
-    SYNCHELP_WRITE_STRING(this->textureName);
+    SYNCHELP_WRITE_FKT( WorldEntity::readState, NWT_SB_WE_STATE );
+
+    SYNCHELP_WRITE_FLOAT(this->size, NWT_SB_SIZE);
+    SYNCHELP_WRITE_STRING(this->textureName, NWT_SB_TEXTURENAME);
 
     return SYNCHELP_WRITE_N;
Index: /branches/network/src/world_entities/space_ships/space_ship.cc
===================================================================
--- /branches/network/src/world_entities/space_ships/space_ship.cc	(revision 6783)
+++ /branches/network/src/world_entities/space_ships/space_ship.cc	(revision 6784)
@@ -557,20 +557,22 @@
 
   byte b;
-
-  do
-  {
-    SYNCHELP_READ_BYTE( b );
-
-    if ( b == DATA_state /*&& (this->getHostID()!=this->getOwner() || sender==0)*/ )
-    {
-     PRINTF(0)("GOT STATE %d\n", this->getUniqueID());
-     setRequestedSync( false );
-     setIsOutOfSync( false );
-     SYNCHELP_READ_FKT( WorldEntity::writeState );
+  
+  if ( SYNCHELP_READ_REMAINING()>0 && SYNCHELP_READ_NEXTBYTE() == DATA_state /*&& (this->getHostID()!=this->getOwner() || sender==0)*/ )
+  {
+    PRINTF(0)("GOT STATE %d\n", this->getUniqueID());
+    setRequestedSync( false );
+    setIsOutOfSync( false );
+    SYNCHELP_READ_FKT( WorldEntity::writeState, NWT_SS_WE_STATE );
      //SYNCHELP_READ_FLOAT( cycle );
 
-      return SYNCHELP_READ_N;
-    }
-
+    return SYNCHELP_READ_N;
+  }
+  
+  if ( this->getOwner() != this->getHostID() )
+    SYNCHELP_READ_FKT( PNode::writeSync, NWT_SS_PN_SYNC );
+
+  while ( SYNCHELP_READ_REMAINING()>0 )
+  {
+    SYNCHELP_READ_BYTE( b, NWT_SS_B );
 
     //TODO: do not recieve data if you are the owner
@@ -578,5 +580,5 @@
     {
       int flags = 0;
-      SYNCHELP_READ_INT( flags );
+      SYNCHELP_READ_INT( flags, NWT_SS_FLAGS );
 
       bUp = (flags & MASK_bUp) != 0;
@@ -595,10 +597,10 @@
     if ( b == DATA_mouse /*&& this->getHostID()!=this->getOwner()*/ )
     {
-      SYNCHELP_READ_FLOAT( mouseDir.w );
-      SYNCHELP_READ_FLOAT( mouseDir.v.x );
-      SYNCHELP_READ_FLOAT( mouseDir.v.y );
-      SYNCHELP_READ_FLOAT( mouseDir.v.z );
+      SYNCHELP_READ_FLOAT( mouseDir.w, NWT_SS_MOUSEDIRW );
+      SYNCHELP_READ_FLOAT( mouseDir.v.x, NWT_SS_MOUSEDIRX );
+      SYNCHELP_READ_FLOAT( mouseDir.v.y, NWT_SS_MOUSEDIRY );
+      SYNCHELP_READ_FLOAT( mouseDir.v.z, NWT_SS_MOUSEDIRZ );
     }
-  } while( b != 0 );
+  };
 
   /*if ( b == DATA_mouse && this->getHostID()!=this->getOwner() )
@@ -610,7 +612,4 @@
 }*/
 
-  if ( this->getOwner() != this->getHostID() )
-    SYNCHELP_READ_FKT( PNode::writeSync );
-
   return SYNCHELP_READ_N;
 }
@@ -636,7 +635,7 @@
     PRINTF(0)("SEND STATE %d %d\n", this->getUniqueID(), rec);
 
-    SYNCHELP_WRITE_BYTE( (byte)DATA_state );
-
-    SYNCHELP_WRITE_FKT( WorldEntity::readState );
+    SYNCHELP_WRITE_BYTE( (byte)DATA_state, NWT_SS_B );
+
+    SYNCHELP_WRITE_FKT( WorldEntity::readState, NWT_SS_WE_STATE );
     //SYNCHELP_WRITE_FLOAT( cycle );
 
@@ -645,4 +644,7 @@
 
   *reciever = 0;
+  
+  if ( this->getOwner() == this->getHostID() )
+    SYNCHELP_WRITE_FKT( PNode::readSync, NWT_SS_PN_SYNC );
 
   if ( this->getHostID()==this->getOwner() )
@@ -674,6 +676,6 @@
     {
       oldMask = mask;
-      SYNCHELP_WRITE_BYTE( DATA_flags );
-      SYNCHELP_WRITE_INT( mask );
+      SYNCHELP_WRITE_BYTE( DATA_flags, NWT_SS_B );
+      SYNCHELP_WRITE_INT( mask, NWT_SS_FLAGS );
     }
 #define __OFFSET_ROT 0.05
@@ -685,19 +687,41 @@
       oldMouseDir = mouseDir;
 
-      SYNCHELP_WRITE_BYTE( DATA_mouse );
-      SYNCHELP_WRITE_FLOAT( mouseDir.w );
-      SYNCHELP_WRITE_FLOAT( mouseDir.v.x );
-      SYNCHELP_WRITE_FLOAT( mouseDir.v.y );
-      SYNCHELP_WRITE_FLOAT( mouseDir.v.z );
+      SYNCHELP_WRITE_BYTE( DATA_mouse, NWT_SS_B );
+      SYNCHELP_WRITE_FLOAT( mouseDir.w, NWT_SS_MOUSEDIRW );
+      SYNCHELP_WRITE_FLOAT( mouseDir.v.x, NWT_SS_MOUSEDIRX );
+      SYNCHELP_WRITE_FLOAT( mouseDir.v.y, NWT_SS_MOUSEDIRY );
+      SYNCHELP_WRITE_FLOAT( mouseDir.v.z, NWT_SS_MOUSEDIRZ );
     }
 
   }
 
-  SYNCHELP_WRITE_BYTE( 0 );
-
-
-  if ( this->getOwner() == this->getHostID() )
-    SYNCHELP_WRITE_FKT( PNode::readSync );
-
   return SYNCHELP_WRITE_N;
 }
+
+int SpaceShip::writeState(const byte* data, int length, int sender)
+{
+  SYNCHELP_READ_BEGIN();
+  
+  return SYNCHELP_READ_N;
+}
+
+int SpaceShip::readState(byte* data, int maxLength )
+{
+  SYNCHELP_WRITE_BEGIN();
+  
+  return SYNCHELP_WRITE_N;
+}
+
+int SpaceShip::writeSync(const byte* data, int length, int sender)
+{
+  SYNCHELP_READ_BEGIN();
+  
+  return SYNCHELP_READ_N;
+}
+
+int SpaceShip::readSync(byte* data, int maxLength )
+{
+  SYNCHELP_WRITE_BEGIN();
+  
+  return SYNCHELP_WRITE_N;
+}
Index: /branches/network/src/world_entities/space_ships/space_ship.h
===================================================================
--- /branches/network/src/world_entities/space_ships/space_ship.h	(revision 6783)
+++ /branches/network/src/world_entities/space_ships/space_ship.h	(revision 6784)
@@ -44,4 +44,9 @@
     virtual int       writeBytes(const byte* data, int length, int sender);
     virtual int       readBytes(byte* data, int maxLength, int * reciever);
+    
+    int       writeState(const byte* data, int length, int sender);
+    int       readState(byte* data, int maxLength );
+    int       writeSync(const byte* data, int length, int sender);
+    int       readSync(byte* data, int maxLength );
 
 
Index: /branches/network/src/world_entities/terrain.cc
===================================================================
--- /branches/network/src/world_entities/terrain.cc	(revision 6783)
+++ /branches/network/src/world_entities/terrain.cc	(revision 6784)
@@ -326,5 +326,5 @@
 
   SYNCHELP_READ_BEGIN();
-  SYNCHELP_READ_FKT( WorldEntity::writeState );
+  SYNCHELP_READ_FKT( WorldEntity::writeState, NWT_TER_WE_STATE );
 
   return SYNCHELP_READ_N;
@@ -344,5 +344,7 @@
     *reciever = rec;
 
-    return WorldEntity::readState( data, maxLength );
+    SYNCHELP_WRITE_BEGIN();
+    SYNCHELP_WRITE_FKT( WorldEntity::readState, NWT_TER_WE_STATE );
+    return SYNCHELP_WRITE_N;
 
   }
Index: /branches/network/src/world_entities/world_entity.cc
===================================================================
--- /branches/network/src/world_entities/world_entity.cc	(revision 6783)
+++ /branches/network/src/world_entities/world_entity.cc	(revision 6784)
@@ -518,8 +518,8 @@
   SYNCHELP_READ_BEGIN();
 
-  SYNCHELP_READ_FKT( PNode::writeState );
-
-  SYNCHELP_READ_STRINGM( modelFileName );
-  SYNCHELP_READ_FLOAT( scaling );
+  SYNCHELP_READ_FKT( PNode::writeState, NWT_WE_PN_WRITESTATE );
+
+  SYNCHELP_READ_STRINGM( modelFileName, NWT_WE_PN_MODELFILENAME );
+  SYNCHELP_READ_FLOAT( scaling, NWT_WE_PN_SCALING );
   //check if modelFileName is relative to datadir or absolute
 
@@ -562,5 +562,5 @@
   SYNCHELP_WRITE_BEGIN();
 
-  SYNCHELP_WRITE_FKT( PNode::readState );
+  SYNCHELP_WRITE_FKT( PNode::readState, NWT_WE_PN_WRITESTATE );
 
   if ( getModel(0) && getModel(0)->getName() )
@@ -573,12 +573,12 @@
     }
 
-    SYNCHELP_WRITE_STRING( name );
+    SYNCHELP_WRITE_STRING( name, NWT_WE_PN_MODELFILENAME );
   }
   else
   {
-    SYNCHELP_WRITE_STRING("");
-  }
-
-  SYNCHELP_WRITE_FLOAT( scaling );
+    SYNCHELP_WRITE_STRING("", NWT_WE_PN_MODELFILENAME);
+  }
+
+  SYNCHELP_WRITE_FLOAT( scaling, NWT_WE_PN_SCALING );
   /*if ( this->md2TextureFileName!=NULL && strcmp(this->md2TextureFileName, "") )
   {
