Remove entities from updates queues on kill. Do it sync so enqueues after

the kill work
avinationmerge
UbitUmarov 2014-08-23 20:59:11 +01:00
parent 8fd836c299
commit 63d1916f51
2 changed files with 21 additions and 0 deletions

View File

@ -134,6 +134,21 @@ namespace OpenSim.Framework
return true; return true;
} }
public void Remove(List<uint> ids)
{
LookupItem lookup;
foreach (uint localid in ids)
{
if (m_lookupTable.TryGetValue(localid, out lookup))
{
lookup.Heap.Remove(lookup.Handle);
m_lookupTable.Remove(localid);
}
}
}
/// <summary> /// <summary>
/// Remove an item from one of the queues. Specifically, it removes the /// Remove an item from one of the queues. Specifically, it removes the
/// oldest item from the next queue in order to provide fair access to /// oldest item from the next queue in order to provide fair access to

View File

@ -1660,6 +1660,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// foreach (uint id in localIDs) // foreach (uint id in localIDs)
// m_log.DebugFormat("[CLIENT]: Sending KillObjectPacket to {0} for {1} in {2}", Name, id, regionHandle); // m_log.DebugFormat("[CLIENT]: Sending KillObjectPacket to {0} for {1} in {2}", Name, id, regionHandle);
// remove pending entities
lock (m_entityProps.SyncRoot)
m_entityProps.Remove(localIDs);
lock (m_entityUpdates.SyncRoot)
m_entityUpdates.Remove(localIDs);
KillObjectPacket kill = (KillObjectPacket)PacketPool.Instance.GetPacket(PacketType.KillObject); KillObjectPacket kill = (KillObjectPacket)PacketPool.Instance.GetPacket(PacketType.KillObject);
// TODO: don't create new blocks if recycling an old packet // TODO: don't create new blocks if recycling an old packet
kill.ObjectData = new KillObjectPacket.ObjectDataBlock[localIDs.Count]; kill.ObjectData = new KillObjectPacket.ObjectDataBlock[localIDs.Count];