mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
Fixed warnings.
This commit is contained in:
parent
8d6b26b6ab
commit
f7c733cd21
4 changed files with 20 additions and 13 deletions
|
|
@ -126,14 +126,21 @@ bool UpdateData::BuildPacket(WorldPacket *packet)
|
|||
|
||||
if (pSize > 100 ) // compress large packets
|
||||
{
|
||||
packet->resize(pSize);
|
||||
|
||||
packet->put<uint32>(0, pSize);
|
||||
*packet << uint32(pSize);
|
||||
packet->append(buf);
|
||||
|
||||
uint32 destsize = pSize;
|
||||
Compress(const_cast<uint8*>(packet->contents()) + sizeof(uint32), &destsize, (void*)buf.contents(), pSize);
|
||||
|
||||
Compress(const_cast<uint8*>(packet->contents()) + sizeof(uint32),
|
||||
&destsize,
|
||||
const_cast<uint8*>(packet->contents()) + sizeof(uint32),
|
||||
pSize);
|
||||
|
||||
if (destsize == 0)
|
||||
{
|
||||
sLog.outError("Error while compressing update packet!");
|
||||
return false;
|
||||
}
|
||||
|
||||
packet->resize( destsize + sizeof(uint32) );
|
||||
packet->SetOpcode( SMSG_COMPRESSED_UPDATE_OBJECT );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue