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

    r8829 r8832  
    5959#include "FunctionCallManager.h"
    6060#include "GamestateManager.h"
    61 #include "WANDiscovery.h"
    6261
    6362namespace orxonox
     
    9998  }
    10099
    101 
    102   /** helper that connects to the master server */
    103   void Server::helper_ConnectToMasterserver()
    104   {
    105 //     WANDiscovery::getInstance().msc.sendRequest( MSPROTO_GAME_SERVER " "
    106 //       MSPROTO_REGISTER_SERVER );
    107   }
    108 
    109100  /**
    110101  * This function opens the server by creating the listener thread
     
    121112    /* make discoverable on WAN */
    122113    WANDiscoverable::setActivity(true);
    123     /* TODO this needs to be optional, we need a switch from the UI to
    124      * enable/disable this
    125      */
    126 //     helper_ConnectToMasterserver();
    127114
    128115    /* done */
     
    149136  }
    150137
    151   /* handle incoming data */
    152   int rephandler( char *addr, ENetEvent *ev )
    153   {
    154     /* reply to pings */
    155     if( !strncmp( (char *)ev->packet->data, MSPROTO_PING_GAMESERVER,
    156       MSPROTO_PING_GAMESERVER_LEN ) )
    157       //this->msc.sendRequest( MSPROTO_ACK );
    158       /* NOTE implement this after pollForReply
    159        * reimplementation
    160        */
    161       return 0;
    162 
    163     /* done handling, return all ok code 0 */
    164     return 0;
    165   }
    166 
    167   void Server::helper_HandleMasterServerRequests()
    168   {
    169     /* poll the master server for replies and see whether something
    170      * has to be done or changed.
    171      */
    172     //WANDiscovery::getInstance().msc.pollForReply( rhandler, 10 );
    173   }
    174 
    175138  /**
    176139  * Run this function once every tick
     
    185148    // receive and process incoming discovery packets
    186149    LANDiscoverable::update();
    187 
    188     // receive and process requests from master server
    189     /* todo */
    190     //helper_HandleMasterServerRequests();
    191150
    192151    if ( GamestateManager::hasPeers() )
Note: See TracChangeset for help on using the changeset viewer.