Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7737


Ignore:
Timestamp:
Dec 8, 2010, 4:08:22 PM (14 years ago)
Author:
smerkli
Message:

pre-merge

Location:
code/branches/masterserver/src/libraries/network
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/masterserver/src/libraries/network/WANDiscovery.cc

    r7692 r7737  
    4141  ManageScopedSingleton(WANDiscovery, ScopeID::Root, true);
    4242
     43  void WANDiscovery::setConfigValues()
     44  {
     45    SetConfigValue(this->msaddr, "msaddr");
     46  }
     47
    4348  WANDiscovery::WANDiscovery()
    4449  {
     50    /* debugging output */
    4551    COUT(4) << "Creating WANDiscovery.\n";
     52 
     53    /* register object with orxonox main class */
     54    RegisterObject(WANDiscovery);
     55
     56    /* set default string for this->msaddr */
     57    this->msaddr = "localhost";
     58
     59    /* ... and register a config value function for it */
     60    this->setConfigValues();
    4661
    4762    /* initialize it and see if it worked */
     
    5065
    5166    /* connect and see if it worked */
    52     if( msc.connect( MS_ADDRESS, 1234 ) )
     67    if( msc.connect( this->msaddr.c_str(), 1234 ) )
    5368      COUT(2) << "Error: could not connect to master server at "
    54         << MS_ADDRESS << std::endl;
     69        << this->msaddr << std::endl;
    5570
     71    /* debugging output */
    5672    COUT(4) << "Initialization of WANDiscovery complete.\n";
    5773  }
  • code/branches/masterserver/src/libraries/network/WANDiscovery.h

    r7692 r7737  
    3232#include "NetworkPrereqs.h"
    3333#include "packet/ServerInformation.h"
     34#include "core/ConfigFileManager.h"
    3435#include "util/Singleton.h"
     36#include "core/OrxonoxClass.h"
     37#include "core/ConfigValueIncludes.h"
     38#include "core/CoreIncludes.h"
    3539#include "MasterServerComm.h"
    3640#include "MasterServerProtocol.h"
     
    4650  class _NetworkExport WANDiscovery
    4751// tolua_end
    48     : public Singleton<WANDiscovery>
     52    : public Singleton<WANDiscovery>, public OrxonoxClass
    4953  { // tolua_export
    5054    friend class Singleton<WANDiscovery>;
     
    8488      /** game server list */
    8589      std::vector<packet::ServerInformation> servers_;
     90
     91      /** Function used for the configuration file parameter update */
     92      void setConfigValues();
    8693     
    8794    private:
     
    9299      MasterServerComm msc;
    93100
     101      /** master server address */
     102      std::string msaddr;
     103
    94104  }; // tolua_export
    95105
Note: See TracChangeset for help on using the changeset viewer.