Index: /code/branches/objecthierarchy/src/network/Synchronisable.cc
===================================================================
--- /code/branches/objecthierarchy/src/network/Synchronisable.cc	(revision 2167)
+++ /code/branches/objecthierarchy/src/network/Synchronisable.cc	(revision 2168)
@@ -79,6 +79,6 @@
     classID = (unsigned int)-1;
     syncList = new std::list<synchronisableVariable *>;
-    
-    
+
+
 #ifndef NDEBUG
     ObjectList<Synchronisable>::iterator it;
@@ -173,5 +173,5 @@
       return 0;
     }
-    
+
     COUT(4) << "fabricating object with id: " << header->objectID << std::endl;
 
@@ -240,5 +240,5 @@
     if (it1 != objectMap_.end())
       return it1->second;
-    
+
     ObjectList<Synchronisable>::iterator it;
     for(it = ObjectList<Synchronisable>::begin(); it; ++it){
@@ -295,5 +295,5 @@
 #endif
   }
-  
+
   void Synchronisable::unregisterVariable(void *var){
     std::list<synchronisableVariable *>::iterator it = syncList->begin();
@@ -311,5 +311,5 @@
     // the variable has not been registered before
   }
-  
+
 
   /**
@@ -366,5 +366,5 @@
         continue;  // this variable should only be received
       }
-      
+
       // =========== start bidirectional stuff =============
       // if the variable gets synchronised bidirectional, then add the reference to the bytestream
@@ -397,5 +397,5 @@
       }
       // ================== end bidirectional stuff
-       
+
       switch((*i)->type){
         case DATA:
@@ -461,5 +461,5 @@
       bool callback=false;
       bool master=false;
-      
+
       if( ( (*i)->mode & direction::bidirectional ) == direction::bidirectional )
       {
@@ -505,5 +505,5 @@
         mem += sizeof((*i)->varReference);
       }
-      
+
       switch((*i)->type){
         case DATA:
@@ -525,5 +525,5 @@
           (*i)->size = *(size_t *)mem;
           mem += sizeof(size_t);
-          
+
           if( (*i)->callback) // check whether this string changed
             if( *static_cast<std::string*>((*i)->var) != std::string((char *)mem) )
@@ -535,5 +535,5 @@
               *static_cast<std::string*>((*i)->varBuffer)=*static_cast<std::string*>( (void*)(mem+sizeof(size_t)) );
           }
-          
+
           *((std::string *)((*i)->var)) = std::string((const char*)mem);
           COUT(5) << "synchronisable: char: " << (const char*)mem << " string: " << std::string((const char*)mem) << std::endl;
Index: /code/branches/objecthierarchy/src/orxonox/CMakeLists.txt
===================================================================
--- /code/branches/objecthierarchy/src/orxonox/CMakeLists.txt	(revision 2167)
+++ /code/branches/objecthierarchy/src/orxonox/CMakeLists.txt	(revision 2168)
@@ -4,4 +4,5 @@
   LevelManager.cc
   Main.cc
+  PlayerManager.cc
   Settings.cc
 
Index: /code/branches/objecthierarchy/src/orxonox/LevelManager.cc
===================================================================
--- /code/branches/objecthierarchy/src/orxonox/LevelManager.cc	(revision 2167)
+++ /code/branches/objecthierarchy/src/orxonox/LevelManager.cc	(revision 2168)
@@ -28,9 +28,7 @@
 
 #include "OrxonoxStableHeaders.h"
-
 #include "LevelManager.h"
 
-#include "core/CoreIncludes.h"
-
+#include "PlayerManager.h"
 #include "objects/infos/Level.h"
 #include "objects/infos/HumanPlayer.h"
@@ -42,10 +40,6 @@
     LevelManager::LevelManager()
     {
-        RegisterRootObject(LevelManager);
-
         assert(singletonRef_s == 0);
         singletonRef_s = this;
-
-        this->getConnectedClients();
     }
 
@@ -95,50 +89,7 @@
         {
             this->levels_s.front()->setActive(true);
-            for (std::map<unsigned int, PlayerInfo*>::iterator it = this->clients_.begin(); it != this->clients_.end(); ++it)
+            for (std::map<unsigned int, PlayerInfo*>::const_iterator it = PlayerManager::getInstance().getClients().begin(); it != PlayerManager::getInstance().getClients().end(); ++it)
                 this->levels_s.front()->playerEntered(it->second);
         }
     }
-
-
-    void LevelManager::clientConnected(unsigned int clientID)
-    {
-        COUT(3) << "client connected" << std::endl;
-
-        // create new HumanPlayer instance
-        HumanPlayer* player = new HumanPlayer(0);
-        player->setClientID(clientID);
-
-        // add to clients-map
-        assert(!this->clients_[clientID]);
-        this->clients_[clientID] = player;
-
-        if (this->getActiveLevel())
-            this->getActiveLevel()->playerEntered(player);
-    }
-
-    void LevelManager::clientDisconnected(unsigned int clientID)
-    {
-        COUT(3) << "client disconnected" << std::endl;
-
-        // remove from clients-map
-        PlayerInfo* player = this->clients_[clientID];
-        this->clients_.erase(clientID);
-
-        if (this->getActiveLevel())
-            this->getActiveLevel()->playerLeft(player);
-
-        // delete PlayerInfo instance
-        if (player)
-            delete player;
-    }
-
-
-    PlayerInfo* LevelManager::getClient(unsigned int clientID) const
-    {
-        std::map<unsigned int, PlayerInfo*>::const_iterator it = this->clients_.find(clientID);
-        if (it != this->clients_.end())
-            return it->second;
-        else
-            return 0;
-    }
 }
Index: /code/branches/objecthierarchy/src/orxonox/LevelManager.h
===================================================================
--- /code/branches/objecthierarchy/src/orxonox/LevelManager.h	(revision 2167)
+++ /code/branches/objecthierarchy/src/orxonox/LevelManager.h	(revision 2168)
@@ -36,9 +36,7 @@
 #include <cassert>
 
-#include "network/ClientConnectionListener.h"
-
 namespace orxonox
 {
-    class _OrxonoxExport LevelManager : public ClientConnectionListener
+    class _OrxonoxExport LevelManager
     {
         public:
@@ -50,8 +48,5 @@
             Level* getActiveLevel();
 
-            PlayerInfo* getClient(unsigned int clientID) const;
-            inline const std::map<unsigned int, PlayerInfo*>& getClients() const
-                { return this->clients_; }
-
+            static LevelManager* getInstancePtr() { return singletonRef_s; }
             static LevelManager& getInstance() { assert(singletonRef_s); return *singletonRef_s; }
 
@@ -59,12 +54,7 @@
             LevelManager(const LevelManager&);
 
-            void clientConnected(unsigned int clientID);
-            void clientDisconnected(unsigned int clientID);
-
             void activateNextLevel();
 
             std::list<Level*> levels_s;
-            std::map<unsigned int, PlayerInfo*> clients_;
-
             static LevelManager* singletonRef_s;
     };
Index: /code/branches/objecthierarchy/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- /code/branches/objecthierarchy/src/orxonox/OrxonoxPrereqs.h	(revision 2167)
+++ /code/branches/objecthierarchy/src/orxonox/OrxonoxPrereqs.h	(revision 2168)
@@ -82,4 +82,5 @@
     class CameraManager;
     class LevelManager;
+    class PlayerManager;
 
     // objects
Index: /code/branches/objecthierarchy/src/orxonox/PlayerManager.cc
===================================================================
--- /code/branches/objecthierarchy/src/orxonox/PlayerManager.cc	(revision 2168)
+++ /code/branches/objecthierarchy/src/orxonox/PlayerManager.cc	(revision 2168)
@@ -0,0 +1,112 @@
+/*
+ *   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 "OrxonoxStableHeaders.h"
+#include "PlayerManager.h"
+
+#include "LevelManager.h"
+#include "core/Core.h"
+#include "core/CoreIncludes.h"
+#include "objects/infos/Level.h"
+#include "objects/infos/HumanPlayer.h"
+
+namespace orxonox
+{
+    PlayerManager::PlayerManager()
+    {
+        RegisterRootObject(PlayerManager);
+
+        this->getConnectedClients();
+    }
+
+    PlayerManager::~PlayerManager()
+    {
+    }
+
+    PlayerManager& PlayerManager::getInstance()
+    {
+        static PlayerManager instance;
+        return instance;
+    }
+
+    void PlayerManager::clientConnected(unsigned int clientID)
+    {
+        if (Core::isMaster())
+        {
+            COUT(3) << "client connected" << std::endl;
+
+            // create new HumanPlayer instance
+            HumanPlayer* player = new HumanPlayer(0);
+            player->setClientID(clientID);
+
+            // add to clients-map
+            assert(!this->clients_[clientID]);
+            this->clients_[clientID] = player;
+
+            if (LevelManager::getInstancePtr() && LevelManager::getInstance().getActiveLevel())
+                LevelManager::getInstance().getActiveLevel()->playerEntered(player);
+        }
+    }
+
+    void PlayerManager::clientDisconnected(unsigned int clientID)
+    {
+        if (Core::isMaster())
+        {
+            COUT(3) << "client disconnected" << std::endl;
+
+            // remove from clients-map
+            PlayerInfo* player = this->clients_[clientID];
+            this->clients_.erase(clientID);
+
+            if (LevelManager::getInstancePtr() && LevelManager::getInstance().getActiveLevel())
+                LevelManager::getInstance().getActiveLevel()->playerLeft(player);
+
+            // delete PlayerInfo instance
+            if (player)
+                delete player;
+        }
+    }
+
+
+    PlayerInfo* PlayerManager::getClient(unsigned int clientID) const
+    {
+        if (Core::isMaster())
+        {
+            std::map<unsigned int, PlayerInfo*>::const_iterator it = this->clients_.find(clientID);
+            if (it != this->clients_.end())
+                return it->second;
+        }
+        else
+        {
+            for (ObjectList<PlayerInfo>::iterator it = ObjectList<PlayerInfo>::begin(); it != ObjectList<PlayerInfo>::end(); ++it)
+                if (it->getClientID() == clientID)
+                    return (*it);
+        }
+        return 0;
+    }
+}
Index: /code/branches/objecthierarchy/src/orxonox/PlayerManager.h
===================================================================
--- /code/branches/objecthierarchy/src/orxonox/PlayerManager.h	(revision 2168)
+++ /code/branches/objecthierarchy/src/orxonox/PlayerManager.h	(revision 2168)
@@ -0,0 +1,59 @@
+/*
+ *   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 _PlayerManager_H__
+#define _PlayerManager_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <map>
+#include "network/ClientConnectionListener.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport PlayerManager : public ClientConnectionListener
+    {
+        public:
+            PlayerManager();
+            virtual ~PlayerManager();
+
+            static PlayerManager& getInstance();
+
+            PlayerInfo* getClient(unsigned int clientID) const;
+            inline const std::map<unsigned int, PlayerInfo*>& getClients() const
+                { return this->clients_; }
+
+        private:
+            void clientConnected(unsigned int clientID);
+            void clientDisconnected(unsigned int clientID);
+
+            std::map<unsigned int, PlayerInfo*> clients_;
+    };
+}
+
+#endif /* _PlayerManager_H__ */
Index: /code/branches/objecthierarchy/src/orxonox/objects/infos/Level.cc
===================================================================
--- /code/branches/objecthierarchy/src/orxonox/objects/infos/Level.cc	(revision 2167)
+++ /code/branches/objecthierarchy/src/orxonox/objects/infos/Level.cc	(revision 2168)
@@ -40,4 +40,5 @@
 #include "PlayerInfo.h"
 #include "objects/gametypes/Gametype.h"
+#include "overlays/OverlayGroup.h"
 
 #include "util/Math.h"
@@ -62,5 +63,6 @@
         if (this->isInitialized())
         {
-            LevelManager::getInstance().releaseActivity(this);
+            if (LevelManager::getInstancePtr())
+                LevelManager::getInstance().releaseActivity(this);
 
             if (this->xmlfile_)
@@ -93,4 +95,5 @@
         mask.exclude(Class(BaseObject));
         mask.include(Class(Template));
+        mask.include(Class(OverlayGroup)); // HACK to include the ChatOverlay
 
         this->xmlfile_ = new XMLFile(Settings::getDataPath() + this->xmlfilename_, mask);
@@ -112,5 +115,6 @@
                 (*it)->setGametype(rootgametype);
 
-            LevelManager::getInstance().requestActivity(this);
+            if (LevelManager::getInstancePtr())
+                LevelManager::getInstance().requestActivity(this);
         }
     }
Index: /code/branches/objecthierarchy/src/orxonox/overlays/hud/ChatOverlay.cc
===================================================================
--- /code/branches/objecthierarchy/src/orxonox/overlays/hud/ChatOverlay.cc	(revision 2167)
+++ /code/branches/objecthierarchy/src/orxonox/overlays/hud/ChatOverlay.cc	(revision 2168)
@@ -38,5 +38,5 @@
 #include "network/ClientInformation.h"
 
-#include "LevelManager.h"
+#include "PlayerManager.h"
 #include "objects/infos/PlayerInfo.h"
 #include "overlays/console/InGameConsole.h"
@@ -76,5 +76,5 @@
             std::string name = "unknown";
 
-            PlayerInfo* player = LevelManager::getInstance().getClient(senderID);
+            PlayerInfo* player = PlayerManager::getInstance().getClient(senderID);
             if (player)
                 name = player->getName();
