diff --git a/src/game/ItemHandler.cpp b/src/game/ItemHandler.cpp index 3a5606b88..3c1845fd4 100644 --- a/src/game/ItemHandler.cpp +++ b/src/game/ItemHandler.cpp @@ -565,12 +565,12 @@ void WorldSession::HandleSellItemOpcode( WorldPacket & recv_data ) pItem->SetCount( pItem->GetCount() - count ); _player->ItemRemovedQuestCheck( pItem->GetEntry(), count ); if( _player->IsInWorld() ) - pItem->SendUpdateToPlayer( _player ); + pItem->SendCreateUpdateToPlayer( _player ); pItem->SetState(ITEM_CHANGED, _player); _player->AddItemToBuyBackSlot( pNewItem ); if( _player->IsInWorld() ) - pNewItem->SendUpdateToPlayer( _player ); + pNewItem->SendCreateUpdateToPlayer( _player ); } else { diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 60e3ac1f7..4cc1ad9a6 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -198,22 +198,12 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) c data->AddUpdateBlock(buf); } -void Object::BuildUpdate(UpdateDataMapType &update_players) +void Object::SendCreateUpdateToPlayer(Player* player) { - ObjectAccessor::_buildUpdateObject(this,update_players); - ClearUpdateMask(true); -} - -void Object::SendUpdateToPlayer(Player* player) -{ - // send update to another players - SendUpdateObjectToAllExcept(player); - // send create update to player UpdateData upd; WorldPacket packet; - upd.Clear(); BuildCreateUpdateBlockForPlayer(&upd, player); upd.BuildPacket(&packet); player->GetSession()->SendPacket(&packet); @@ -762,20 +752,6 @@ void Object::ClearUpdateMask(bool remove) } } -// Send current value fields changes to all viewers -void Object::SendUpdateObjectToAllExcept(Player* exceptPlayer) -{ - // changes will be send in create packet - if(!IsInWorld()) - return; - - // nothing do - if(!m_objectUpdated) - return; - - ObjectAccessor::UpdateObject(this,exceptPlayer); -} - bool Object::LoadValues(const char* data) { if(!m_uint32Values) _InitValues(); diff --git a/src/game/Object.h b/src/game/Object.h index 80044ef76..f74e96591 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -146,12 +146,11 @@ class MANGOS_DLL_SPEC Object bool isType(uint16 mask) const { return (mask & m_objectType); } virtual void BuildCreateUpdateBlockForPlayer( UpdateData *data, Player *target ) const; - void SendUpdateToPlayer(Player* player); + void SendCreateUpdateToPlayer(Player* player); void BuildValuesUpdateBlockForPlayer( UpdateData *data, Player *target ) const; void BuildOutOfRangeUpdateBlock( UpdateData *data ) const; void BuildMovementUpdateBlock( UpdateData * data, uint32 flags = 0 ) const; - void BuildUpdate(UpdateDataMapType &); virtual void DestroyForPlayer( Player *target, bool anim = false ) const; @@ -289,7 +288,6 @@ class MANGOS_DLL_SPEC Object } void ClearUpdateMask(bool remove); - void SendUpdateObjectToAllExcept(Player* exceptPlayer); bool LoadValues(const char* data); diff --git a/src/game/ObjectAccessor.cpp b/src/game/ObjectAccessor.cpp index cd6a3ffb3..6b99ef178 100644 --- a/src/game/ObjectAccessor.cpp +++ b/src/game/ObjectAccessor.cpp @@ -182,24 +182,6 @@ ObjectAccessor::SaveAllPlayers() itr->second->SaveToDB(); } -void -ObjectAccessor::UpdateObject(Object* obj, Player* exceptPlayer) -{ - UpdateDataMapType update_players; - obj->BuildUpdate(update_players); - - WorldPacket packet; - for(UpdateDataMapType::iterator iter = update_players.begin(); iter != update_players.end(); ++iter) - { - if(iter->first == exceptPlayer) - continue; - - iter->second.BuildPacket(&packet); - iter->first->GetSession()->SendPacket(&packet); - packet.clear(); - } -} - void ObjectAccessor::_buildUpdateObject(Object *obj, UpdateDataMapType &update_players) { diff --git a/src/game/ObjectAccessor.h b/src/game/ObjectAccessor.h index fb42d97a1..e77b5abeb 100644 --- a/src/game/ObjectAccessor.h +++ b/src/game/ObjectAccessor.h @@ -199,7 +199,6 @@ class MANGOS_DLL_DECL ObjectAccessor : public MaNGOS::SingletonSetInFront(target); if (target->GetTypeId() == TYPEID_PLAYER) - m_creature->SendUpdateToPlayer((Player*)target); + m_creature->SendCreateUpdateToPlayer((Player*)target); if (owner && owner->GetTypeId() == TYPEID_PLAYER) - m_creature->SendUpdateToPlayer( (Player*)owner ); + m_creature->SendCreateUpdateToPlayer( (Player*)owner ); } m_creature->AddCreatureSpellCooldown(spell->m_spellInfo->Id); diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp index c40cea1d8..9e95dfc78 100644 --- a/src/game/PetHandler.cpp +++ b/src/game/PetHandler.cpp @@ -197,17 +197,17 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data ) { pet->SetInFront(unit_target); if (unit_target->GetTypeId() == TYPEID_PLAYER) - pet->SendUpdateToPlayer( (Player*)unit_target ); + pet->SendCreateUpdateToPlayer( (Player*)unit_target ); } else if(Unit *unit_target2 = spell->m_targets.getUnitTarget()) { pet->SetInFront(unit_target2); if (unit_target2->GetTypeId() == TYPEID_PLAYER) - pet->SendUpdateToPlayer( (Player*)unit_target2 ); + pet->SendCreateUpdateToPlayer( (Player*)unit_target2 ); } if (Unit* powner = pet->GetCharmerOrOwner()) if(powner->GetTypeId() == TYPEID_PLAYER) - pet->SendUpdateToPlayer((Player*)powner); + pet->SendCreateUpdateToPlayer((Player*)powner); result = SPELL_CAST_OK; } diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 14ac2c082..c21760ee0 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -10407,7 +10407,7 @@ Item* Player::_StoreItem( uint16 pos, Item *pItem, uint32 count, bool clone, boo if (IsInWorld() && update) { pItem->AddToWorld(); - pItem->SendUpdateToPlayer( this ); + pItem->SendCreateUpdateToPlayer( this ); } pItem->SetState(ITEM_CHANGED, this); @@ -10418,7 +10418,7 @@ Item* Player::_StoreItem( uint16 pos, Item *pItem, uint32 count, bool clone, boo if( IsInWorld() && update ) { pItem->AddToWorld(); - pItem->SendUpdateToPlayer( this ); + pItem->SendCreateUpdateToPlayer( this ); } pItem->SetState(ITEM_CHANGED, this); pBag->SetState(ITEM_CHANGED, this); @@ -10438,7 +10438,7 @@ Item* Player::_StoreItem( uint16 pos, Item *pItem, uint32 count, bool clone, boo pItem2->SetCount( pItem2->GetCount() + count ); if (IsInWorld() && update) - pItem2->SendUpdateToPlayer( this ); + pItem2->SendCreateUpdateToPlayer( this ); if (!clone) { @@ -10528,7 +10528,7 @@ Item* Player::EquipItem( uint16 pos, Item *pItem, bool update ) if( IsInWorld() && update ) { pItem->AddToWorld(); - pItem->SendUpdateToPlayer( this ); + pItem->SendCreateUpdateToPlayer( this ); } ApplyEquipCooldown(pItem); @@ -10548,7 +10548,7 @@ Item* Player::EquipItem( uint16 pos, Item *pItem, bool update ) { pItem2->SetCount( pItem2->GetCount() + pItem->GetCount() ); if( IsInWorld() && update ) - pItem2->SendUpdateToPlayer( this ); + pItem2->SendCreateUpdateToPlayer( this ); // delete item (it not in any slot currently) //pItem->DeleteFromDB(); @@ -10589,7 +10589,7 @@ void Player::QuickEquipItem( uint16 pos, Item *pItem) if( IsInWorld() ) { pItem->AddToWorld(); - pItem->SendUpdateToPlayer( this ); + pItem->SendCreateUpdateToPlayer( this ); } GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry()); @@ -10711,7 +10711,7 @@ void Player::RemoveItem( uint8 bag, uint8 slot, bool update ) // pItem->SetUInt64Value( ITEM_FIELD_OWNER, 0 ); not clear owner at remove (it will be set at store). This used in mail and auction code pItem->SetSlot( NULL_SLOT ); if( IsInWorld() && update ) - pItem->SendUpdateToPlayer( this ); + pItem->SendCreateUpdateToPlayer( this ); } } @@ -10859,7 +10859,7 @@ void Player::DestroyItemCount( uint32 item, uint32 count, bool update, bool uneq ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount ); pItem->SetCount( pItem->GetCount() - count + remcount ); if (IsInWorld() & update) - pItem->SendUpdateToPlayer( this ); + pItem->SendCreateUpdateToPlayer( this ); pItem->SetState(ITEM_CHANGED, this); return; } @@ -10887,7 +10887,7 @@ void Player::DestroyItemCount( uint32 item, uint32 count, bool update, bool uneq ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount ); pItem->SetCount( pItem->GetCount() - count + remcount ); if (IsInWorld() & update) - pItem->SendUpdateToPlayer( this ); + pItem->SendCreateUpdateToPlayer( this ); pItem->SetState(ITEM_CHANGED, this); return; } @@ -10920,7 +10920,7 @@ void Player::DestroyItemCount( uint32 item, uint32 count, bool update, bool uneq ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount ); pItem->SetCount( pItem->GetCount() - count + remcount ); if (IsInWorld() && update) - pItem->SendUpdateToPlayer( this ); + pItem->SendCreateUpdateToPlayer( this ); pItem->SetState(ITEM_CHANGED, this); return; } @@ -10953,7 +10953,7 @@ void Player::DestroyItemCount( uint32 item, uint32 count, bool update, bool uneq ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount ); pItem->SetCount( pItem->GetCount() - count + remcount ); if (IsInWorld() & update) - pItem->SendUpdateToPlayer( this ); + pItem->SendCreateUpdateToPlayer( this ); pItem->SetState(ITEM_CHANGED, this); return; } @@ -11038,7 +11038,7 @@ void Player::DestroyItemCount( Item* pItem, uint32 &count, bool update ) pItem->SetCount( pItem->GetCount() - count ); count = 0; if( IsInWorld() & update ) - pItem->SendUpdateToPlayer( this ); + pItem->SendCreateUpdateToPlayer( this ); pItem->SetState(ITEM_CHANGED, this); } } @@ -11103,7 +11103,7 @@ void Player::SplitItem( uint16 src, uint16 dst, uint32 count ) } if( IsInWorld() ) - pSrcItem->SendUpdateToPlayer( this ); + pSrcItem->SendCreateUpdateToPlayer( this ); pSrcItem->SetState(ITEM_CHANGED, this); StoreItem( dest, pNewItem, true); } @@ -11123,7 +11123,7 @@ void Player::SplitItem( uint16 src, uint16 dst, uint32 count ) } if( IsInWorld() ) - pSrcItem->SendUpdateToPlayer( this ); + pSrcItem->SendCreateUpdateToPlayer( this ); pSrcItem->SetState(ITEM_CHANGED, this); BankItem( dest, pNewItem, true); } @@ -11143,7 +11143,7 @@ void Player::SplitItem( uint16 src, uint16 dst, uint32 count ) } if( IsInWorld() ) - pSrcItem->SendUpdateToPlayer( this ); + pSrcItem->SendCreateUpdateToPlayer( this ); pSrcItem->SetState(ITEM_CHANGED, this); EquipItem( dest, pNewItem, true); AutoUnequipOffhandIfNeed(); @@ -11314,8 +11314,8 @@ void Player::SwapItem( uint16 src, uint16 dst ) pDstItem->SetState(ITEM_CHANGED, this); if( IsInWorld() ) { - pSrcItem->SendUpdateToPlayer( this ); - pDstItem->SendUpdateToPlayer( this ); + pSrcItem->SendCreateUpdateToPlayer( this ); + pDstItem->SendCreateUpdateToPlayer( this ); } } return; @@ -16936,7 +16936,7 @@ void Player::HandleStealthedUnitsDetection() { if(!hasAtClient) { - (*i)->SendUpdateToPlayer(this); + (*i)->SendCreateUpdateToPlayer(this); m_clientGUIDs.insert((*i)->GetGUID()); #ifdef MANGOS_DEBUG @@ -18109,7 +18109,7 @@ void Player::UpdateVisibilityOf(WorldObject const* viewPoint, WorldObject* targe { if(target->isVisibleForInState(this, viewPoint, false)) { - target->SendUpdateToPlayer(this); + target->SendCreateUpdateToPlayer(this); if(target->GetTypeId()!=TYPEID_GAMEOBJECT||!((GameObject*)target)->IsTransport()) m_clientGUIDs.insert(target->GetGUID()); @@ -18163,7 +18163,6 @@ void Player::UpdateVisibilityOf(WorldObject const* viewPoint, T* target, UpdateD if(target->isVisibleForInState(this,viewPoint,false)) { visibleNow.insert(target); - target->BuildUpdate(data_updates); target->BuildCreateUpdateBlockForPlayer(&data, this); UpdateVisibilityOf_helper(m_clientGUIDs,target); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 829307eb7..524c2cf73 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8626" + #define REVISION_NR "8627" #endif // __REVISION_NR_H__