Updated to 3.1.3.9947 client build.

This commit is contained in:
tomrus88 2009-06-02 14:58:59 +04:00
parent 78fbb2c405
commit 4154d606cc
4 changed files with 25 additions and 20 deletions

View file

@ -124,7 +124,7 @@ void Object::_Create( uint32 guidlow, uint32 entry, HighGuid guidhigh )
void Object::BuildMovementUpdateBlock(UpdateData * data, uint32 flags ) const
{
ByteBuffer buf(50);
ByteBuffer buf(500);
buf << uint8( UPDATETYPE_MOVEMENT );
buf.append(GetPackGUID());
@ -185,7 +185,7 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) c
//sLog.outDebug("BuildCreateUpdate: update-type: %u, object-type: %u got flags: %X, flags2: %X", updatetype, m_objectTypeId, flags, flags2);
ByteBuffer buf(50);
ByteBuffer buf(500);
buf << (uint8)updatetype;
buf.append(GetPackGUID());
buf << (uint8)m_objectTypeId;
@ -222,7 +222,7 @@ void Object::SendUpdateToPlayer(Player* player)
void Object::BuildValuesUpdateBlockForPlayer(UpdateData *data, Player *target) const
{
ByteBuffer buf(50);
ByteBuffer buf(500);
buf << (uint8) UPDATETYPE_VALUES;
buf.append(GetPackGUID());

View file

@ -103,41 +103,46 @@ void UpdateData::Compress( uint8* dst, uint32 *dst_size, uint8* src, int src_siz
bool UpdateData::BuildPacket(WorldPacket *packet)
{
if(!packet->empty())
packet->clear();
ASSERT(packet->empty()); // shouldn't happen
ByteBuffer buf(m_data.size());
ByteBuffer buf(m_outOfRangeGUIDs.empty() ? m_data.size() : 1 + 4 + m_outOfRangeGUIDs.size() * 9 + m_data.size());
buf << uint32(!m_outOfRangeGUIDs.empty() ? m_blockCount + 1 : m_blockCount);
// put update blocks count
buf << uint32(m_outOfRangeGUIDs.empty() ? m_blockCount : m_blockCount + 1);
if(!m_outOfRangeGUIDs.empty())
if(m_outOfRangeGUIDs.empty())
{
// put update data
buf.append(m_data);
}
else
{
// put out of range GUID's
buf << uint8(UPDATETYPE_OUT_OF_RANGE_OBJECTS);
buf << uint32(m_outOfRangeGUIDs.size());
for(std::set<uint64>::const_iterator i = m_outOfRangeGUIDs.begin(); i != m_outOfRangeGUIDs.end(); ++i)
{
buf.appendPackGUID(*i);
}
}
// put update data
buf.append(m_data);
}
size_t pSize = buf.size();
if (pSize > 100 ) // compress large packets
if(pSize > 100) // compress large packets
{
packet->resize(pSize + sizeof(uint32));
packet->SetOpcode(SMSG_COMPRESSED_UPDATE_OBJECT);
packet->resize(pSize + sizeof(uint32));
packet->put<uint32>(0, pSize); // original size
uint32 destsize = pSize;
Compress((uint8*)packet->contents() + sizeof(uint32), &destsize, (uint8*)buf.contents(), pSize);
packet->resize(destsize + sizeof(uint32));
packet->resize(destsize + sizeof(uint32)); // resize packet to compressed size + 4
}
else // send small packets without compression
{
packet->SetOpcode( SMSG_UPDATE_OBJECT );
packet->append( buf );
packet->SetOpcode(SMSG_UPDATE_OBJECT);
packet->append(buf);
}
return true;

View file

@ -19,7 +19,7 @@
#ifndef _UPDATEFIELDS_AUTO_H
#define _UPDATEFIELDS_AUTO_H
// Auto generated for version 3, 1, 2, 9901
// Auto generated for version 3, 1, 3, 9947
enum EObjectFields
{

View file

@ -66,8 +66,8 @@ enum LoginResult
// we need to stick to 1 version or half of the stuff will work for someone
// others will not and opposite
// will only support WoW, WoW:TBC and WoW:WotLK 3.1.2 client build 9901...
// will only support WoW, WoW:TBC and WoW:WotLK 3.1.3 client build 9947...
#define EXPECTED_MANGOS_CLIENT_BUILD {9901, 0}
#define EXPECTED_MANGOS_CLIENT_BUILD {9947, 0}
#endif