diff options
author | Melanie | 2011-11-06 20:38:07 +0000 |
---|---|---|
committer | Melanie | 2011-11-06 20:38:07 +0000 |
commit | c7dd7b13a2058fa6855e2e78f1dbb83e9a806f95 (patch) | |
tree | 2208d841ddd01013d590845f306d2719ecf96503 /OpenSim/Region/ClientStack/Linden | |
parent | Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff) | |
download | opensim-SC-c7dd7b13a2058fa6855e2e78f1dbb83e9a806f95.zip opensim-SC-c7dd7b13a2058fa6855e2e78f1dbb83e9a806f95.tar.gz opensim-SC-c7dd7b13a2058fa6855e2e78f1dbb83e9a806f95.tar.bz2 opensim-SC-c7dd7b13a2058fa6855e2e78f1dbb83e9a806f95.tar.xz |
Convert SendKillObject to take a list of uint rather than sending one
packet per prim. More to come as we change to make use of this.
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 53 |
1 files changed, 32 insertions, 21 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index a7f83f9..4a0b0c6 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -1531,38 +1531,49 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1531 | OutPacket(pc, ThrottleOutPacketType.Unknown); | 1531 | OutPacket(pc, ThrottleOutPacketType.Unknown); |
1532 | } | 1532 | } |
1533 | 1533 | ||
1534 | public void SendKillObject(ulong regionHandle, uint localID) | 1534 | public void SendKillObject(ulong regionHandle, List<uint> localIDs) |
1535 | { | 1535 | { |
1536 | // m_log.DebugFormat("[CLIENT]: Sending KillObjectPacket to {0} for {1} in {2}", Name, localID, regionHandle); | 1536 | // m_log.DebugFormat("[CLIENT]: Sending KillObjectPacket to {0} for {1} in {2}", Name, localID, regionHandle); |
1537 | 1537 | ||
1538 | KillObjectPacket kill = (KillObjectPacket)PacketPool.Instance.GetPacket(PacketType.KillObject); | 1538 | KillObjectPacket kill = (KillObjectPacket)PacketPool.Instance.GetPacket(PacketType.KillObject); |
1539 | // TODO: don't create new blocks if recycling an old packet | 1539 | // TODO: don't create new blocks if recycling an old packet |
1540 | kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1]; | 1540 | kill.ObjectData = new KillObjectPacket.ObjectDataBlock[localIDs.Count]; |
1541 | kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock(); | 1541 | for (int i = 0 ; i < localIDs.Count ; i++ ) |
1542 | kill.ObjectData[0].ID = localID; | 1542 | { |
1543 | kill.ObjectData[i] = new KillObjectPacket.ObjectDataBlock(); | ||
1544 | kill.ObjectData[i].ID = localIDs[i]; | ||
1545 | } | ||
1543 | kill.Header.Reliable = true; | 1546 | kill.Header.Reliable = true; |
1544 | kill.Header.Zerocoded = true; | 1547 | kill.Header.Zerocoded = true; |
1545 | 1548 | ||
1546 | if (m_scene.GetScenePresence(localID) == null) | 1549 | lock (m_killRecord) |
1547 | { | 1550 | { |
1548 | // We must lock for both manipulating the kill record and sending the packet, in order to avoid a race | 1551 | if (localIDs.Count == 1) |
1549 | // condition where a kill can be processed before an out-of-date update for the same object. | ||
1550 | lock (m_killRecord) | ||
1551 | { | 1552 | { |
1552 | m_killRecord.Add(localID); | 1553 | if (m_scene.GetScenePresence(localIDs[0]) != null) |
1553 | 1554 | { | |
1554 | // The throttle queue used here must match that being used for updates. Otherwise, there is a | 1555 | OutPacket(kill, ThrottleOutPacketType.State); |
1555 | // chance that a kill packet put on a separate queue will be sent to the client before an existing | 1556 | return; |
1556 | // update packet on another queue. Receiving updates after kills results in unowned and undeletable | 1557 | } |
1557 | // scene objects in a viewer until that viewer is relogged in. | 1558 | m_killRecord.Add(localIDs[0]); |
1558 | OutPacket(kill, ThrottleOutPacketType.Task); | 1559 | } |
1560 | else | ||
1561 | { | ||
1562 | lock (m_entityUpdates.SyncRoot) | ||
1563 | { | ||
1564 | foreach (uint localID in localIDs) | ||
1565 | m_killRecord.Add(localID); | ||
1566 | } | ||
1559 | } | 1567 | } |
1560 | } | 1568 | } |
1561 | else | 1569 | |
1562 | { | 1570 | // The throttle queue used here must match that being used for |
1563 | // OutPacket(kill, ThrottleOutPacketType.State); | 1571 | // updates. Otherwise, there is a chance that a kill packet put |
1564 | OutPacket(kill, ThrottleOutPacketType.Task); | 1572 | // on a separate queue will be sent to the client before an |
1565 | } | 1573 | // existing update packet on another queue. Receiving updates |
1574 | // after kills results in unowned and undeletable | ||
1575 | // scene objects in a viewer until that viewer is relogged in. | ||
1576 | OutPacket(kill, ThrottleOutPacketType.Task); | ||
1566 | } | 1577 | } |
1567 | 1578 | ||
1568 | /// <summary> | 1579 | /// <summary> |
@@ -11265,7 +11276,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11265 | { | 11276 | { |
11266 | // It's a ghost! tell the client to delete it from view. | 11277 | // It's a ghost! tell the client to delete it from view. |
11267 | simClient.SendKillObject(Scene.RegionInfo.RegionHandle, | 11278 | simClient.SendKillObject(Scene.RegionInfo.RegionHandle, |
11268 | localId); | 11279 | new List<uint> { localId }); |
11269 | } | 11280 | } |
11270 | else | 11281 | else |
11271 | { | 11282 | { |