Index: /code/branches/network/TODO
===================================================================
--- /code/branches/network/TODO	(revision 1774)
+++ /code/branches/network/TODO	(revision 1775)
@@ -1,2 +1,5 @@
-- should we use enet_peer_ping to test if a client is still alive ?
-- enet_host_broadcast ? (to all peers)
+todo: 
+	!!! check that enet does not cause a packet traffic jam when a reliable packet gets missed !!!
+	spaceship of client vanishes on server
+	new gamestate concept
+
Index: /code/branches/network/src/network/CMakeLists.txt
===================================================================
--- /code/branches/network/src/network/CMakeLists.txt	(revision 1774)
+++ /code/branches/network/src/network/CMakeLists.txt	(revision 1775)
@@ -17,4 +17,5 @@
   packet/Gamestate.cc
   packet/Welcome.cc
+  packet/DeleteObjects.cc
 )
 
Index: /code/branches/network/src/network/Client.cc
===================================================================
--- /code/branches/network/src/network/Client.cc	(revision 1774)
+++ /code/branches/network/src/network/Client.cc	(revision 1775)
@@ -170,6 +170,5 @@
       if(!isSynched_)
         isSynched_=true;
-    }else
-      COUT(3) << "gamestate has not been processed sucessfully" << std::endl;
+    }
     gamestate.cleanup();
     return;
Index: /code/branches/network/src/network/GamestateClient.cc
===================================================================
--- /code/branches/network/src/network/GamestateClient.cc	(revision 1774)
+++ /code/branches/network/src/network/GamestateClient.cc	(revision 1775)
@@ -156,5 +156,5 @@
     if(myShip_){
       //      unsigned char *data = new unsigned char[myShip_->getSize()];
-      int size=myShip_->getSize2(0, 0x1);
+      int size=myShip_->getSize(0, 0x1);
       if(size==0)
         return false;
Index: /code/branches/network/src/network/Server.cc
===================================================================
--- /code/branches/network/src/network/Server.cc	(revision 1774)
+++ /code/branches/network/src/network/Server.cc	(revision 1775)
@@ -56,4 +56,5 @@
 #include "packet/Packet.h"
 #include "packet/Welcome.h"
+#include "packet/DeleteObjects.h"
 #include <util/Convert.h>
 
@@ -229,4 +230,5 @@
     //std::cout << "updated gamestate, sending it" << std::endl;
     //if(clients->getGamestateID()!=GAMESTATEID_INITIAL)
+    sendObjectDeletes();
     sendGameState();
     COUT(5) << "Server: one sendGameState turn complete, repeat in next tick" << std::endl;
@@ -276,12 +278,30 @@
       // gs gets automatically deleted by enet callback
     }
-    /*if(added) {
-      //std::cout << "send gamestates from server.cc in sendGameState" << std::endl;
-      return connection->sendPackets();
-    }*/
-    //COUT(5) << "Server: had no gamestates to send" << std::endl;
     return true;
   }
 
+  bool Server::sendObjectDeletes(){
+    ClientInformation *temp = ClientInformation::getBegin();
+    packet::DeleteObjects *del = new packet::DeleteObjects();
+    if(!del->fetchIDs())
+      return true;  //everything ok (no deletes this tick)
+    while(temp != NULL){
+      if( !(temp->getSynched()) ){
+        COUT(5) << "Server: not sending gamestate" << std::endl;
+        temp=temp->next();
+        continue;
+      }
+      int cid = temp->getID(); //get client id
+      packet::DeleteObjects *cd = new packet::DeleteObjects(*del);
+      assert(cd);
+      cd->setClientID(cid);
+      if ( !cd->send() )
+        COUT(3) << "Server: packet with client id (cid): " << cid << " not sended: " << temp->getFailures() << std::endl;
+      temp=temp->next();
+      // gs gets automatically deleted by enet callback
+    }
+    return true;
+  }
+  
 //   void Server::processChat( chat *data, int clientId){
 //     char *message = new char [strlen(data->message)+10+1];
Index: /code/branches/network/src/network/Server.h
===================================================================
--- /code/branches/network/src/network/Server.h	(revision 1774)
+++ /code/branches/network/src/network/Server.h	(revision 1775)
@@ -85,5 +85,5 @@
     bool processPacket( ENetPacket *packet, ENetPeer *peer );
     bool sendGameState();
-    
+    bool sendObjectDeletes();
     
     //void processChat( chat *data, int clientId);
Index: /code/branches/network/src/network/Synchronisable.cc
===================================================================
--- /code/branches/network/src/network/Synchronisable.cc	(revision 1774)
+++ /code/branches/network/src/network/Synchronisable.cc	(revision 1775)
@@ -52,4 +52,6 @@
 {
 
+  std::map<unsigned int, Synchronisable *> Synchronisable::objectMap_;
+  std::queue<unsigned int> Synchronisable::deletedObjects_;
 
   int Synchronisable::state_=0x1; // detemines wheter we are server (default) or client
@@ -61,5 +63,5 @@
   Synchronisable::Synchronisable(){
     RegisterRootObject(Synchronisable);
-    static int idCounter=0;
+    static unsigned int idCounter=0;
     datasize=0;
     objectFrequency_=1;
@@ -67,15 +69,19 @@
     objectID=idCounter++;
     syncList = new std::list<synchronisableVariable *>;
-    //registerAllVariables();
   }
 
   Synchronisable::~Synchronisable(){
     // delete callback function objects
-    if(!orxonox::Identifier::isCreatingHierarchy())
+    if(!orxonox::Identifier::isCreatingHierarchy()){
       for(std::list<synchronisableVariable *>::iterator it = syncList->begin(); it!=syncList->end(); it++)
         delete (*it)->callback;
+      assert(objectMap_[objectID]->objectID==objectID);
+      objectMap_.erase(objectID);
+    }
   }
 
   bool Synchronisable::create(){
+    objectMap_[objectID]=this;
+    assert(objectMap_[objectID]==this);
     this->classID = this->getIdentifier()->getNetworkID();
     COUT(4) << "creating synchronisable: setting classid from " << this->getIdentifier()->getName() << " to: " << classID << std::endl;
@@ -91,5 +97,5 @@
   }
   
-  bool Synchronisable::fabricate(unsigned char*& mem, int mode)
+  Synchronisable *Synchronisable::fabricate(unsigned char*& mem, int mode)
   {
     unsigned int size, objectID, classID;
@@ -98,15 +104,6 @@
     classID = *(unsigned int*)(mem+2*sizeof(unsigned int));
     
-    if(size==3*sizeof(unsigned int)){ //not our turn, dont do anything
-      mem+=3*sizeof(unsigned int);
-      return true;
-    }
-    
     orxonox::Identifier* id = GetIdentifier(classID);
-    if(!id){
-      COUT(3) << "We could not identify a new object; classid: " << classID << " uint: " << (unsigned int)classID << " objectID: " << objectID << " size: " << size << std::endl;
-      assert(0);
-      return false; // most probably the gamestate is corrupted
-    }
+    assert(id);
     orxonox::BaseObject *bo = id->fabricate();
     Synchronisable *no = dynamic_cast<Synchronisable *>(bo);
@@ -116,16 +113,26 @@
     COUT(3) << "fabricate objectID: " << no->objectID << " classID: " << no->classID << std::endl;
           // update data and create object/entity...
-    if( !no->updateData(mem, mode) ){
-      COUT(1) << "We couldn't update the object: " << objectID << std::endl;
-      return false;
-    }
-    if( !no->create() )
-    {
-      COUT(1) << "We couldn't manifest (create() ) the object: " << objectID << std::endl;
-      return false;
-    }
+    assert(no->updateData(mem, mode));
+    assert( no->create() );
+    return no;
+  }
+
+  
+  bool Synchronisable::deleteObject(unsigned int objectID){
+    assert(getSynchronisable(objectID));
+    assert(getSynchronisable(objectID)->objectID==objectID);
+    delete objectMap_[objectID];
     return true;
   }
-
+  
+  Synchronisable* Synchronisable::getSynchronisable(unsigned int objectID){
+    std::map<unsigned int, Synchronisable *>::iterator i = objectMap_.find(objectID);
+    if(i==objectMap_.end())
+      return NULL;
+    assert(i->second->objectID==objectID);
+    return (*i).second;
+  }
+
+  
   /**
   * This function is used to register a variable to be synchronized
@@ -161,4 +168,7 @@
    */
   bool Synchronisable::getData(unsigned char*& mem, unsigned int id, int mode){
+    //if this tick is we dont synchronise, then abort now
+    if(!isMyTick(id))
+      return true;
     //std::cout << "inside getData" << std::endl;
     unsigned int tempsize = 0;
@@ -170,5 +180,5 @@
     std::list<synchronisableVariable *>::iterator i;
     unsigned int size;
-    size=getSize2(id, mode);
+    size=getSize(id, mode);
     
     // start copy header
@@ -182,7 +192,4 @@
     // end copy header
     
-    //if this tick is we dont synchronise, then abort now
-    if(!isMyTick(id))
-      return true;
     
     COUT(5) << "Synchronisable getting data from objectID: " << objectID << " classID: " << classID << " length: " << size << std::endl;
@@ -222,5 +229,4 @@
    */
   bool Synchronisable::updateData(unsigned char*& mem, int mode){
-    unsigned char *data = mem;
     if(mode==0x0)
       mode=state_;
@@ -230,6 +236,8 @@
       return false;
     }
-    
+    unsigned char *data=mem;
     // start extract header
+    if(!isMyData(mem))
+      return true;
     unsigned int objectID, classID, size;
     size = *(int *)mem;
@@ -242,7 +250,4 @@
     assert(this->objectID==objectID);
     assert(this->classID==classID);
-    if(size==3*sizeof(unsigned int)) //if true, only the header is available
-      return true;
-      //assert(0);
     
     COUT(5) << "Synchronisable: objectID " << objectID << ", classID " << classID << " size: " << size << " synchronising data" << std::endl;
@@ -288,5 +293,5 @@
     if(!isMyTick(id))
       return 0;
-    int tsize=0;
+    int tsize=sizeof(synchronisableHeader);
     if(mode==0x0)
       mode=state_;
@@ -311,12 +316,4 @@
 
   /**
-   * This function returns the total amount of bytes needed by getData to save the whole content of the variables
-   * @return amount of bytes
-   */
-  int Synchronisable::getSize2(unsigned int id, int mode){
-    return sizeof(synchronisableHeader) + getSize( id, mode );
-  }
-  
-  /**
    * 
    * @param id 
Index: /code/branches/network/src/network/Synchronisable.h
===================================================================
--- /code/branches/network/src/network/Synchronisable.h	(revision 1774)
+++ /code/branches/network/src/network/Synchronisable.h	(revision 1775)
@@ -33,4 +33,6 @@
 
 #include <list>
+#include <map>
+#include <queue>
 #include "core/OrxonoxClass.h"
 #include "util/XMLIncludes.h"
@@ -74,5 +76,5 @@
     void registerVar(void *var, int size, variableType t, int mode=1, NetworkCallbackBase *cb=0);
     bool getData(unsigned char*& men, unsigned int id, int mode=0x0);
-    int getSize2(unsigned int id, int mode=0x0);
+    int getSize(unsigned int id, int mode=0x0);
     bool updateData(unsigned char*& mem, int mode=0x0);
     bool isMyData(unsigned char* mem);
@@ -84,9 +86,14 @@
     static void setClient(bool b);
     
-    static bool fabricate(unsigned char*& mem, int mode=0x0);
+    static Synchronisable *fabricate(unsigned char*& mem, int mode=0x0);
+    static bool deleteObject(unsigned int objectID);
+    static Synchronisable *getSynchronisable(unsigned int objectID);
+    static unsigned int getNumberOfDeletedObject(){ return deletedObjects_.size(); }
+    static unsigned int popDeletedObject(){ unsigned int i = deletedObjects_.front(); deletedObjects_.pop(); return i; }
+    
+    
   protected:
     Synchronisable();
   private:
-    int getSize(unsigned int id, int mode=0x0);
     bool isMyTick(unsigned int id);
     std::list<synchronisableVariable *> *syncList;
@@ -96,4 +103,6 @@
     unsigned int objectFrequency_;
     int objectMode_;
+    static std::map<unsigned int, Synchronisable *> objectMap_;
+    static std::queue<unsigned int> deletedObjects_;
   };
 }
Index: /code/branches/network/src/network/packet/DeleteObjects.cc
===================================================================
--- /code/branches/network/src/network/packet/DeleteObjects.cc	(revision 1775)
+++ /code/branches/network/src/network/packet/DeleteObjects.cc	(revision 1775)
@@ -0,0 +1,88 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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.
+ *
+ *   Author:
+ *      Oliver Scheuss, (C) 2008
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#include "DeleteObjects.h"
+#include <enet/enet.h>
+#include "network/Synchronisable.h"
+#include "core/CoreIncludes.h"
+#include <assert.h>
+
+namespace network {
+namespace packet {
+
+#define PACKET_FLAGS_DELETE    ENET_PACKET_FLAG_RELIABLE
+#define _PACKETID           0
+#define _QUANTITY           _PACKETID + sizeof(ENUM::Type)
+#define _OBJECTIDS          _QUANTITY + sizeof(unsigned int)
+  
+DeleteObjects::DeleteObjects()
+ : Packet()
+{
+  flags_ = flags_ | PACKET_FLAGS_DELETE;
+}
+
+DeleteObjects::DeleteObjects( unsigned char *data, int clientID )
+  : Packet(data, clientID)
+{
+}
+
+DeleteObjects::~DeleteObjects()
+{
+}
+
+bool DeleteObjects::fetchIDs(){
+  unsigned int number = Synchronisable::getNumberOfDeletedObject();
+  if(number==0)
+    return false;
+  unsigned int size = sizeof(ENUM::Type) + sizeof(unsigned int)*number;
+  data_ = new unsigned char[size];
+  *(ENUM::Type *)(data_ + _PACKETID ) = ENUM::DeleteObjects;
+  *(unsigned int *)(data_ + _QUANTITY) = number;
+  for(unsigned int i=0; i<number; i++){
+    *(unsigned int *)(data_ + sizeof(ENUM::Type) + i*sizeof(unsigned int)) = Synchronisable::popDeletedObject();
+  }
+  return true;
+}
+
+unsigned int DeleteObjects::getSize() const{
+  assert(data_);
+  return _OBJECTIDS + sizeof(unsigned int) + *(unsigned int*)(data_+_QUANTITY);
+}
+
+bool DeleteObjects::process(){
+  for(unsigned int i=0; i<*(unsigned int *)(data_+_QUANTITY); i++){
+    COUT(3) << "deleting object with id: " << *(unsigned int*)(data_+_OBJECTIDS+i*sizeof(unsigned int)) << std::endl;
+    Synchronisable::deleteObject( *(unsigned int*)(data_+_OBJECTIDS+i*sizeof(unsigned int)) );
+  }
+  return true;
+}
+
+
+} //namespace packet
+} //namespace network
Index: /code/branches/network/src/network/packet/DeleteObjects.h
===================================================================
--- /code/branches/network/src/network/packet/DeleteObjects.h	(revision 1775)
+++ /code/branches/network/src/network/packet/DeleteObjects.h	(revision 1775)
@@ -0,0 +1,57 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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.
+ *
+ *   Author:
+ *      Oliver Scheuss <scheusso [at] ee.ethz.ch>, (C) 2008
+ *   Co-authors:
+ *      ...
+ *
+ */
+#ifndef NETWORKPACKETDELETEOBJECTS_H
+#define NETWORKPACKETDELETEOBJECTS_H
+
+#include "Packet.h"
+
+
+namespace network {
+namespace packet {
+/**
+	@author 
+*/
+class DeleteObjects : public Packet
+{
+public:
+  DeleteObjects( );
+  DeleteObjects( unsigned char* data, int clientID );
+  ~DeleteObjects();
+  
+  bool fetchIDs();
+  
+  inline unsigned int getSize() const;
+  bool process();
+  
+private:
+};
+
+} //namespace packet
+} //namespace network
+
+#endif
Index: /code/branches/network/src/network/packet/Gamestate.cc
===================================================================
--- /code/branches/network/src/network/packet/Gamestate.cc	(revision 1774)
+++ /code/branches/network/src/network/packet/Gamestate.cc	(revision 1775)
@@ -46,4 +46,5 @@
 #define HEADER GAMESTATE_HEADER(data_)
 
+  
 Gamestate::Gamestate()
 {
@@ -80,5 +81,5 @@
   orxonox::ObjectList<Synchronisable>::iterator it;
   for(it = orxonox::ObjectList<Synchronisable>::begin(); it; ++it){
-    tempsize=it->getSize2(id, mode);
+    tempsize=it->getSize(id, mode);
 
     if(currentsize+tempsize > size){
@@ -88,5 +89,5 @@
       int addsize=tempsize;
       while(++temp)
-        addsize+=temp->getSize2(id, mode);
+        addsize+=temp->getSize(id, mode);
       data_ = (unsigned char *)realloc(data_, sizeof(GamestateHeader) + currentsize + addsize);
       if(!data_)
@@ -105,5 +106,5 @@
   HEADER->packetType = ENUM::Gamestate;
   assert( *(ENUM::Type *)(data_) == ENUM::Gamestate);
-  HEADER->normsize = currentsize;
+  HEADER->datasize = currentsize;
   HEADER->id = id;
   HEADER->diffed = false;
@@ -125,44 +126,31 @@
   unsigned char *mem=data_+sizeof(GamestateHeader);
     // get the start of the Synchronisable list
-  orxonox::ObjectList<Synchronisable>::iterator it=orxonox::ObjectList<Synchronisable>::begin();
-
-  while(mem < data_+sizeof(GamestateHeader)+HEADER->normsize){
-      // extract synchronisable header
+  //orxonox::ObjectList<Synchronisable>::iterator it=orxonox::ObjectList<Synchronisable>::begin();
+  Synchronisable *s;
+
+  // update the data of the objects we received
+  while(mem < data_+sizeof(GamestateHeader)+HEADER->datasize){
     size = *(unsigned int *)mem;
     objectID = *(unsigned int*)(mem+sizeof(unsigned int));
     classID = *(unsigned int*)(mem+2*sizeof(unsigned int));
 
-    if(!it || it->objectID!=objectID || it->classID!=classID){
-        // bad luck ;)
-        // delete the synchronisable (obviously seems to be deleted on the server)
-      while(it && it->objectID!=objectID)
-        removeObject(it);
-
-      if(!it){
-        //fabricate the new synchronisable
-        if(!Synchronisable::fabricate(mem, mode))
-          return false;
-        it=orxonox::ObjectList<Synchronisable>::end();
-      }else{
-	if(! it->updateData(mem, mode))
-        {
-          COUT(1) << "We couldn't update objectID: " \
-            << objectID << "; classID: " << classID << std::endl;
-        }
-      }
-    } else
+    s = Synchronisable::getSynchronisable( objectID );
+    if(!s)
     {
-        // we have our object
-      if(! it->updateData(mem, mode))
-      {
-        COUT(1) << "We couldn't update objectID: " \
-            << objectID << "; classID: " << classID << std::endl;
-      }
+      s = Synchronisable::fabricate(mem, mode);
+      if(!s)
+        return false;
     }
-    ++it;
-  }
-
-  return true;
-}
+    else
+    {
+      if(!s->updateData(mem, mode))
+        return false;
+    }
+  }
+
+  return true;
+}
+
+
 
 int Gamestate::getID(){
@@ -177,5 +165,5 @@
   else
   {
-    return HEADER->normsize+sizeof(GamestateHeader);
+    return HEADER->datasize+sizeof(GamestateHeader);
   }
 }
@@ -186,5 +174,5 @@
   assert(!isCompressed());
   assert(!gs.isCompressed());
-  while(d1<data_+HEADER->normsize)
+  while(d1<data_+HEADER->datasize)
   {
     if(*d1!=*d2)
@@ -205,5 +193,5 @@
   assert(HEADER);
   assert(!HEADER->compressed);
-  uLongf buffer = (uLongf)(((HEADER->normsize + 12)*1.01)+1);
+  uLongf buffer = (uLongf)(((HEADER->datasize + 12)*1.01)+1);
   if(buffer==0)
     return false;
@@ -214,5 +202,5 @@
   unsigned char *source = GAMESTATE_START(data_);
   int retval;
-  retval = compress( dest, &buffer, source, (uLong)(HEADER->normsize) );
+  retval = compress( dest, &buffer, source, (uLong)(HEADER->datasize) );
   switch ( retval ) {
     case Z_OK: COUT(5) << "G.St.Man: compress: successfully compressed" << std::endl; break;
@@ -223,9 +211,9 @@
 #ifndef NDEBUG
   //decompress and compare the start and the decompressed data
-  unsigned char *rdata = new unsigned char[HEADER->normsize+sizeof(GamestateHeader)];
+  unsigned char *rdata = new unsigned char[HEADER->datasize+sizeof(GamestateHeader)];
   unsigned char *d2 = GAMESTATE_START(rdata);
-  uLongf length2 = HEADER->normsize;
+  uLongf length2 = HEADER->datasize;
   uncompress(d2, &length2, dest, buffer);
-  for(unsigned int i=0; i<HEADER->normsize; i++){
+  for(unsigned int i=0; i<HEADER->datasize; i++){
     assert(*(source+i)==*(d2+i));
   }
@@ -235,5 +223,5 @@
   //copy and modify header
 #ifndef NDEBUG
-  HEADER->crc32 = calcCRC(data_+sizeof(GamestateHeader), HEADER->normsize);
+  HEADER->crc32 = calcCRC(data_+sizeof(GamestateHeader), HEADER->datasize);
 #endif
   *GAMESTATE_HEADER(ndata) = *HEADER;
@@ -245,5 +233,5 @@
   HEADER->compressed = true;
   assert(HEADER->compressed);
-  COUT(3) << "gamestate compress normsize: " << HEADER->normsize << " compsize: " << HEADER->compsize << std::endl;
+  COUT(3) << "gamestate compress datasize: " << HEADER->datasize << " compsize: " << HEADER->compsize << std::endl;
   return true;
 }
@@ -252,10 +240,10 @@
   assert(HEADER);
   assert(HEADER->compressed);
-  COUT(3) << "GameStateClient: uncompressing gamestate. id: " << HEADER->id << ", baseid: " << HEADER->base_id << ", normsize: " << HEADER->normsize << ", compsize: " << HEADER->compsize << std::endl;
-  unsigned int normsize = HEADER->normsize;
+  COUT(3) << "GameStateClient: uncompressing gamestate. id: " << HEADER->id << ", baseid: " << HEADER->base_id << ", datasize: " << HEADER->datasize << ", compsize: " << HEADER->compsize << std::endl;
+  unsigned int datasize = HEADER->datasize;
   unsigned int compsize = HEADER->compsize;
   unsigned int bufsize;
-  assert(compsize<=normsize);
-  bufsize = normsize;
+  assert(compsize<=datasize);
+  bufsize = datasize;
   assert(bufsize!=0);
   unsigned char *ndata = new unsigned char[bufsize + sizeof(GamestateHeader)];
@@ -272,5 +260,5 @@
   }
 #ifndef NDEBUG
-  assert(HEADER->crc32==calcCRC(ndata+sizeof(GamestateHeader), HEADER->normsize));
+  assert(HEADER->crc32==calcCRC(ndata+sizeof(GamestateHeader), HEADER->datasize));
 #endif
 
@@ -282,5 +270,5 @@
   data_ = ndata;
   HEADER->compressed = false;
-  assert(HEADER->normsize==normsize);
+  assert(HEADER->datasize==datasize);
   assert(HEADER->compsize==compsize);
   return true;
@@ -296,16 +284,16 @@
   unsigned int of=0; // pointers offset
   unsigned int dest_length=0;
-  dest_length=HEADER->normsize;
+  dest_length=HEADER->datasize;
   if(dest_length==0)
     return NULL;
   unsigned char *ndata = new unsigned char[dest_length*sizeof(unsigned char)+sizeof(GamestateHeader)];
   unsigned char *dest = ndata + sizeof(GamestateHeader);
-  while(of < GAMESTATE_HEADER(base->data_)->normsize && of < HEADER->normsize){
+  while(of < GAMESTATE_HEADER(base->data_)->datasize && of < HEADER->datasize){
     *(dest+of)=*(basep+of)^*(gs+of); // do the xor
     ++of;
   }
-  if(GAMESTATE_HEADER(base->data_)->normsize!=HEADER->normsize){
+  if(GAMESTATE_HEADER(base->data_)->datasize!=HEADER->datasize){
     unsigned char n=0;
-    if(GAMESTATE_HEADER(base->data_)->normsize < HEADER->normsize){
+    if(GAMESTATE_HEADER(base->data_)->datasize < HEADER->datasize){
       while(of<dest_length){
         *(dest+of)=n^*(gs+of);
@@ -334,16 +322,16 @@
   unsigned int of=0; // pointers offset
   unsigned int dest_length=0;
-  dest_length=HEADER->normsize;
+  dest_length=HEADER->datasize;
   if(dest_length==0)
     return NULL;
   unsigned char *ndata = new unsigned char[dest_length*sizeof(unsigned char)+sizeof(GamestateHeader)];
   unsigned char *dest = ndata + sizeof(GamestateHeader);
-  while(of < GAMESTATE_HEADER(base->data_)->normsize && of < HEADER->normsize){
+  while(of < GAMESTATE_HEADER(base->data_)->datasize && of < HEADER->datasize){
     *(dest+of)=*(basep+of)^*(gs+of); // do the xor
     ++of;
   }
-  if(GAMESTATE_HEADER(base->data_)->normsize!=HEADER->normsize){
+  if(GAMESTATE_HEADER(base->data_)->datasize!=HEADER->datasize){
     unsigned char n=0;
-    if(GAMESTATE_HEADER(base->data_)->normsize < HEADER->normsize){
+    if(GAMESTATE_HEADER(base->data_)->datasize < HEADER->datasize){
       while(of < dest_length){
         *(dest+of)=n^*(gs+of);
@@ -370,5 +358,5 @@
     // get total size of gamestate
   for(it = orxonox::ObjectList<Synchronisable>::begin(); it; ++it)
-    size+=it->getSize2(id, mode); // size of the actual data of the synchronisable
+    size+=it->getSize(id, mode); // size of the actual data of the synchronisable
 //  size+=sizeof(GamestateHeader);
   return size;
Index: /code/branches/network/src/network/packet/Gamestate.h
===================================================================
--- /code/branches/network/src/network/packet/Gamestate.h	(revision 1774)
+++ /code/branches/network/src/network/packet/Gamestate.h	(revision 1775)
@@ -33,4 +33,5 @@
 #endif
 
+
 #ifndef NETWORK_PACKETGAMESTATE_H
 #define NETWORK_PACKETGAMESTATE_H
@@ -44,5 +45,5 @@
   int id; // id of the gamestate
   unsigned int compsize;
-  unsigned int normsize;
+  unsigned int datasize;
   int base_id; // id of the base-gamestate diffed from
   bool diffed; // wheter diffed or not
@@ -55,5 +56,5 @@
 
 /**
-	@author
+	@author Oliver Scheuss
 */
 class Gamestate: public Packet{
@@ -84,7 +85,5 @@
     void removeObject(orxonox::ObjectListIterator<Synchronisable> &it);
 
-
-    //Bytestream *bs_;
-    //GamestateHeader *header_;
+  private:
 };
 
Index: /code/branches/network/src/network/packet/Packet.cc
===================================================================
--- /code/branches/network/src/network/packet/Packet.cc	(revision 1774)
+++ /code/branches/network/src/network/packet/Packet.cc	(revision 1775)
@@ -42,4 +42,5 @@
 #include "Gamestate.h"
 #include "Welcome.h"
+#include "DeleteObjects.h"
 #include "network/Host.h"
 #include "core/CoreIncludes.h"
@@ -141,27 +142,31 @@
   unsigned int clientID = ClientInformation::findClient(&peer->address)->getID();
   Packet *p;
-  COUT(3) << "packet type: " << *(ENUM::Type *)&data[_PACKETID] << std::endl;
+  COUT(5) << "packet type: " << *(ENUM::Type *)&data[_PACKETID] << std::endl;
   switch( *(ENUM::Type *)(data + _PACKETID) )
   {
     case ENUM::Acknowledgement:
-      COUT(3) << "ack" << std::endl;
+      COUT(4) << "ack" << std::endl;
       p = new Acknowledgement( data, clientID );
       break;
     case ENUM::Chat:
-      COUT(3) << "chat" << std::endl;
+      COUT(4) << "chat" << std::endl;
       p = new Chat( data, clientID );
       break;
     case ENUM::ClassID:
-      COUT(3) << "classid" << std::endl;
+      COUT(4) << "classid" << std::endl;
       p = new ClassID( data, clientID );
       break;
     case ENUM::Gamestate:
-      COUT(3) << "gamestate" << std::endl;
+      COUT(4) << "gamestate" << std::endl;
       // TODO: remove brackets
       p = new Gamestate( data, clientID );
       break;
     case ENUM::Welcome:
-      COUT(3) << "welcome" << std::endl;
+      COUT(4) << "welcome" << std::endl;
       p = new Welcome( data, clientID );
+      break;
+    case ENUM::DeleteObjects:
+      COUT(4) << "deleteobjects" << std::endl;
+      p = new DeleteObjects( data, clientID );
       break;
     default:
Index: /code/branches/network/src/network/packet/Packet.h
===================================================================
--- /code/branches/network/src/network/packet/Packet.h	(revision 1774)
+++ /code/branches/network/src/network/packet/Packet.h	(revision 1775)
@@ -47,5 +47,6 @@
     ClassID,
     Chat,
-    Welcome
+    Welcome,
+    DeleteObjects
   };
 }
Index: /code/branches/network/src/orxonox/objects/Model.cc
===================================================================
--- /code/branches/network/src/orxonox/objects/Model.cc	(revision 1774)
+++ /code/branches/network/src/orxonox/objects/Model.cc	(revision 1775)
@@ -86,5 +86,5 @@
       }
       if(this->isExactlyA(Class(Model)))
-        setObjectFrequency(300); //sync all 10 seconds (this only applies to asteroids and other isExactlyA(Model)
+        setObjectFrequency(1); //sync all 10 seconds (this only applies to asteroids and other isExactlyA(Model)
       return true;
     }
