- Timestamp:
- May 7, 2015, 2:22:43 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/multiplayerFS15/src/libraries/network/WANDiscoverable.cc
r9667 r10427 44 44 /* debugging output */ 45 45 orxout(verbose, context::master_server) << "Creating WANDiscoverable." << endl; 46 46 47 47 /* register object in orxonox */ 48 48 RegisterObject(WANDiscoverable); … … 50 50 /* check for the masterserver address option in orxonox.ini */ 51 51 this->setConfigValues(); 52 52 53 53 } 54 54 55 55 void WANDiscoverable::setConfigValues() 56 56 { 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. 59 59 */ 60 60 SetConfigValueExternal(msaddress, "WANDiscovery", "msaddress", "orxonox.net"); 61 SetConfigValueExternal(ownName, "WANDiscovery", "ownName", "tme213"); 61 62 // SetConfigValue( msaddress, "orxonox.net"); 62 } 63 } 63 64 64 65 WANDiscoverable::~WANDiscoverable() … … 67 68 this->disconnect(); 68 69 } 69 70 70 71 void WANDiscoverable::setActivity(bool bActive) 71 72 { 72 73 if( bActive==this->bActive_ ) 73 74 return; 74 75 75 76 if( bActive ) 76 77 { … … 84 85 } 85 86 } 86 87 87 88 bool WANDiscoverable::connect() 88 89 { … … 93 94 return false; 94 95 } 95 96 96 97 /* connect and see if it worked */ 97 98 if( msc.connect( this->msaddress.c_str(), ORX_MSERVER_PORT ) ) 98 99 { 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 " 100 101 << this->msaddress << endl; 101 102 return false; 102 103 } 103 104 104 105 /* debugging output */ 105 106 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 108 111 // Now register the server at the master server 109 112 this->msc.sendRequest( MSPROTO_GAME_SERVER " " MSPROTO_REGISTER_SERVER ); 110 113 this->msc.sendRequest( request ); 114 115 111 116 return true; 112 117 } … … 120 125 121 126 122 127 123 128 } // namespace orxonox
Note: See TracChangeset
for help on using the changeset viewer.