Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 7, 2015, 2:22:43 PM (10 years ago)
Author:
frovelli
Message:

Implemented custom servernames

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/multiplayerFS15/src/libraries/network/WANDiscoverable.cc

    r9667 r10427  
    4444    /* debugging output */
    4545    orxout(verbose, context::master_server) << "Creating WANDiscoverable." << endl;
    46  
     46
    4747    /* register object in orxonox */
    4848    RegisterObject(WANDiscoverable);
     
    5050    /* check for the masterserver address option in orxonox.ini */
    5151    this->setConfigValues();
    52    
     52
    5353  }
    5454
    5555  void WANDiscoverable::setConfigValues()
    5656  {
    57     /* update msaddress string from orxonox.ini config file, if it 
    58      * has changed. 
     57    /* update msaddress string from orxonox.ini config file, if it
     58     * has changed.
    5959     */
    6060    SetConfigValueExternal(msaddress, "WANDiscovery", "msaddress", "orxonox.net");
     61    SetConfigValueExternal(ownName, "WANDiscovery", "ownName", "tme213");
    6162//     SetConfigValue( msaddress, "orxonox.net");
    62   } 
     63  }
    6364
    6465  WANDiscoverable::~WANDiscoverable()
     
    6768      this->disconnect();
    6869  }
    69  
     70
    7071  void WANDiscoverable::setActivity(bool bActive)
    7172  {
    7273    if( bActive==this->bActive_ )
    7374      return;
    74    
     75
    7576    if( bActive )
    7677    {
     
    8485    }
    8586  }
    86  
     87
    8788  bool WANDiscoverable::connect()
    8889  {
     
    9394      return false;
    9495    }
    95    
     96
    9697    /* connect and see if it worked */
    9798    if( msc.connect( this->msaddress.c_str(), ORX_MSERVER_PORT ) )
    9899    {
    99       orxout(internal_error, context::master_server) << "Could not connect to master server at " 
     100      orxout(internal_error, context::master_server) << "Could not connect to master server at "
    100101                 << this->msaddress << endl;
    101102      return false;
    102103    }
    103                  
     104
    104105    /* debugging output */
    105106    orxout(verbose, context::master_server) << "Initialization of WANDiscoverable complete." << endl;
    106    
    107    
     107
     108    std::string request = MSPROTO_GAME_SERVER " " MSPROTO_SET_NAME " ";
     109    request += this->ownName;
     110
    108111    // Now register the server at the master server
    109112    this->msc.sendRequest( MSPROTO_GAME_SERVER " " MSPROTO_REGISTER_SERVER );
    110    
     113    this->msc.sendRequest( request );
     114
     115
    111116    return true;
    112117  }
     
    120125
    121126
    122  
     127
    123128} // namespace orxonox
Note: See TracChangeset for help on using the changeset viewer.