- Timestamp:
- Oct 4, 2015, 12:13:42 PM (9 years ago)
- Location:
- code/branches/presentationFS15merge
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentationFS15merge
- Property svn:mergeinfo changed
/code/branches/multiplayerFS15 (added) merged: 10324,10334,10427,10434,10446-10447,10456-10457
- Property svn:mergeinfo changed
-
code/branches/presentationFS15merge/src/libraries/network/WANDiscoverable.cc
r9667 r10612 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 SetConfigValueExternal(msaddress, " WANDiscovery", "msaddress", "orxonox.net");61 // SetConfigValue( msaddress, "orxonox.net");62 } 60 SetConfigValueExternal(msaddress, "Discovery", "msaddress", "orxonox.net"); 61 SetConfigValueExternal(ownName, "Discovery", "ownName", "OrxServer"); 62 } 63 63 64 64 WANDiscoverable::~WANDiscoverable() … … 67 67 this->disconnect(); 68 68 } 69 69 70 70 void WANDiscoverable::setActivity(bool bActive) 71 71 { 72 72 if( bActive==this->bActive_ ) 73 73 return; 74 74 75 75 if( bActive ) 76 76 { … … 84 84 } 85 85 } 86 86 87 87 bool WANDiscoverable::connect() 88 88 { … … 93 93 return false; 94 94 } 95 95 96 96 /* connect and see if it worked */ 97 97 if( msc.connect( this->msaddress.c_str(), ORX_MSERVER_PORT ) ) 98 98 { 99 orxout(internal_error, context::master_server) << "Could not connect to master server at " 99 orxout(internal_error, context::master_server) << "Could not connect to master server at " 100 100 << this->msaddress << endl; 101 101 return false; 102 102 } 103 103 104 104 /* debugging output */ 105 105 orxout(verbose, context::master_server) << "Initialization of WANDiscoverable complete." << endl; 106 107 106 108 107 // Now register the server at the master server 109 108 this->msc.sendRequest( MSPROTO_GAME_SERVER " " MSPROTO_REGISTER_SERVER ); 110 109 110 std::string request = MSPROTO_GAME_SERVER " " MSPROTO_SET_NAME " "; 111 request += this->ownName; 112 this->msc.sendRequest( request ); 113 111 114 return true; 112 115 } … … 118 121 } 119 122 123 void WANDiscoverable::updateClientNumber(int clientNumber) 124 { 125 orxout(verbose, context::master_server) << "Sending new number of clients: " << clientNumber << endl; 126 std::string request = MSPROTO_GAME_SERVER " " MSPROTO_SET_CLIENTS " "; 127 request += Ogre::StringConverter::toString(clientNumber); 128 129 this->msc.sendRequest( request ); 130 } 120 131 121 132 122 133 134 123 135 } // namespace orxonox
Note: See TracChangeset
for help on using the changeset viewer.