aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-17 14:35:11 -0600
committermegamage <none@none>2009-03-17 14:35:11 -0600
commit5fb7a0585c0fcc417811aae23ced3dd577aadcd3 (patch)
tree809c489a4931acbaa8cab0f86dd29ad419c01486 /src
parentd4b52d5bbcd966da58e03db11442bee995c11e98 (diff)
*Fix a bug that redundant packets are sent to clients which may cause freeze.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/GridNotifiers.cpp13
-rw-r--r--src/game/GridNotifiers.h5
-rw-r--r--src/game/GridNotifiersImpl.h4
-rw-r--r--src/game/Object.cpp1
-rw-r--r--src/game/Player.cpp13
-rw-r--r--src/game/Player.h2
6 files changed, 10 insertions, 28 deletions
diff --git a/src/game/GridNotifiers.cpp b/src/game/GridNotifiers.cpp
index fcb4e376b26..f52932df83d 100644
--- a/src/game/GridNotifiers.cpp
+++ b/src/game/GridNotifiers.cpp
@@ -54,7 +54,7 @@ PlayerVisibilityNotifier::Notify()
if(i_clientGUIDs.find((*itr)->GetGUID())!=i_clientGUIDs.end())
{
(*itr)->UpdateVisibilityOf(&i_player);
- i_player.UpdateVisibilityOf((*itr),i_data,i_data_updates,i_visibleNow);
+ i_player.UpdateVisibilityOf((*itr),i_data,i_visibleNow);
i_clientGUIDs.erase((*itr)->GetGUID());
}
}
@@ -72,17 +72,6 @@ PlayerVisibilityNotifier::Notify()
#endif
}
- // send update to other players (except player updates that already sent using SendUpdateToPlayer)
- for(UpdateDataMapType::iterator iter = i_data_updates.begin(); iter != i_data_updates.end(); ++iter)
- {
- if(iter->first==&i_player)
- continue;
-
- WorldPacket packet;
- iter->second.BuildPacket(&packet);
- iter->first->GetSession()->SendPacket(&packet);
- }
-
if( i_data.HasData() )
{
// send create/outofrange packet to player (except player create updates that already sent using SendUpdateToPlayer)
diff --git a/src/game/GridNotifiers.h b/src/game/GridNotifiers.h
index daa8296674a..b34eee36e7b 100644
--- a/src/game/GridNotifiers.h
+++ b/src/game/GridNotifiers.h
@@ -42,17 +42,12 @@ namespace Trinity
{
Player &i_player;
UpdateData i_data;
- UpdateDataMapType i_data_updates;
Player::ClientGUIDs i_clientGUIDs;
std::set<WorldObject*> i_visibleNow;
PlayerVisibilityNotifier(Player &player) : i_player(player),i_clientGUIDs(player.m_clientGUIDs) {}
template<class T> inline void Visit(GridRefManager<T> &);
- /*#ifdef WIN32
- template<> inline void Visit(PlayerMapType &);
- template<> inline void Visit(CreatureMapType &);
- #endif*/
void Notify(void);
};
diff --git a/src/game/GridNotifiersImpl.h b/src/game/GridNotifiersImpl.h
index b7660d90c3b..5c071567f9a 100644
--- a/src/game/GridNotifiersImpl.h
+++ b/src/game/GridNotifiersImpl.h
@@ -87,7 +87,7 @@ Trinity::PlayerRelocationNotifier::Visit(PlayerMapType &m)
if(iter->getSource()->m_Notified) //self is also skipped in this check
continue;
- i_player.UpdateVisibilityOf(iter->getSource(),i_data,i_data_updates,i_visibleNow);
+ i_player.UpdateVisibilityOf(iter->getSource(),i_data,i_visibleNow);
iter->getSource()->UpdateVisibilityOf(&i_player);
//if (!i_player.GetSharedVisionList().empty())
@@ -112,7 +112,7 @@ Trinity::PlayerRelocationNotifier::Visit(CreatureMapType &m)
if(iter->getSource()->m_Notified)
continue;
- i_player.UpdateVisibilityOf(iter->getSource(),i_data,i_data_updates,i_visibleNow);
+ i_player.UpdateVisibilityOf(iter->getSource(),i_data,i_visibleNow);
PlayerCreatureRelocationWorker(&i_player, iter->getSource());
}
diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index 10eafcba93d..23db2319cf9 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -214,7 +214,6 @@ void Object::SendUpdateToPlayer(Player* player)
UpdateData upd;
WorldPacket packet;
- upd.Clear();
BuildCreateUpdateBlockForPlayer(&upd, player);
upd.BuildPacket(&packet);
player->GetSession()->SendPacket(&packet);
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 28dc950abcd..cdec0f53eca 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -17810,7 +17810,7 @@ inline void UpdateVisibilityOf_helper(std::set<uint64>& s64, GameObject* target)
}
template<class T>
-void Player::UpdateVisibilityOf(T* target, UpdateData& data, UpdateDataMapType& data_updates, std::set<WorldObject*>& visibleNow)
+void Player::UpdateVisibilityOf(T* target, UpdateData& data, std::set<WorldObject*>& visibleNow)
{
if(HaveAtClient(target))
{
@@ -17830,7 +17830,6 @@ void Player::UpdateVisibilityOf(T* target, UpdateData& data, UpdateDataMapType&
if(target->isVisibleForInState(this,false))
{
visibleNow.insert(target);
- target->BuildUpdate(data_updates);
target->BuildCreateUpdateBlockForPlayer(&data, this);
UpdateVisibilityOf_helper(m_clientGUIDs,target);
@@ -17877,11 +17876,11 @@ void Player::UpdateVisibilityOf<Creature>(Creature* target, UpdateData& data, Up
}
}*/
-template void Player::UpdateVisibilityOf(Player* target, UpdateData& data, UpdateDataMapType& data_updates, std::set<WorldObject*>& visibleNow);
-template void Player::UpdateVisibilityOf(Creature* target, UpdateData& data, UpdateDataMapType& data_updates, std::set<WorldObject*>& visibleNow);
-template void Player::UpdateVisibilityOf(Corpse* target, UpdateData& data, UpdateDataMapType& data_updates, std::set<WorldObject*>& visibleNow);
-template void Player::UpdateVisibilityOf(GameObject* target, UpdateData& data, UpdateDataMapType& data_updates, std::set<WorldObject*>& visibleNow);
-template void Player::UpdateVisibilityOf(DynamicObject* target, UpdateData& data, UpdateDataMapType& data_updates, std::set<WorldObject*>& visibleNow);
+template void Player::UpdateVisibilityOf(Player* target, UpdateData& data, std::set<WorldObject*>& visibleNow);
+template void Player::UpdateVisibilityOf(Creature* target, UpdateData& data, std::set<WorldObject*>& visibleNow);
+template void Player::UpdateVisibilityOf(Corpse* target, UpdateData& data, std::set<WorldObject*>& visibleNow);
+template void Player::UpdateVisibilityOf(GameObject* target, UpdateData& data, std::set<WorldObject*>& visibleNow);
+template void Player::UpdateVisibilityOf(DynamicObject* target, UpdateData& data, std::set<WorldObject*>& visibleNow);
void Player::InitPrimaryProffesions()
{
diff --git a/src/game/Player.h b/src/game/Player.h
index 0003c6d85bc..7cedab880f2 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -2026,7 +2026,7 @@ class TRINITY_DLL_SPEC Player : public Unit
void SendInitialVisiblePackets(Unit* target);
template<class T>
- void UpdateVisibilityOf(T* target, UpdateData& data, UpdateDataMapType& data_updates, std::set<WorldObject*>& visibleNow);
+ void UpdateVisibilityOf(T* target, UpdateData& data, std::set<WorldObject*>& visibleNow);
// Stealth detection system
uint32 m_DetectInvTimer;