Index: /code/branches/network/CMakeLists.txt
===================================================================
--- /code/branches/network/CMakeLists.txt	(revision 313)
+++ /code/branches/network/CMakeLists.txt	(revision 314)
@@ -37,4 +37,7 @@
 #This sets where to look for "Find*.cmake" files
 SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+SET(BOOST_LIBDIR /usr/pack/boost-1.33.1-mo/i686-debian-linux3.1/lib/)
+SET(BOOST_INCDIR /usr/pack/boost-1.33.1-mo/i686-debian-linux3.1/include/)
+
 #Performs the search and sets the variables
 FIND_PACKAGE(OGRE)
@@ -42,7 +45,7 @@
 
 #Sets the search paths for the linking
-LINK_DIRECTORIES(${OGRE_LIB_DIR} ${OIS_LIB_DIR})
+LINK_DIRECTORIES(${OGRE_LIB_DIR} ${OIS_LIB_DIR} ${BOOST_LIBDIR})
 #Sets the search path for include files
-INCLUDE_DIRECTORIES(${OGRE_INCLUDE_DIR} ${OIS_INCLUDE_DIR})
+INCLUDE_DIRECTORIES(${OGRE_INCLUDE_DIR} ${OIS_INCLUDE_DIR} ${BOOST_INCDIR})
 
 #add main source dir
Index: /code/branches/network/Ogre.log
===================================================================
--- /code/branches/network/Ogre.log	(revision 313)
+++ /code/branches/network/Ogre.log	(revision 314)
@@ -1,38 +1,38 @@
-14:39:58: Creating resource group General
-14:39:58: Creating resource group Internal
-14:39:58: Creating resource group Autodetect
-14:39:58: SceneManagerFactory for type 'DefaultSceneManager' registered.
-14:39:58: Registering ResourceManager for type Material
-14:39:58: Registering ResourceManager for type Mesh
-14:39:58: Registering ResourceManager for type Skeleton
-14:39:58: MovableObjectFactory for type 'ParticleSystem' registered.
-14:39:58: OverlayElementFactory for type Panel registered.
-14:39:58: OverlayElementFactory for type BorderPanel registered.
-14:39:58: OverlayElementFactory for type TextArea registered.
-14:39:58: Registering ResourceManager for type Font
-14:39:58: ArchiveFactory for archive type FileSystem registered.
-14:39:58: ArchiveFactory for archive type Zip registered.
-14:39:58: FreeImage version: 3.9.3
-14:39:58: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
-14:39:58: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi
-14:39:58: DDS codec registering
-14:39:58: Registering ResourceManager for type HighLevelGpuProgram
-14:39:58: Registering ResourceManager for type Compositor
-14:39:58: MovableObjectFactory for type 'Entity' registered.
-14:39:58: MovableObjectFactory for type 'Light' registered.
-14:39:58: MovableObjectFactory for type 'BillboardSet' registered.
-14:39:58: MovableObjectFactory for type 'ManualObject' registered.
-14:39:58: MovableObjectFactory for type 'BillboardChain' registered.
-14:39:58: MovableObjectFactory for type 'RibbonTrail' registered.
-14:39:58: OGRE EXCEPTION(6:FileNotFoundException): 'plugins.cfg' file not found! in ConfigFile::load at OgreConfigFile.cpp (line 84)
-14:39:58: plugins.cfg not found, automatic plugin loading disabled.
-14:39:58: *-*-* OGRE Initialising
-14:39:58: *-*-* Version 1.4.5 (Eihort)
-14:39:58: OGRE EXCEPTION(6:FileNotFoundException): 'resources.cfg' file not found! in ConfigFile::load at OgreConfigFile.cpp (line 84)
-14:39:58: *-*-* OGRE Shutdown
-14:39:58: Unregistering ResourceManager for type Compositor
-14:39:58: Unregistering ResourceManager for type Font
-14:39:58: Unregistering ResourceManager for type Skeleton
-14:39:58: Unregistering ResourceManager for type Mesh
-14:39:58: Unregistering ResourceManager for type HighLevelGpuProgram
-14:39:58: Unregistering ResourceManager for type Material
+15:20:52: Creating resource group General
+15:20:52: Creating resource group Internal
+15:20:52: Creating resource group Autodetect
+15:20:52: SceneManagerFactory for type 'DefaultSceneManager' registered.
+15:20:52: Registering ResourceManager for type Material
+15:20:52: Registering ResourceManager for type Mesh
+15:20:52: Registering ResourceManager for type Skeleton
+15:20:52: MovableObjectFactory for type 'ParticleSystem' registered.
+15:20:52: OverlayElementFactory for type Panel registered.
+15:20:52: OverlayElementFactory for type BorderPanel registered.
+15:20:52: OverlayElementFactory for type TextArea registered.
+15:20:52: Registering ResourceManager for type Font
+15:20:52: ArchiveFactory for archive type FileSystem registered.
+15:20:52: ArchiveFactory for archive type Zip registered.
+15:20:52: FreeImage version: 3.9.3
+15:20:52: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
+15:20:52: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi
+15:20:52: DDS codec registering
+15:20:52: Registering ResourceManager for type HighLevelGpuProgram
+15:20:52: Registering ResourceManager for type Compositor
+15:20:52: MovableObjectFactory for type 'Entity' registered.
+15:20:52: MovableObjectFactory for type 'Light' registered.
+15:20:52: MovableObjectFactory for type 'BillboardSet' registered.
+15:20:52: MovableObjectFactory for type 'ManualObject' registered.
+15:20:52: MovableObjectFactory for type 'BillboardChain' registered.
+15:20:52: MovableObjectFactory for type 'RibbonTrail' registered.
+15:20:52: OGRE EXCEPTION(6:FileNotFoundException): 'plugins.cfg' file not found! in ConfigFile::load at OgreConfigFile.cpp (line 84)
+15:20:52: plugins.cfg not found, automatic plugin loading disabled.
+15:20:52: *-*-* OGRE Initialising
+15:20:52: *-*-* Version 1.4.5 (Eihort)
+15:20:52: OGRE EXCEPTION(6:FileNotFoundException): 'resources.cfg' file not found! in ConfigFile::load at OgreConfigFile.cpp (line 84)
+15:20:52: *-*-* OGRE Shutdown
+15:20:52: Unregistering ResourceManager for type Compositor
+15:20:52: Unregistering ResourceManager for type Font
+15:20:52: Unregistering ResourceManager for type Skeleton
+15:20:52: Unregistering ResourceManager for type Mesh
+15:20:52: Unregistering ResourceManager for type HighLevelGpuProgram
+15:20:52: Unregistering ResourceManager for type Material
Index: /code/branches/network/src/network/GameStateManager.cc
===================================================================
--- /code/branches/network/src/network/GameStateManager.cc	(revision 313)
+++ /code/branches/network/src/network/GameStateManager.cc	(revision 314)
@@ -22,13 +22,85 @@
 }
 
-GameState GameStateManager::getSnapshot()
+/**
+ * This function goes through the whole list of synchronisables and 
+ * saves all the synchronisables to a flat "list".
+ * @return struct of type gamestate containing the size of the whole gamestate and a pointer linking to the flat list
+ */
+GameState GameStateManager::getSnapshot(int id)
 {
+  //the size of the gamestate
+  int totalsize=0;
+  //the size of one specific synchronisable
+  int tempsize=0;
+  // get the start of the Synchronisable list
+  Iterator<Synchronisable> it;
+  // struct for return value of Synchronisable::getData()
+  syncData sync;
+  
+  GameState retval; //return value
+  retval.id=id;
+  // reserve a little memory and increase it later on
+  retval.data = malloc(1);
+  
+  // offset of memory functions
+  int offset=0;
+  // go through all Synchronisables
+  for(it = ObjectList<Synchronisable>::start(); it != 0; it++){
+    //get size of the synchronisable
+    tempsize=it->getSize();
+    // add place for data and 3 ints (length,classid,objectid)
+    totalsize+=tempsize+3*sizeof(int);
+    // allocate additional space
+    retval.data = (unsigned char *)realloc((void *)retval.data, totalsize);
+    
+    // run Synchronisable::getData with offset and additional place for 3 ints in between (for ids and length)
+    sync=it->getData(retval.data+offset+3*sizeof(int));
+    *(retval.data+offset)=sync.length;
+    *(retval.data+offset+sizeof(int))=sync.objectID;
+    *(retval.data+offset+*sizeof(int))=sync.classID;
+    // increase data pointer
+    offset+=tempsize+3*sizeof(int);
+  }
+  retval.size=totalsize;
+  return retval;
+}
+
+/**
+ * This function loads a Snapshort of the gamestate into the universe
+ * @param state a GameState struct containing the size of the gamestate and a pointer linking to a flat list (returned by getSnapshot)
+ */
+bool GameStateManager::loadSnapshot(GameState state)
+{
+  unsigned char *data=state->data;
+  // get the start of the Synchronisable list
+  Iterator<Synchronisable> it=ObjectList<Synchronisable>::start();
+  syncData sync;
+  // loop as long as we have some data ;)
+  while(data < state->data+state->size){
+    // prepare the syncData struct
+    sync.length = *(int *)data;
+    data+=sizeof(int);
+    sync.objectID = *(int *)data;
+    data+=sizeof(int);
+    sync.classID = *(int *)data;
+    data+=sizeof(int);
+    sync.data = data;
+    data+=sync.length;
+    
+    if(it->objectID!=sync.objectID){
+      // bad luck ;)
+    } else {
+      // we have our object
+      if(! it->updateData(sync))
+        std::cout << "We couldn't update objectID: " << sync.objectID << "; classID: " << sync.classID << std::endl;
+    }
+  }
   
 }
 
-bool GameStateManager::loadSnapshot(GameState state)
-{
-  
+
+
+
 }
 
-}
+
Index: /code/branches/network/src/network/GameStateManager.h
===================================================================
--- /code/branches/network/src/network/GameStateManager.h	(revision 313)
+++ /code/branches/network/src/network/GameStateManager.h	(revision 314)
@@ -13,4 +13,6 @@
 #define NETWORK_GAMESTATEMANAGER_H
 
+#include "network/Synchronisable.h"
+
 namespace network {
 
@@ -20,5 +22,6 @@
  * data: pointer to the data allocated in the memory
  */
-struct GameState{
+  struct GameState{
+  int id;
   int size;
   unsigned char *data;
@@ -36,5 +39,5 @@
   GameStateManager();
   ~GameStateManager();
-  GameState getSnapshot();
+  GameState getSnapshot(int id);
   bool loadSnapshot(GameState state);
 private:
Index: /code/branches/network/src/network/Synchronisable.h
===================================================================
--- /code/branches/network/src/network/Synchronisable.h	(revision 313)
+++ /code/branches/network/src/network/Synchronisable.h	(revision 314)
@@ -14,4 +14,7 @@
 
 #include <list>
+#include <iostream>
+
+#include "orxonox/core/IdentifierIncludes.h"
 
 namespace network {
@@ -20,6 +23,6 @@
 struct syncData{
   int length;
+  int objectID;
   int classID;
-  int objectID;
   unsigned char *data;
 };
