Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 9, 2011, 12:37:21 AM (13 years ago)
Author:
landauf
Message:

Quick and dirty fix to un-singletonize WANDiscovery. It is now created on demand by the multiplayer menu. This delays the master server connection until we really need it (and avoids the annoying connection-failed error/warning during startup if the master server can't be reached).
Also removed some unneeded/commented functions related to WANDiscovery from Server.
Presumably won't collide with the changes in the masterserver2 branch, but needs some review.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/output/src/libraries/network/WANDiscovery.h

    r8817 r8832  
    3232#include "packet/ServerInformation.h"
    3333#include "core/ConfigFileManager.h"
    34 #include "util/Singleton.h"
    3534#include "core/OrxonoxClass.h"
    3635#include "core/ConfigValueIncludes.h"
     
    4948  class _NetworkExport WANDiscovery
    5049// tolua_end
    51     : public Singleton<WANDiscovery>, public OrxonoxClass
     50    : public OrxonoxClass
    5251  { // tolua_export
    53     friend class Singleton<WANDiscovery>;
    5452    public:
    5553      /** constructor */
    56       WANDiscovery();
     54      WANDiscovery(); // tolua_export
    5755
    5856      /** destructor */
     
    8381      std::string getServerListItemIP( unsigned int index ); // tolua_export
    8482
    85       /** \return an instance of WANDiscovery
    86        *
    87        * Create and return an instance of WANDiscovery.
    88        */
    89       static WANDiscovery& getInstance() { return Singleton<WANDiscovery>::getInstance(); } // tolua_export
    90    
    9183      /* todo: might make this private and use getter/setter methods
    9284       * at some later time.
     
    10092      /** Master server communications object */
    10193      MasterServerComm msc;
     94
     95      int rhandler( char *addr, ENetEvent *ev );
    10296     
    10397    private:
    104       /** Singleton pointer */
    105       static WANDiscovery* singletonPtr_s;
    106 
    10798      /** master server address */
    10899      std::string msaddress;
Note: See TracChangeset for help on using the changeset viewer.