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.cc

    r8817 r8832  
    3232#include <cstring>
    3333
    34 #include "util/ScopedSingletonManager.h"
    3534#include "core/CoreIncludes.h"
    3635
     
    3837namespace orxonox
    3938{
    40   ManageScopedSingleton(WANDiscovery, ScopeID::Graphics, true);
    41 
    42 
    4339  WANDiscovery::WANDiscovery()
    4440  {
     
    8076
    8177  /* callback for the network reply poller */
    82   int rhandler( char *addr, ENetEvent *ev )
     78  int WANDiscovery::rhandler( char *addr, ENetEvent *ev )
    8379  {
    8480    /* error recognition */
     
    10399
    104100      /* add to list */
    105       WANDiscovery::getInstance().servers_.push_back( toadd );
     101      this->servers_.push_back( toadd );
    106102    }
    107103    else if( !strncmp( (char*)ev->packet->data, MSPROTO_SERVERLIST_END,
     
    132128    {
    133129      /* poll for reply and act according to what was received */
    134       switch( this->msc.pollForReply( rhandler, 500 ) )
     130      switch( this->msc.pollForReply( this, 500 ) )
    135131      { case 0: /* no event occured, decrease timeout */
    136132          --i; break;
Note: See TracChangeset for help on using the changeset viewer.