- Timestamp:
- Jan 21, 2016, 1:59:04 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/network/packet/ServerInformation.cc
r11071 r11083 55 55 // Save ACK 56 56 uint8_t* temp = event->packet->data; 57 char* ack = n ew char[strlen(LAN_DISCOVERY_ACK)+1];57 char* ack = nullptr; 58 58 loadAndIncrease((char*&)ack, temp); 59 59 … … 64 64 // Save Server Name 65 65 loadAndIncrease(this->serverName_, temp); 66 delete[] ack; 66 67 } 67 68 … … 74 75 { 75 76 std::string payload = this->serverName_ + Ogre::StringConverter::toString(this->clientNumber_); 76 uint32_t size = returnSize( (char*&)LAN_DISCOVERY_ACK) + returnSize(payload);77 uint32_t size = returnSize(LAN_DISCOVERY_ACK) + returnSize(payload); 77 78 uint8_t* temp = new uint8_t[size]; 78 79 uint8_t* temp2 = temp; 79 saveAndIncrease( (char*&)LAN_DISCOVERY_ACK, temp2);80 saveAndIncrease(LAN_DISCOVERY_ACK, temp2); 80 81 saveAndIncrease(payload, temp2); 81 82 ENetPacket* packet = enet_packet_create( temp, size, 0 );
Note: See TracChangeset
for help on using the changeset viewer.