Index: code/branches/masterserver/src/libraries/network/MasterServerProtocol.h
===================================================================
--- code/branches/masterserver/src/libraries/network/MasterServerProtocol.h	(revision 7656)
+++ code/branches/masterserver/src/libraries/network/MasterServerProtocol.h	(revision 7657)
@@ -37,4 +37,5 @@
 
 #define MSPROTO_REQ_LIST "REQ:LIST"
+#define MSPROTO_REQ_LIST_LEN 8
 
 
Index: code/branches/masterserver/src/libraries/network/WANDiscovery.cc
===================================================================
--- code/branches/masterserver/src/libraries/network/WANDiscovery.cc	(revision 7656)
+++ code/branches/masterserver/src/libraries/network/WANDiscovery.cc	(revision 7657)
@@ -62,8 +62,12 @@
 
   /* callback for the network reply poller */
-  /* WORK MARK WORK WORK */
-  /* NOTE implement protocol-specific part here. */
-  int WANDiscovery::rhandler( char *addr, ENetEvent *ev )
+  int rhandler( char *addr, ENetEvent *ev )
   { 
+    /* error recognition */
+    if( !ev || !ev->packet || !ev->packet->data )
+    { COUT(2) << "Bad arguments received in WANDiscovery's reply handler.\n";
+      return 0;
+    }
+
     /* handle incoming data */
     /* if a list entry arrives add to list */
@@ -81,5 +85,5 @@
 
       /* add to list */
-      this->servers_.push_back( toadd );
+      WANDiscovery::getInstance().servers_.push_back( toadd );
     }
     else if( !strncmp( (char*)ev->packet->data, MSPROTO_SERVERLIST_END,
@@ -97,8 +101,8 @@
 
     /* send request to server */
-    msc.sendRequest( MSPROTO_CLIENT " " MSPROTO_REQ_LIST );
+    this->msc.sendRequest( MSPROTO_CLIENT " " MSPROTO_REQ_LIST );
 
     /* deal with replies */
-    while( !msc.pollForReply( WANDiscovery::rhandler ) ) 
+    while( !(this->msc).pollForReply( rhandler ) )
       /* nothing */;
 
Index: code/branches/masterserver/src/libraries/network/WANDiscovery.h
===================================================================
--- code/branches/masterserver/src/libraries/network/WANDiscovery.h	(revision 7656)
+++ code/branches/masterserver/src/libraries/network/WANDiscovery.h	(revision 7657)
@@ -78,5 +78,6 @@
       static WANDiscovery& getInstance() { return Singleton<WANDiscovery>::getInstance(); } // tolua_export
     
-      int rhandler( char *addr, ENetEvent *ev );
+      /** game server list */
+      std::vector<packet::ServerInformation> servers_;
       
     private:
@@ -87,7 +88,4 @@
       MasterServerComm msc;
 
-      /** game server list */
-      std::vector<packet::ServerInformation> servers_;
-
   }; // tolua_export
 
Index: code/branches/masterserver/src/modules/masterserver/MasterServer.cc
===================================================================
--- code/branches/masterserver/src/modules/masterserver/MasterServer.cc	(revision 7656)
+++ code/branches/masterserver/src/modules/masterserver/MasterServer.cc	(revision 7657)
@@ -80,5 +80,5 @@
 
     /* remove the server from the list it belongs to */
-    this->mainlist->delServerByName( name );
+    this->mainlist.delServerByName( name );
 
     /* Reset the peer's client information. */
@@ -141,5 +141,5 @@
         MSPROTO_REGISTER_SERVER, MSPROTO_REGISTER_SERVER_LEN ) )
       { /* register new server */
-        mainlist->addServer( packet::ServerInformation( event ) );
+        mainlist.addServer( packet::ServerInformation( event ) );
       }
     }
@@ -149,18 +149,18 @@
       
       if( !strncmp( (char *)event->packet->data + MSPROTO_CLIENT_LEN+1,
-        MSPROTO_REQ_LIST ) )
+        MSPROTO_REQ_LIST, MSPROTO_REQ_LIST_LEN ) )
       { /* send server list */
         
         /* get an iterator */
-        std::list<packet::ServerInformation *>::iterator i;
+        std::list<packet::ServerInformation>::iterator i;
 
         /* loop through list elements */
-        for( i = serverlist.begin(); i != serverlist.end(); ++i ) 
+        for( i = mainlist.serverlist.begin(); i != mainlist.serverlist.end(); ++i ) 
         {
           /* WORK MARK */
           /* send this particular server */
           /* build reply string */
-          char *tosend = (char *)calloc( (*i)->getServerIP().length() + 1,1 );
-          snprintf( "%s %s", MSPROTO_SERVERLIST_ITEM, (*i)->getServerIP() );
+          char *tosend = (char *)calloc( (*i).getServerIP().length() + MSPROTO_SERVERLIST_ITEM_LEN + 2,1 );
+          sprintf( "%s %s", MSPROTO_SERVERLIST_ITEM, (*i).getServerIP().c_str() );
 
           /* create packet from it */
@@ -258,10 +258,10 @@
 
     /***** INITIALIZE GAME SERVER AND PEER LISTS *****/
-    this->mainlist = new ServerList();
+    //this->mainlist = new ServerList();
     this->peers = new PeerList();
-    if( this->mainlist == NULL || this->peers == NULL )
-    { COUT(1) << "Error creating server or peer list.\n";
-      exit( EXIT_FAILURE );
-    }
+    //if( this->mainlist == NULL || this->peers == NULL )
+    //{ COUT(1) << "Error creating server or peer list.\n";
+      //exit( EXIT_FAILURE );
+    //}
 
     /* run the main method */
Index: code/branches/masterserver/src/modules/masterserver/MasterServer.h
===================================================================
--- code/branches/masterserver/src/modules/masterserver/MasterServer.h	(revision 7656)
+++ code/branches/masterserver/src/modules/masterserver/MasterServer.h	(revision 7657)
@@ -73,5 +73,5 @@
       ENetAddress address;
       ENetHost *server;
-      ServerList *mainlist;
+      ServerList mainlist;
       PeerList *peers;
 
Index: code/branches/masterserver/src/modules/masterserver/ServerList.cc
===================================================================
--- code/branches/masterserver/src/modules/masterserver/ServerList.cc	(revision 7656)
+++ code/branches/masterserver/src/modules/masterserver/ServerList.cc	(revision 7657)
@@ -40,5 +40,5 @@
 
   int 
-  ServerList::addServer( packet::ServerInformation *toadd )
+  ServerList::addServer( packet::ServerInformation toadd )
   { this->serverlist.push_back( toadd ); 
     return 0;
@@ -49,11 +49,11 @@
   { 
     /* get an iterator */
-    std::list<packet::ServerInformation *>::iterator i;
+    std::list<packet::ServerInformation>::iterator i;
 
     /* loop through list elements */
     for( i = serverlist.begin(); i != serverlist.end(); ++i ) 
-      if( (*i)->getServerName() == name )
+      if( (*i).getServerName() == name )
       { /* found this name, remove and quit */
-        this->serverlist.remove( *i );
+        this->serverlist.erase( i );
         return true;
       }
@@ -64,11 +64,11 @@
   { 
     /* get an iterator */
-    std::list<packet::ServerInformation *>::iterator i;
+    std::list<packet::ServerInformation>::iterator i;
 
     /* loop through list elements */
     for( i=serverlist.begin(); i != serverlist.end(); ++i ) 
-      if( (*i)->getServerIP() == address )
+      if( (*i).getServerIP() == address )
       { /* found this name, remove and quit */
-        this->serverlist.remove( *i );
+        this->serverlist.erase( i );
         return true;
       }
@@ -78,7 +78,7 @@
 
   /* sort by name */
-  bool sub_compare_names( packet::ServerInformation *no1, 
-    packet::ServerInformation *no2 )
-  { return no1->getServerName() > no2->getServerName(); }
+  bool sub_compare_names( packet::ServerInformation no1, 
+    packet::ServerInformation no2 )
+  { return no1.getServerName() > no2.getServerName(); }
 
   void ServerList::sortByName()
@@ -88,9 +88,9 @@
   
   /* sort by ping */
-  bool sub_compare_pings( packet::ServerInformation *no1, 
-    packet::ServerInformation *no2 )
+  bool sub_compare_pings( packet::ServerInformation no1, 
+    packet::ServerInformation no2 )
   { 
     /* TODO */
-    return no1->getServerName() > no2->getServerName();
+    return no1.getServerName() > no2.getServerName();
   }
 
Index: code/branches/masterserver/src/modules/masterserver/ServerList.h
===================================================================
--- code/branches/masterserver/src/modules/masterserver/ServerList.h	(revision 7656)
+++ code/branches/masterserver/src/modules/masterserver/ServerList.h	(revision 7657)
@@ -54,5 +54,5 @@
        * Add server to the game server list
        */
-      int addServer( packet::ServerInformation *toadd );
+      int addServer( packet::ServerInformation toadd );
 
       /** \param name Name of the server to remove
@@ -78,5 +78,5 @@
 
       /** the list of servers for internal storage */
-      std::list<packet::ServerInformation *> serverlist;
+      std::list<packet::ServerInformation> serverlist;
     private:
   };
Index: code/branches/masterserver/src/orxonox/Main.cc
===================================================================
--- code/branches/masterserver/src/orxonox/Main.cc	(revision 7656)
+++ code/branches/masterserver/src/orxonox/Main.cc	(revision 7657)
@@ -90,4 +90,6 @@
             else if (CommandLineParser::getValue("dedicatedClient").getBool())
                 Game::getInstance().requestStates("client, level");
+            //else if (CommandLineParser::getValue("masterserver").getBool())
+                //Game::getInstance().requestStates("client, level");
             else
             {
