Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 29, 2018, 4:04:35 PM (7 years ago)
Author:
mdedial
Message:

Clean up some code, add lots of comments

File:
1 edited

Legend:

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

    r11083 r11842  
    5050      // Save Server Round Trip Time
    5151      this->serverRTT_ = event->peer->roundTripTime;
     52
    5253      // Save Server Address, leave some space for scope ID
    5354      enet_address_get_host_ip(&event->peer->address, serverIP, 64);
     55
    5456      this->serverIP_ = std::string(serverIP);
    5557      // Save ACK
     
    5759      char* ack = nullptr;
    5860      loadAndIncrease((char*&)ack, temp);
    59 
    60       /* Fabian, what is this used for? it crashes the masterserver, hence commenting it */
    61       // written by Oli: this is just to make sure that loadAndIncrease really writes the whole ACK string into char* ack
    62 //       assert(strcmp(ack, (const char*)LAN_DISCOVERY_ACK)==0);
    63 
    6461      // Save Server Name
    6562      loadAndIncrease(this->serverName_, temp);
     
    7471    void ServerInformation::send(ENetPeer* peer)
    7572    {
    76       std::string payload = this->serverName_ + Ogre::StringConverter::toString(this->clientNumber_);
     73      std::string payload = this->serverName_ + std::to_string(this->clientNumber_);
    7774      uint32_t size = returnSize(LAN_DISCOVERY_ACK) + returnSize(payload);
    7875      uint8_t* temp = new uint8_t[size];
Note: See TracChangeset for help on using the changeset viewer.