Index: /code/branches/network3/bin/levels/sample.oxw
===================================================================
--- /code/branches/network3/bin/levels/sample.oxw	(revision 1169)
+++ /code/branches/network3/bin/levels/sample.oxw	(revision 1170)
@@ -9,14 +9,14 @@
   </audio--> 
 
-<Ambient colourvalue="1,1,1" />
-<Skybox src="Orxonox/StarSkyBox" />
+<!--Ambient colourvalue="1,1,1" />
+<Skybox src="Orxonox/StarSkyBox" /-->
 
 <SpaceShip camera="true" position="0,0,0" scale="10" yawpitchroll="-90,-90,0" mesh="assf3.mesh" maxSpeed="500" maxSideAndBackSpeed="50" maxRotation="1.0" transAcc="200" rotAcc="3.0" transDamp="75" rotDamp="1.0" />
 
-<NPC position="0,100,400" scale="1" mesh="razor.mesh"/>
+<!--NPC position="0,100,400" scale="1" mesh="razor.mesh"/>
 <NPC position="0,100,400" scale="1" mesh="razor.mesh"/>
 <NPC position="0,-100,500" scale="1" mesh="razor.mesh"/>
 <NPC position="0,-200,450" scale="1" mesh="razor.mesh"/>
-<NPC position="100,0,400" scale="1" mesh="razor.mesh"/>
+<NPC position="100,0,400" scale="1" mesh="razor.mesh"/-->
 
 <!--Model name="starship" position="200,0,500" scale="10" mesh="starship.mesh" yawpitchroll="-90,-90,0" />
@@ -31,9 +31,9 @@
 </Model-->
 
-<Model position="-200,1000,500" scale="10" mesh="hoover_body.mesh" yawpitchroll="-90,-90,0" />
+<!--Model position="-200,1000,500" scale="10" mesh="hoover_body.mesh" yawpitchroll="-90,-90,0" />
 <Model position="-200,1000,500" scale="10" mesh="hoover_gear0.mesh" yawpitchroll="-90,-90,0" />
 <Model position="-200,1000,500" scale="10" mesh="hoover_gear1.mesh" yawpitchroll="-90,-90,0" />
 <Model position="-200,1000,500" scale="10" mesh="hoover_gear2.mesh" yawpitchroll="-90,-90,0" />
-<Model position="-200,1000,500" scale="10" mesh="hoover_turbine.mesh" yawpitchroll="-90,-90,0" />
+<Model position="-200,1000,500" scale="10" mesh="hoover_turbine.mesh" yawpitchroll="-90,-90,0" /-->
 
 
@@ -41,5 +41,5 @@
 for i = 1, 226, 1 
 do ?>
-  <Model position="<?lua print(math.random(-19597, 18732))?>, <?lua print(math.random(-19597, 18732)) ?>, <?lua print(math.random(-19597, 18732)) ?>" scale="<?lua print(math.random( 20, 119)) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" rotationAxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationRate="<?lua print(math.random(16, 44)) ?>" />
+  <!--Model position="<?lua print(math.random(-19597, 18732))?>, <?lua print(math.random(-19597, 18732)) ?>, <?lua print(math.random(-19597, 18732)) ?>" scale="<?lua print(math.random( 20, 119)) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" rotationAxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationRate="<?lua print(math.random(16, 44)) ?>" /-->
 <?lua 
 end
Index: /code/branches/network3/src/network/CMakeFiles/CMakeDirectoryInformation.cmake
===================================================================
--- /code/branches/network3/src/network/CMakeFiles/CMakeDirectoryInformation.cmake	(revision 1169)
+++ /code/branches/network3/src/network/CMakeFiles/CMakeDirectoryInformation.cmake	(revision 1170)
@@ -18,5 +18,5 @@
   "src/."
   "src/orxonox"
-  "src/tolua"
+  "src/util/tolua"
   )
 SET(CMAKE_CXX_INCLUDE_PATH ${CMAKE_C_INCLUDE_PATH})
Index: /code/branches/network3/src/network/CMakeFiles/network.dir/DependInfo.cmake
===================================================================
--- /code/branches/network3/src/network/CMakeFiles/network.dir/DependInfo.cmake	(revision 1169)
+++ /code/branches/network3/src/network/CMakeFiles/network.dir/DependInfo.cmake	(revision 1170)
@@ -8,8 +8,8 @@
   "/home/scheusso/orxonox/network/src/network/ClientConnection.cc"
   "/home/scheusso/orxonox/network/src/network/CMakeFiles/network.dir/ClientConnection.o"
+  "/home/scheusso/orxonox/network/src/network/ConnectionManager.cc"
+  "/home/scheusso/orxonox/network/src/network/CMakeFiles/network.dir/ConnectionManager.o"
   "/home/scheusso/orxonox/network/src/network/ClientInformation.cc"
   "/home/scheusso/orxonox/network/src/network/CMakeFiles/network.dir/ClientInformation.o"
-  "/home/scheusso/orxonox/network/src/network/ConnectionManager.cc"
-  "/home/scheusso/orxonox/network/src/network/CMakeFiles/network.dir/ConnectionManager.o"
   "/home/scheusso/orxonox/network/src/network/GameStateManager.cc"
   "/home/scheusso/orxonox/network/src/network/CMakeFiles/network.dir/GameStateManager.o"
Index: /code/branches/network3/src/network/CMakeFiles/network.dir/build.make
===================================================================
--- /code/branches/network3/src/network/CMakeFiles/network.dir/build.make	(revision 1169)
+++ /code/branches/network3/src/network/CMakeFiles/network.dir/build.make	(revision 1170)
@@ -349,5 +349,4 @@
 bin/lib/libnetwork.so: bin/lib/libcore.so
 bin/lib/libnetwork.so: bin/lib/libutil.so
-bin/lib/libnetwork.so: bin/lib/libtolualib.a
 bin/lib/libnetwork.so: /usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib/liblua.so
 bin/lib/libnetwork.so: /usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib/liblualib.so
Index: /code/branches/network3/src/network/CMakeFiles/network.dir/depend.internal
===================================================================
--- /code/branches/network3/src/network/CMakeFiles/network.dir/depend.internal	(revision 1169)
+++ /code/branches/network3/src/network/CMakeFiles/network.dir/depend.internal	(revision 1170)
@@ -280,16 +280,4 @@
  src/./util/Sleep.h
  src/./util/UtilPrereqs.h
- src/orxonox/OrxonoxPlatform.h
-src/network/CMakeFiles/network.dir/ClientInformation.o
- /home/scheusso/orxonox/network/src/network/ClientInformation.cc
- /home/scheusso/orxonox/network/src/network/ClientInformation.h
- /home/scheusso/orxonox/network/src/network/NetworkPrereqs.h
- /usr/pack/enet-2007-sd/include/enet/callbacks.h
- /usr/pack/enet-2007-sd/include/enet/enet.h
- /usr/pack/enet-2007-sd/include/enet/list.h
- /usr/pack/enet-2007-sd/include/enet/protocol.h
- /usr/pack/enet-2007-sd/include/enet/types.h
- /usr/pack/enet-2007-sd/include/enet/unix.h
- /usr/pack/enet-2007-sd/include/enet/win32.h
  src/orxonox/OrxonoxPlatform.h
 src/network/CMakeFiles/network.dir/ConnectionManager.o
@@ -549,4 +537,16 @@
  src/./util/UtilPrereqs.h
  src/orxonox/OrxonoxPlatform.h
+src/network/CMakeFiles/network.dir/ClientInformation.o
+ /home/scheusso/orxonox/network/src/network/ClientInformation.cc
+ /home/scheusso/orxonox/network/src/network/ClientInformation.h
+ /home/scheusso/orxonox/network/src/network/NetworkPrereqs.h
+ /usr/pack/enet-2007-sd/include/enet/callbacks.h
+ /usr/pack/enet-2007-sd/include/enet/enet.h
+ /usr/pack/enet-2007-sd/include/enet/list.h
+ /usr/pack/enet-2007-sd/include/enet/protocol.h
+ /usr/pack/enet-2007-sd/include/enet/types.h
+ /usr/pack/enet-2007-sd/include/enet/unix.h
+ /usr/pack/enet-2007-sd/include/enet/win32.h
+ src/orxonox/OrxonoxPlatform.h
 src/network/CMakeFiles/network.dir/GameStateManager.o
  /home/scheusso/orxonox/network/src/network/ClientInformation.h
Index: /code/branches/network3/src/network/CMakeFiles/network.dir/depend.make
===================================================================
--- /code/branches/network3/src/network/CMakeFiles/network.dir/depend.make	(revision 1169)
+++ /code/branches/network3/src/network/CMakeFiles/network.dir/depend.make	(revision 1170)
@@ -280,16 +280,4 @@
 src/network/CMakeFiles/network.dir/ClientConnection.o: src/./util/UtilPrereqs.h
 src/network/CMakeFiles/network.dir/ClientConnection.o: src/orxonox/OrxonoxPlatform.h
-
-src/network/CMakeFiles/network.dir/ClientInformation.o: src/network/ClientInformation.cc
-src/network/CMakeFiles/network.dir/ClientInformation.o: src/network/ClientInformation.h
-src/network/CMakeFiles/network.dir/ClientInformation.o: src/network/NetworkPrereqs.h
-src/network/CMakeFiles/network.dir/ClientInformation.o: /usr/pack/enet-2007-sd/include/enet/callbacks.h
-src/network/CMakeFiles/network.dir/ClientInformation.o: /usr/pack/enet-2007-sd/include/enet/enet.h
-src/network/CMakeFiles/network.dir/ClientInformation.o: /usr/pack/enet-2007-sd/include/enet/list.h
-src/network/CMakeFiles/network.dir/ClientInformation.o: /usr/pack/enet-2007-sd/include/enet/protocol.h
-src/network/CMakeFiles/network.dir/ClientInformation.o: /usr/pack/enet-2007-sd/include/enet/types.h
-src/network/CMakeFiles/network.dir/ClientInformation.o: /usr/pack/enet-2007-sd/include/enet/unix.h
-src/network/CMakeFiles/network.dir/ClientInformation.o: /usr/pack/enet-2007-sd/include/enet/win32.h
-src/network/CMakeFiles/network.dir/ClientInformation.o: src/orxonox/OrxonoxPlatform.h
 
 src/network/CMakeFiles/network.dir/ConnectionManager.o: src/network/ClientInformation.h
@@ -549,4 +537,16 @@
 src/network/CMakeFiles/network.dir/ConnectionManager.o: src/orxonox/OrxonoxPlatform.h
 
+src/network/CMakeFiles/network.dir/ClientInformation.o: src/network/ClientInformation.cc
+src/network/CMakeFiles/network.dir/ClientInformation.o: src/network/ClientInformation.h
+src/network/CMakeFiles/network.dir/ClientInformation.o: src/network/NetworkPrereqs.h
+src/network/CMakeFiles/network.dir/ClientInformation.o: /usr/pack/enet-2007-sd/include/enet/callbacks.h
+src/network/CMakeFiles/network.dir/ClientInformation.o: /usr/pack/enet-2007-sd/include/enet/enet.h
+src/network/CMakeFiles/network.dir/ClientInformation.o: /usr/pack/enet-2007-sd/include/enet/list.h
+src/network/CMakeFiles/network.dir/ClientInformation.o: /usr/pack/enet-2007-sd/include/enet/protocol.h
+src/network/CMakeFiles/network.dir/ClientInformation.o: /usr/pack/enet-2007-sd/include/enet/types.h
+src/network/CMakeFiles/network.dir/ClientInformation.o: /usr/pack/enet-2007-sd/include/enet/unix.h
+src/network/CMakeFiles/network.dir/ClientInformation.o: /usr/pack/enet-2007-sd/include/enet/win32.h
+src/network/CMakeFiles/network.dir/ClientInformation.o: src/orxonox/OrxonoxPlatform.h
+
 src/network/CMakeFiles/network.dir/GameStateManager.o: src/network/ClientInformation.h
 src/network/CMakeFiles/network.dir/GameStateManager.o: src/network/GameStateManager.cc
Index: /code/branches/network3/src/network/CMakeFiles/network.dir/flags.make
===================================================================
--- /code/branches/network3/src/network/CMakeFiles/network.dir/flags.make	(revision 1169)
+++ /code/branches/network3/src/network/CMakeFiles/network.dir/flags.make	(revision 1170)
@@ -2,4 +2,4 @@
 # Generated by "Unix Makefiles" Generator, CMake Version 2.4
 
-CXX_FLAGS = -Dnetwork_EXPORTS  -O2 -Wall -g -ggdb -fPIC -I/usr/pack/ogre-1.4.5-sd/include -I/usr/pack/ogre-1.4.5-sd/include/OGRE -I/usr/pack/ois-1.0-sd/include/OIS -I/usr/pack/ois-1.0-sd/include -I/usr/pack/enet-2007-sd/include -I/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/include -I/usr/pack/openal-0.0.8-cl/include -I/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0/include -I/usr/pack/lua-5.0.3-sd/include -I/home/scheusso/orxonox/network/src/. -I/home/scheusso/orxonox/network/src/orxonox -I/home/scheusso/orxonox/network/src/tolua  
+CXX_FLAGS = -Dnetwork_EXPORTS  -O2 -Wall -g -ggdb -fPIC -I/usr/pack/ogre-1.4.5-sd/include -I/usr/pack/ogre-1.4.5-sd/include/OGRE -I/usr/pack/ois-1.0-sd/include/OIS -I/usr/pack/ois-1.0-sd/include -I/usr/pack/enet-2007-sd/include -I/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/include -I/usr/pack/openal-0.0.8-cl/include -I/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0/include -I/usr/pack/lua-5.0.3-sd/include -I/home/scheusso/orxonox/network/src/. -I/home/scheusso/orxonox/network/src/orxonox -I/home/scheusso/orxonox/network/src/util/tolua  
 
Index: /code/branches/network3/src/network/CMakeFiles/network.dir/link.txt
===================================================================
--- /code/branches/network3/src/network/CMakeFiles/network.dir/link.txt	(revision 1169)
+++ /code/branches/network3/src/network/CMakeFiles/network.dir/link.txt	(revision 1170)
@@ -1,1 +1,1 @@
-g++-4.1.1  -fPIC  -O2 -Wall -g -ggdb  --no-undefined -shared -Wl,-soname,libnetwork.so -o ../../bin/lib/libnetwork.so "CMakeFiles/network.dir/Client.o" "CMakeFiles/network.dir/ClientConnection.o" "CMakeFiles/network.dir/ClientInformation.o" "CMakeFiles/network.dir/ConnectionManager.o" "CMakeFiles/network.dir/GameStateManager.o" "CMakeFiles/network.dir/GameStateClient.o" "CMakeFiles/network.dir/PacketBuffer.o" "CMakeFiles/network.dir/PacketDecoder.o" "CMakeFiles/network.dir/PacketGenerator.o" "CMakeFiles/network.dir/Server.o" "CMakeFiles/network.dir/Synchronisable.o" -L/usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1/lib -L/usr/pack/ois-1.0-sd/i686-debian-linux3.1/lib -L/usr/pack/enet-2007-sd/i686-debian-linux3.1/lib/libenet.a -L/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/lib -L/home/scheusso/orxonox/network/bin/lib -L/usr/pack/enet-2007-sd/i686-debian-linux3.1/lib -L/usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib -lz -Wl,-Bstatic -lenet -Wl,-Bdynamic -lboost_thread-gcc41-mt -lcore -lutil -lOgreMain -Wl,-Bstatic -ltolualib -Wl,-Bdynamic -llua -llualib -lOIS -Wl,-rpath,/usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1/lib:/usr/pack/ois-1.0-sd/i686-debian-linux3.1/lib:/usr/pack/enet-2007-sd/i686-debian-linux3.1/lib/libenet.a:/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/lib:/home/scheusso/orxonox/network/bin/lib:/usr/pack/enet-2007-sd/i686-debian-linux3.1/lib:/usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib 
+g++-4.1.1  -fPIC  -O2 -Wall -g -ggdb  --no-undefined -shared -Wl,-soname,libnetwork.so -o ../../bin/lib/libnetwork.so "CMakeFiles/network.dir/Client.o" "CMakeFiles/network.dir/ClientConnection.o" "CMakeFiles/network.dir/ClientInformation.o" "CMakeFiles/network.dir/ConnectionManager.o" "CMakeFiles/network.dir/GameStateManager.o" "CMakeFiles/network.dir/GameStateClient.o" "CMakeFiles/network.dir/PacketBuffer.o" "CMakeFiles/network.dir/PacketDecoder.o" "CMakeFiles/network.dir/PacketGenerator.o" "CMakeFiles/network.dir/Server.o" "CMakeFiles/network.dir/Synchronisable.o" -L/usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1/lib -L/usr/pack/ois-1.0-sd/i686-debian-linux3.1/lib -L/usr/pack/enet-2007-sd/i686-debian-linux3.1/lib/libenet.a -L/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/lib -L/home/scheusso/orxonox/network/bin/lib -L/usr/pack/enet-2007-sd/i686-debian-linux3.1/lib -L/usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib -lz -Wl,-Bstatic -lenet -Wl,-Bdynamic -lboost_thread-gcc41-mt -lcore -lOIS -lutil -lOgreMain -llua -llualib -Wl,-rpath,/usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1/lib:/usr/pack/ois-1.0-sd/i686-debian-linux3.1/lib:/usr/pack/enet-2007-sd/i686-debian-linux3.1/lib/libenet.a:/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/lib:/home/scheusso/orxonox/network/bin/lib:/usr/pack/enet-2007-sd/i686-debian-linux3.1/lib:/usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib 
Index: /code/branches/network3/src/network/Synchronisable.cc
===================================================================
--- /code/branches/network3/src/network/Synchronisable.cc	(revision 1169)
+++ /code/branches/network3/src/network/Synchronisable.cc	(revision 1170)
@@ -151,6 +151,4 @@
     for(i=syncList->begin(); n<datasize && i!=syncList->end(); ++i){
       //(std::memcpy(retVal.data+n, (const void*)(&(i->size)), sizeof(int));
-      memcpy( (void *)(retVal.data+n), (const void *)&((*i)->size), sizeof(int) );
-      n+=sizeof(int);
       switch((*i)->type){
       case DATA:
@@ -159,4 +157,6 @@
         break;
       case STRING:
+        memcpy( (void *)(retVal.data+n), (const void *)&((*i)->size), sizeof(int) );
+        n+=sizeof(int);
         std::memcpy( retVal.data+n, (const void*)( ( (std::string *) (*i)->var)->c_str()), (*i)->size);
         n+=(*i)->size;
@@ -182,20 +182,16 @@
     for(i=syncList->begin(); i!=syncList->end(); i++){
       COUT(5) << "Synchronisable: element size: " << (*i)->size << " type: " << (*i)->type << std::endl;
-      if(*(int *)data==(*i)->size || (*i)->type==STRING){
-        switch((*i)->type){
-        case DATA:
-          data+=sizeof(int);
-          memcpy((void*)(*i)->var, data, (*i)->size);
-          data+=(*i)->size;
-          break;
-        case STRING:
-          (*i)->size = *(int *)data;
-          data+=sizeof(int);
-          *((std::string *)((*i)->var)) = std::string((const char*)data);
-          data += (*i)->size;
-          break;
-        }
-      } else
-        return false; //there was some problem with registerVar
+      switch((*i)->type){
+      case DATA:
+        memcpy((void*)(*i)->var, data, (*i)->size);
+        data+=(*i)->size;
+        break;
+      case STRING:
+        (*i)->size = *(int *)data;
+        data+=sizeof(int);
+        *((std::string *)((*i)->var)) = std::string((const char*)data);
+        data += (*i)->size;
+        break;
+      }
     }
     return true;
@@ -212,5 +208,4 @@
       switch((*i)->type){
       case DATA:
-        tsize+=sizeof(int);
         tsize+=(*i)->size;
         break;
