Index: code/branches/dockingsystem2/src/modules/docking/Dock.cc
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/Dock.cc	(revision 8257)
+++ code/branches/dockingsystem2/src/modules/docking/Dock.cc	(revision 8382)
@@ -33,7 +33,11 @@
 
 #include "Dock.h"
+
 #include "infos/HumanPlayer.h"
 #include "worldentities/pawns/Pawn.h"
 #include "interfaces/PlayerTrigger.h"
+#include "controllers/HumanController.h"
+#include "core/command/ConsoleCommand.h"
+
 
 
@@ -41,4 +45,7 @@
 {
     CreateFactory(Dock);
+
+    SetConsoleCommand("Dock", "dock",    &Dock::cmdDock).addShortcut().setAsInputCommand();
+    SetConsoleCommand("Dock", "undock",  &Dock::cmdUndock).addShortcut().setAsInputCommand();
 
     Dock::Dock(BaseObject* creator) : StaticEntity(creator)
@@ -80,15 +87,15 @@
         {
             if(!pTrigger->isForPlayer()) {  // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one.
-                COUT(0) << "Docking:execute PlayerTrigger was not triggered by a player.." << std::endl;
+                COUT(2) << "Docking:execute PlayerTrigger was not triggered by a player.." << std::endl;
                 return false;
             }
             pawn = pTrigger->getTriggeringPlayer();
         } else {
-            COUT(0) << "Docking::execute Not a player trigger, can't extract pawn from it.." << std::endl;
+            COUT(2) << "Docking::execute Not a player trigger, can't extract pawn from it.." << std::endl;
             return false;
         }
         if(pawn == NULL)
         {
-            COUT(0) << "Docking::execute Can't retrieve Pawn from Trigger. (" << trigger->getIdentifier()->getName() << ")" << std::endl;
+            COUT(2) << "Docking::execute Can't retrieve Pawn from Trigger. (" << trigger->getIdentifier()->getName() << ")" << std::endl;
             return false;
         }
@@ -98,5 +105,5 @@
         if(player == NULL)
         {
-            COUT(0) << "The PlayerInfo* is NULL." << std::endl;
+            COUT(2) << "The PlayerInfo* is NULL." << std::endl;
             return false;
         }
@@ -105,8 +112,13 @@
 
         if(bTriggered) {
-            DockingEffect::invokeEffect(docking::DOCKING, player, effects_);
-            DockingEffect::invokeEffect(docking::ATTACH, player, effects_);
+            // Add player to this Docks candidates
+            candidates.insert(player);
+
+            //DockingEffect::invokeEffect(docking::DOCKING, player, effects_);
         } else {
-            DockingEffect::invokeEffect(docking::RELEASE, player, effects_);
+            // Remove player from candidates list
+            candidates.erase(player);
+
+            //DockingEffect::invokeEffect(docking::RELEASE, player, effects_);
         }
 
@@ -115,7 +127,53 @@
 
 
+    void Dock::cmdDock() {
+        PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer();
+        for(ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it) {
+            if(it->dock(player))
+                break;
+        }
+    }
+
+    void Dock::cmdUndock() {
+        PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer();
+        for(ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it) {
+            if(it->undock(player))
+                break;
+        }
+    }
+
+
+    bool Dock::dock(PlayerInfo* player) {
+        // Check if player is a candidate
+        if(candidates.find(player) == candidates.end()) {
+            COUT(0) << "Player is not a candidate!";
+            return false;
+        }
+
+        // Remove player from candidates, add to docked players and invoke docking effect
+        candidates.erase(player);
+        docked.insert(player);
+        DockingEffect::invokeEffect(docking::ATTACH, player, effects);
+        return true;
+    }
+
+    bool Dock::undock(PlayerInfo* player) {
+        // Check if player is docked to this Dock
+        if(docked.find(player) == docked.end()) {
+            COUT(0) << "Player is not docked to this Dock." << std::endl;
+            return false;
+        }
+
+        // Remove player from docked, add to candidates and reverse DockingEffect 
+        docked.erase(player);
+        candidates.insert(player);
+        DockingEffect::invokeEffect(docking::RELEASE, player, effects);
+        return true;
+    }
+
+
     bool Dock::addEffect(DockingEffect* effect) {
         assert(effect);
-        effects_.push_back(effect);
+        effects.push_back(effect);
         return true;
     }
@@ -123,9 +181,7 @@
     const DockingEffect* Dock::getEffect(unsigned int index) const {
         int i = index;
-        for (std::list<DockingEffect*>::const_iterator effect = this->effects_.begin(); effect != this->effects_.end(); ++effect)
-        {
+        for (std::list<DockingEffect*>::const_iterator effect = this->effects.begin(); effect != this->effects.end(); ++effect) {
             if(i == 0)
                return *effect;
-
             i--;
         }
Index: code/branches/dockingsystem2/src/modules/docking/Dock.h
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/Dock.h	(revision 8257)
+++ code/branches/dockingsystem2/src/modules/docking/Dock.h	(revision 8382)
@@ -36,4 +36,6 @@
 #define _Dock_H__
 
+#include <map>
+
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
@@ -41,9 +43,10 @@
 
 #include "worldentities/StaticEntity.h"
+#include "notifications/NotificationManager.h"
+
 #include "DockingEffect.h"
 #include "DockingPrereqs.h"
 
-namespace orxonox { 
-
+namespace orxonox {
 
     class _DockingExport Dock : public StaticEntity {
@@ -60,6 +63,14 @@
         const DockingEffect* getEffect(unsigned int index) const; //!< Get the DockingEffect at a given index.
 
+        bool dock(PlayerInfo* player); //!< Returns true if given player docked successfully (player must be a candidate)
+        bool undock(PlayerInfo* player); //!< Undocks a player (player must be docked)
+
+        static void cmdDock();
+        static void cmdUndock();
+
     private:
-        std::list<DockingEffect*> effects_; //!< The list of DockingEffects to be executed when a player docks.
+        std::set<PlayerInfo*> candidates; //!< A set of all players which are allowed to dock using the console command.
+        std::set<PlayerInfo*> docked; //!< A set of all docked players
+        std::list<DockingEffect*> effects; //!< The list of DockingEffects to be executed when a player docks.
     };
 
Index: code/branches/dockingsystem2/src/modules/docking/DockToShip.cc
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockToShip.cc	(revision 8257)
+++ code/branches/dockingsystem2/src/modules/docking/DockToShip.cc	(revision 8382)
@@ -89,4 +89,6 @@
         }
 
+        // Make sure target isn't removed when undocking
+        dockTo->setDestroyWhenPlayerLeft(false);
         player->startTemporaryControl(dockTo);
 
@@ -97,4 +99,7 @@
     {
         COUT(0) << "DockToShip::release" << endl;
+
+        player->stopTemporaryControl();
+
         return true;
     }
