Index: code/trunk/src/network/CMakeLists.txt
===================================================================
--- code/trunk/src/network/CMakeLists.txt	(revision 2669)
+++ code/trunk/src/network/CMakeLists.txt	(revision 2710)
@@ -1,3 +1,22 @@
-SET( NETWORK_SRC_FILES
+ #
+ #             ORXONOX - the hottest 3D action shooter ever to exist
+ #                             > www.orxonox.net <
+ #
+ #        This program is free software; you can redistribute it and/or
+ #         modify it under the terms of the GNU General Public License
+ #        as published by the Free Software Foundation; either version 2
+ #            of the License, or (at your option) any later version.
+ #
+ #       This program is distributed in the hope that it will be useful,
+ #        but WITHOUT ANY WARRANTY; without even the implied warranty of
+ #        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ #                 GNU General Public License for more details.
+ #
+ #   You should have received a copy of the GNU General Public License along
+ #      with this program; if not, write to the Free Software Foundation,
+ #     Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ #
+
+SET_SOURCE_FILES(NETWORK_SRC_FILES
   ChatListener.cc
   Client.cc
@@ -14,36 +33,35 @@
   Host.cc
 )
+ADD_SUBDIRECTORY(packet)
+ADD_SUBDIRECTORY(synchronisable)
+GET_ALL_HEADER_FILES(NETWORK_HDR_FILES)
+SET(NETWORK_FILES ${NETWORK_SRC_FILES} ${NETWORK_HDR_FILES})
 
-ADD_SOURCE_DIRECTORY(NETWORK_SRC_FILES packet)
-ADD_SOURCE_DIRECTORY(NETWORK_SRC_FILES synchronisable)
+GENERATE_SOURCE_GROUPS(${NETWORK_FILES})
 
-
-IF(WIN32)
-  ADD_LIBRARY( network ${NETWORK_SRC_FILES} )
-ELSE(WIN32)
-  ADD_LIBRARY( network SHARED ${NETWORK_SRC_FILES} )
-ENDIF(WIN32)
-
-TARGET_LINK_LIBRARIES( network
+ADD_LIBRARY(network SHARED ${NETWORK_FILES})
+SET_TARGET_PROPERTIES(network PROPERTIES DEFINE_SYMBOL "NETWORK_SHARED_BUILD")
+TARGET_LINK_LIBRARIES(network
   ${ZLIB_LIBRARY}
-  ${ENet_LIBRARY}
-  ${Boost_thread_LIBRARIES}
+  ${ENET_LIBRARY}
+  ${Boost_THREAD_LIBRARY}
+  util
   core
 )
 
+ORXONOX_INSTALL(network)
 
 # build those parts only on request.
 IF(NETWORK_TESTING_ENABLED)
   ##### test for gamestate stuff #####
-  SET( TEST_SRC_FILES
+  SET(TEST_SRC_FILES
     ${NETWORK_SRC_FILES}
   )
   ADD_EXECUTABLE(networktest ${TEST_SRC_FILES})
-  TARGET_LINK_LIBRARIES( networktest
-    ${OGRE_LIBRARIES}
+  TARGET_LINK_LIBRARIES(networktest
+    ${OGRE_LIBRARY}
     network
-    ${ENet_LIBRARY}
+    ${ENET_LIBRARY}
     ${ZLIB_LIBRARY}
-    ${WINDOWS_ENET_DEPENDENCIES}
   )
   ##### end test for gamestate stuff #####
Index: code/trunk/src/network/GamestateManager.cc
===================================================================
--- code/trunk/src/network/GamestateManager.cc	(revision 2669)
+++ code/trunk/src/network/GamestateManager.cc	(revision 2710)
@@ -118,5 +118,4 @@
       return 0;
     gs = reference->doSelection(clientID, 10000);
-//     gs = new packet::Gamestate(*reference);
     // save the (undiffed) gamestate in the clients gamestate map
     gamestateMap_[clientID][gs->getID()]=gs;
Index: code/trunk/src/network/Makefile.norm
===================================================================
--- code/trunk/src/network/Makefile.norm	(revision 2669)
+++ 	(revision )
@@ -1,40 +1,0 @@
-CC=g++
-MAIN_INC=..
-INC=-I ${MAIN_INC}
-
-all: server client
-
-# Link command:
-server: PacketBuffer.o ConnectionManager.o dummyserver.o PacketDecoder.o PacketGenerator.o
-	${CC} PacketDecoder.o PacketGenerator.o ConnectionManager.o dummyserver.o PacketBuffer.o -o server -lenet -lboost_thread -g
-
-dummyserver.o: dummyserver.cc
-	${CC} -c dummyserver.cc -o dummyserver.o -g ${INC}
-# Compilation commands:
-ConnectionManager.o: ConnectionManager.cc ConnectionManager.h
-	${CC} -c ConnectionManager.cc -o ConnectionManager.o -g ${INC}
-ClientConnection.o: ClientConnection.cc ClientConnection.h
-	${CC} -c ClientConnection.cc -o ClientConnection.o -g ${INC}
-
-PacketBuffer.o: PacketBuffer.cc
-	${CC} -c PacketBuffer.cc -o PacketBuffer.o -g ${INC}
-PacketGenerator.o: PacketGenerator.cc
-	${CC} -c PacketGenerator.cc -o PacketGenerator.o -g ${INC}
-PacketDecoder.o: PacketDecoder.cc
-	${CC} -c PacketDecoder.cc -o PacketDecoder.o -g ${INC}
-Client.o: Client.cc
-	${CC} -c Client.cc -g ${INC}
-Server.o: Server.cc
-	${CC} -c Server.cc -g ${INC}
-Synchronisable.o: Synchronisable.cc
-	${CC} -c Synchronisable.cc -g ${INC}
-GameStateManager.o: GameStateManager.cc
-	${CC} -c GameStateManager.cc -g ${INC}
-
-clean:
-	rm -rf *.o
-
-client_old: PacketGenerator.o dummyclient.cc
-	${CC} dummyclient.cc PacketGenerator.o -o client -lenet -g ${INC}
-client: PacketGenerator.o ClientConnection.o PacketBuffer.o dummyclient2.cc 
-	${CC} dummyclient2.cc PacketGenerator.o PacketBuffer.o ClientConnection.o -o client -lenet -lboost_thread -g ${INC}
Index: code/trunk/src/network/Makefile.tardis
===================================================================
--- code/trunk/src/network/Makefile.tardis	(revision 2669)
+++ 	(revision )
@@ -1,39 +1,0 @@
-all: server client
-
-CC=g++-4.1.1
-
-BOOST_INC=/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/include/boost-1_34_1/
-BOOST_LIB=/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/lib/
-MAIN_INC=..
-ENET_INC=/usr/pack/enet-2007-sd/include/
-ENET_LIB=/usr/pack/enet-2007-sd/i686-debian-linux3.1/lib/
-INC=-I ${BOOST_INC} -I ${MAIN_INC} -I ${ENET_INC}
-LIB=-L ${BOOST_LIB} -L ${ENET_LIB}
-
-# Link command:
-server: clean PacketBuffer.o ConnectionManager.o dummyserver.o PacketGenerator.o PacketDecoder.o
-	${CC} ConnectionManager.o dummyserver.o PacketBuffer.o PacketDecoder.o PacketGenerator.o -o server -lenet -lboost_thread-gcc41-mt -g ${INC} ${LIB} -Wl,-rpath,${BOOST_LIB} -Wl,-rpath,${ENET_LIB}
-
-dummyserver.o:
-	${CC} -c dummyserver.cc -o dummyserver.o -g ${INC}
-# Compilation commands:
-
-ConnectionManager.o:
-	${CC} -c ConnectionManager.cc -o ConnectionManager.o -g ${INC}
-
-PacketBuffer.o: 
-	${CC} -c PacketBuffer.cc -o PacketBuffer.o -g ${INC}
-PacketGenerator.o: PacketGenerator.cc
-	${CC} -c PacketGenerator.cc -o PacketGenerator.o -g ${INC}
-PacketDecoder.o: PacketDecoder.cc
-	${CC} -c PacketDecoder.cc -o PacketDecoder.o -g ${INC}
-Synchronisable.o: Synchronisable.cc
-	${CC} -c Synchronisable.cc -g ${INC}
-GameStateManager.o: GameStateManager.cc
-	${CC} -c GameStateManager.cc -g ${INC}
-
-clean:
-	rm -rf *.o
-
-client: dummyclient.cc PacketDecoder.o PacketGenerator.o
-	${CC} PacketGenerator.o PacketDecoder.o dummyclient.cc -o client -lenet ${LIB} ${INC} -Wl,-rpath,${BOOST_LIB}
Index: code/trunk/src/network/Makefile.test
===================================================================
--- code/trunk/src/network/Makefile.test	(revision 2669)
+++ 	(revision )
@@ -1,45 +1,0 @@
-CC=g++
-MAIN_INC=..
-INC=-I ${MAIN_INC} -I..
-
-all: server client
-
-# Link command:
-server: PacketBuffer.o ConnectionManager.o dummyserver.o PacketDecoder.o PacketGenerator.o ClientInformation.o
-	${CC} PacketDecoder.o PacketGenerator.o ClientInformation.o ConnectionManager.o dummyserver.o PacketBuffer.o -o server -lenet -lboost_thread -g
-
-dummyserver.o: dummyserver.cc
-	${CC} -c dummyserver.cc -o dummyserver.o -g ${INC}
-# Compilation commands:
-ConnectionManager.o: ConnectionManager.cc ConnectionManager.h
-	${CC} -c ConnectionManager.cc -o ConnectionManager.o -g ${INC}
-ClientConnection.o: ClientConnection.cc ClientConnection.h
-	${CC} -c ClientConnection.cc -o ClientConnection.o -g ${INC}
-
-PacketBuffer.o: PacketBuffer.cc
-	${CC} -c PacketBuffer.cc -o PacketBuffer.o -g ${INC}
-PacketGenerator.o: PacketGenerator.cc
-	${CC} -c PacketGenerator.cc -o PacketGenerator.o -g ${INC}
-PacketDecoder.o: PacketDecoder.cc
-	${CC} -c PacketDecoder.cc -o PacketDecoder.o -g ${INC}
-Client.o: Client.cc
-	${CC} -c Client.cc -g ${INC}
-Server.o: Server.cc
-	${CC} -c Server.cc -g ${INC}
-Synchronisable.o: Synchronisable.cc
-	${CC} -c Synchronisable.cc -g ${INC}
-GameStateManager.o: GameStateManager.cc
-	${CC} -c GameStateManager.cc -g ${INC}
-ClientInformation.o: ClientInformation.cc
-	${CC} -c ClientInformation.cc -g ${INC}
-
-clean:
-	rm -rf *.o
-
-client_old: PacketGenerator.o dummyclient.cc
-	${CC} dummyclient.cc PacketGenerator.o -o client -lenet -g ${INC}
-client: PacketGenerator.o ClientConnection.o PacketBuffer.o dummyclient2.cc 
-	${CC} dummyclient2.cc PacketGenerator.o PacketBuffer.o ClientConnection.o -o client -lenet -lboost_thread -g ${INC}
-
-chatserver: Server.o ConnectionManager.o PacketGenerator.o PacketDecoder.o PacketBuffer.o ClientInformation.o GameStateManager.o
-	${CC} dummyserver3.cc Server.o ConnectionManager.o PacketGenerator.o PacketBuffer.o GameStateManager.o ClientInformation.o -o chatserver -lenet -lboost_thread -g ${INC}
Index: code/trunk/src/network/NetworkPrereqs.h
===================================================================
--- code/trunk/src/network/NetworkPrereqs.h	(revision 2669)
+++ code/trunk/src/network/NetworkPrereqs.h	(revision 2710)
@@ -35,10 +35,10 @@
 #define _NetworkPrereqs_H__
 
-#include "util/OrxonoxPlatform.h"
+#include "OrxonoxConfig.h"
 
 //-----------------------------------------------------------------------
 // Shared library settings
 //-----------------------------------------------------------------------
-#if (ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32) && !defined( NETWORK_STATIC_BUILD )
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined( NETWORK_STATIC_BUILD )
 #  ifdef NETWORK_SHARED_BUILD
 #    define _NetworkExport __declspec(dllexport)
@@ -55,9 +55,4 @@
 #  define _NetworkExport
 #endif
-
-//-----------------------------------------------------------------------
-// Includes
-//-----------------------------------------------------------------------
-#include "util/Integers.h"
 
 //-----------------------------------------------------------------------
Index: code/trunk/src/network/TrafficControl.h
===================================================================
--- code/trunk/src/network/TrafficControl.h	(revision 2669)
+++ code/trunk/src/network/TrafficControl.h	(revision 2710)
@@ -36,5 +36,4 @@
 #include <utility>
 #include <algorithm>
-#include "util/Integers.h"
 #include "core/OrxonoxClass.h"
 #include "network/ClientConnectionListener.h"
Index: code/trunk/src/network/packet/Acknowledgement.cc
===================================================================
--- code/trunk/src/network/packet/Acknowledgement.cc	(revision 2669)
+++ code/trunk/src/network/packet/Acknowledgement.cc	(revision 2710)
@@ -64,5 +64,5 @@
 
 bool Acknowledgement::process(){
-COUT(0) << "processing ACK with ID: " << getAckID() << endl;
+COUT(6) << "processing ACK with ID: " << getAckID() << endl;
   bool b = GamestateHandler::ackGamestate(getAckID(), clientID_);
   delete this;
Index: code/trunk/src/network/packet/CMakeLists.txt
===================================================================
--- code/trunk/src/network/packet/CMakeLists.txt	(revision 2669)
+++ code/trunk/src/network/packet/CMakeLists.txt	(revision 2710)
@@ -1,3 +1,3 @@
-SET( SRC_FILES
+ADD_SOURCE_FILES(NETWORK_SRC_FILES
   Packet.cc
   Chat.cc
@@ -8,4 +8,2 @@
   DeleteObjects.cc
 )
-
-ADD_SOURCE_FILES(SRC_FILES)
Index: code/trunk/src/network/packet/Gamestate.cc
===================================================================
--- code/trunk/src/network/packet/Gamestate.cc	(revision 2669)
+++ code/trunk/src/network/packet/Gamestate.cc	(revision 2710)
@@ -110,6 +110,6 @@
   for(it = ObjectList<Synchronisable>::begin(); it; ++it){
     
+    tempsize=it->getSize(id, mode);
 #ifndef NDEBUG
-    tempsize=it->getSize(id, mode);
     if(currentsize+tempsize > size){
       assert(0); // if we don't use multithreading this part shouldn't be neccessary
@@ -184,4 +184,6 @@
     {
       bool b = s->updateData(mem, mode);
+//      if(!b)
+//        COUT(0) << "data could not be updated" << endl;
       assert(b);
     }
Index: code/trunk/src/network/packet/Packet.cc
===================================================================
--- code/trunk/src/network/packet/Packet.cc	(revision 2669)
+++ code/trunk/src/network/packet/Packet.cc	(revision 2710)
@@ -167,5 +167,5 @@
   assert(ClientInformation::findClient(&peer->address)->getID() != (unsigned int)-2 || !Host::isServer());
   unsigned int clientID = ClientInformation::findClient(&peer->address)->getID();
-  Packet *p;
+  Packet *p = 0;
   COUT(5) << "packet type: " << *(ENUM::Type *)&data[_PACKETID] << std::endl;
   switch( *(ENUM::Type *)(data + _PACKETID) )
Index: code/trunk/src/network/packet/Packet.h
===================================================================
--- code/trunk/src/network/packet/Packet.h	(revision 2669)
+++ code/trunk/src/network/packet/Packet.h	(revision 2710)
@@ -34,6 +34,4 @@
 #include <enet/enet.h>
 #include <boost/thread/recursive_mutex.hpp>
-
-#include "util/Integers.h"
 
 namespace orxonox {
Index: code/trunk/src/network/synchronisable/CMakeLists.txt
===================================================================
--- code/trunk/src/network/synchronisable/CMakeLists.txt	(revision 2669)
+++ code/trunk/src/network/synchronisable/CMakeLists.txt	(revision 2710)
@@ -1,3 +1,3 @@
-SET( SRC_FILES
+ADD_SOURCE_FILES(NETWORK_SRC_FILES
   NetworkCallbackManager.cc
   Synchronisable.cc
@@ -5,4 +5,2 @@
   SynchronisableVariable.cc
 )
-
-ADD_SOURCE_FILES(SRC_FILES)
Index: code/trunk/src/network/synchronisable/Synchronisable.cc
===================================================================
--- code/trunk/src/network/synchronisable/Synchronisable.cc	(revision 2669)
+++ code/trunk/src/network/synchronisable/Synchronisable.cc	(revision 2710)
@@ -236,50 +236,4 @@
     return NULL;
   }
-
-
-  /**
-  * This function is used to register a variable to be synchronized
-  * also counts the total datasize needed to save the variables
-  * @param var pointer to the variable
-  * @param size size of the datatype the variable consists of
-  * @param t the type of the variable (DATA or STRING
-  * @param mode same as in getData
-  * @param cb callback object that should get called, if the value of the variable changes
-  */
-
-/*  void Synchronisable::registerVariable(void *var, int size, variableType t, uint8_t mode, NetworkCallbackBase *cb){
-    assert( mode==variableDirection::toclient || mode==variableDirection::toserver || mode==variableDirection::serverMaster || mode==variableDirection::clientMaster);
-    // create temporary synch.Var struct
-    synchronisableVariable *temp = new synchronisableVariable;
-    temp->size = size;
-    temp->var = var;
-    temp->mode = mode;
-    temp->type = t;
-    temp->callback = cb;
-    if( ( mode & variableDirection::bidirectional ) )
-    {
-      if(t!=STRING)
-      {
-        temp->varBuffer = new uint8_t[size];
-        memcpy(temp->varBuffer, temp->var, size); //now fill the buffer for the first time
-      }
-      else
-      {
-        temp->varBuffer=new std::string( *static_cast<std::string*>(var) );
-      }
-      temp->varReference = 0;
-    }
-    COUT(5) << "Syncronisable::registering var with size: " << temp->size << " and type: " << temp->type << std::endl;
-    //std::cout << "push temp to syncList (at the bottom) " << datasize << std::endl;
-    COUT(5) << "Syncronisable::objectID: " << objectID << " this: " << this << " name: " << this->getIdentifier()->getName() << " networkID: " << this->getIdentifier()->getNetworkID() << std::endl;
-    syncList->push_back(temp);
-#ifndef NDEBUG
-    std::list<synchronisableVariable *>::iterator it = syncList->begin();
-    while(it!=syncList->end()){
-      assert(*it!=var);
-      it++;
-    }
-#endif
-  }*/
 
 
Index: code/trunk/src/network/synchronisable/Synchronisable.h
===================================================================
--- code/trunk/src/network/synchronisable/Synchronisable.h	(revision 2669)
+++ code/trunk/src/network/synchronisable/Synchronisable.h	(revision 2710)
@@ -153,6 +153,6 @@
     uint32_t getSize(int32_t id, uint8_t mode=0x0);
     bool updateData(uint8_t*& mem, uint8_t mode=0x0, bool forceCallback=false);
-    inline bool isMyData(uint8_t* mem);
-    inline bool doSync(int32_t id, uint8_t mode=0x0);
+    bool isMyData(uint8_t* mem);
+    bool doSync(int32_t id, uint8_t mode=0x0);
 
     uint32_t objectID;
Index: code/trunk/src/network/synchronisable/SynchronisableVariable.cc
===================================================================
--- code/trunk/src/network/synchronisable/SynchronisableVariable.cc	(revision 2669)
+++ code/trunk/src/network/synchronisable/SynchronisableVariable.cc	(revision 2710)
@@ -362,5 +362,5 @@
 {
   double temp;
-  *(uint64_t*)(&temp) = *(uint64_t*)(mem);
+  memcpy(&temp, mem, sizeof(uint64_t));
   *(long double*)(&this->variable_) = static_cast<const long double>(temp);
   mem += SynchronisableVariable<const long double>::returnSize();
@@ -370,5 +370,5 @@
 {
   double temp = static_cast<double>(this->variable_);
-  *(uint64_t*)(mem) = *(uint64_t*)(&temp);
+  memcpy(mem, &temp, sizeof(uint64_t));
   mem += SynchronisableVariable<const long double>::returnSize();
 }
@@ -377,5 +377,5 @@
 {
   double temp = static_cast<double>(this->variable_);
-  return *(uint64_t*)(mem) == *(uint64_t*)(&temp);
+  return memcmp(&temp, mem, sizeof(uint64_t))==0;
 }
 
Index: code/trunk/src/network/synchronisable/SynchronisableVariable.h
===================================================================
--- code/trunk/src/network/synchronisable/SynchronisableVariable.h	(revision 2669)
+++ code/trunk/src/network/synchronisable/SynchronisableVariable.h	(revision 2710)
@@ -35,5 +35,4 @@
 #include <string>
 #include <cassert>
-#include "util/Integers.h"
 #include "core/Core.h"
 #include "core/CoreIncludes.h"
