Index: code/branches/output/data/gui/scripts/MultiplayerMenu.lua
===================================================================
--- code/branches/output/data/gui/scripts/MultiplayerMenu.lua	(revision 8831)
+++ code/branches/output/data/gui/scripts/MultiplayerMenu.lua	(revision 8832)
@@ -117,5 +117,5 @@
         local listbox = winMgr:getWindow("orxonox/MultiplayerListbox")
         CEGUI.toListbox(listbox):resetList()
-        local discovery = orxonox.WANDiscovery:getInstance()
+        local discovery = orxonox.WANDiscovery()
         cout(0, "discovering.\n" )
         discovery:discover()
Index: code/branches/output/src/libraries/network/MasterServerComm.cc
===================================================================
--- code/branches/output/src/libraries/network/MasterServerComm.cc	(revision 8831)
+++ code/branches/output/src/libraries/network/MasterServerComm.cc	(revision 8832)
@@ -29,4 +29,5 @@
 #include "MasterServerComm.h"
 #include "util/Output.h"
+#include "WANDiscovery.h"
 
 namespace orxonox
@@ -149,6 +150,5 @@
    * so we can also make callbacks from objects
    */
-  int MasterServerComm::pollForReply( int (*callback)( char*, ENetEvent* ),
-    int delayms )
+  int MasterServerComm::pollForReply( WANDiscovery* listener, int delayms )
   { 
     /* see whether anything happened */
@@ -193,6 +193,6 @@
 
           /* call the supplied callback, if any. */
-          if( (*callback) != NULL )
-            retval = (*callback)( addrconv, &(this->event) );
+          if( listener != NULL )
+            retval = listener->rhandler( addrconv, &(this->event) );
 
           /* clean up */
Index: code/branches/output/src/libraries/network/MasterServerComm.h
===================================================================
--- code/branches/output/src/libraries/network/MasterServerComm.h	(revision 8831)
+++ code/branches/output/src/libraries/network/MasterServerComm.h	(revision 8832)
@@ -93,5 +93,5 @@
        * 
        * Poll the master server for new data and act accordingly */
-      int pollForReply( int (*callback)( char*, ENetEvent* ), int delayms );
+      int pollForReply( WANDiscovery* listener, int delayms );
 
     private:
Index: code/branches/output/src/libraries/network/NetworkPrereqs.h
===================================================================
--- code/branches/output/src/libraries/network/NetworkPrereqs.h	(revision 8831)
+++ code/branches/output/src/libraries/network/NetworkPrereqs.h	(revision 8832)
@@ -129,4 +129,6 @@
   class GamestateManager;
   class Host;
+  class MasterServer;
+  class MasterServerComm;
   class NetworkChatListener;
   class NetworkFunctionBase;
@@ -136,7 +138,10 @@
   class NetworkMemberFunction;
   class NetworkMemberFunctionBase;
+  class PeerList;
   class Server;
   class ServerConnection;
   class TrafficControl;
+  class WANDiscoverable;
+  class WANDiscovery;
 
   // packet
Index: code/branches/output/src/libraries/network/Server.cc
===================================================================
--- code/branches/output/src/libraries/network/Server.cc	(revision 8831)
+++ code/branches/output/src/libraries/network/Server.cc	(revision 8832)
@@ -59,5 +59,4 @@
 #include "FunctionCallManager.h"
 #include "GamestateManager.h"
-#include "WANDiscovery.h"
 
 namespace orxonox
@@ -99,12 +98,4 @@
   }
 
-
-  /** helper that connects to the master server */
-  void Server::helper_ConnectToMasterserver()
-  {
-//     WANDiscovery::getInstance().msc.sendRequest( MSPROTO_GAME_SERVER " "
-//       MSPROTO_REGISTER_SERVER );
-  }
-
   /**
   * This function opens the server by creating the listener thread
@@ -121,8 +112,4 @@
     /* make discoverable on WAN */
     WANDiscoverable::setActivity(true);
-    /* TODO this needs to be optional, we need a switch from the UI to
-     * enable/disable this
-     */
-//     helper_ConnectToMasterserver();
 
     /* done */
@@ -149,28 +136,4 @@
   }
 
-  /* handle incoming data */
-  int rephandler( char *addr, ENetEvent *ev )
-  {
-    /* reply to pings */
-    if( !strncmp( (char *)ev->packet->data, MSPROTO_PING_GAMESERVER,
-      MSPROTO_PING_GAMESERVER_LEN ) )
-      //this->msc.sendRequest( MSPROTO_ACK );
-      /* NOTE implement this after pollForReply
-       * reimplementation
-       */
-      return 0;
-
-    /* done handling, return all ok code 0 */
-    return 0;
-  }
-
-  void Server::helper_HandleMasterServerRequests()
-  {
-    /* poll the master server for replies and see whether something
-     * has to be done or changed.
-     */
-    //WANDiscovery::getInstance().msc.pollForReply( rhandler, 10 );
-  }
-
   /**
   * Run this function once every tick
@@ -185,8 +148,4 @@
     // receive and process incoming discovery packets
     LANDiscoverable::update();
-
-    // receive and process requests from master server
-    /* todo */
-    //helper_HandleMasterServerRequests();
 
     if ( GamestateManager::hasPeers() )
Index: code/branches/output/src/libraries/network/Server.h
===================================================================
--- code/branches/output/src/libraries/network/Server.h	(revision 8831)
+++ code/branches/output/src/libraries/network/Server.h	(revision 8832)
@@ -42,6 +42,4 @@
 #include "LANDiscoverable.h"
 #include "WANDiscoverable.h"
-// #include "MasterServerComm.h"
-// #include "MasterServerProtocol.h"
 
 
@@ -60,9 +58,4 @@
     Server(int port, const std::string& bindAddress);
     ~Server();
-
-    /* helpers */
-    void helper_ConnectToMasterserver();
-    void helper_HandleMasterServerRequests();
-    int replyhandler( char *addr, ENetEvent *ev );
 
     void open();
Index: code/branches/output/src/libraries/network/WANDiscovery.cc
===================================================================
--- code/branches/output/src/libraries/network/WANDiscovery.cc	(revision 8831)
+++ code/branches/output/src/libraries/network/WANDiscovery.cc	(revision 8832)
@@ -32,5 +32,4 @@
 #include <cstring>
 
-#include "util/ScopedSingletonManager.h"
 #include "core/CoreIncludes.h"
 
@@ -38,7 +37,4 @@
 namespace orxonox
 {
-  ManageScopedSingleton(WANDiscovery, ScopeID::Graphics, true);
-
-
   WANDiscovery::WANDiscovery()
   {
@@ -80,5 +76,5 @@
 
   /* callback for the network reply poller */
-  int rhandler( char *addr, ENetEvent *ev )
+  int WANDiscovery::rhandler( char *addr, ENetEvent *ev )
   { 
     /* error recognition */
@@ -103,5 +99,5 @@
 
       /* add to list */
-      WANDiscovery::getInstance().servers_.push_back( toadd );
+      this->servers_.push_back( toadd );
     }
     else if( !strncmp( (char*)ev->packet->data, MSPROTO_SERVERLIST_END,
@@ -132,5 +128,5 @@
     {
       /* poll for reply and act according to what was received */
-      switch( this->msc.pollForReply( rhandler, 500 ) )
+      switch( this->msc.pollForReply( this, 500 ) )
       { case 0: /* no event occured, decrease timeout */
           --i; break;
Index: code/branches/output/src/libraries/network/WANDiscovery.h
===================================================================
--- code/branches/output/src/libraries/network/WANDiscovery.h	(revision 8831)
+++ code/branches/output/src/libraries/network/WANDiscovery.h	(revision 8832)
@@ -32,5 +32,4 @@
 #include "packet/ServerInformation.h"
 #include "core/ConfigFileManager.h"
-#include "util/Singleton.h"
 #include "core/OrxonoxClass.h"
 #include "core/ConfigValueIncludes.h"
@@ -49,10 +48,9 @@
   class _NetworkExport WANDiscovery
 // tolua_end
-    : public Singleton<WANDiscovery>, public OrxonoxClass
+    : public OrxonoxClass
   { // tolua_export
-    friend class Singleton<WANDiscovery>;
     public:
       /** constructor */
-      WANDiscovery();
+      WANDiscovery(); // tolua_export
 
       /** destructor */
@@ -83,10 +81,4 @@
       std::string getServerListItemIP( unsigned int index ); // tolua_export
 
-      /** \return an instance of WANDiscovery
-       * 
-       * Create and return an instance of WANDiscovery.
-       */
-      static WANDiscovery& getInstance() { return Singleton<WANDiscovery>::getInstance(); } // tolua_export
-    
       /* todo: might make this private and use getter/setter methods
        * at some later time. 
@@ -100,9 +92,8 @@
       /** Master server communications object */
       MasterServerComm msc;
+
+      int rhandler( char *addr, ENetEvent *ev );
       
     private:
-      /** Singleton pointer */
-      static WANDiscovery* singletonPtr_s;
-
       /** master server address */
       std::string msaddress;
