diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 49 |
1 files changed, 43 insertions, 6 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 18d3889..3b26dde 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -40,7 +40,6 @@ using OpenMetaverse.Packets; | |||
40 | using OpenMetaverse.StructuredData; | 40 | using OpenMetaverse.StructuredData; |
41 | using OpenSim.Framework; | 41 | using OpenSim.Framework; |
42 | using OpenSim.Framework.Client; | 42 | using OpenSim.Framework.Client; |
43 | |||
44 | using OpenSim.Framework.Statistics; | 43 | using OpenSim.Framework.Statistics; |
45 | using OpenSim.Region.Framework.Interfaces; | 44 | using OpenSim.Region.Framework.Interfaces; |
46 | using OpenSim.Region.Framework.Scenes; | 45 | using OpenSim.Region.Framework.Scenes; |
@@ -353,6 +352,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
353 | protected PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock> m_avatarTerseUpdates; | 352 | protected PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock> m_avatarTerseUpdates; |
354 | private PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock> m_primTerseUpdates; | 353 | private PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock> m_primTerseUpdates; |
355 | private PriorityQueue<double, ObjectUpdatePacket.ObjectDataBlock> m_primFullUpdates; | 354 | private PriorityQueue<double, ObjectUpdatePacket.ObjectDataBlock> m_primFullUpdates; |
355 | |||
356 | /// <value> | ||
357 | /// List used in construction of data blocks for an object update packet. This is to stop us having to | ||
358 | /// continually recreate it. | ||
359 | /// </value> | ||
360 | protected List<ObjectUpdatePacket.ObjectDataBlock> m_fullUpdateDataBlocksBuilder; | ||
361 | |||
362 | /// <value> | ||
363 | /// Maintain a record of all the objects killed. This allows us to stop an update being sent from the | ||
364 | /// thread servicing the m_primFullUpdates queue after a kill. If this happens the object persists as an | ||
365 | /// ownerless phantom. | ||
366 | /// | ||
367 | /// All manipulation of this set has to occur under a m_primFullUpdate.SyncRoot lock | ||
368 | /// | ||
369 | /// </value> | ||
370 | protected HashSet<uint> m_killRecord; | ||
371 | |||
356 | private int m_moneyBalance; | 372 | private int m_moneyBalance; |
357 | private int m_animationSequenceNumber = 1; | 373 | private int m_animationSequenceNumber = 1; |
358 | private bool m_SendLogoutPacketWhenClosing = true; | 374 | private bool m_SendLogoutPacketWhenClosing = true; |
@@ -449,6 +465,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
449 | m_avatarTerseUpdates = new PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock>(); | 465 | m_avatarTerseUpdates = new PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock>(); |
450 | m_primTerseUpdates = new PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock>(); | 466 | m_primTerseUpdates = new PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock>(); |
451 | m_primFullUpdates = new PriorityQueue<double, ObjectUpdatePacket.ObjectDataBlock>(m_scene.Entities.Count); | 467 | m_primFullUpdates = new PriorityQueue<double, ObjectUpdatePacket.ObjectDataBlock>(m_scene.Entities.Count); |
468 | m_fullUpdateDataBlocksBuilder = new List<ObjectUpdatePacket.ObjectDataBlock>(); | ||
469 | m_killRecord = new HashSet<uint>(); | ||
452 | 470 | ||
453 | m_assetService = m_scene.RequestModuleInterface<IAssetService>(); | 471 | m_assetService = m_scene.RequestModuleInterface<IAssetService>(); |
454 | m_hyperAssets = m_scene.RequestModuleInterface<IHyperAssetService>(); | 472 | m_hyperAssets = m_scene.RequestModuleInterface<IHyperAssetService>(); |
@@ -1489,7 +1507,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1489 | kill.ObjectData[0].ID = localID; | 1507 | kill.ObjectData[0].ID = localID; |
1490 | kill.Header.Reliable = true; | 1508 | kill.Header.Reliable = true; |
1491 | kill.Header.Zerocoded = true; | 1509 | kill.Header.Zerocoded = true; |
1492 | OutPacket(kill, ThrottleOutPacketType.State); | 1510 | |
1511 | lock (m_primFullUpdates.SyncRoot) | ||
1512 | { | ||
1513 | m_killRecord.Add(localID); | ||
1514 | OutPacket(kill, ThrottleOutPacketType.State); | ||
1515 | } | ||
1493 | } | 1516 | } |
1494 | 1517 | ||
1495 | /// <summary> | 1518 | /// <summary> |
@@ -3538,21 +3561,35 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3538 | if (count == 0) | 3561 | if (count == 0) |
3539 | return; | 3562 | return; |
3540 | 3563 | ||
3541 | outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[count]; | 3564 | m_fullUpdateDataBlocksBuilder.Clear(); |
3565 | |||
3542 | for (int i = 0; i < count; i++) | 3566 | for (int i = 0; i < count; i++) |
3543 | { | 3567 | { |
3544 | outPacket.ObjectData[i] = m_primFullUpdates.Dequeue(); | 3568 | ObjectUpdatePacket.ObjectDataBlock block = m_primFullUpdates.Dequeue(); |
3569 | //outPacket.ObjectData[i] = m_primFullUpdates.Dequeue(); | ||
3545 | 3570 | ||
3571 | if (!m_killRecord.Contains(block.ID)) | ||
3572 | { | ||
3573 | m_fullUpdateDataBlocksBuilder.Add(block); | ||
3574 | |||
3546 | // string text = Util.FieldToString(outPacket.ObjectData[i].Text); | 3575 | // string text = Util.FieldToString(outPacket.ObjectData[i].Text); |
3547 | // if (text.IndexOf("\n") >= 0) | 3576 | // if (text.IndexOf("\n") >= 0) |
3548 | // text = text.Remove(text.IndexOf("\n")); | 3577 | // text = text.Remove(text.IndexOf("\n")); |
3549 | // m_log.DebugFormat( | 3578 | // m_log.DebugFormat( |
3550 | // "[CLIENT]: Sending full info about prim {0} text {1} to client {2}", | 3579 | // "[CLIENT]: Sending full info about prim {0} text {1} to client {2}", |
3551 | // outPacket.ObjectData[i].ID, text, Name); | 3580 | // outPacket.ObjectData[i].ID, text, Name); |
3581 | } | ||
3582 | // else | ||
3583 | // { | ||
3584 | // m_log.WarnFormat( | ||
3585 | // "[CLIENT]: Preventing full update for {0} after kill to {1}", block.ID, Name); | ||
3586 | // } | ||
3552 | } | 3587 | } |
3553 | } | ||
3554 | 3588 | ||
3555 | OutPacket(outPacket, ThrottleOutPacketType.State); | 3589 | outPacket.ObjectData = m_fullUpdateDataBlocksBuilder.ToArray(); |
3590 | |||
3591 | OutPacket(outPacket, ThrottleOutPacketType.State); | ||
3592 | } | ||
3556 | } | 3593 | } |
3557 | 3594 | ||
3558 | public void SendPrimTerseUpdate(SendPrimitiveTerseData data) | 3595 | public void SendPrimTerseUpdate(SendPrimitiveTerseData data) |