Index: code/branches/netp6/src/network/CMakeLists.txt
===================================================================
--- code/branches/netp6/src/network/CMakeLists.txt	(revision 3215)
+++ code/branches/netp6/src/network/CMakeLists.txt	(revision 3227)
@@ -31,5 +31,4 @@
   NetworkFunction.cc
   Host.cc
-  PacketBuffer.cc
   Server.cc
   ServerConnection.cc
Index: code/branches/netp6/src/network/GamestateClient.cc
===================================================================
--- code/branches/netp6/src/network/GamestateClient.cc	(revision 3215)
+++ code/branches/netp6/src/network/GamestateClient.cc	(revision 3227)
@@ -52,4 +52,9 @@
 
   GamestateClient::~GamestateClient() {
+      std::map<unsigned int, packet::Gamestate *>::iterator it;
+      for ( it = this->gamestateMap_.begin(); it != this->gamestateMap_.end(); ++it )
+          delete (*it).second;
+      if( this->tempGamestate_ )
+          delete this->tempGamestate_;
   }
 
Index: code/branches/netp6/src/network/GamestateClient.h
===================================================================
--- code/branches/netp6/src/network/GamestateClient.h	(revision 3215)
+++ code/branches/netp6/src/network/GamestateClient.h	(revision 3227)
@@ -73,5 +73,4 @@
     std::map<unsigned int, packet::Gamestate *> gamestateMap_;
     packet::Gamestate *tempGamestate_; // we save the received gamestates here during processQueue
-    unsigned char *shipCache_;
 
   };
Index: code/branches/netp6/src/network/GamestateManager.cc
===================================================================
--- code/branches/netp6/src/network/GamestateManager.cc	(revision 3215)
+++ code/branches/netp6/src/network/GamestateManager.cc	(revision 3227)
@@ -61,7 +61,14 @@
   {
     if( this->reference )
-      delete this->reference;
-    for( std::map<unsigned int, packet::Gamestate*>::iterator it = gamestateQueue.begin(); it != gamestateQueue.end(); it++ )
+        delete this->reference;std::map<unsigned int, packet::Gamestate*>::iterator it;
+    for( it = gamestateQueue.begin(); it != gamestateQueue.end(); ++it )
       delete (*it).second;
+    std::map<unsigned int, std::map<unsigned int, packet::Gamestate*> >::iterator it1;
+    std::map<unsigned int, packet::Gamestate*>::iterator it2;
+    for( it1 = gamestateMap_.begin(); it1 != gamestateMap_.end(); ++it1 )
+    {
+      for( it2 = it1->second.begin(); it2 != it1->second.end(); ++it2 )
+        delete (*it2).second;
+    }
     delete trafficControl_;
   }
Index: code/branches/netp6/src/network/NetworkPrereqs.h
===================================================================
--- code/branches/netp6/src/network/NetworkPrereqs.h	(revision 3215)
+++ code/branches/netp6/src/network/NetworkPrereqs.h	(revision 3227)
@@ -102,5 +102,4 @@
   template <class T> class NetworkMemeberFunction;
   struct NetworkFunctionPointer;
-  class PacketBuffer;
   class Server;
   class ServerConnection;
Index: code/branches/netp6/src/network/PacketBuffer.cc
===================================================================
--- code/branches/netp6/src/network/PacketBuffer.cc	(revision 3215)
+++ 	(revision )
@@ -1,146 +1,0 @@
-/*
- *   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) 2007
- *   Co-authors:
- *      ...
- *
- */
-
-// C++ PacketBuffer
-// d
-// Author Oliver Scheuss
-
-#include "PacketBuffer.h"
-
-//#include <iostream>
-#include <boost/thread/recursive_mutex.hpp>
-
-namespace orxonox
-{
-  static boost::recursive_mutex packetBuffer_mutex_g;
-
-  PacketBuffer::PacketBuffer() {
-    closed=false;
-    first=NULL;
-    last=NULL;
-  }
-  //this is needed in order to make the packetbuffer threadsafe
-
-
-  bool PacketBuffer::push(ENetEvent *ev) {
-    boost::recursive_mutex::scoped_lock lock(packetBuffer_mutex_g);
-    //std::cout << "event size inside packetbuffer " << ev->packet->dataLength << std::endl;
-    //   if(closed)
-    //     return false;
-    // first element?
-    if(first==NULL){
-      first=new QueueItem;
-      last=first;
-      last->next=NULL;
-      // change this!!!!!!!  ---- we are not doing stl so we won't change this
-      last->event = ev;
-      //last->address = ev->peer->address;
-    } else {
-      //insert a new element at the bottom
-      last->next = new QueueItem;
-      last=last->next;
-      // initialize last->next
-      last->next=NULL;
-      // save the packet to the new element
-      last->event = ev;
-      //last->address = ev->peer->address;
-    }
-    lock.unlock();
-    return true;
-  }
-
-  //returns the first element in the list without deleting it but
-  //moving first pointer to next element
-  /*ENetPacket *PacketBuffer::pop() {
-    ENetAddress address;
-    return pop(address);
-  }*/
-  
-  ENetEvent *PacketBuffer::pop(){
-    boost::recursive_mutex::scoped_lock lock(packetBuffer_mutex_g);
-    //std::cout << "packetbuffer pop(address)" << std::endl;
-    if(first!=NULL /*&& !closed*/){
-      QueueItem *temp = first;
-      // get packet
-      ENetEvent *ev=first->event;
-      //address = first->address;
-      // remove first element
-      first = first->next;
-      delete temp;
-      lock.unlock();
-      //std::cout << "pop(address) size of packet " << pck->dataLength << std::endl;
-      return ev;
-    } else{
-      lock.unlock();
-      return NULL;
-    }
-  }
-
-  /*ENetPacket *PacketBuffer::pop(ENetAddress &address) {
-    boost::recursive_mutex::scoped_lock lock(packetBuffer_mutex_g);
-    //std::cout << "packetbuffer pop(address)" << std::endl;
-    if(first!=NULL ){
-      QueueItem *temp = first;
-      // get packet
-      ENetPacket *pck=first->event->packet;
-      address = first->event->peer->address;
-      // remove first element
-      first = first->next;
-      delete temp;
-      lock.unlock();
-      //std::cout << "pop(address) size of packet " << pck->dataLength << std::endl;
-      return pck;
-    } else{
-      lock.unlock();
-      return NULL;
-    }
-  }*/
-
-  bool PacketBuffer::isEmpty() {
-    return (first==NULL);
-  }
-
-  void PacketBuffer::print() {
-    QueueItem *temp=first;
-    while(temp!=NULL){
-      //    std::cout << temp->packet->data << std::endl;
-      temp=temp->next;
-    }
-
-  }
-
-  bool PacketBuffer::isClosed() {
-    return closed;
-  }
-
-  void PacketBuffer::setClosed(bool value){
-    closed=value;
-    return;
-  }
-
-} // namespace orxonox
Index: code/branches/netp6/src/network/PacketBuffer.h
===================================================================
--- code/branches/netp6/src/network/PacketBuffer.h	(revision 3215)
+++ 	(revision )
@@ -1,80 +1,0 @@
-/*
- *   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) 2007
- *   Co-authors:
- *      ...
- *
- */
-
-//
-// C++ Interface: PacketBuffer
-//
-// Description:
-//
-//
-// Author:  Oliver Scheuss, (C) 2007
-//
-// Copyright: See COPYING file that comes with this distribution
-//
-//
-
-#ifndef _PacketBuffer_H__
-#define _PacketBuffer_H__
-
-#include "NetworkPrereqs.h"
-
-namespace orxonox
-{
-  struct _NetworkExport PacketEnvelope{
-    int length;
-    int data;
-  };
-
-  struct _NetworkExport QueueItem{
-    ENetEvent *event;
-    //ENetAddress address;
-    QueueItem *next;
-  };
-
-  class _NetworkExport PacketBuffer{
-  public:
-    PacketBuffer();
-    bool isEmpty();
-    bool isClosed();
-    void setClosed(bool value);
-    void print();
-    // pops a packet from the queue
-    //ENetPacket *pop();
-    //ENetPacket *pop(ENetAddress &address);
-    ENetEvent *pop();
-    // pushs a packet to the queue
-    bool push(ENetEvent *ev);
-
-  private:
-    QueueItem *first;
-    QueueItem *last;
-    bool closed;
-  };
-
-} //namespace
-#endif /* _PacketBuffer_H__ */
Index: code/branches/netp6/src/network/synchronisable/Synchronisable.h
===================================================================
--- code/branches/netp6/src/network/synchronisable/Synchronisable.h	(revision 3215)
+++ code/branches/netp6/src/network/synchronisable/Synchronisable.h	(revision 3227)
@@ -43,8 +43,4 @@
 #include "NetworkCallback.h"
 
-/*#define REGISTERDATA(varname, ...) \
-    registerVariable((void*)&varname, sizeof(varname), DATA, __VA_ARGS__)
-#define REGISTERSTRING(stringname, ...) \
-    registerVariable(&stringname, stringname.length()+1, STRING, __VA_ARGS__)*/
 
 namespace orxonox
Index: code/branches/netp6/src/network/synchronisable/SynchronisableSpecialisations.cc
===================================================================
--- code/branches/netp6/src/network/synchronisable/SynchronisableSpecialisations.cc	(revision 3215)
+++ code/branches/netp6/src/network/synchronisable/SynchronisableSpecialisations.cc	(revision 3227)
@@ -73,8 +73,4 @@
     registerVariable(variable.y, mode, cb, bidirectional);
   }
-//   template <> void Synchronisable::registerVariable( Vector2& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional)
-//   {
-//     registerVariable( (const ColourValue&)variable, mode, cb, bidirectional);
-//   }
   
   template <> void Synchronisable::registerVariable( const Vector3& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional)
