Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 23, 2015, 9:47:30 PM (10 years ago)
Author:
frovelli
Message:

Transmit client count in LAN by evil hack

Location:
code/branches/multiplayerFS15/src/libraries/network/packet
Files:
2 edited

Legend:

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

    r10434 r10456  
    7373    void ServerInformation::send(ENetPeer* peer)
    7474    {
    75       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);
    7677      uint8_t* temp = new uint8_t[size];
    7778      uint8_t* temp2 = temp;
    7879      saveAndIncrease((char*&)LAN_DISCOVERY_ACK, temp2);
    79       saveAndIncrease(this->serverName_, temp2);
     80      saveAndIncrease(payload, temp2);
    8081      ENetPacket* packet = enet_packet_create( temp, size, 0 );
    8182      enet_peer_send(peer, 0, packet);
  • code/branches/multiplayerFS15/src/libraries/network/packet/ServerInformation.h

    r10434 r10456  
    3030
    3131#include <string>
     32#include <OgreStringConverter.h>
     33
    3234
    3335#ifndef SERVERINFORMATION_H
     
    5759      private:
    5860        std::string   serverName_;
     61        int           clientNumber_;
    5962        std::string   serverIP_;
    6063        uint32_t      serverRTT_;
    61         int           clientNumber_;
    6264    };
    6365
Note: See TracChangeset for help on using the changeset viewer.