Index: code/branches/network/src/network/packet/Acknowledgement.cc
===================================================================
--- code/branches/network/src/network/packet/Acknowledgement.cc	(revision 1834)
+++ code/branches/network/src/network/packet/Acknowledgement.cc	(revision 1890)
@@ -40,15 +40,15 @@
 #define _ACKID              _PACKETID + sizeof(network::packet::ENUM::Type)
   
-Acknowledgement::Acknowledgement( unsigned int id, int clientID )
+Acknowledgement::Acknowledgement( unsigned int id, unsigned int clientID )
  : Packet()
 {
   flags_ = flags_ | PACKET_FLAGS_ACK;
-  data_=new unsigned char[ getSize() ];
+  data_=new uint8_t[ getSize() ];
   *(ENUM::Type *)(data_ + _PACKETID ) = ENUM::Acknowledgement;
-  *(unsigned int *)(data_ + _ACKID ) = id;
+  *(uint32_t *)(data_ + _ACKID ) = id;
   clientID_=clientID;
 }
 
-Acknowledgement::Acknowledgement( unsigned char *data, int clientID )
+Acknowledgement::Acknowledgement( uint8_t *data, unsigned int clientID )
   : Packet(data, clientID)
 {
@@ -60,5 +60,5 @@
 
 unsigned int Acknowledgement::getSize() const{
-  return _ACKID + sizeof(unsigned int);
+  return _ACKID + sizeof(uint32_t);
 }
 
@@ -70,5 +70,5 @@
 
 unsigned int Acknowledgement::getAckID(){
-  return *(unsigned int *)(data_ + _ACKID);
+  return *(uint32_t *)(data_ + _ACKID);
 }
 
Index: code/branches/network/src/network/packet/Acknowledgement.h
===================================================================
--- code/branches/network/src/network/packet/Acknowledgement.h	(revision 1834)
+++ code/branches/network/src/network/packet/Acknowledgement.h	(revision 1890)
@@ -40,6 +40,6 @@
 {
 public:
-  Acknowledgement( unsigned int id, int clientID );
-  Acknowledgement( unsigned char* data, int clientID );
+  Acknowledgement( unsigned int id, unsigned int clientID );
+  Acknowledgement( uint8_t* data, unsigned int clientID );
   ~Acknowledgement();
   
Index: code/branches/network/src/network/packet/Chat.cc
===================================================================
--- code/branches/network/src/network/packet/Chat.cc	(revision 1834)
+++ code/branches/network/src/network/packet/Chat.cc	(revision 1890)
@@ -37,6 +37,6 @@
 #define   _PACKETID         0
 const int _PLAYERID     =   _PACKETID + sizeof(ENUM::Type);
-#define   _MESSAGELENGTH    _PLAYERID + sizeof(unsigned int)
-#define   _MESSAGE          _MESSAGELENGTH + sizeof(unsigned int)
+#define   _MESSAGELENGTH    _PLAYERID + sizeof(uint32_t)
+#define   _MESSAGE          _MESSAGELENGTH + sizeof(uint32_t)
 
 Chat::Chat( std::string message, unsigned int playerID )
@@ -52,8 +52,8 @@
 }
 
-Chat::Chat( unsigned char *data, int clientID )
+Chat::Chat( uint8_t* data, unsigned int clientID )
   : Packet(data, clientID)
 {
-  messageLength_ = *(unsigned int *)(data + _MESSAGELENGTH );
+  messageLength_ = *(uint32_t *)(data + _MESSAGELENGTH );
 }
 
@@ -67,5 +67,5 @@
 
 bool Chat::process(){
-  bool b = Host::incomingChat(std::string((const char*)data_+_MESSAGE), *(unsigned int *)(data_+_PLAYERID));
+  bool b = Host::incomingChat(std::string((const char*)data_+_MESSAGE), *(uint32_t *)(data_+_PLAYERID));
   delete this;
   return b;
Index: code/branches/network/src/network/packet/Chat.h
===================================================================
--- code/branches/network/src/network/packet/Chat.h	(revision 1834)
+++ code/branches/network/src/network/packet/Chat.h	(revision 1890)
@@ -16,5 +16,5 @@
 public:
   Chat( std::string message, unsigned int playerID );
-  Chat( unsigned char* data, int clientID );
+  Chat( uint8_t* data, unsigned int clientID );
   ~Chat();
   
@@ -25,6 +25,6 @@
   unsigned char *getMessage();
 private:
-  unsigned int messageLength_;
-  int clientID_;
+  uint32_t messageLength_;
+  unsigned int clientID_;
 };
 
Index: code/branches/network/src/network/packet/ClassID.cc
===================================================================
--- code/branches/network/src/network/packet/ClassID.cc	(revision 1834)
+++ code/branches/network/src/network/packet/ClassID.cc	(revision 1890)
@@ -40,5 +40,5 @@
 #define _PACKETID             0
 #define _CLASSID              _PACKETID + sizeof(ENUM::Type)
-#define _CLASSNAMELENGTH      _CLASSID + sizeof(unsigned int)
+#define _CLASSNAMELENGTH      _CLASSID + sizeof(uint32_t)
 #define _CLASSNAME            _CLASSNAMELENGTH + sizeof(classNameLength_)
   
@@ -57,5 +57,5 @@
 }
 
-ClassID::ClassID( unsigned char *data, int clientID )
+ClassID::ClassID( uint8_t* data, unsigned int clientID )
   : Packet(data, clientID)
 {
@@ -68,5 +68,5 @@
 
 unsigned int ClassID::getSize() const{
-  return sizeof(network::packet::ENUM::Type) + 2*sizeof(unsigned int) + classNameLength_;
+  return sizeof(network::packet::ENUM::Type) + 2*sizeof(uint32_t) + classNameLength_;
 }
 
@@ -82,5 +82,5 @@
 
 unsigned int ClassID::getClassID(){
-  return *(unsigned int *)&data_[ _CLASSID ];
+  return *(uint32_t *)(data_ + _CLASSID);
 }
 
Index: code/branches/network/src/network/packet/ClassID.h
===================================================================
--- code/branches/network/src/network/packet/ClassID.h	(revision 1834)
+++ code/branches/network/src/network/packet/ClassID.h	(revision 1890)
@@ -43,5 +43,5 @@
 public:
   ClassID( unsigned int classID, std::string className );
-  ClassID( unsigned char* data, int clientID );
+  ClassID( uint8_t* data, unsigned int clientID );
   ~ClassID();
   
@@ -53,5 +53,5 @@
   unsigned char *getClassName();
 private:
-  unsigned int classNameLength_;
+  uint32_t classNameLength_;
 };
 
Index: code/branches/network/src/network/packet/DeleteObjects.cc
===================================================================
--- code/branches/network/src/network/packet/DeleteObjects.cc	(revision 1834)
+++ code/branches/network/src/network/packet/DeleteObjects.cc	(revision 1890)
@@ -40,5 +40,5 @@
 #define _PACKETID           0
 #define _QUANTITY           _PACKETID + sizeof(ENUM::Type)
-#define _OBJECTIDS          _QUANTITY + sizeof(unsigned int)
+#define _OBJECTIDS          _QUANTITY + sizeof(uint32_t)
   
 DeleteObjects::DeleteObjects()
@@ -48,5 +48,5 @@
 }
 
-DeleteObjects::DeleteObjects( unsigned char *data, int clientID )
+DeleteObjects::DeleteObjects( uint8_t *data, unsigned int clientID )
   : Packet(data, clientID)
 {
@@ -61,10 +61,10 @@
   if(number==0)
     return false;
-  unsigned int size = sizeof(ENUM::Type) + sizeof(unsigned int)*number;
-  data_ = new unsigned char[size];
+  unsigned int size = sizeof(ENUM::Type) + sizeof(uint32_t)*(number+1);
+  data_ = new uint8_t[size];
   *(ENUM::Type *)(data_ + _PACKETID ) = ENUM::DeleteObjects;
-  *(unsigned int *)(data_ + _QUANTITY) = number;
+  *(uint32_t *)(data_ + _QUANTITY) = number;
   for(unsigned int i=0; i<number; i++){
-    *(unsigned int *)(data_ + sizeof(ENUM::Type) + i*sizeof(unsigned int)) = Synchronisable::popDeletedObject();
+    *(uint32_t *)(data_ + sizeof(ENUM::Type) + (i+1)*sizeof(uint32_t)) = Synchronisable::popDeletedObject();
   }
   return true;
@@ -73,11 +73,11 @@
 unsigned int DeleteObjects::getSize() const{
   assert(data_);
-  return _OBJECTIDS + sizeof(unsigned int) + *(unsigned int*)(data_+_QUANTITY);
+  return _OBJECTIDS + *(uint32_t*)(data_+_QUANTITY)*sizeof(uint32_t);
 }
 
 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)) );
+    COUT(3) << "deleting object with id: " << *(uint32_t*)(data_+_OBJECTIDS+i*sizeof(uint32_t)) << std::endl;
+    Synchronisable::deleteObject( *(uint32_t*)(data_+_OBJECTIDS+i*sizeof(uint32_t)) );
   }
   return true;
Index: code/branches/network/src/network/packet/DeleteObjects.h
===================================================================
--- code/branches/network/src/network/packet/DeleteObjects.h	(revision 1834)
+++ code/branches/network/src/network/packet/DeleteObjects.h	(revision 1890)
@@ -41,5 +41,5 @@
 public:
   DeleteObjects( );
-  DeleteObjects( unsigned char* data, int clientID );
+  DeleteObjects( uint8_t* data, unsigned int clientID );
   ~DeleteObjects();
   
Index: code/branches/network/src/network/packet/Packet.cc
===================================================================
--- code/branches/network/src/network/packet/Packet.cc	(revision 1834)
+++ code/branches/network/src/network/packet/Packet.cc	(revision 1890)
@@ -67,5 +67,5 @@
 }
 
-Packet::Packet(unsigned char *data, int clientID){
+Packet::Packet(uint8_t *data, unsigned int clientID){
   flags_ = PACKET_FLAG_DEFAULT;
   packetDirection_ = ENUM::Incoming;
@@ -75,10 +75,4 @@
 }
 
-/*Packet::Packet(ENetPacket *packet, ENetPeer *peer){
-  packetDirection_ = ENUM::Incoming;
-  enetPacket_ = packet;
-  clientID_ = ClientInformation::findClient(&peer->address)->getID();
-  data_ = packet->data;
-}*/
 
 Packet::Packet(const Packet &p){
@@ -88,5 +82,5 @@
   clientID_ = p.clientID_;
   if(p.data_){
-    data_ = new unsigned char[p.getSize()];
+    data_ = new uint8_t[p.getSize()];
     memcpy(data_, p.data_, p.getSize());
   }else
@@ -139,5 +133,5 @@
 
 Packet *Packet::createPacket(ENetPacket *packet, ENetPeer *peer){
-  unsigned char *data = packet->data;
+  uint8_t *data = packet->data;
   unsigned int clientID = ClientInformation::findClient(&peer->address)->getID();
   Packet *p;
Index: code/branches/network/src/network/packet/Packet.h
===================================================================
--- code/branches/network/src/network/packet/Packet.h	(revision 1834)
+++ code/branches/network/src/network/packet/Packet.h	(revision 1890)
@@ -31,4 +31,6 @@
 #include <map>
 #include <enet/enet.h>
+
+#include "util/Integers.h"
 
 namespace network {
@@ -75,10 +77,10 @@
   protected:
     Packet();
-    Packet(unsigned char *data, int clientID);
+    Packet(uint8_t *data, unsigned int clientID);
 //    Packet(ENetPacket *packet, ENetPeer *peer);
     enet_uint32 flags_;
-    int clientID_;
+    unsigned int clientID_;
     ENUM::Direction packetDirection_;
-    unsigned char *data_;
+    uint8_t *data_;
   private:
     static std::map<ENetPacket *, Packet *> packetMap_;
Index: code/branches/network/src/network/packet/Welcome.cc
===================================================================
--- code/branches/network/src/network/packet/Welcome.cc	(revision 1834)
+++ code/branches/network/src/network/packet/Welcome.cc	(revision 1890)
@@ -42,5 +42,5 @@
 #define _PACKETID             0
 #define _CLIENTID             _PACKETID + sizeof(ENUM::Type)
-#define _SHIPID               _CLIENTID + sizeof(unsigned int)
+#define _SHIPID               _CLIENTID + sizeof(uint32_t)
   
   Welcome::Welcome( unsigned int clientID, unsigned int shipID )
@@ -49,12 +49,12 @@
   flags_ = flags_ | PACKET_FLAGS_CLASSID;
   assert(getSize());
-  data_=new unsigned char[ getSize() ];
+  data_=new uint8_t[ getSize() ];
   assert(data_);
   *(packet::ENUM::Type *)(data_ + _PACKETID ) = packet::ENUM::Welcome;
-  *(unsigned int *)&data_[ _CLIENTID ] = clientID;
-  *(unsigned int *)&data_[ _SHIPID ] = shipID;
+  *(uint32_t *)&data_[ _CLIENTID ] = clientID;
+  *(uint32_t *)&data_[ _SHIPID ] = shipID;
 }
 
-Welcome::Welcome( unsigned char *data, int clientID )
+Welcome::Welcome( uint8_t* data, unsigned int clientID )
   : Packet(data, clientID)
 {
@@ -65,16 +65,16 @@
 }
 
-unsigned char *Welcome::getData(){
+uint8_t *Welcome::getData(){
   return data_;
 }
 
 unsigned int Welcome::getSize() const{
-  return sizeof(network::packet::ENUM::Type) + 2*sizeof(unsigned int);
+  return sizeof(network::packet::ENUM::Type) + 2*sizeof(uint32_t);
 }
 
 bool Welcome::process(){
   unsigned int shipID, clientID;
-  clientID = *(unsigned int *)&data_[ _CLIENTID ];
-  shipID = *(unsigned int *)&data_[ _SHIPID ];
+  clientID = *(uint32_t *)&data_[ _CLIENTID ];
+  shipID = *(uint32_t *)&data_[ _SHIPID ];
   Host::setClientID(clientID);
   Host::setShipID(shipID);
Index: code/branches/network/src/network/packet/Welcome.h
===================================================================
--- code/branches/network/src/network/packet/Welcome.h	(revision 1834)
+++ code/branches/network/src/network/packet/Welcome.h	(revision 1890)
@@ -41,8 +41,8 @@
 public:
   Welcome( unsigned int clientID, unsigned int shipID );
-  Welcome( unsigned char* data, int clientID );
+  Welcome( uint8_t* data, unsigned int clientID );
   virtual ~Welcome();
   
-  unsigned char *getData();
+  uint8_t *getData();
   inline unsigned int getSize() const;
   bool process();
