Index: /code/branches/network/src/network/Client.cc
===================================================================
--- /code/branches/network/src/network/Client.cc	(revision 229)
+++ /code/branches/network/src/network/Client.cc	(revision 229)
@@ -0,0 +1,142 @@
+//
+// C++ Implementation: Client
+//
+// Description: 
+//
+//
+// Author:  <>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#include "network/Client.h"
+
+namespace network{
+  
+  /**
+   * Constructor for the Client class
+   * initializes the address and the port to default localhost:NETWORK_PORT
+   */
+  Client::Client(): client_connection(NETWORK_PORT,"127.0.0.1"){
+    // set server address to localhost
+    //server_address="127.0.0.1";
+    //port = NETWORK_PORT;
+    isConnected=false;
+  }
+  
+  /**
+   * Constructor for the Client class
+   * @param address the server address
+   * @param port port of the application on the server
+   */
+  Client::Client(std::string address, int port) : client_connection(port, address){
+    //server_address=address.c_str();
+    //this->port = port;
+    isConnected=false;
+  }
+  
+  /**
+   * Constructor for the Client class
+   * @param address the server address
+   * @param port port of the application on the server
+   */
+  Client::Client(const char *address, int port) : client_connection(port, address){
+    //server_address = address;
+    //this->port = port;
+    isConnected=false;
+  }
+  
+  /**
+   * Establish the Connection to the Server
+   * @return true/false
+   */
+  bool Client::establishConnection(){
+    isConnected=client_connection.createConnection();
+    return isConnected;
+  }
+  
+  /**
+   * closes the Connection to the Server
+   * @return true/false
+   */
+  bool Client::closeConnection(){
+    isConnected=false;
+    return client_connection.closeConnection();
+  }
+  
+  /**
+   * submits a MouseAction to the server
+   * @param x x Coordinate
+   * @param y y Coordinate
+   * @return true/false
+   */
+  bool Client::sendMouse(double x, double y){
+    ENetEvent event;
+    // generate packet and add it to the queue
+    if(!client_connection.addPacket(pck_gen.mousem(x, y)))
+        return false;
+    // send packets
+    client_connection.sendPackets(&event);
+    if(event.type==ENET_EVENT_TYPE_NONE)
+      return true;
+    else
+      return false;
+  }
+  
+  /**
+   * submits a Keystrike to the server
+   * @param key_code code to submit
+   * @return true/false
+   */
+  bool Client::sendKeyboard(char key_code){
+    ENetEvent event;
+    // generate packet and add it to queue
+    if(!client_connection.addPacket(pck_gen.keystrike(key_code)))
+        return false;
+    // send packets
+    client_connection.sendPackets(&event);
+    if(event.type==ENET_EVENT_TYPE_NONE)
+      return true;
+    else
+      return false;
+  }
+  
+  /**
+   * 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){
+    ENetEvent event;
+    // generate packet and add it to queue
+    if(client_connection.addPacket(pck_gen.keystrike(key_code)))
+      return true;
+    else
+      return false;
+  }
+  
+  /**
+   * Performs a GameState update
+   */
+  void Client::update(){
+    // to be implemented ==================
+    
+    
+  }
+  
+}
Index: /code/branches/network/src/network/Client.h
===================================================================
--- /code/branches/network/src/network/Client.h	(revision 229)
+++ /code/branches/network/src/network/Client.h	(revision 229)
@@ -0,0 +1,58 @@
+//
+// C++ Interface: Client
+//
+// Description: 
+//
+//
+// Author:  <>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#ifndef NETWORK_CLIENT_H
+#define NETWORK_CLIENT_H
+
+#include <string>
+
+#include "network/ClientConnection.h"
+#include "network/PacketManager.h"
+
+
+namespace network{
+
+/**
+ * The network/Client class
+ * This class implements all necessary function for the network communication
+ * It is the root class of the network module
+ * 
+ */
+class Client : PacketDecoder{
+  public:
+  Client();
+  Client(std::string address, int port);
+  Client(const char *address, int port);
+  
+  bool establishConnection();
+  bool closeConnection();
+  
+  bool sendMouse(double x, double y);
+  bool sendKeyboard(char key_code);
+  
+  bool addMouse(double x, double y);
+  bool addKeyboard(char key_code);
+  
+  void update();
+  
+  private:
+  ClientConnection client_connection;
+  PacketGenerator pck_gen;
+  
+  //const char *server_address;
+  //int port;
+  bool isConnected;
+};
+
+}
+
+#endif
Index: /code/branches/network/src/network/ClientConnection.cc
===================================================================
--- /code/branches/network/src/network/ClientConnection.cc	(revision 228)
+++ /code/branches/network/src/network/ClientConnection.cc	(revision 229)
@@ -50,8 +50,8 @@
   }
   
-  void ClientConnection::createConnection(){
+  bool ClientConnection::createConnection(){
     network_threads.create_thread(boost::bind(boost::mem_fn(&ClientConnection::receiverThread), this));
-//     boost::thread thr(boost::bind(boost::mem_fn(&ClientConnection::receiverThread), this));
-    return;
+    // wait 10 seconds for the connection to be established
+    return waitEstablished(10000);
   }
   
@@ -77,4 +77,14 @@
       return false;
     if(enet_host_service(client, event, NETWORK_SEND_WAIT)>=0)
+      return true;
+    else 
+      return false;
+  }
+  
+  bool ClientConnection::sendPackets(){
+    ENetEvent event;
+    if(server==NULL)
+      return false;
+    if(enet_host_service(client, &event, NETWORK_SEND_WAIT)>=0)
       return true;
     else 
Index: /code/branches/network/src/network/ClientConnection.h
===================================================================
--- /code/branches/network/src/network/ClientConnection.h	(revision 228)
+++ /code/branches/network/src/network/ClientConnection.h	(revision 229)
@@ -41,9 +41,11 @@
     bool queueEmpty();
     // create a new listener thread
-    void createConnection();
+    bool createConnection();
     bool closeConnection();
     // add a packet to queue for the server
     bool addPacket(ENetPacket *packet);
     // send out all queued packets
+    bool sendPackets();
+    // send out all queued packets and save result in event
     bool sendPackets(ENetEvent *event);
     bool waitEstablished(int milisec);
Index: /code/branches/network/src/network/ConnectionManager.cc
===================================================================
--- /code/branches/network/src/network/ConnectionManager.cc	(revision 228)
+++ /code/branches/network/src/network/ConnectionManager.cc	(revision 229)
@@ -73,5 +73,5 @@
   
   bool ConnectionManager::addPacket(ENetPacket *packet, int ID){
-    if(client=NULL)
+    if(client==NULL)
       return false;
     ClientList *temp=client;
Index: /code/branches/network/src/network/Makefile
===================================================================
--- /code/branches/network/src/network/Makefile	(revision 228)
+++ /code/branches/network/src/network/Makefile	(revision 229)
@@ -23,5 +23,6 @@
 PacketDecoder.o: PacketDecoder.cc
 	${CC} -c PacketDecoder.cc -o PacketDecoder.o -g ${INC}
-
+Client.o: Client.cc
+	${CC} -c Client.cc -g ${INC}
 
 clean:
