Index: trunk/src/lib/network/converter.cc
===================================================================
--- trunk/src/lib/network/converter.cc	(revision 6737)
+++ trunk/src/lib/network/converter.cc	(revision 6753)
@@ -200,136 +200,4 @@
 
 /*!
- * Converts a float value into a byte-array
- * @param x: The float which is to convert
- * @return: A byte-array which accords the given float
- */
-byte* Converter::floatToByteArray(float x)
-{
-  byte* result = new byte[4];
-  floatToByteArray(x, result, 4);
-  return result;
-  /*
-  int mantisse = 0;
-  int exponent = 128;
-
-  int sgn;
-  if (x < 0)
-  {
-    x = -x;
-    sgn = -1;
-  }
-  else
-    sgn = 1;
-
-  if (x == 0)
-  {
-    exponent = 255;
-    mantisse = 0;
-  }
-  else
-  {
-    //if (x < getDenormConst())
-    //  printf("Denormalisiert!\n");
-    //printf("DenormConst = %e", getDenormConst());
-
-    float sub = 1;
-    while (sub < x)
-    {
-      sub *= 2;
-      exponent++;
-    }
-
-    while (x > 0)
-    {
-      if (x >= sub)
-      {
-        mantisse += 1;
-        x -= sub;
-      }
-
-      mantisse *= 2;
-      exponent--;
-      sub /= 2;
-    }
-    exponent++;
-    mantisse /= 2;
-
-    printf("Conv:        mantisse = %i exponent = %i \n", mantisse, exponent);
-
-
-    if (mantisse != 0)
-    {
-      while (mantisse < expmult)
-      {
-        mantisse *= 2;
-        exponent--;
-      }
-
-      mantisse -= expmult;
-    }
-  }
-
-  printf("Conv: mantisse = %i exponent = %i \n", mantisse, exponent);
-
-
-  int hx = mantisse + expmult * exponent;
-  byte* result = intToByteArray(hx);
-  if (sgn == -1)
-    result[3] += sgnadd;
-
-  return result;
-  */
-}
-
-
-/*!
- * Converts a byte-array into a float value
- * @param a: The byte-array which is to convert
- * @return: A float value which accords the given byte-array
- */
-float Converter::byteArrayToFloat(byte* a)
-{
-  byte* h = new byte[4];
-  float result = 0.0f;
-  byteArrayToFloat(a, &result);
-  return result;
-  /*
-  int hexp = a[2] + a[3] * 256;
-  int exponent = (hexp / 128) % 256;
-
-  int hmant = a[0] + a[1] * 256 + a[2] * 65536;
-  int mantisse = hmant % expmult;
-  if (mantisse == 0 && exponent == 255)
-    return 0;
-
-  mantisse += expmult;
-  exponent -= 128;
-
-
-  int sgn;
-  if (a[3] >= sgnadd)
-    sgn = -1;
-  else
-    sgn = 1;
-
-  printf("ReConv: mantisse = %i exponent = %i \n", mantisse, exponent);
-
-  float emult = 1;
-  if (exponent > 0)
-    for (int i = 0; i < exponent; i++)
-      emult *= 2;
-  else if (exponent < 0)
-    for (int i = 0; i > exponent; i--)
-      emult /= 2;
-
-  float result = mantisse * emult;
-  if (sgn == -1)
-    result = -result;
-
-  return result;
-  */
-}
-
-/*!
  * Converts a float value into a byte-array and stores the result into a given byte-array
  * @param x: The float which is to convert
@@ -338,5 +206,5 @@
  * @return: The number of written bytes
  */
-int Converter::floatToByteArray(float x, byte* a, int length)
+int Converter::_floatToByteArray(float x, byte* a, int length)
 {
   if (length < FLOATSIZE)
@@ -452,5 +320,5 @@
  * @return: The number of read bytes
  */
-int Converter::byteArrayToFloat(const byte* a, float* x)
+int Converter::_byteArrayToFloat(const byte* a, float* x)
 {
     //handle 0
@@ -527,5 +395,5 @@
  * @return: The number of written bytes
  */
-int Converter::_floatToByteArray(float x, byte* a, int length)
+int Converter::floatToByteArray(float x, byte* a, int length)
 {
   if ( length< FLOATSIZE )
@@ -538,5 +406,5 @@
   for (int i = 0; i < 4; i++)
     a[i] = p[i];
-  
+
   return FLOATSIZE;
 }
@@ -549,5 +417,5 @@
  * @return: The number of read bytes
  */
-int Converter::_byteArrayToFloat(const byte* a, float* x)
+int Converter::byteArrayToFloat(const byte* a, float* x)
 {
   *x = *((float*)a);
@@ -651,16 +519,16 @@
   printf("To Convert: %e\n", x);
 
-  byte* res = floatToByteArray(x);
-  for (int i = 0; i < 4; i++)
-    printf("%i ", res[i]);
-  printf("\n");
-
-  float y = byteArrayToFloat(res);
-  printf("ReConvert: %e\n", y);
-
-  if (x == y)
-    printf("equal\n");
-  else
-    printf("different\n");
+//  byte* res = floatToByteArray(x);
+//   for (int i = 0; i < 4; i++)
+//     printf("%i ", res[i]);
+//   printf("\n");
+
+//  float y = byteArrayToFloat(res);
+//   printf("ReConvert: %e\n", y);
+
+//   if (x == y)
+//     printf("equal\n");
+//   else
+//     printf("different\n");
 }
 
@@ -702,6 +570,6 @@
   //floatTest(-0.0f);
   //floatTest(-5.67e-29f);
-  
-  
+
+
   //floatTest(-45.7e-32f);
   //floatTest(45.7e-33f);
Index: trunk/src/lib/network/converter.h
===================================================================
--- trunk/src/lib/network/converter.h	(revision 6737)
+++ trunk/src/lib/network/converter.h	(revision 6753)
@@ -31,7 +31,4 @@
     static int byteArrayToInt(const byte* a, int* x);
 
-    static int floatToByteArray(float x, byte* a, int length);
-    static int byteArrayToFloat(const byte* a, float* x);
-
     static int stringToByteArray(const char* s, byte* a, int length, int maxLength);
     static int byteArrayToString(const byte* a, char* s, int maxLength);
@@ -41,9 +38,13 @@
     static char* floatToBinString(float x);
 
-    static byte* floatToByteArray(float x);
-    static float byteArrayToFloat(byte* a);
+//     static byte* floatToByteArray(float x);
+//     static float byteArrayToFloat(byte* a);
+
+    static int floatToByteArray(float x, byte* a, int length);
+    static int byteArrayToFloat(const byte* a, float* x);
 
     static int _floatToByteArray(float x, byte* a, int length);
     static int _byteArrayToFloat(const byte* a, float* x);
+
 
 
Index: trunk/src/lib/network/handshake.cc
===================================================================
--- trunk/src/lib/network/handshake.cc	(revision 6737)
+++ trunk/src/lib/network/handshake.cc	(revision 6753)
@@ -21,4 +21,6 @@
 
 #include "handshake.h"
+
+#include <cassert>
 
 Handshake::Handshake( bool server, int clientId, int networkGameManagerId )
Index: trunk/src/lib/network/synchronizeable.cc
===================================================================
--- trunk/src/lib/network/synchronizeable.cc	(revision 6737)
+++ trunk/src/lib/network/synchronizeable.cc	(revision 6753)
@@ -23,5 +23,5 @@
 #include "state.h"
 
-#include "assert.h"
+#include <cassert>
 
 #include "synchronizeable.h"
@@ -35,5 +35,5 @@
 {
   this->setClassID(CL_SYNCHRONIZEABLE, "Synchronizeable");
-  this->owner = 0;
+  this->owner = -1;
   this->state = 0;
   this->hostID = SharedNetworkData::getInstance()->getHostID();
Index: trunk/src/lib/network/synchronizeable.h
===================================================================
--- trunk/src/lib/network/synchronizeable.h	(revision 6737)
+++ trunk/src/lib/network/synchronizeable.h	(revision 6753)
@@ -62,4 +62,5 @@
 #define SYNCHELP_WRITE_INT(i) { __synchelp_write_n = \
                                 Converter::intToByteArray( i, data+__synchelp_write_i, maxLength-__synchelp_write_i ); \
+                                assert( __synchelp_write_n == INTSIZE ); \
                                 if ( __synchelp_write_n <= 0) \
 { \
@@ -71,4 +72,5 @@
 #define SYNCHELP_WRITE_FLOAT(f) { __synchelp_write_n = \
                                 Converter::floatToByteArray( f, data+__synchelp_write_i, maxLength-__synchelp_write_i ); \
+                                assert( __synchelp_write_n == FLOATSIZE ); \
                                 if ( __synchelp_write_n <= 0) \
 { \
@@ -87,10 +89,12 @@
                                 __synchelp_write_i++; \
 }
-#define SYNCHELP_WRITE_STRING(s) { if (s!=NULL) \
+#define SYNCHELP_WRITE_STRING(s) { if (s!=NULL) {\
                                 __synchelp_write_n = \
                                 Converter::stringToByteArray( s, data+__synchelp_write_i, strlen(s), maxLength-__synchelp_write_i ); \
-                                else \
+                                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 ); } \
                                 if ( __synchelp_write_n <= 0) \
 { \
@@ -116,5 +120,7 @@
                                       return 0; \
 } \
-                                    __synchelp_read_i += Converter::byteArrayToInt( data+__synchelp_read_i, &i );  \
+                                    __synchelp_read_n = Converter::byteArrayToInt( data+__synchelp_read_i, &i );  \
+                                    assert( __synchelp_read_n == INTSIZE ); \
+                                    __synchelp_read_i += __synchelp_read_n; \
 }
 #define SYNCHELP_READ_FLOAT(f)    { \
@@ -124,8 +130,11 @@
                                       return 0; \
 } \
-                                    __synchelp_read_i += Converter::byteArrayToFloat( data+__synchelp_read_i, &f );  \
+                                    __synchelp_read_n = Converter::byteArrayToFloat( data+__synchelp_read_i, &f );  \
+                                    assert( __synchelp_read_n == FLOATSIZE ) ;\
+                                    __synchelp_read_i += __synchelp_read_n; \
 }
 #define SYNCHELP_READ_STRING(s,l)    { \
                                     __synchelp_read_n = Converter::byteArrayToString( data+__synchelp_read_i, s, l );  \
+                                    assert( __synchelp_read_n == strlen(s)+INTSIZE ) ;\
                                     if ( __synchelp_read_n <0 )  \
 { \
@@ -137,4 +146,5 @@
 #define SYNCHELP_READ_STRINGM(s)    { \
                                     __synchelp_read_n = Converter::byteArrayToStringM( data+__synchelp_read_i, s );  \
+                                    assert( __synchelp_read_n == strlen(s)+INTSIZE ) ;\
                                     if ( __synchelp_read_n <0 )  \
 { \
