Index: /code/branches/masterserver/src/libraries/network/WANDiscovery.cc
===================================================================
--- /code/branches/masterserver/src/libraries/network/WANDiscovery.cc	(revision 7630)
+++ /code/branches/masterserver/src/libraries/network/WANDiscovery.cc	(revision 7630)
@@ -0,0 +1,66 @@
+/*
+ *   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 "WANDiscovery.h"
+
+#include <enet/enet.h>
+#include <cstring>
+
+#include "util/ScopedSingletonManager.h"
+#include "core/CoreIncludes.h"
+
+
+namespace orxonox
+{
+  ManageScopedSingleton(WANDiscovery, ScopeID::Root, true);
+
+  WANDiscovery::WANDiscovery()
+  {
+  }
+
+  WANDiscovery::~WANDiscovery()
+  {
+  }
+
+  void WANDiscovery::discover()
+  {
+    this->servers_.clear();
+  }
+
+  std::string WANDiscovery::getServerListItemName(unsigned int index)
+  {
+
+  }
+
+  std::string WANDiscovery::getServerListItemIP(unsigned int index)
+  {
+
+  }
+
+
+} // namespace orxonox
Index: /code/branches/masterserver/src/libraries/network/WANDiscovery.h
===================================================================
--- /code/branches/masterserver/src/libraries/network/WANDiscovery.h	(revision 7630)
+++ /code/branches/masterserver/src/libraries/network/WANDiscovery.h	(revision 7630)
@@ -0,0 +1,63 @@
+/*
+ *   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 (original)
+ *   Co-authors:
+ *      Sandro 'smerkli' Merkli (copied and adapted to WAN)
+ *
+ */
+
+#ifndef WANDISCOVERY_H
+#define WANDISCOVERY_H
+
+#include "NetworkPrereqs.h"
+#include "packet/ServerInformation.h"
+#include "util/Singleton.h"
+
+#include <vector>
+
+// tolua_begin
+namespace orxonox
+{
+
+  class _NetworkExport WANDiscovery
+// tolua_end
+    : public Singleton<WANDiscovery>
+  { // tolua_export
+    friend class Singleton<WANDiscovery>;
+    public:
+      WANDiscovery();
+      ~WANDiscovery();
+      void discover(); // tolua_export
+      std::string getServerListItemName( unsigned int index ); // tolua_export
+      std::string getServerListItemIP( unsigned int index ); // tolua_export
+      static WANDiscovery& getInstance(){ return Singleton<WANDiscovery>::getInstance(); } // tolua_export
+      
+    private:
+      static WANDiscovery* singletonPtr_s;
+      ENetHost* host_;
+      std::vector<packet::ServerInformation> servers_;
+  }; // tolua_export
+
+} // tolua_export
+
+#endif // WANDISCOVERY_H
Index: /code/branches/masterserver/src/modules/masterserver/MasterServer.cc
===================================================================
--- /code/branches/masterserver/src/modules/masterserver/MasterServer.cc	(revision 7629)
+++ /code/branches/masterserver/src/modules/masterserver/MasterServer.cc	(revision 7630)
@@ -116,25 +116,27 @@
       << event->channelID << "\n";
 
-    /* send some packet back for testing */
-    /* TESTING */
-
-    /* Create a reliable reply of size 7 containing "reply\0" */
-    ENetPacket * reply = enet_packet_create ("reply", 
-        strlen ("reply") + 1, 
-        ENET_PACKET_FLAG_RELIABLE);
-
-    /* Send the reply to the peer over channel id 0. */
-    enet_peer_send( event->peer, 0, reply );
-
-    /* One could just use enet_host_service() instead. */
-    enet_host_flush( this->server );
-
-    /* /TESTING */
-
-    /* game server or client connection? */
-    /* game server */
+    //[> send some packet back for testing <]
+    //[> TESTING <]
+
+    //[> Create a reliable reply of size 7 containing "reply\0" <]
+    //ENetPacket * reply = enet_packet_create ("reply", 
+        //strlen ("reply") + 1, 
+        //ENET_PACKET_FLAG_RELIABLE);
+
+    //[> Send the reply to the peer over channel id 0. <]
+    //enet_peer_send( event->peer, 0, reply );
+
+    //[> One could just use enet_host_service() instead. <]
+    //enet_host_flush( this->server );
+
+    //[> /TESTING <]
+
+    /* GAME SERVER OR CLIENT CONNECTION? */
+
+    /* Game server */
     /* parse data */
     /* start actions */
     /* and send reply */
+
     /* client */
     /* parse data */
Index: /code/branches/masterserver/src/modules/masterserver/MasterServerComm.cc
===================================================================
--- /code/branches/masterserver/src/modules/masterserver/MasterServerComm.cc	(revision 7629)
+++ /code/branches/masterserver/src/modules/masterserver/MasterServerComm.cc	(revision 7630)
@@ -76,5 +76,6 @@
   { fprintf( stderr, 
         "No available peers for initiating an ENet connection.\n");
-    exit (EXIT_FAILURE);
+    //exit (EXIT_FAILURE);
+    return -1;
   }
 
@@ -87,5 +88,6 @@
     enet_peer_reset (this->peer);
     fprintf( stdout, "Connection to %s failed.", address );
-    exit(EXIT_FAILURE);
+    //exit(EXIT_FAILURE);
+    return -1;
   }
 
@@ -171,5 +173,6 @@
   /* setup object and connect */
   MasterServerComm msc = MasterServerComm();
-  msc.connect( argv[1], 1234 );
+  if( msc.connect( argv[1], 1234 ) )
+    exit(EXIT_FAILURE);
   
   /* send some data and poll for replies */
