Index: /code/branches/core5/src/libraries/network/ClientConnectionListener.cc
===================================================================
--- /code/branches/core5/src/libraries/network/ClientConnectionListener.cc	(revision 5819)
+++ /code/branches/core5/src/libraries/network/ClientConnectionListener.cc	(revision 5820)
@@ -33,21 +33,32 @@
 #include "ClientInformation.h"
 
-namespace orxonox{
+namespace orxonox
+{
+    ClientConnectionListener::ClientConnectionListener()
+    { 
+        RegisterRootObject(ClientConnectionListener); 
+    }
 
-  ClientConnectionListener::ClientConnectionListener()
-  { 
-    RegisterRootObject(ClientConnectionListener); 
-  }
+    void ClientConnectionListener::broadcastClientConnected(unsigned int clientID)
+    {
+        for (ObjectList<ClientConnectionListener>::iterator it = ObjectList<ClientConnectionListener>::begin(); it != ObjectList<ClientConnectionListener>::end(); ++it)
+            it->clientConnected(clientID);
+    }
+    
+    void ClientConnectionListener::broadcastClientDisconnected(unsigned int clientID)
+    {
+        for (ObjectList<ClientConnectionListener>::iterator it = ObjectList<ClientConnectionListener>::begin(); it != ObjectList<ClientConnectionListener>::end(); ++it)
+            it->clientDisconnected(clientID);
+    }
 
-  void ClientConnectionListener::getConnectedClients(){
-    if(GameMode::showsGraphics())
-      this->clientConnected(0); //server client id
-    ClientInformation *client = ClientInformation::getBegin();
-    while(client){
-      this->clientConnected(client->getID());
-      client=client->next();
+    void ClientConnectionListener::getConnectedClients()
+    {
+        ClientInformation* client = ClientInformation::getBegin();
+        while (client)
+        {
+            this->clientConnected(client->getID());
+            client = client->next();
+        }
     }
-  }
-
 }
 
Index: /code/branches/core5/src/libraries/network/ClientConnectionListener.h
===================================================================
--- /code/branches/core5/src/libraries/network/ClientConnectionListener.h	(revision 5819)
+++ /code/branches/core5/src/libraries/network/ClientConnectionListener.h	(revision 5820)
@@ -33,21 +33,21 @@
 #include "core/OrxonoxClass.h"
 
-namespace orxonox{
+namespace orxonox
+{
+    class _NetworkExport ClientConnectionListener : virtual public OrxonoxClass
+    {
+        public:
+            ClientConnectionListener();
+            virtual ~ClientConnectionListener() {}
+            
+            static void broadcastClientConnected(unsigned int clientID);
+            static void broadcastClientDisconnected(unsigned int clientID);
 
-  class _NetworkExport ClientConnectionListener : virtual public OrxonoxClass
-  {
-    friend class Server;
+            virtual void clientConnected(unsigned int clientID) = 0;
+            virtual void clientDisconnected(unsigned int clientID) = 0;
 
-  public:
-    ClientConnectionListener();
-    virtual ~ClientConnectionListener() {}
-
-    void getConnectedClients();
-
-  protected:
-    virtual void clientConnected(unsigned int clientID) = 0;
-    virtual void clientDisconnected(unsigned int clientID) = 0;
-  };
-
+        protected:
+            void getConnectedClients();
+    };
 }
 
Index: /code/branches/core5/src/libraries/network/Server.cc
===================================================================
--- /code/branches/core5/src/libraries/network/Server.cc	(revision 5819)
+++ /code/branches/core5/src/libraries/network/Server.cc	(revision 5820)
@@ -279,9 +279,5 @@
 
     // inform all the listeners
-    ObjectList<ClientConnectionListener>::iterator listener = ObjectList<ClientConnectionListener>::begin();
-    while(listener){
-      listener->clientConnected(newid);
-      listener++;
-    }
+    ClientConnectionListener::broadcastClientConnected(newid);
 
     ++newid;
@@ -329,10 +325,7 @@
     ServerConnection::disconnectClient( client );
     GamestateManager::removeClient(client);
-// inform all the listeners
-    ObjectList<ClientConnectionListener>::iterator listener = ObjectList<ClientConnectionListener>::begin();
-    while(listener){
-      listener->clientDisconnected(client->getID());
-      ++listener;
-    }
+    // inform all the listeners
+    ClientConnectionListener::broadcastClientDisconnected(client->getID());
+
     delete client; //remove client from list
   }
Index: /code/branches/core5/src/modules/gamestates/GSLevel.cc
===================================================================
--- /code/branches/core5/src/modules/gamestates/GSLevel.cc	(revision 5819)
+++ /code/branches/core5/src/modules/gamestates/GSLevel.cc	(revision 5820)
@@ -129,4 +129,7 @@
             // level is loaded: we can start capturing the input
             InputManager::getInstance().enterState("game");
+            
+            // connect the HumanPlayer to the game
+            this->playerManager_->clientConnected(0);
         }
     }
@@ -177,5 +180,10 @@
 
         if (GameMode::showsGraphics())
+        {
+            // disconnect the HumanPlayer
+            this->playerManager_->clientDisconnected(0);
+            
             InputManager::getInstance().leaveState("game");
+        }
 
         if (GameMode::isMaster())
@@ -234,7 +242,4 @@
     void GSLevel::unloadLevel()
     {
-        for (ObjectList<HumanPlayer>::iterator it = ObjectList<HumanPlayer>::begin(); it; ++it)
-            it->setGametype(0);
-        
         Loader::unload(startFile_s);
 
Index: /code/branches/core5/src/orxonox/LevelManager.cc
===================================================================
--- /code/branches/core5/src/orxonox/LevelManager.cc	(revision 5819)
+++ /code/branches/core5/src/orxonox/LevelManager.cc	(revision 5820)
@@ -39,5 +39,4 @@
 #include "PlayerManager.h"
 #include "Level.h"
-#include "infos/HumanPlayer.h"
 
 namespace orxonox
Index: /code/branches/core5/src/orxonox/PlayerManager.cc
===================================================================
--- /code/branches/core5/src/orxonox/PlayerManager.cc	(revision 5819)
+++ /code/branches/core5/src/orxonox/PlayerManager.cc	(revision 5820)
@@ -74,5 +74,6 @@
         if (GameMode::isMaster())
         {
-            COUT(3) << "client disconnected" << std::endl;
+            if (clientID != 0)
+                COUT(3) << "client disconnected" << std::endl;
 
             // remove from clients-map
Index: /code/branches/core5/src/orxonox/PlayerManager.h
===================================================================
--- /code/branches/core5/src/orxonox/PlayerManager.h	(revision 5819)
+++ /code/branches/core5/src/orxonox/PlayerManager.h	(revision 5820)
@@ -50,8 +50,8 @@
                 { return this->clients_; }
 
-        private:
             void clientConnected(unsigned int clientID);
             void clientDisconnected(unsigned int clientID);
 
+        private:
             std::map<unsigned int, PlayerInfo*> clients_;
 
