Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 4, 2015, 12:13:42 PM (9 years ago)
Author:
landauf
Message:

merged branch multiplayerFS15

Location:
code/branches/presentationFS15merge
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentationFS15merge

  • code/branches/presentationFS15merge/src/libraries/network/LANDiscoverable.cc

    r8858 r10612  
    3535#include "util/Output.h"
    3636#include "packet/ServerInformation.h"
     37#include "core/config/ConfigValueIncludes.h"
     38#include "core/CoreIncludes.h"
     39
    3740
    3841namespace orxonox
     
    4346  LANDiscoverable::LANDiscoverable()
    4447  {
     48    /* register object in orxonox */
     49    RegisterObject(LANDiscoverable);
     50
     51    this->setConfigValues();
     52    //     this->setActivity(true);
    4553    this->host_ = 0;
    4654    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");
    4863  }
    4964
     
    6176    if( bActive == this->bActive_ )        // no change
    6277      return;
    63    
     78
    6479    if( bActive )
    6580    {
     
    8499  {
    85100    ENetEvent event;
    86    
     101
    87102    if( this->bActive_==false )
    88103      return;
    89104    assert(this->host_);
    90    
     105
    91106    while( enet_host_service( this->host_, &event, 0 ) > 0 )
    92107    {
     
    104119            orxout(internal_info, context::network) << "Received LAN discovery message from client " << event.peer->host->receivedAddress << endl;
    105120            packet::ServerInformation info;
    106             info.setServerName("Orxonox Server");
     121            info.setServerName(this->ownName);
     122            info.setClientNumber(this->clientNumber);
    107123            info.send(event.peer);
    108124//             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.