Index: /code/branches/output/src/libraries/network/CMakeLists.txt
===================================================================
--- /code/branches/output/src/libraries/network/CMakeLists.txt	(revision 8828)
+++ /code/branches/output/src/libraries/network/CMakeLists.txt	(revision 8829)
@@ -19,5 +19,4 @@
 
 SET_SOURCE_FILES(NETWORK_SRC_FILES
-  ChatListener.cc
   Client.cc
   ClientConnection.cc
@@ -45,5 +44,4 @@
 
 SET_SOURCE_FILES(NETWORK_HDR_FILES
-  ChatListener.h
   Client.h
   ClientConnection.h
@@ -61,4 +59,5 @@
   WANDiscovery.h
   MasterServerComm.h
+  NetworkChatListener.h
   NetworkFunction.h
   NetworkPrecompiledHeaders.h
Index: de/branches/output/src/libraries/network/ChatListener.cc
===================================================================
--- /code/branches/output/src/libraries/network/ChatListener.cc	(revision 8828)
+++ 	(revision )
@@ -1,50 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#include "ChatListener.h"
-#include "core/CoreIncludes.h"
-
-namespace orxonox
-{
-    ChatListener::ChatListener()
-    {
-        RegisterRootObject(ChatListener);
-    }
-
-    //void ChatListener::incomingChat( const std::string& message,
-      //unsigned int senderID )
-    //{
-      //orxout(message) << "Chat: \"" << message << "\"" << endl;
-
-
-    //}
-
-
-}
-
-
Index: de/branches/output/src/libraries/network/ChatListener.h
===================================================================
--- /code/branches/output/src/libraries/network/ChatListener.h	(revision 8828)
+++ 	(revision )
@@ -1,49 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _NETWORK_ChatListener__
-#define _NETWORK_ChatListener__
-
-#include "NetworkPrereqs.h"
-#include "core/OrxonoxClass.h"
-
-namespace orxonox
-{
-    class _NetworkExport ChatListener : virtual public OrxonoxClass
-    {
-        public:
-            /* constructor, destructor */
-            ChatListener();
-            virtual ~ChatListener() {}
-
-            /* What to do with incoming chat */
-            virtual void incomingChat(const std::string& message, unsigned int senderID) = 0;
-    };
-}
-
-#endif /* _NETWORK_ChatListener__ */
Index: /code/branches/output/src/libraries/network/Client.cc
===================================================================
--- /code/branches/output/src/libraries/network/Client.cc	(revision 8828)
+++ /code/branches/output/src/libraries/network/Client.cc	(revision 8829)
@@ -116,10 +116,4 @@
   }
 
-  bool Client::processChat(const std::string& message, unsigned int playerID)
-  {
-//    orxout(message) << "Player " << playerID << ": " << message << endl;
-    return true;
-  }
-
   void Client::printRTT()
   {
@@ -128,14 +122,24 @@
 
   /**
-   * This function implements the method of sending a chat message to the server
+   * @brief Sends a chat message to the server.
    * @param message message to be sent
-   * @return result(true/false)
+   * @param sourceID the ID of the sender
+   * @param targetID the ID of the receiver
    */
-  bool Client::chat(const std::string& message)
-  {
-    packet::Chat *m = new packet::Chat(message, Host::getPlayerID());
-    return m->send(static_cast<Host*>(this));
-  }
-
+  void Client::doSendChat(const std::string& message, unsigned int sourceID, unsigned int targetID)
+  {
+    // send the message to the server
+    packet::Chat* packet = new packet::Chat(message, sourceID, targetID);
+    packet->send(static_cast<Host*>(this));
+  }
+
+  /**
+   * @brief Gets called if a packet::Chat packet is received. Calls the parent function which passes the message to the listeners.
+   */
+  void Client::doReceiveChat(const std::string& message, unsigned int sourceID, unsigned int targetID)
+  {
+    // call the parent function which passes the message to the listeners
+    Host::doReceiveChat(message, sourceID, targetID);
+  }
 
   /**
@@ -203,5 +207,5 @@
     Game::getInstance().popState();
   }
-  
+
   void Client::processPacket(packet::Packet* packet)
   {
@@ -216,7 +220,3 @@
       packet->process(static_cast<Host*>(this));
   }
-
-
-
-
 }
Index: /code/branches/output/src/libraries/network/Client.h
===================================================================
--- /code/branches/output/src/libraries/network/Client.h	(revision 8828)
+++ /code/branches/output/src/libraries/network/Client.h	(revision 8829)
@@ -73,5 +73,5 @@
     Client();
     ~Client();
-    
+
     static Client* getInstance(){ return singletonPtr_s; } // tolua_export
 
@@ -81,7 +81,6 @@
     void queuePacket(ENetPacket* packet, int clientID, uint8_t channelID);
     virtual bool sendPacket( packet::Packet* packet ){ return packet->send( static_cast<Host*>(this) ); }
-    bool processChat(const std::string& message, unsigned int playerID);
-    virtual bool chat(const std::string& message);
-    virtual bool broadcast(const std::string& message) { return false; }
+    virtual void doSendChat(const std::string& message, unsigned int sourceID, unsigned int targetID);
+    virtual void doReceiveChat(const std::string& message, unsigned int sourceID, unsigned int targetID);
     virtual void printRTT();
 
Index: /code/branches/output/src/libraries/network/Host.cc
===================================================================
--- /code/branches/output/src/libraries/network/Host.cc	(revision 8828)
+++ /code/branches/output/src/libraries/network/Host.cc	(revision 8829)
@@ -32,7 +32,8 @@
 #include <string>
 
+#include "core/CoreIncludes.h"
 #include "core/ObjectList.h"
 #include "core/command/ConsoleCommand.h"
-#include "ChatListener.h"
+#include "NetworkChatListener.h"
 
 namespace orxonox {
@@ -41,5 +42,4 @@
   static const std::string __CC_printRTT_name = "printRTT";
 
-  SetConsoleCommand("chat", &Host::Chat);
   SetConsoleCommand(__CC_printRTT_group, __CC_printRTT_name, &Host::printRTT);
 
@@ -89,54 +89,26 @@
   }
 
-  void Host::Chat(const std::string& message)
+  /**
+   * @brief Sends a chat message through the network.
+   * @param message message to be sent
+   * @param sourceID the ID of the sender
+   * @param targetID the ID of the receiver
+   */
+  void Host::sendChat(const std::string& message, unsigned int sourceID, unsigned int targetID)
   {
-    for (ObjectList<ChatListener>::iterator it = ObjectList<ChatListener>::begin(); it != ObjectList<ChatListener>::end(); ++it)
-      it->incomingChat(message, 0);
-
-    bool result = true;
     for( std::vector<Host*>::iterator it = instances_s.begin(); it!=instances_s.end(); ++it )
-    {
       if( (*it)->isActive() )
-      {
-        if( !(*it)->chat(message) )
-          result = false;
-      }
-    }
-//    return result;
+        (*it)->doSendChat(message, sourceID, targetID);
   }
 
-  bool Host::Broadcast(const std::string& message)
+  /**
+   * @brief Gets called if a packet::Chat packet is received. Passes the message to the listeners.
+   */
+  void Host::doReceiveChat(const std::string& message, unsigned int sourceID, unsigned int targetID)
   {
-    for (ObjectList<ChatListener>::iterator it = ObjectList<ChatListener>::begin(); it != ObjectList<ChatListener>::end(); ++it)
-      it->incomingChat(message, NETWORK_PEER_ID_BROADCAST);
-
-    bool result = true;
-    for( std::vector<Host*>::iterator it = instances_s.begin(); it!=instances_s.end(); ++it )
-    {
-      if( (*it)->isActive() )
-      {
-        if( !(*it)->broadcast(message) )
-          result = false;
-      }
-    }
-    return result;
+    for (ObjectList<NetworkChatListener>::iterator it = ObjectList<NetworkChatListener>::begin(); it != ObjectList<NetworkChatListener>::end(); ++it)
+      it->incomingChat(message, sourceID);
   }
 
-  bool Host::incomingChat(const std::string& message, unsigned int playerID)
-  {
-    for (ObjectList<ChatListener>::iterator it = ObjectList<ChatListener>::begin(); it != ObjectList<ChatListener>::end(); ++it)
-      it->incomingChat(message, playerID);
-
-    bool result = true;
-    for( std::vector<Host*>::iterator it = instances_s.begin(); it!=instances_s.end(); ++it )
-    {
-      if( (*it)->isActive() )
-      {
-        if( !(*it)->processChat(message, playerID) )
-          result = false;
-      }
-    }
-    return result;
-  }
 
   bool Host::isServer()
@@ -167,3 +139,12 @@
 
 
+  //////////////////////////////////////////////////////////////////////////
+  // NetworkChatListener                                                  //
+  //////////////////////////////////////////////////////////////////////////
+
+  NetworkChatListener::NetworkChatListener()
+  {
+      RegisterRootObject(NetworkChatListener);
+  }
+
 }//namespace orxonox
Index: /code/branches/output/src/libraries/network/Host.h
===================================================================
--- /code/branches/output/src/libraries/network/Host.h	(revision 8828)
+++ /code/branches/output/src/libraries/network/Host.h	(revision 8829)
@@ -52,15 +52,9 @@
 class _NetworkExport Host: public GamestateManager
 {
+  friend class packet::Chat;
+
   private:
-    //TODO add these functions or adequate
-    //virtual bool processChat(packet::Chat *message, unsigned int clientID)=0;
-    //virtual bool sendChat(packet::Chat *chat)=0;
     virtual void queuePacket(ENetPacket *packet, int clientID, uint8_t channelID)=0;
-    virtual bool chat(const std::string& message)=0;
-    virtual bool broadcast(const std::string& message)=0;
-    virtual bool processChat(const std::string& message, unsigned int playerID)=0;
     virtual bool isServer_()=0;
-
-
 
   protected:
@@ -68,5 +62,7 @@
     virtual ~Host();
     void setActive( bool bActive ){ bIsActive_ = bActive; }
-//     static Host *instance_;
+
+    virtual void doSendChat(const std::string& message, unsigned int sourceID, unsigned int targetID)=0;
+    virtual void doReceiveChat(const std::string& message, unsigned int sourceID, unsigned int targetID)=0;
 
   public:
@@ -74,12 +70,8 @@
     static bool running(){ return instances_s.size(); }
     static void addPacket(ENetPacket* packet, int clientID = NETWORK_PEER_ID_SERVER, uint8_t channelID = 0);
-    //static bool chat(std::string& message);
-//     static bool receiveChat(packet::Chat *message, unsigned int clientID);
     static unsigned int getPlayerID(){ return clientID_s; }
     static void setClientID(unsigned int id){ clientID_s = id; }
     static bool isServer();
-    static void Chat(const std::string& message);
-    static bool Broadcast(const std::string& message);
-    static bool incomingChat(const std::string& message, unsigned int playerID);
+    static void sendChat(const std::string& message, unsigned int sourceID, unsigned int targetID);
     virtual void printRTT()=0;
     bool isActive(){ return bIsActive_; }
Index: /code/branches/output/src/libraries/network/NetworkChatListener.h
===================================================================
--- /code/branches/output/src/libraries/network/NetworkChatListener.h	(revision 8829)
+++ /code/branches/output/src/libraries/network/NetworkChatListener.h	(revision 8829)
@@ -0,0 +1,61 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _NetworkChatListener_H__
+#define _NetworkChatListener_H__
+
+#include "NetworkPrereqs.h"
+
+namespace orxonox
+{
+    /**
+        @brief The only function of this interface, incomingChat(), gets called whenever a chat
+        message was received through the network.
+
+        This interface exists mostly to resolve circular dependencies between the chat functions
+        in Host and ChatManager. ChatManager is the main derivative of this interface.
+    */
+    class _NetworkExport NetworkChatListener : virtual public OrxonoxClass
+    {
+        friend class Host;
+
+        public:
+            NetworkChatListener(); // implemented in Host.cc
+            virtual ~NetworkChatListener() {}
+
+        protected:
+            /**
+                @brief Gets called when a chat message was received through the network.
+                @param message The message
+                @param sourceID The (network) client ID of the sender
+            */
+            virtual void incomingChat(const std::string& message, unsigned int sourceID) = 0;
+    };
+}
+
+#endif /* _NetworkChatListener_H__ */
Index: /code/branches/output/src/libraries/network/NetworkPrereqs.h
===================================================================
--- /code/branches/output/src/libraries/network/NetworkPrereqs.h	(revision 8828)
+++ /code/branches/output/src/libraries/network/NetworkPrereqs.h	(revision 8829)
@@ -118,5 +118,4 @@
 namespace orxonox
 {
-  class ChatListener;
   class Client;
   class ClientConnection;
@@ -130,4 +129,5 @@
   class GamestateManager;
   class Host;
+  class NetworkChatListener;
   class NetworkFunctionBase;
   struct NetworkFunctionPointer;
Index: /code/branches/output/src/libraries/network/Server.cc
===================================================================
--- /code/branches/output/src/libraries/network/Server.cc	(revision 8828)
+++ /code/branches/output/src/libraries/network/Server.cc	(revision 8829)
@@ -56,5 +56,4 @@
 #include "packet/Gamestate.h"
 #include "packet/Welcome.h"
-#include "ChatListener.h"
 // #include "ClientInformation.h"
 #include "FunctionCallManager.h"
@@ -104,5 +103,5 @@
   void Server::helper_ConnectToMasterserver()
   {
-//     WANDiscovery::getInstance().msc.sendRequest( MSPROTO_GAME_SERVER " " 
+//     WANDiscovery::getInstance().msc.sendRequest( MSPROTO_GAME_SERVER " "
 //       MSPROTO_REGISTER_SERVER );
   }
@@ -116,5 +115,5 @@
     orxout(verbose, context::network) << "opening server" << endl;
     this->openListener();
-    
+
     /* make discoverable on LAN */
     LANDiscoverable::setActivity(true);
@@ -123,5 +122,5 @@
     WANDiscoverable::setActivity(true);
     /* TODO this needs to be optional, we need a switch from the UI to
-     * enable/disable this 
+     * enable/disable this
      */
 //     helper_ConnectToMasterserver();
@@ -143,5 +142,5 @@
     /* tell master server we're closing */
     orxout(internal_info, context::network) << "disconnecting." << endl;
-    WANDiscoverable::setActivity(false);    
+    WANDiscoverable::setActivity(false);
     orxout(internal_info, context::network) << "disconnecting done" << endl;
 
@@ -150,29 +149,13 @@
   }
 
-  bool Server::processChat(const std::string& message, unsigned int playerID)
-  {
-//     ClientInformation *temp = ClientInformation::getBegin();
-    packet::Chat *chat;
-//     while(temp){
-    chat = new packet::Chat(message, playerID);
-    chat->setPeerID(NETWORK_PEER_ID_BROADCAST);
-    chat->send( static_cast<Host*>(this) );
-//         orxout(internal_warning, context::network) << "could not send Chat message to client ID: " << temp->getID() << endl;
-//       temp = temp->next();
-//     }
-//    orxout(message) << "Player " << playerID << ": " << message << endl;
-    return true;
-  }
-
-
   /* handle incoming data */
   int rephandler( char *addr, ENetEvent *ev )
-  { 
+  {
     /* reply to pings */
-    if( !strncmp( (char *)ev->packet->data, MSPROTO_PING_GAMESERVER, 
+    if( !strncmp( (char *)ev->packet->data, MSPROTO_PING_GAMESERVER,
       MSPROTO_PING_GAMESERVER_LEN ) )
       //this->msc.sendRequest( MSPROTO_ACK );
       /* NOTE implement this after pollForReply
-       * reimplementation 
+       * reimplementation
        */
       return 0;
@@ -183,6 +166,6 @@
 
   void Server::helper_HandleMasterServerRequests()
-  { 
-    /* poll the master server for replies and see whether something 
+  {
+    /* poll the master server for replies and see whether something
      * has to be done or changed.
      */
@@ -202,5 +185,5 @@
     // receive and process incoming discovery packets
     LANDiscoverable::update();
-    
+
     // receive and process requests from master server
     /* todo */
@@ -330,5 +313,5 @@
   {
 //     static unsigned int newid=1;
-// 
+//
 //     orxout(internal_info, context::network) << "Server: adding client" << endl;
 //     ClientInformation *temp = ClientInformation::insertBack(new ClientInformation);
@@ -375,5 +358,5 @@
 //     }
   }
-  
+
   void Server::processPacket(packet::Packet* packet)
   {
@@ -411,5 +394,5 @@
 //     temp->setSynched(true);
     GamestateManager::setSynched(clientID);
-    
+
     orxout(verbose, context::network) << "sending welcome" << endl;
     packet::Welcome *w = new packet::Welcome(clientID);
@@ -438,31 +421,50 @@
   }
 
-  bool Server::chat(const std::string& message)
-  {
-      return this->sendChat(message, Host::getPlayerID());
-  }
-
-  bool Server::broadcast(const std::string& message)
-  {
-      return this->sendChat(message, NETWORK_PEER_ID_BROADCAST);
-  }
-
-  bool Server::sendChat(const std::string& message, unsigned int clientID)
-  {
-//     ClientInformation *temp = ClientInformation::getBegin();
-    packet::Chat *chat;
-//     while(temp)
-    {
-      chat = new packet::Chat(message, clientID);
-      chat->setPeerID(NETWORK_PEER_ID_BROADCAST);
-      chat->send( static_cast<Host*>(this) );
-//         orxout(internal_warning, context::network) << "could not send Chat message to client ID: " << temp->getID() << endl;
-//       temp = temp->next();
-    }
-//    orxout(message) << "Player " << Host::getPlayerID() << ": " << message << endl;
-    for (ObjectList<ChatListener>::iterator it = ObjectList<ChatListener>::begin(); it != ObjectList<ChatListener>::end(); ++it)
-      it->incomingChat(message, clientID);
-
-    return true;
+  /**
+   * @brief Sends a chat message to the given target ID.
+   * @param message message to be sent
+   * @param sourceID the ID of the sender
+   * @param targetID the ID of the receiver
+   */
+  void Server::doSendChat(const std::string& message, unsigned int sourceID, unsigned int targetID)
+  {
+    // check if the target exists. just ignore the message otherwise
+    if (!this->isValidTarget(targetID)) // TODO: remove this if an invalid clientIDs don't trigger assertions anymore
+      return;
+
+    // send the message to the target
+    packet::Chat* packet = new packet::Chat(message, sourceID, targetID);
+    packet->setPeerID(targetID);
+    packet->send( static_cast<Host*>(this) );
+
+    // if the target is (or includes) this host as well, call the parent function which passes the message to the listeners
+    if (targetID == NETWORK_PEER_ID_BROADCAST || targetID == Host::getPlayerID())
+      Host::doReceiveChat(message, sourceID, targetID);
+  }
+
+  /**
+   * @brief Gets called if a packet::Chat packet is received. Forwards the packet to the target
+   * and calls the parent function if necessary.
+   */
+  void Server::doReceiveChat(const std::string& message, unsigned int sourceID, unsigned int targetID)
+  {
+      this->doSendChat(message, sourceID, targetID);
+  }
+
+  /**
+   * @brief Returns true if the target ID is in the list of clients (or if it
+   * corresponds to the broadcast or the server ID).
+   */
+  bool Server::isValidTarget(unsigned int targetID)
+  {
+    if (targetID == NETWORK_PEER_ID_BROADCAST || targetID == NETWORK_PEER_ID_SERVER)
+      return true;
+
+    std::vector<uint32_t>::iterator it;
+    for( it=this->clientIDs_.begin(); it!=this->clientIDs_.end(); ++it )
+      if( *it == targetID )
+        return true;
+
+    return false;
   }
 
Index: /code/branches/output/src/libraries/network/Server.h
===================================================================
--- /code/branches/output/src/libraries/network/Server.h	(revision 8828)
+++ /code/branches/output/src/libraries/network/Server.h	(revision 8829)
@@ -68,5 +68,4 @@
     void open();
     void close();
-    bool processChat(const std::string& message, unsigned int playerID);
     void queuePacket(ENetPacket *packet, int clientID, uint8_t channelID);
     virtual bool sendPacket( packet::Packet* packet ){ return packet->send( static_cast<Host*>(this) ); }
@@ -89,7 +88,7 @@
     bool sendGameStates();
     bool sendObjectDeletes();
-    virtual bool chat(const std::string& message);
-    virtual bool broadcast(const std::string& message);
-    bool sendChat(const std::string& message, unsigned int clientID);
+    bool isValidTarget(unsigned int targetID);
+    virtual void doSendChat(const std::string& message, unsigned int sourceID, unsigned int targetID);
+    virtual void doReceiveChat(const std::string& message, unsigned int sourceID, unsigned int targetID);
     void syncClassid(unsigned int clientID);
 
Index: /code/branches/output/src/libraries/network/packet/Chat.cc
===================================================================
--- /code/branches/output/src/libraries/network/packet/Chat.cc	(revision 8828)
+++ /code/branches/output/src/libraries/network/packet/Chat.cc	(revision 8829)
@@ -39,10 +39,11 @@
 
 /* Some lengths */
-#define   _PACKETID         0
-const int _PLAYERID     =   _PACKETID + sizeof(Type::Value);
-#define   _MESSAGELENGTH    _PLAYERID + sizeof(uint32_t)
-#define   _MESSAGE          _MESSAGELENGTH + sizeof(uint32_t)
+#define _PACKETID         0
+#define _SOURCEID         _PACKETID + sizeof(Type::Value)
+#define _TARGETID         _SOURCEID + sizeof(uint32_t)
+#define _MESSAGELENGTH    _TARGETID + sizeof(uint32_t)
+#define _MESSAGE          _MESSAGELENGTH + sizeof(uint32_t)
 
-Chat::Chat( const std::string& message, unsigned int playerID )
+Chat::Chat( const std::string& message, unsigned int sourceID, unsigned int targetID )
  : Packet()
 {
@@ -57,5 +58,6 @@
 
   *(Type::Value *)(data_ + _PACKETID ) = Type::Chat;
-  *(unsigned int *)(data_ + _PLAYERID ) = playerID;
+  *(unsigned int *)(data_ + _SOURCEID ) = sourceID;
+  *(unsigned int *)(data_ + _TARGETID ) = targetID;
   *(unsigned int *)(data_ + _MESSAGELENGTH ) = messageLength_;
 
@@ -81,7 +83,7 @@
 
 bool Chat::process(orxonox::Host* host){
-  bool b = host->incomingChat(std::string((const char*)data_+_MESSAGE), *(uint32_t *)(data_+_PLAYERID));
+  host->doReceiveChat(std::string((const char*)data_+_MESSAGE), *(uint32_t *)(data_+_SOURCEID), *(uint32_t *)(data_+_TARGETID));
   delete this;
-  return b;
+  return true;
 }
 
Index: /code/branches/output/src/libraries/network/packet/Chat.h
===================================================================
--- /code/branches/output/src/libraries/network/packet/Chat.h	(revision 8828)
+++ /code/branches/output/src/libraries/network/packet/Chat.h	(revision 8829)
@@ -42,5 +42,5 @@
 public:
   /* constructors */
-  Chat( const std::string& message, unsigned int playerID );
+  Chat( const std::string& message, unsigned int sourceID, unsigned int targetID );
   Chat( uint8_t* data, unsigned int clientID );
 
Index: /code/branches/output/src/modules/gametypes/RaceCheckPoint.cc
===================================================================
--- /code/branches/output/src/modules/gametypes/RaceCheckPoint.cc	(revision 8828)
+++ /code/branches/output/src/modules/gametypes/RaceCheckPoint.cc	(revision 8829)
@@ -32,5 +32,5 @@
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
-#include "network/Host.h"
+#include "chat/ChatManager.h"
 #include "SpaceRace.h"
 
@@ -112,5 +112,5 @@
                             + " seconds to reach the check point " + multi_cast<std::string>(this->bCheckpointIndex_+1);
                 const_cast<GametypeInfo*>(gametype->getGametypeInfo())->sendAnnounceMessage(message);
-                Host::Broadcast(message);
+                ChatManager::message(message);
             }
         }
Index: /code/branches/output/src/modules/gametypes/SpaceRace.cc
===================================================================
--- /code/branches/output/src/modules/gametypes/SpaceRace.cc	(revision 8828)
+++ /code/branches/output/src/modules/gametypes/SpaceRace.cc	(revision 8829)
@@ -30,7 +30,7 @@
 
 #include "core/CoreIncludes.h"
-#include "network/Host.h"
-#include <util/Clock.h>
-#include <util/Math.h>
+#include "chat/ChatManager.h"
+#include "util/Clock.h"
+#include "util/Math.h"
 #include "util/Convert.h"
 
@@ -60,5 +60,5 @@
                         + " before the time limit. You lose!";
             const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
-            Host::Broadcast(message);
+            ChatManager::message(message);
         }
         else
@@ -70,5 +70,5 @@
                         + "." + multi_cast<std::string>(ms) + " seconds.";
             const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
-            Host::Broadcast(message);
+            ChatManager::message(message);
 /*
             float time = this->clock_.getSecondsPrecise();
@@ -86,5 +86,5 @@
 
         std::string message("The match has started! Reach the check points as quickly as possible!");
-        Host::Broadcast(message);
+        ChatManager::message(message);
     }
 
@@ -99,5 +99,5 @@
                         + " seconds.";
         const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
-        Host::Broadcast(message);
+        ChatManager::message(message);
     }
 
Index: /code/branches/output/src/modules/overlays/hud/ChatOverlay.cc
===================================================================
--- /code/branches/output/src/modules/overlays/hud/ChatOverlay.cc	(revision 8828)
+++ /code/branches/output/src/modules/overlays/hud/ChatOverlay.cc	(revision 8829)
@@ -67,16 +67,7 @@
     }
 
-    void ChatOverlay::incomingChat(const std::string& message, unsigned int senderID)
+    void ChatOverlay::incomingChat(const std::string& message, const std::string& /*name*/)
     {
-        std::string text = message;
-
-        if (senderID != NETWORK_PEER_ID_UNKNOWN)
-        {
-            PlayerInfo* player = PlayerManager::getInstance().getClient(senderID);
-            if (player)
-                text = player->getName() + ": " + message;
-        }
-
-        this->messages_.push_back(multi_cast<Ogre::DisplayString>(text));
+        this->messages_.push_back(multi_cast<Ogre::DisplayString>(message));
 
         Timer* timer = new Timer();
Index: /code/branches/output/src/modules/overlays/hud/ChatOverlay.h
===================================================================
--- /code/branches/output/src/modules/overlays/hud/ChatOverlay.h	(revision 8828)
+++ /code/branches/output/src/modules/overlays/hud/ChatOverlay.h	(revision 8829)
@@ -35,5 +35,5 @@
 #include <OgreOverlayElement.h>
 
-#include "network/ChatListener.h"
+#include "chat/ChatListener.h"
 #include "overlays/OverlayText.h"
 
@@ -49,5 +49,5 @@
 
         protected:
-            virtual void incomingChat(const std::string& message, unsigned int senderID);
+            virtual void incomingChat(const std::string& message, const std::string& name);
 
             std::list<Ogre::DisplayString> messages_;
Index: /code/branches/output/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- /code/branches/output/src/orxonox/OrxonoxPrereqs.h	(revision 8828)
+++ /code/branches/output/src/orxonox/OrxonoxPrereqs.h	(revision 8829)
@@ -77,4 +77,10 @@
     class Radar;
     class Scene;
+
+    // chat
+    class ChatHistory;
+    class ChatInputHandler;
+    class ChatListener;
+    class ChatManager;
 
     // collisionshapes
Index: /code/branches/output/src/orxonox/chat/CMakeLists.txt
===================================================================
--- /code/branches/output/src/orxonox/chat/CMakeLists.txt	(revision 8828)
+++ /code/branches/output/src/orxonox/chat/CMakeLists.txt	(revision 8829)
@@ -2,3 +2,4 @@
   ChatHistory.cc
   ChatInputHandler.cc
+  ChatManager.cc
 )
Index: /code/branches/output/src/orxonox/chat/ChatHistory.cc
===================================================================
--- /code/branches/output/src/orxonox/chat/ChatHistory.cc	(revision 8828)
+++ /code/branches/output/src/orxonox/chat/ChatHistory.cc	(revision 8829)
@@ -74,25 +74,11 @@
 
   /* react to incoming chat */
-  void ChatHistory::incomingChat(const std::string& message,
-    unsigned int senderID)
+  void ChatHistory::incomingChat(const std::string& message, const std::string& /*name*/)
   {
-    /* --> a) look up the actual name of the sender */
-    std::string text = message;
-
-#ifndef CHATTEST
-    /* get sender ID and prepend it to the message */
-    if (senderID != NETWORK_PEER_ID_UNKNOWN)
-    {
-      PlayerInfo* player = PlayerManager::getInstance().getClient(senderID);
-      if (player)
-        text = player->getName() + ": " + message;
-    }
-#endif
-
     /* add the line to the history */
-    this->chat_hist_addline( text );
+    this->chat_hist_addline( message );
 
     /* add the line to the log */
-    this->chat_hist_logline( text );
+    this->chat_hist_logline( message );
   }
 
Index: /code/branches/output/src/orxonox/chat/ChatHistory.h
===================================================================
--- /code/branches/output/src/orxonox/chat/ChatHistory.h	(revision 8828)
+++ /code/branches/output/src/orxonox/chat/ChatHistory.h	(revision 8829)
@@ -37,11 +37,12 @@
 
 #ifndef CHATTEST
-#include <OrxonoxPrereqs.h>
-#include <PlayerManager.h>
-#include <infos/PlayerInfo.h>
-#include <core/BaseObject.h>
-#include <network/ChatListener.h>
-#include <core/PathConfig.h>
-#include <util/Singleton.h>
+#include "OrxonoxPrereqs.h"
+
+#include "util/Singleton.h"
+#include "core/BaseObject.h"
+#include "core/PathConfig.h"
+#include "chat/ChatListener.h"
+#include "infos/PlayerInfo.h"
+#include "PlayerManager.h"
 #endif
 
@@ -82,6 +83,5 @@
        * \param senderID Identification number of the sender
        */
-      virtual void incomingChat(const std::string& message,
-        unsigned int senderID);
+      virtual void incomingChat(const std::string& message, const std::string& name);
 
       /** Synchronize logfile onto the hard drive
Index: /code/branches/output/src/orxonox/chat/ChatInputHandler.cc
===================================================================
--- /code/branches/output/src/orxonox/chat/ChatInputHandler.cc	(revision 8828)
+++ /code/branches/output/src/orxonox/chat/ChatInputHandler.cc	(revision 8829)
@@ -44,6 +44,6 @@
 #include "core/input/InputManager.h"
 #include "core/input/InputState.h"
-#include "network/Host.h"
-
+
+#include "chat/ChatManager.h"
 #include "PlayerManager.h"
 #include "infos/PlayerInfo.h"
@@ -213,24 +213,8 @@
 
   /* handle incoming chat */
-  void ChatInputHandler::incomingChat(const std::string& message,
-    unsigned int senderID)
-  {
-    /* look up the actual name of the sender */
-    std::string text = message;
-    std::string name = "";
-
-    /* setup player name info */
-    if (senderID != NETWORK_PEER_ID_UNKNOWN)
-    {
-       PlayerInfo* player = PlayerManager::getInstance().getClient(senderID);
-       if (player)
-       {
-         name = player->getName();
-         text = name + ": " + message;
-       }
-    }
-
+  void ChatInputHandler::incomingChat(const std::string& message, const std::string& name)
+  {
     /* create item */
-    CEGUI::ListboxTextItem *toadd = new CEGUI::ListboxTextItem( text );
+    CEGUI::ListboxTextItem *toadd = new CEGUI::ListboxTextItem( message );
 
     /* setup colors */
@@ -320,5 +304,5 @@
 
     /* c) send the chat via some call */
-    Host::Chat( msgtosend );
+    ChatManager::chat( msgtosend );
 
     /* d) stop listening to input - only if this is not fullchat */
Index: /code/branches/output/src/orxonox/chat/ChatInputHandler.h
===================================================================
--- /code/branches/output/src/orxonox/chat/ChatInputHandler.h	(revision 8828)
+++ /code/branches/output/src/orxonox/chat/ChatInputHandler.h	(revision 8829)
@@ -30,5 +30,5 @@
 #define _ChatInputHandler_H__
 
-#include <OrxonoxPrereqs.h>
+#include "OrxonoxPrereqs.h"
 
 #include <string>
@@ -37,5 +37,5 @@
 
 #include "util/Singleton.h"
-#include "network/ChatListener.h"
+#include "chat/ChatListener.h"
 
 namespace orxonox // tolua_export
@@ -112,6 +112,5 @@
        * history window of the full chat window)
        */
-      void incomingChat( const std::string& message,
-        unsigned int senderID );
+      void incomingChat(const std::string& message, const std::string& name);
 
       /** \param full true means show full chat window with history,
Index: /code/branches/output/src/orxonox/chat/ChatListener.h
===================================================================
--- /code/branches/output/src/orxonox/chat/ChatListener.h	(revision 8829)
+++ /code/branches/output/src/orxonox/chat/ChatListener.h	(revision 8829)
@@ -0,0 +1,58 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _ChatListener_H__
+#define _ChatListener_H__
+
+#include "OrxonoxPrereqs.h"
+
+namespace orxonox
+{
+    /**
+        @brief Classes inheriting from this interface get a notification whenever a chat
+        message was sent through ChatManager.
+    */
+    class _OrxonoxExport ChatListener : virtual public OrxonoxClass
+    {
+        friend class ChatManager;
+
+        public:
+            ChatListener(); // implemented in ChatManager.cc
+            virtual ~ChatListener() {}
+
+        protected:
+            /**
+                @brief Gets called whenever a chat message was sent through ChatManager.
+                @param message The whole message (including name of the sender if available)
+                @param name The name of the sender (if available, otherwise "")
+            */
+            virtual void incomingChat(const std::string& message, const std::string& name) = 0;
+    };
+}
+
+#endif /* _ChatListener_H__ */
Index: /code/branches/output/src/orxonox/chat/ChatManager.cc
===================================================================
--- /code/branches/output/src/orxonox/chat/ChatManager.cc	(revision 8829)
+++ /code/branches/output/src/orxonox/chat/ChatManager.cc	(revision 8829)
@@ -0,0 +1,120 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "ChatManager.h"
+#include "ChatListener.h"
+
+#include "util/ScopedSingletonManager.h"
+#include "core/CoreIncludes.h"
+#include "core/command/ConsoleCommand.h"
+#include "network/Host.h"
+
+#include "PlayerManager.h"
+#include "infos/PlayerInfo.h"
+
+namespace orxonox
+{
+    ManageScopedSingleton(ChatManager, ScopeID::Root, false);
+
+    SetConsoleCommand("chat", &ChatManager::chat).defaultValue(1, NETWORK_PEER_ID_BROADCAST);
+
+    ChatManager::ChatManager()
+    {
+        RegisterObject(ChatManager);
+    }
+
+    /**
+        @brief Sends a message (usually gameplay related) without explicit sender to the chat.
+        @param message The message
+        @param targetID The client ID (network) of the receiver. Usually the broadcast ID
+    */
+    /*static*/ void ChatManager::message(const std::string& message, unsigned int targetID)
+    {
+        unsigned int sourceID = NETWORK_PEER_ID_UNKNOWN;
+
+        // only the server should send gameplay messages through the network. otherwise display the message locally
+        if (GameMode::isServer())
+            Host::sendChat(message, sourceID, targetID);
+        else
+            ChatManager::getInstance().incomingChat(message, sourceID);
+    }
+
+    /**
+        @brief Sends a chat message with the client as its sender to the chat.
+        @param message The message
+        @param targetID The client ID (network) of the receiver. Usually the broadcast ID
+    */
+    /*static*/ void ChatManager::chat(const std::string& message, unsigned int targetID)
+    {
+        unsigned int sourceID = Host::getPlayerID();
+
+        // if connected to the network, send chat messages online. otherwise display chat locally
+        if (GameMode::isServer() || GameMode::isClient())
+            Host::sendChat(message, sourceID, targetID);
+        else
+            ChatManager::getInstance().incomingChat(message, sourceID);
+    }
+
+    /**
+        @brief Inherited callback from NetworkChatListener, but gets also called directly
+        by ChatManager itself if the client is offline. Distributes an incoming chat message
+        to all ChatListeners.
+        @param message The message
+        @param sourceID The client ID (network) of the sender
+    */
+    void ChatManager::incomingChat(const std::string& message, unsigned int sourceID)
+    {
+        std::string text = message;
+        std::string name;
+
+        // get the name of the sender and prepend it to the text message
+        if (sourceID != NETWORK_PEER_ID_UNKNOWN)
+        {
+            PlayerInfo* player = PlayerManager::getInstance().getClient(sourceID);
+            if (player)
+            {
+                name = player->getName();
+                text = name + ": " + message;
+            }
+        }
+
+        // notify all listeners
+        for (ObjectList<ChatListener>::iterator it = ObjectList<ChatListener>::begin(); it != ObjectList<ChatListener>::end(); ++it)
+            it->incomingChat(text, name);
+    }
+
+
+    //////////////////////////////////////////////////////////////////////////
+    // ChatListener                                                         //
+    //////////////////////////////////////////////////////////////////////////
+
+    ChatListener::ChatListener()
+    {
+        RegisterRootObject(ChatListener);
+    }
+}
Index: /code/branches/output/src/orxonox/chat/ChatManager.h
===================================================================
--- /code/branches/output/src/orxonox/chat/ChatManager.h	(revision 8829)
+++ /code/branches/output/src/orxonox/chat/ChatManager.h	(revision 8829)
@@ -0,0 +1,63 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _ChatManager_H__
+#define _ChatManager_H__
+
+#include "OrxonoxPrereqs.h"
+#include "util/Singleton.h"
+#include "network/NetworkChatListener.h"
+
+namespace orxonox
+{
+    /**
+        @brief This class collects and distributes chat messages. If the client is online,
+        all chat messages are sent and received through the network. Otherwise chat is handled
+        directly by this class.
+    */
+    class _OrxonoxExport ChatManager : public Singleton<ChatManager>, public NetworkChatListener
+    {
+        friend class Singleton<ChatManager>;
+
+        public:
+            ChatManager();
+            virtual ~ChatManager() {}
+
+            static void message(const std::string& message, unsigned int targetID = NETWORK_PEER_ID_BROADCAST);
+            static void chat(const std::string& message, unsigned int targetID = NETWORK_PEER_ID_BROADCAST);
+
+        protected:
+            ChatManager(const ChatManager&);
+
+            virtual void incomingChat(const std::string& message, unsigned int sourceID);
+
+            static ChatManager* singletonPtr_s;
+    };
+}
+
+#endif /* _ChatManager_H__ */
Index: /code/branches/output/src/orxonox/gametypes/Asteroids.cc
===================================================================
--- /code/branches/output/src/orxonox/gametypes/Asteroids.cc	(revision 8828)
+++ /code/branches/output/src/orxonox/gametypes/Asteroids.cc	(revision 8829)
@@ -30,5 +30,5 @@
 
 #include "core/CoreIncludes.h"
-#include "network/Host.h"
+#include "chat/ChatManager.h"
 #include "worldentities/pawns/Pawn.h"
 
@@ -74,5 +74,5 @@
 
         std::string message("The match has started! Reach the first chekpoint within 15 seconds! But be aware, there may be pirates around...");
-        Host::Broadcast(message);
+        ChatManager::message(message);
 
     }
@@ -83,5 +83,5 @@
 
         std::string message("The match has ended.");
-        Host::Broadcast(message);
+        ChatManager::message(message);
     }
 }
Index: /code/branches/output/src/orxonox/gametypes/Deathmatch.cc
===================================================================
--- /code/branches/output/src/orxonox/gametypes/Deathmatch.cc	(revision 8828)
+++ /code/branches/output/src/orxonox/gametypes/Deathmatch.cc	(revision 8829)
@@ -30,5 +30,5 @@
 
 #include "core/CoreIncludes.h"
-#include "network/Host.h"
+#include "chat/ChatManager.h"
 #include "infos/PlayerInfo.h"
 #include "worldentities/pawns/Pawn.h"
@@ -48,5 +48,5 @@
 
         std::string message("The match has started!");
-        Host::Broadcast(message);
+        ChatManager::message(message);
     }
 
@@ -56,5 +56,5 @@
 
         std::string message("The match has ended.");
-        Host::Broadcast(message);
+        ChatManager::message(message);
     }
 
@@ -64,5 +64,5 @@
 
         const std::string& message = player->getName() + " entered the game";
-        Host::Broadcast(message);
+        ChatManager::message(message);
     }
 
@@ -74,5 +74,5 @@
         {
             const std::string& message = player->getName() + " left the game";
-            Host::Broadcast(message);
+            ChatManager::message(message);
         }
 
@@ -87,5 +87,5 @@
         {
             const std::string& message = player->getOldName() + " changed name to " + player->getName();
-            Host::Broadcast(message);
+            ChatManager::message(message);
         }
 
@@ -108,5 +108,5 @@
                 message = victim->getPlayer()->getName() + " died";
 
-            Host::Broadcast(message);
+            ChatManager::message(message);
         }
 
@@ -121,5 +121,5 @@
         {
             const std::string& message = player->getName() + " scores!";
-            Host::Broadcast(message);
+            ChatManager::message(message);
         }
     }
Index: /code/branches/output/src/orxonox/gametypes/Dynamicmatch.cc
===================================================================
--- /code/branches/output/src/orxonox/gametypes/Dynamicmatch.cc	(revision 8828)
+++ /code/branches/output/src/orxonox/gametypes/Dynamicmatch.cc	(revision 8829)
@@ -49,5 +49,5 @@
 #include "core/CoreIncludes.h"
 #include "core/command/Executor.h"
-#include "network/Host.h"
+#include "chat/ChatManager.h"
 #include "infos/PlayerInfo.h"
 #include "worldentities/pawns/Pawn.h"
@@ -343,5 +343,5 @@
         Gametype::playerEntered(player);
         const std::string& message = player->getName() + " entered the game";
-        Host::Broadcast(message);
+        ChatManager::message(message);
     }
 
@@ -358,5 +358,5 @@
             }
             const std::string& message = player->getName() + " left the game";
-            Host::Broadcast(message);
+            ChatManager::message(message);
             //remove player from map
             playerParty_.erase (player);
@@ -615,5 +615,5 @@
         {
             const std::string& message = player->getOldName() + " changed name to " + player->getName();
-            Host::Broadcast(message);
+            ChatManager::message(message);
         }
 
@@ -627,5 +627,5 @@
         {
             std::string message("Dynamicmatch started!");
-            Host::Broadcast(message);
+            ChatManager::message(message);
         }
         else if(tutorial) // Announce selectionphase
@@ -643,5 +643,5 @@
     {
         std::string message("Earn points:\n\n\n\tIf you're red: Chase the blue player!\n\n\tIf you're blue shoot at a red player or hide.\n\n\tIf you're green: You've got the licence to kill red players!");
-        Host::Broadcast(message);
+        ChatManager::message(message);
         callInstructions_.setTimer(10, false, createExecutor(createFunctor(&Dynamicmatch::furtherInstructions, this)));
     }
@@ -650,5 +650,5 @@
     {
         std::string message("After 3 Minutes the game is over.");
-        Host::Broadcast(message);
+        ChatManager::message(message);
     }*/
     void Dynamicmatch::end()
@@ -657,5 +657,5 @@
 
         std::string message("Time out. Press F2 to see the points you scored.");
-        Host::Broadcast(message);
+        ChatManager::message(message);
     }
     SpawnPoint* Dynamicmatch::getBestSpawnPoint(PlayerInfo* player) const
Index: /code/branches/output/src/orxonox/gametypes/LastManStanding.cc
===================================================================
--- /code/branches/output/src/orxonox/gametypes/LastManStanding.cc	(revision 8828)
+++ /code/branches/output/src/orxonox/gametypes/LastManStanding.cc	(revision 8829)
@@ -30,5 +30,5 @@
 
 #include "core/CoreIncludes.h"
-#include "network/Host.h"
+#include "chat/ChatManager.h"
 #include "infos/PlayerInfo.h"
 #include "worldentities/pawns/Pawn.h"
@@ -105,5 +105,5 @@
             this->playersAlive--;
             const std::string& message = victim->getPlayer()->getName() + " has lost all lives";
-            Host::Broadcast(message);
+            ChatManager::message(message);
         }
 
Index: /code/branches/output/src/orxonox/gametypes/LastTeamStanding.cc
===================================================================
--- /code/branches/output/src/orxonox/gametypes/LastTeamStanding.cc	(revision 8828)
+++ /code/branches/output/src/orxonox/gametypes/LastTeamStanding.cc	(revision 8829)
@@ -30,6 +30,5 @@
 
 #include "core/CoreIncludes.h"
-#include "network/NetworkPrereqs.h"
-#include "network/Host.h"
+#include "chat/ChatManager.h"
 #include "infos/PlayerInfo.h"
 #include "worldentities/pawns/Pawn.h"
@@ -119,5 +118,5 @@
                 this->teamsAlive--;
             const std::string& message = victim->getPlayer()->getName() + " has lost all lives";
-            Host::Broadcast(message);
+            ChatManager::message(message);
         }
         return allow;
Index: /code/branches/output/src/orxonox/gametypes/UnderAttack.cc
===================================================================
--- /code/branches/output/src/orxonox/gametypes/UnderAttack.cc	(revision 8828)
+++ /code/branches/output/src/orxonox/gametypes/UnderAttack.cc	(revision 8829)
@@ -32,5 +32,5 @@
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
-#include "network/Host.h"
+#include "chat/ChatManager.h"
 #include "worldentities/pawns/Destroyer.h"
 #include "infos/PlayerInfo.h"
@@ -70,5 +70,5 @@
         this->end(); //end gametype
         std::string message("Ship destroyed! Team 0 has won!");
-        Host::Broadcast(message);
+        ChatManager::message(message);
         this->gameEnded_ = true;
 
@@ -152,5 +152,5 @@
                 this->end();
                 std::string message("Time is up! Team 1 has won!");
-                Host::Broadcast(message);
+                ChatManager::message(message);
 
                 for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)
@@ -171,5 +171,5 @@
                 const std::string& message = multi_cast<std::string>(timesequence_) + " seconds left!";
 /*
-                Host::Broadcast(message);
+                ChatManager::message(message);
 */
                 this->gtinfo_->sendAnnounceMessage(message);
