- Added support for non-compressed update opcodes
- Changed UPDATETYPE_VALUES so the update values gets changed in the object. - Updated misc other stuff to the UPDATETYPE_VALUES code
This commit is contained in:
parent
d6f526da1e
commit
f4148cefc1
@ -65,7 +65,7 @@ public:
|
|||||||
{
|
{
|
||||||
_floatvalues[ index ] = value;
|
_floatvalues[ index ] = value;
|
||||||
}
|
}
|
||||||
inline void SetUInt32Value( uint16 index, float value )
|
inline void SetUInt32Value( uint16 index, uint32 value )
|
||||||
{
|
{
|
||||||
_uint32values[ index ] = value;
|
_uint32values[ index ] = value;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,25 +52,51 @@ void WorldSession::_HandleUpdateObjectOpcode(WorldPacket& recvPacket)
|
|||||||
uint8 blockcount, masksize;
|
uint8 blockcount, masksize;
|
||||||
uint32 value, valuesCount = 1500;
|
uint32 value, valuesCount = 1500;
|
||||||
uguid = recvPacket.GetPackedGuid();
|
uguid = recvPacket.GetPackedGuid();
|
||||||
recvPacket >> blockcount;
|
|
||||||
masksize = blockcount * 4;
|
|
||||||
logdebug("UPDATETYPE_VALUES: guid="I64FMT" blockcount=%u masksize=%d",uguid,blockcount, masksize);
|
|
||||||
|
|
||||||
UpdateMask umask;
|
Object *obj = objmgr.GetObj(uguid);
|
||||||
umask.SetCount(masksize);
|
|
||||||
uint32 *updateMask = new uint32[100];
|
|
||||||
recvPacket.read((uint8*)updateMask, masksize);
|
|
||||||
umask.SetMask(updateMask);
|
|
||||||
|
|
||||||
for (uint32 i = 0; i < valuesCount; i++) // How do i get valuesCount?
|
if (obj)
|
||||||
{
|
{
|
||||||
if (umask.GetBit(i))
|
recvPacket >> blockcount;
|
||||||
|
masksize = blockcount * 4;
|
||||||
|
logdebug("UPDATETYPE_VALUES: guid="I64FMT" blockcount=%u masksize=%d",uguid,blockcount, masksize);
|
||||||
|
|
||||||
|
uint32 *updateMask = new uint32[100];
|
||||||
|
UpdateMask umask;
|
||||||
|
umask.SetCount(masksize);
|
||||||
|
recvPacket.read((uint8*)updateMask, masksize);
|
||||||
|
umask.SetMask(updateMask);
|
||||||
|
|
||||||
|
for (uint32 i = 0; i < valuesCount; i++) // How do we get valuesCount?
|
||||||
{
|
{
|
||||||
recvPacket >> value;
|
if (umask.GetBit(i))
|
||||||
//logdebug("Value (%d): %d", i, value);
|
{
|
||||||
|
recvPacket >> value;
|
||||||
|
|
||||||
|
// These values are sent by the server as uint32 but must be stored at the client as float values
|
||||||
|
if( obj->isType(TYPE_UNIT) && (
|
||||||
|
i >= UNIT_FIELD_POWER1 && i <= UNIT_FIELD_MAXPOWER5 ||
|
||||||
|
i >= UNIT_FIELD_BASEATTACKTIME && i <= UNIT_FIELD_RANGEDATTACKTIME ||
|
||||||
|
i >= UNIT_FIELD_STR && i <= UNIT_FIELD_RESISTANCES + 6 )
|
||||||
|
|| obj->isType(TYPE_PLAYER) &&
|
||||||
|
i >= PLAYER_FIELD_POSSTAT0 && i <= PLAYER_FIELD_RESISTANCEBUFFMODSNEGATIVE + 6 )
|
||||||
|
{
|
||||||
|
obj->SetFloatValue(i, (float)value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
obj->SetUInt32Value(i, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
//logdebug("Value (%d): %d", i, value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
logerror("Got UpdateObject_Values for unknown object "I64FMT,uguid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -93,9 +119,10 @@ void WorldSession::_HandleUpdateObjectOpcode(WorldPacket& recvPacket)
|
|||||||
recvPacket >> objtypeid >> flags;
|
recvPacket >> objtypeid >> flags;
|
||||||
logdebug("Create Object type %u with guid "I64FMT,objtypeid,uguid);
|
logdebug("Create Object type %u with guid "I64FMT,objtypeid,uguid);
|
||||||
|
|
||||||
//this->_MovementUpdate(objtypeid, uguid, recvPacket); // i think thats the wrong place for this [FG]
|
this->_MovementUpdate(objtypeid, uguid, recvPacket); // i think thats the wrong place for this [FG]
|
||||||
|
// Double checked - seems right - if i really am wrong, please correct [Mini]
|
||||||
|
|
||||||
// (TODO) and then: Add object to objmgr
|
// TODO: Add object to objmgr
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@ -171,6 +171,7 @@ OpcodeHandler *WorldSession::_GetOpcodeHandlerTable() const
|
|||||||
|
|
||||||
{MSG_MOVE_TELEPORT_ACK, &WorldSession::_HandleTelePortAckOpcode},
|
{MSG_MOVE_TELEPORT_ACK, &WorldSession::_HandleTelePortAckOpcode},
|
||||||
{SMSG_COMPRESSED_UPDATE_OBJECT, &WorldSession::_HandleCompressedUpdateObjectOpcode},
|
{SMSG_COMPRESSED_UPDATE_OBJECT, &WorldSession::_HandleCompressedUpdateObjectOpcode},
|
||||||
|
{SMSG_UPDATE_OBJECT, &WorldSession::_HandleUpdateObjectOpcode},
|
||||||
{SMSG_CAST_RESULT, &WorldSession::_HandleCastResultOpcode},
|
{SMSG_CAST_RESULT, &WorldSession::_HandleCastResultOpcode},
|
||||||
{SMSG_ITEM_QUERY_SINGLE_RESPONSE, &WorldSession::_HandleItemQuerySingleResponseOpcode},
|
{SMSG_ITEM_QUERY_SINGLE_RESPONSE, &WorldSession::_HandleItemQuerySingleResponseOpcode},
|
||||||
{SMSG_DESTROY_OBJECT, &WorldSession::_HandleDestroyObjectOpcode},
|
{SMSG_DESTROY_OBJECT, &WorldSession::_HandleDestroyObjectOpcode},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user