Changeset 11083 for code/trunk/src/libraries/network
- Timestamp:
- Jan 21, 2016, 1:59:04 PM (9 years ago)
- Location:
- code/trunk/src/libraries/network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/network/MasterServer.cc
r11071 r11083 253 253 /* convert to string */ 254 254 std::string ip = std::string( addrconv ); 255 /* output debug info about the data that has come */ 256 helper_output_debug(event, addrconv); 255 257 /* delete addrconv */ 256 258 if( addrconv ) free( addrconv ); … … 259 261 char * packetdata = (char *)event->packet->data; 260 262 261 /* output debug info about the data that has come */262 helper_output_debug( event, addrconv );263 263 264 264 /* GAME SERVER OR CLIENT CONNECTION? */ … … 332 332 { 333 333 /***** ENTER MAIN LOOP *****/ 334 ENetEvent *event = (ENetEvent *)calloc( sizeof(ENetEvent), sizeof(char));334 ENetEvent *event = (ENetEvent *)calloc(1, sizeof(ENetEvent)); 335 335 if( event == nullptr ) 336 336 { -
code/trunk/src/libraries/network/packet/Gamestate.cc
r11071 r11083 489 489 Gamestate* Gamestate::diffVariables(Gamestate *base) 490 490 { 491 assert( this &&base); assert(data_ && base->data_);491 assert(base); assert(data_ && base->data_); 492 492 assert(!header_.isCompressed() && !base->header_.isCompressed()); 493 493 assert(!header_.isDiffed()); -
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.