Index: code/branches/network/src/network/Client.cc
===================================================================
--- code/branches/network/src/network/Client.cc	(revision 1433)
+++ code/branches/network/src/network/Client.cc	(revision 1440)
@@ -140,34 +140,7 @@
   }
 
-  /**
-  * submits a MouseAction to the server
-  * @param x x Coordinate
-  * @param y y Coordinate
-  * @return true/false
-  */
-  bool Client::sendMouse(double x, double y){
-    // generate packet and add it to the queue
-    if(!isConnected)
-      return false;
-    if(!client_connection.addPacket(pck_gen.mousem(x, y)))
-      return false;
-    // send packets
-    return client_connection.sendPackets();
-  }
-
-  /**
-  * submits a Keystrike to the server
-  * @param key_code code to submit
-  * @return true/false
-  */
-  bool Client::sendKeyboard(char key_code){
-    // generate packet and add it to queue
-    if(!isConnected)
-      return false;
-    if(!client_connection.addPacket(pck_gen.keystrike(key_code)))
-      return false;
-    // send packets
-    return client_connection.sendPackets();
-  }
+  
+
+  
 
   /**
@@ -186,30 +159,4 @@
   }
 
-  /**
-  * Adds a MouseAction to the PacketQueue
-  * @param x x Coordinate
-  * @param y y Coordinate
-  * @return true/false
-  */
-  bool Client::addMouse(double x, double y){
-    // generate packet and add it to the queue
-    if(client_connection.addPacket(pck_gen.mousem(x, y)))
-      return true;
-    else
-      return false;
-  }
-
-  /**
-  * Adds a Keystrike to the PacketQueue
-  * @param key_code
-  * @return true/false
-  */
-  bool Client::addKeyboard(char key_code){
-    // generate packet and add it to queue
-    if(client_connection.addPacket(pck_gen.keystrike(key_code)))
-      return true;
-    else
-      return false;
-  }
 
   /**
Index: code/branches/network/src/network/Client.h
===================================================================
--- code/branches/network/src/network/Client.h	(revision 1433)
+++ code/branches/network/src/network/Client.h	(revision 1440)
@@ -75,11 +75,6 @@
     bool closeConnection();
 
-    bool sendMouse(double x, double y);
-    bool sendKeyboard(char key_code);
     bool sendChat( std::string message );
-
-    bool addMouse(double x, double y);
-    bool addKeyboard(char key_code);
-
+    
     bool sendPackets();
     
Index: code/branches/network/src/network/PacketDecoder.cc
===================================================================
--- code/branches/network/src/network/PacketDecoder.cc	(revision 1433)
+++ code/branches/network/src/network/PacketDecoder.cc	(revision 1440)
@@ -68,10 +68,4 @@
     case COMMAND:
       return command( packet, clientId );
-    case MOUSE:
-      mousem( packet, clientId );
-      return true;
-    case KEYBOARD:
-      keystrike( packet, clientId );
-      return true;
     case CHAT:
       chatMessage( packet, clientId );
@@ -135,26 +129,4 @@
   }
 
-  void PacketDecoder::mousem( ENetPacket* packet, int clientId )
-  {
-    mouse* mouseMove = new mouse;
-    //copy data of packet->data to new struct
-    *mouseMove = *(mouse*)packet->data;
-
-    //clean memory
-    enet_packet_destroy( packet );
-    printMouse( mouseMove ); //debug info
-  }
-
-  void PacketDecoder::keystrike( ENetPacket* packet, int clientId )
-  {
-    keyboard* key = new keyboard;
-    *key = *(keyboard*)packet->data; //see above
-
-    //clean memory
-    enet_packet_destroy( packet );
-    printKey( key ); //debug info
-
-  }
-
   void PacketDecoder::chatMessage( ENetPacket* packet, int clientId )
   {
@@ -189,7 +161,4 @@
       return;
     }
-    //since it's not alowed to use void* for pointer arithmetic
-    //FIXME: variable never used
-    unsigned char* data = (unsigned char *)(packet->data);
     //copy the GameStateCompressed id into the struct, which is located at second place data+sizeof( int )
     memcpy( (void*)&(currentState->id), (const void*)(packet->data+1*sizeof( int )), sizeof( int) );
@@ -307,15 +276,4 @@
   }
 
-  void PacketDecoder::printMouse( mouse* data )
-  {
-    COUT(5) << "data id: " << data->id << std::endl;
-    COUT(5) << "data:    " << data->x << " " << data->y << std::endl;
-  }
-
-  void PacketDecoder::printKey( keyboard* data )
-  {
-    COUT(5) << "data id: " << data->id << std::endl;
-    COUT(5) << "data:    " << (char)data->press << std::endl;
-  }
 
   void PacketDecoder::printChat( chat* data, int clientId )
Index: code/branches/network/src/network/PacketGenerator.cc
===================================================================
--- code/branches/network/src/network/PacketGenerator.cc	(revision 1433)
+++ code/branches/network/src/network/PacketGenerator.cc	(revision 1440)
@@ -78,10 +78,10 @@
   {
     COUT(4) << "PacketGenerator: generating new acknowledgement, id: " << state << std::endl;
-    ack* ackreq = new ack;
+    
+    ENetPacket *packet = enet_packet_create( NULL , sizeof( ack ), reliable );
+    ack* ackreq = (ack *)packet->data;
     ackreq->id = ACK;
     ackreq->a = state;
-
-    ENetPacket *packet = enet_packet_create( ackreq , sizeof( *ackreq ), reliable );
-    delete ackreq;
+    //delete ackreq;
     return packet;
   }
@@ -103,30 +103,4 @@
   }
 
-  /*### mouseupdates */
-  ENetPacket* PacketGenerator::mousem( double x, double y, int reliable )
-  {
-    COUT(4) << "PacketGenerator: generating new mouse" << std::endl;
-    mouse* mousemove = new mouse;
-    mousemove->id = MOUSE;
-    mousemove->x = x;
-    mousemove->y = y;
-
-    ENetPacket *packet = enet_packet_create( mousemove , sizeof( *mousemove ), reliable );
-    delete mousemove;
-    return packet;
-  }
-
-  /*### keystrikes updates */
-  ENetPacket* PacketGenerator::keystrike( char press, int reliable )
-  {
-    COUT(4) << "PacketGenerator: generating new keyboard" << std::endl;
-    keyboard* key = new keyboard;
-    key->id = KEYBOARD;
-    key->press = press;
-
-    ENetPacket *packet = enet_packet_create( key , sizeof( *key ), reliable );
-    delete key;
-    return packet;
-  }
 
   /*### chat messages packet */
@@ -154,5 +128,7 @@
     if(totalLen==0)
       return NULL;
-    unsigned char *data = new unsigned char[totalLen];
+    ENetPacket *packet = enet_packet_create( NULL , totalLen+sizeof(uint32_t), reliable );
+    //unsigned char *data = new unsigned char[totalLen];
+    unsigned char *data = packet->data;
     memcpy( (void*)(data), (const void*)&gid, sizeof( int ) ); //this is the enet id
     memcpy( (void*)(data+sizeof(int)), (const void*)&(states->id), sizeof(int) ); //the GameStateCompressed id
@@ -167,6 +143,5 @@
     //create an enet packet with the generated bytestream
     COUT(4) << "PacketGenerator generating totalLen " << totalLen << std::endl;
-    ENetPacket *packet = enet_packet_create( data , totalLen, reliable );
-    delete[] data;
+    //delete[] data;
     if(!addCRC(packet))
       COUT(3) << "could not add crc to gamestate packet" << std::endl;
@@ -212,14 +187,14 @@
   bool PacketGenerator::addCRC( ENetPacket *packet){
     unsigned char *data = packet->data;
-    uint32_t crc32=calcCRC(data, packet->dataLength);
+    uint32_t crc32=calcCRC(data, packet->dataLength-sizeof(uint32_t));
     // now append the crc to the packet data
-    int oldlength = packet->dataLength;
-    if(enet_packet_resize(packet, packet->dataLength+sizeof(uint32_t))==0){
+    int oldlength = packet->dataLength-sizeof(uint32_t);
+    //if(enet_packet_resize(packet, packet->dataLength+sizeof(uint32_t))==0){
       memcpy(&packet->data[oldlength], &crc32, sizeof(uint32_t));
       return true;
-    }else{
-      COUT(3) << "could not add crc to gamestate" << std::endl;
-      return false;
-    }
+    //}else{
+     // COUT(3) << "could not add crc to gamestate" << std::endl;
+     // return false;
+    //}
   }
 
Index: code/branches/network/src/network/PacketManager.h
===================================================================
--- code/branches/network/src/network/PacketManager.h	(revision 1433)
+++ code/branches/network/src/network/PacketManager.h	(revision 1440)
@@ -59,6 +59,4 @@
     ENetPacket* acknowledgement( int state, int reliable = 0 ); // we do not want reliability
     ENetPacket* command( int dataLength, void *data, int reliable = ENET_PACKET_FLAG_RELIABLE );
-    ENetPacket* mousem( double x, double y, int reliable = ENET_PACKET_FLAG_RELIABLE );
-    ENetPacket* keystrike( char press, int reliable = ENET_PACKET_FLAG_RELIABLE );
     ENetPacket* chatMessage( const char* message, int reliable = ENET_PACKET_FLAG_RELIABLE );
     ENetPacket* gstate( GameStateCompressed *states, int reliable = 0 ); // we do not want reliability of gamestates
@@ -94,6 +92,4 @@
     void acknowledgement( ENetPacket* packet, int clientId = CLIENTID_CLIENT );
     bool command( ENetPacket* packet, int clientId );
-    void mousem( ENetPacket* packet, int clientId = CLIENTID_CLIENT );
-    void keystrike( ENetPacket* packet, int clientId = CLIENTID_CLIENT );
     void chatMessage( ENetPacket* packet, int clientId = CLIENTID_CLIENT );
     void gstate( ENetPacket* packet, int clientID = CLIENTID_CLIENT );
@@ -113,6 +109,4 @@
     //print functions
     void printAck( ack* data );
-    void printMouse( mouse* data );
-    void printKey( keyboard* data );
     void printChat( chat* data, int clientId );
     void printGamestate( GameStateCompressed *data );
Index: code/branches/network/src/network/PacketTypes.h
===================================================================
--- code/branches/network/src/network/PacketTypes.h	(revision 1433)
+++ code/branches/network/src/network/PacketTypes.h	(revision 1440)
@@ -48,7 +48,5 @@
   enum packet_id {
     ACK,
-    MOUSE,
     COMMAND,
-    KEYBOARD,
     CHAT,
     GAMESTATE ,
@@ -104,14 +102,4 @@
   };
 
-  struct mouse {
-    int id;
-    double x;
-    double y;
-  };
-
-  struct keyboard {
-    int id;
-    char press;
-  };
   //only in this class, not PacketGenerator, used as pattern to put incoming
   //bytes inside
