- 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/LANDiscoverable.cc
r8858 r10612 35 35 #include "util/Output.h" 36 36 #include "packet/ServerInformation.h" 37 #include "core/config/ConfigValueIncludes.h" 38 #include "core/CoreIncludes.h" 39 37 40 38 41 namespace orxonox … … 43 46 LANDiscoverable::LANDiscoverable() 44 47 { 48 /* register object in orxonox */ 49 RegisterObject(LANDiscoverable); 50 51 this->setConfigValues(); 52 // this->setActivity(true); 45 53 this->host_ = 0; 46 54 this->bActive_ = false; 47 // this->setActivity(true); 55 } 56 57 void LANDiscoverable::setConfigValues() 58 { 59 /* update ownName string from orxonox.ini config file, if it 60 * has changed. 61 */ 62 SetConfigValueExternal(ownName, "Discovery", "ownName", "OrxServer"); 48 63 } 49 64 … … 61 76 if( bActive == this->bActive_ ) // no change 62 77 return; 63 78 64 79 if( bActive ) 65 80 { … … 84 99 { 85 100 ENetEvent event; 86 101 87 102 if( this->bActive_==false ) 88 103 return; 89 104 assert(this->host_); 90 105 91 106 while( enet_host_service( this->host_, &event, 0 ) > 0 ) 92 107 { … … 104 119 orxout(internal_info, context::network) << "Received LAN discovery message from client " << event.peer->host->receivedAddress << endl; 105 120 packet::ServerInformation info; 106 info.setServerName("Orxonox Server"); 121 info.setServerName(this->ownName); 122 info.setClientNumber(this->clientNumber); 107 123 info.send(event.peer); 108 124 // ENetPacket* packet = enet_packet_create( LAN_DISCOVERY_ACK, strlen(LAN_DISCOVERY_ACK)+1, ENET_PACKET_FLAG_RELIABLE );
Note: See TracChangeset
for help on using the changeset viewer.