Index: /code/branches/masterserver2/src/libraries/network/MasterServer.cc
===================================================================
--- /code/branches/masterserver2/src/libraries/network/MasterServer.cc	(revision 8279)
+++ /code/branches/masterserver2/src/libraries/network/MasterServer.cc	(revision 8280)
@@ -38,5 +38,5 @@
   /* commands for the terminal interface */
   SetConsoleCommand( "ms-listservers", &MasterServer::listServers );
-  //SetConsoleCommand( "ms-delserver", &MasterServer::delServer );
+  SetConsoleCommand( "ms-delserver", &MasterServer::delServer );
   //SetConsoleCommand( "ms-serverinfo", &MasterServer::serverInfo );
 
@@ -67,4 +67,30 @@
     COUT(0) << MasterServer::getInstance()->mainlist.serverlist.size() <<
       " servers connected." << std::endl;
+  }
+
+  void 
+  MasterServer::delServer( std::string todeladdr )
+  {
+    /* tell the user we're now removing the entry from the server list */
+    COUT(0) << "MS: Deleting server \"" << todeladdr << "\"..." 
+      << std::endl;
+
+    /* see if we actually have that server on our list */
+    ServerListSearchResult shandle = 
+      MasterServer::getInstance()->mainlist.findServerByAddress(todeladdr);
+
+    if( !shandle.success )
+    { COUT(0) << "MS: Server not found, not removing." << std::endl;
+      return;
+    }
+
+    /* force-disconnect the server */  
+    enet_peer_disconnect( shandle.result.peer, NULL );
+
+    /* actually remove the entry from the server list by address */
+    MasterServer::getInstance()->mainlist.delServerByAddress( todeladdr);
+
+    /* tell the user about our success */
+    COUT(0) << "MS: Server deletion successful." << std::endl;
   }
 
@@ -365,7 +391,4 @@
     }
 
-    /***** INITIALIZE GAME SERVER AND PEER LISTS *****/
-    this->peers = new PeerList();
-
     /* set pointer to this instance */
     MasterServer::setInstance( this );
Index: /code/branches/masterserver2/src/libraries/network/MasterServer.h
===================================================================
--- /code/branches/masterserver2/src/libraries/network/MasterServer.h	(revision 8279)
+++ /code/branches/masterserver2/src/libraries/network/MasterServer.h	(revision 8280)
@@ -70,4 +70,5 @@
       /* functions for commands */
       static void listServers( void );
+      static void delServer( std::string todeladdr );
 
     private:
@@ -85,5 +86,4 @@
       ENetHost *server;
       ServerList mainlist;
-      PeerList *peers;
 
       unsigned int port;
Index: /code/branches/masterserver2/src/libraries/network/MasterServerComm.cc
===================================================================
--- /code/branches/masterserver2/src/libraries/network/MasterServerComm.cc	(revision 8279)
+++ /code/branches/masterserver2/src/libraries/network/MasterServerComm.cc	(revision 8280)
@@ -168,6 +168,8 @@
         case ENET_EVENT_TYPE_CONNECT: break;
 
-        /* disconnect */
-        case ENET_EVENT_TYPE_DISCONNECT: /* ?? */ break;
+        /* disconnection event - probably kick from masterserver or crash. */
+        case ENET_EVENT_TYPE_DISCONNECT: 
+          COUT(0) << "ERROR: Master server connection was dropped." << std::endl;
+          break;
 
         /* incoming data */
Index: /code/branches/masterserver2/src/libraries/network/ServerList.cc
===================================================================
--- /code/branches/masterserver2/src/libraries/network/ServerList.cc	(revision 8279)
+++ /code/branches/masterserver2/src/libraries/network/ServerList.cc	(revision 8280)
@@ -82,5 +82,45 @@
   }
 
+  /* SEARCHING */
+  ServerListSearchResult
+  ServerList::findServerByAddress( std::string address )
+  {
+    /* get an iterator */
+    std::list<ServerListElem>::iterator i;
 
+    /* loop through list elements */
+    for( i = serverlist.begin(); i != serverlist.end(); ++i ) 
+      if( (*i).ServerInfo.getServerIP() == address )
+      { /* found the target, return it */
+        ServerListSearchResult res = { (*i), true };
+        return res;
+      }
+
+    /* no success */
+    ServerListSearchResult res = { (*i), false };
+    return res;
+  }
+
+  ServerListSearchResult
+  ServerList::findServerByName( std::string name )
+  {
+    /* get an iterator */
+    std::list<ServerListElem>::iterator i;
+
+    /* iterate, return when name found */
+    /* loop through list elements */
+    for( i = serverlist.begin(); i != serverlist.end(); ++i ) 
+      if( (*i).ServerInfo.getServerName() == name )
+      { 
+        ServerListSearchResult res = { (*i), true };
+        return res;
+      }
+
+    /* no luck, return a struct that tells the caller so */
+    ServerListSearchResult res = { (*i), false };
+    return res;
+  }
+
+  /* SORTING */
   /* sort by name */
   bool sub_compare_names( ServerListElem no1, 
Index: /code/branches/masterserver2/src/libraries/network/ServerList.h
===================================================================
--- /code/branches/masterserver2/src/libraries/network/ServerList.h	(revision 8279)
+++ /code/branches/masterserver2/src/libraries/network/ServerList.h	(revision 8280)
@@ -37,4 +37,5 @@
 namespace orxonox 
 { 
+  /* HELPER STRUCTURES */
   struct ServerListElem 
   {
@@ -45,4 +46,17 @@
     ENetPeer* peer;
   };
+
+  struct ServerListSearchResult
+  {
+    /* list element found */
+    ServerListElem result;
+
+    /* successful search */
+    bool success;
+  };
+
+
+
+
 
   /** This class is keeps a list of game servers
@@ -79,6 +93,29 @@
 
 
-      /* SORTING (to be implemented) */
 
+
+      /* SEARCHING */
+      /* \param address The address of the server that is to be 
+       *  found
+       * \return A struct containing a result of the search and a boolean
+       *  that is only true if the search was successful
+       * 
+       * Find and return the list handle of a given address.
+       */
+      ServerListSearchResult
+      findServerByAddress( std::string address );
+
+
+      /* \param name The name of the server that is to be 
+       *  found
+       * \return The struct containing the list entry of the server
+       * 
+       * Find and return the list handle of a given name.
+       */
+      ServerListSearchResult
+      findServerByName( std::string name );
+
+
+      /* SORTING */
       /** sort by name  */
       void sortByName();
