Index: code/branches/network/src/core/ConsoleCommand.h
===================================================================
--- code/branches/network/src/core/ConsoleCommand.h	(revision 1517)
+++ code/branches/network/src/core/ConsoleCommand.h	(revision 1518)
@@ -42,5 +42,5 @@
 
 #define SetConsoleCommandGeneric(fakevariable, classname, command, bCreateShortcut) \
-    ConsoleCommand& fakevariable = ClassManager<classname>::getIdentifier()->addConsoleCommand(command, bCreateShortcut)
+    orxonox::ConsoleCommand& fakevariable = orxonox::ClassManager<classname>::getIdentifier()->addConsoleCommand(command, bCreateShortcut)
 
 
@@ -52,5 +52,5 @@
 
 #define SetConsoleCommandShortcutGeneric(fakevariable, command) \
-    ConsoleCommand& fakevariable = CommandExecutor::addConsoleCommandShortcut(command)
+    orxonox::ConsoleCommand& fakevariable = orxonox::CommandExecutor::addConsoleCommandShortcut(command)
 
 
Index: code/branches/network/src/network/Client.cc
===================================================================
--- code/branches/network/src/network/Client.cc	(revision 1517)
+++ code/branches/network/src/network/Client.cc	(revision 1518)
@@ -42,7 +42,11 @@
 #include "Synchronisable.h"
 #include "core/CoreIncludes.h"
+#include "core/ConsoleCommand.h"
+#include "Server.h"
 
 namespace network
 {
+  SetConsoleCommandShortcut(Client, Chat);
+  
   Client* Client::_sClient = 0;
   
@@ -142,4 +146,10 @@
   
 
+  void Client::Chat( std::string message ){
+    if(Client::getSingleton())
+      Client::getSingleton()->sendChat(message);
+    else if(Server::getSingleton())
+      Server::getSingleton()->sendChat(message);
+  }
   
 
@@ -224,6 +234,6 @@
   }
 
-  void Client::processChat( chat *data){
-    COUT(0) << "Server: " << data->message << std::endl;
+  void Client::processChat( chat *data, int clientId){
+    COUT(1) << data->message << std::endl;
     delete[] data->message;
     delete data;
Index: code/branches/network/src/network/Client.h
===================================================================
--- code/branches/network/src/network/Client.h	(revision 1517)
+++ code/branches/network/src/network/Client.h	(revision 1518)
@@ -75,5 +75,5 @@
     bool closeConnection();
 
-    bool sendChat( std::string message );
+    static void Chat( std::string message );
     
     int getShipID(){return shipID_;}
@@ -96,8 +96,10 @@
     bool isSynched_;
 
+    bool sendChat( std::string message );
+    
     // implement data processing functions of PacketDecoder
     void processGamestate( GameStateCompressed *data, int clientID);
     void processClassid(classid *clid);
-    void processChat( chat *data);
+    void processChat( chat *data, int clientId );
     bool processWelcome( welcome *w );
     int clientID_;     // this is the id the server gave to us
Index: code/branches/network/src/network/ConnectionManager.cc
===================================================================
--- code/branches/network/src/network/ConnectionManager.cc	(revision 1517)
+++ code/branches/network/src/network/ConnectionManager.cc	(revision 1518)
@@ -168,5 +168,6 @@
     boost::recursive_mutex::scoped_lock lock(enet_mutex_);
     for(ClientInformation *i=head_->next(); i!=0; i=i->next()){
-      if(enet_peer_send(i->getPeer(), (enet_uint8)i->getID(), packet)!=0)
+      COUT(3) << "adding broadcast packet for client: " << i->getID() << std::endl;
+      if(enet_peer_send(i->getPeer(), 0, packet)!=0)
         return false;
     }
Index: code/branches/network/src/network/Server.cc
===================================================================
--- code/branches/network/src/network/Server.cc	(revision 1517)
+++ code/branches/network/src/network/Server.cc	(revision 1518)
@@ -51,12 +51,38 @@
 #include "util/Sleep.h"
 #include "objects/SpaceShip.h"
-
+#include "core/ConsoleCommand.h"
 
 namespace network
 {
-  
-  
-#define MAX_FAILURES 20;
-#define NETWORK_FREQUENCY 30
+  #define MAX_FAILURES 20;
+  #define NETWORK_FREQUENCY 30
+  
+  Server *Server::instance_=0;
+  
+  Server *Server::createSingleton(){
+    if(!instance_)
+      instance_ = new Server();
+    return instance_;
+  }
+  Server *Server::createSingleton(int port){
+    if(!instance_)
+      instance_ = new Server(port);
+    return instance_;
+  }
+  Server *Server::createSingleton(int port, std::string bindAddress){
+    if(!instance_)
+      instance_ = new Server(port, bindAddress);
+    return instance_;
+  }
+  Server *Server::createSingleton(int port, const char *bindAddress){
+    if(!instance_)
+      instance_ = new Server(port, bindAddress);
+    return instance_;
+  }
+  
+  Server *Server::getSingleton(){
+    return instance_;
+  }
+  
   
   /**
@@ -127,8 +153,6 @@
   * @return true/false
   */
-  bool Server::sendMSG(std::string msg) {
-    ENetPacket *packet = packet_gen.chatMessage(msg.c_str());
-    //std::cout <<"adding packets" << std::endl;
-    return connection->addPacketAll(packet);
+  bool Server::sendChat(std::string msg) {
+    return sendChat(msg.c_str());
   }
 
@@ -138,7 +162,10 @@
   * @return true/false
   */
-  bool Server::sendMSG(const char *msg) {
-    ENetPacket *packet = packet_gen.chatMessage(msg);
-    COUT(4) <<"Server: adding Packets" << std::endl;
+  bool Server::sendChat(const char *msg) {
+    char *message = new char [strlen(msg)+10+1];
+    sprintf(message, "Player %d: %s", CLIENTID_SERVER, msg);
+    COUT(1) << message << std::endl;
+    ENetPacket *packet = packet_gen.chatMessage(message);
+    COUT(5) <<"Server: adding Packets" << std::endl;
     return connection->addPacketAll(packet);
   }
@@ -288,4 +315,14 @@
   }
   
+  void Server::processChat( chat *data, int clientId){
+    char *message = new char [strlen(data->message)+10+1];
+    sprintf(message, "Player %d: %s", clientId, data->message);
+    COUT(1) << message << std::endl;
+    ENetPacket *pck = packet_gen.chatMessage(message);
+    connection->addPacketAll(pck);
+    delete[] data->message;
+    delete data;
+  }
+  
   bool Server::addClient(ENetEvent *event){
     ClientInformation *temp = clients->insertBack(new ClientInformation);
Index: code/branches/network/src/network/Server.h
===================================================================
--- code/branches/network/src/network/Server.h	(revision 1517)
+++ code/branches/network/src/network/Server.h	(revision 1518)
@@ -53,4 +53,6 @@
 namespace network
 {
+  #define CLIENTID_SERVER 0
+  
   /**
   * This class is the root class of the network module for a server.
@@ -59,12 +61,15 @@
   class _NetworkExport Server : public PacketDecoder, public orxonox::Tickable{
   public:
-    Server();
-    Server(int port);
-    Server(int port, std::string bindAddress);
-    Server(int port, const char *bindAddress);
+    static Server *createSingleton();
+    static Server *createSingleton(int port);
+    static Server *createSingleton(int port, std::string bindAddress);
+    static Server *createSingleton(int port, const char *bindAddress);
+    
+    static Server *getSingleton();
+    
     void open();
     void close();
-    bool sendMSG(std::string msg);
-    bool sendMSG(const char *msg);
+    bool sendChat(std::string msg);
+    bool sendChat(const char *msg);
     void tick(float time);
   protected:
@@ -72,4 +77,11 @@
     void updateGamestate();
   private:
+    Server();
+    Server(int port);
+    Server(int port, std::string bindAddress);
+    Server(int port, const char *bindAddress);
+    
+    static Server *instance_;
+    
     bool addClient(ENetEvent *event);
     bool createClient(int clientID);
@@ -82,4 +94,5 @@
     bool processConnectRequest( connectRequest *con, int clientID );
     void processGamestate( GameStateCompressed *data, int clientID);
+    void processChat( chat *data, int clientId);
     ConnectionManager *connection;
     GameStateManager *gamestates;
Index: code/branches/network/src/orxonox/Orxonox.cc
===================================================================
--- code/branches/network/src/orxonox/Orxonox.cc	(revision 1517)
+++ code/branches/network/src/orxonox/Orxonox.cc	(revision 1518)
@@ -127,5 +127,5 @@
       network::Client::destroySingleton();
     if (server_g)
-      delete server_g;
+      delete network::Server::getSingleton();
   }
 
@@ -303,5 +303,6 @@
     COUT(2) << "Loading level in server mode" << std::endl;
 
-    server_g = new network::Server(serverPort_);
+    //server_g = new network::Server(serverPort_);
+    server_g = network::Server::createSingleton(serverPort_);
 
     if (!loadScene())
