Changeset 10497 for code/branches/presentationFS15/src/libraries/network/packet/ServerInformation.cc
- Timestamp:
- May 27, 2015, 10:45:56 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentationFS15/src/libraries/network/packet/ServerInformation.cc
r8351 r10497 39 39 namespace packet 40 40 { 41 41 42 42 ServerInformation::ServerInformation() 43 43 { 44 45 44 } 46 45 47 46 ServerInformation::ServerInformation(ENetEvent* event) 48 47 { … … 69 68 ServerInformation::~ServerInformation() 70 69 { 71 70 72 71 } 73 72 74 73 void ServerInformation::send(ENetPeer* peer) 75 74 { 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); 77 77 uint8_t* temp = new uint8_t[size]; 78 78 uint8_t* temp2 = temp; 79 79 saveAndIncrease((char*&)LAN_DISCOVERY_ACK, temp2); 80 saveAndIncrease( this->serverName_, temp2);80 saveAndIncrease(payload, temp2); 81 81 ENetPacket* packet = enet_packet_create( temp, size, 0 ); 82 82 enet_peer_send(peer, 0, packet); 83 83 84 84 delete[] temp; 85 85 } 86 86 87 87 } // namespace packet 88 88 … … 95 95 } 96 96 } // namespace orxonox 97
Note: See TracChangeset
for help on using the changeset viewer.