Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 27, 2015, 10:45:56 AM (9 years ago)
Author:
maxima
Message:

multiplayer branch merged to presentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentationFS15/src/libraries/network/packet/ServerInformation.cc

    r8351 r10497  
    3939  namespace packet
    4040  {
    41    
     41
    4242    ServerInformation::ServerInformation()
    4343    {
    44      
    4544    }
    46    
     45
    4746    ServerInformation::ServerInformation(ENetEvent* event)
    4847    {
     
    6968    ServerInformation::~ServerInformation()
    7069    {
    71      
     70
    7271    }
    7372
    7473    void ServerInformation::send(ENetPeer* peer)
    7574    {
    76       uint32_t size = returnSize((char*&)LAN_DISCOVERY_ACK) + returnSize(this->serverName_);
     75      std::string payload = this->serverName_ + Ogre::StringConverter::toString(this->clientNumber_);
     76      uint32_t size = returnSize((char*&)LAN_DISCOVERY_ACK) + returnSize(payload);
    7777      uint8_t* temp = new uint8_t[size];
    7878      uint8_t* temp2 = temp;
    7979      saveAndIncrease((char*&)LAN_DISCOVERY_ACK, temp2);
    80       saveAndIncrease(this->serverName_, temp2);
     80      saveAndIncrease(payload, temp2);
    8181      ENetPacket* packet = enet_packet_create( temp, size, 0 );
    8282      enet_peer_send(peer, 0, packet);
    83      
     83
    8484      delete[] temp;
    8585    }
    86  
     86
    8787  } // namespace packet
    8888
     
    9595  }
    9696} // namespace orxonox
    97 
Note: See TracChangeset for help on using the changeset viewer.