mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[8627] Avoid not needed too oftent send update data, cleanups.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
9cb356851c
commit
023b13f348
9 changed files with 29 additions and 75 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue