diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 173 |
1 files changed, 90 insertions, 83 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 46c6a19..8ba26e8 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -347,12 +347,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
347 | private const uint MaxTransferBytesPerPacket = 600; | 347 | private const uint MaxTransferBytesPerPacket = 600; |
348 | 348 | ||
349 | /// <value> | 349 | /// <value> |
350 | /// List used in construction of data blocks for an object update packet. This is to stop us having to | ||
351 | /// continually recreate it. | ||
352 | /// </value> | ||
353 | protected List<ObjectUpdatePacket.ObjectDataBlock> m_fullUpdateDataBlocksBuilder; | ||
354 | |||
355 | /// <value> | ||
356 | /// Maintain a record of all the objects killed. This allows us to stop an update being sent from the | 350 | /// Maintain a record of all the objects killed. This allows us to stop an update being sent from the |
357 | /// thread servicing the m_primFullUpdates queue after a kill. If this happens the object persists as an | 351 | /// thread servicing the m_primFullUpdates queue after a kill. If this happens the object persists as an |
358 | /// ownerless phantom. | 352 | /// ownerless phantom. |
@@ -511,7 +505,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
511 | m_scene = scene; | 505 | m_scene = scene; |
512 | m_entityUpdates = new PriorityQueue(m_scene.Entities.Count); | 506 | m_entityUpdates = new PriorityQueue(m_scene.Entities.Count); |
513 | m_entityProps = new PriorityQueue(m_scene.Entities.Count); | 507 | m_entityProps = new PriorityQueue(m_scene.Entities.Count); |
514 | m_fullUpdateDataBlocksBuilder = new List<ObjectUpdatePacket.ObjectDataBlock>(); | ||
515 | m_killRecord = new List<uint>(); | 508 | m_killRecord = new List<uint>(); |
516 | // m_attachmentsSent = new HashSet<uint>(); | 509 | // m_attachmentsSent = new HashSet<uint>(); |
517 | 510 | ||
@@ -594,13 +587,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
594 | OutPacket(disable, ThrottleOutPacketType.Unknown); | 587 | OutPacket(disable, ThrottleOutPacketType.Unknown); |
595 | } | 588 | } |
596 | 589 | ||
597 | // Shutdown the image manager | ||
598 | ImageManager.Close(); | ||
599 | 590 | ||
600 | // Fire the callback for this connection closing | 591 | // Fire the callback for this connection closing |
601 | if (OnConnectionClosed != null) | 592 | if (OnConnectionClosed != null) |
602 | OnConnectionClosed(this); | 593 | OnConnectionClosed(this); |
603 | 594 | ||
595 | |||
604 | // Flush all of the packets out of the UDP server for this client | 596 | // Flush all of the packets out of the UDP server for this client |
605 | if (m_udpServer != null) | 597 | if (m_udpServer != null) |
606 | m_udpServer.Flush(m_udpClient); | 598 | m_udpServer.Flush(m_udpClient); |
@@ -615,8 +607,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
615 | 607 | ||
616 | // Disable UDP handling for this client | 608 | // Disable UDP handling for this client |
617 | m_udpClient.Shutdown(); | 609 | m_udpClient.Shutdown(); |
618 | 610 | ||
619 | 611 | m_udpClient.OnQueueEmpty -= HandleQueueEmpty; | |
612 | m_udpClient.HasUpdates -= HandleHasUpdates; | ||
613 | m_udpClient.OnPacketStats -= PopulateStats; | ||
614 | |||
615 | // Shutdown the image manager | ||
616 | ImageManager.Close(); | ||
617 | ImageManager = null; | ||
618 | |||
619 | m_entityUpdates = null; | ||
620 | m_entityProps = null; | ||
621 | m_killRecord.Clear(); | ||
622 | GroupsInView.Clear(); | ||
623 | m_scene = null; | ||
620 | //m_log.InfoFormat("[CLIENTVIEW] Memory pre GC {0}", System.GC.GetTotalMemory(false)); | 624 | //m_log.InfoFormat("[CLIENTVIEW] Memory pre GC {0}", System.GC.GetTotalMemory(false)); |
621 | //GC.Collect(); | 625 | //GC.Collect(); |
622 | //m_log.InfoFormat("[CLIENTVIEW] Memory post GC {0}", System.GC.GetTotalMemory(true)); | 626 | //m_log.InfoFormat("[CLIENTVIEW] Memory post GC {0}", System.GC.GetTotalMemory(true)); |
@@ -814,7 +818,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
814 | public void ProcessSpecificPacketAsync(object state) | 818 | public void ProcessSpecificPacketAsync(object state) |
815 | { | 819 | { |
816 | AsyncPacketProcess packetObject = (AsyncPacketProcess)state; | 820 | AsyncPacketProcess packetObject = (AsyncPacketProcess)state; |
817 | 821 | ||
818 | try | 822 | try |
819 | { | 823 | { |
820 | packetObject.result = packetObject.Method(packetObject.ClientView, packetObject.Pack); | 824 | packetObject.result = packetObject.Method(packetObject.ClientView, packetObject.Pack); |
@@ -4095,19 +4099,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4095 | ResendPrimUpdate(update); | 4099 | ResendPrimUpdate(update); |
4096 | } | 4100 | } |
4097 | 4101 | ||
4102 | private List<ObjectUpdatePacket.ObjectDataBlock> objectUpdateBlocks = new List<ObjectUpdatePacket.ObjectDataBlock>(); | ||
4103 | private List<ObjectUpdateCompressedPacket.ObjectDataBlock> compressedUpdateBlocks = new List<ObjectUpdateCompressedPacket.ObjectDataBlock>(); | ||
4104 | private List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> terseUpdateBlocks = new List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>(); | ||
4105 | private List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> terseAgentUpdateBlocks = new List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>(); | ||
4106 | |||
4098 | private void ProcessEntityUpdates(int maxUpdatesBytes) | 4107 | private void ProcessEntityUpdates(int maxUpdatesBytes) |
4099 | { | 4108 | { |
4100 | OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>> objectUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>>(); | ||
4101 | OpenSim.Framework.Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>> compressedUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>>(); | ||
4102 | OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>> terseUpdateBlocks = new OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>>(); | ||
4103 | OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>> terseAgentUpdateBlocks = new OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>>(); | ||
4104 | |||
4105 | OpenSim.Framework.Lazy<List<EntityUpdate>> objectUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); | 4109 | OpenSim.Framework.Lazy<List<EntityUpdate>> objectUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); |
4106 | OpenSim.Framework.Lazy<List<EntityUpdate>> compressedUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); | 4110 | OpenSim.Framework.Lazy<List<EntityUpdate>> compressedUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); |
4107 | OpenSim.Framework.Lazy<List<EntityUpdate>> terseUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); | 4111 | OpenSim.Framework.Lazy<List<EntityUpdate>> terseUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); |
4108 | OpenSim.Framework.Lazy<List<EntityUpdate>> terseAgentUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); | 4112 | OpenSim.Framework.Lazy<List<EntityUpdate>> terseAgentUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); |
4109 | 4113 | ||
4110 | |||
4111 | // Check to see if this is a flush | 4114 | // Check to see if this is a flush |
4112 | if (maxUpdatesBytes <= 0) | 4115 | if (maxUpdatesBytes <= 0) |
4113 | { | 4116 | { |
@@ -4328,7 +4331,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4328 | ablock = CreateAvatarUpdateBlock((ScenePresence)update.Entity); | 4331 | ablock = CreateAvatarUpdateBlock((ScenePresence)update.Entity); |
4329 | else | 4332 | else |
4330 | ablock = CreatePrimUpdateBlock((SceneObjectPart)update.Entity, this.m_agentId); | 4333 | ablock = CreatePrimUpdateBlock((SceneObjectPart)update.Entity, this.m_agentId); |
4331 | objectUpdateBlocks.Value.Add(ablock); | 4334 | objectUpdateBlocks.Add(ablock); |
4332 | objectUpdates.Value.Add(update); | 4335 | objectUpdates.Value.Add(update); |
4333 | maxUpdatesBytes -= ablock.Length; | 4336 | maxUpdatesBytes -= ablock.Length; |
4334 | 4337 | ||
@@ -4337,7 +4340,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4337 | { | 4340 | { |
4338 | ObjectUpdateCompressedPacket.ObjectDataBlock ablock = | 4341 | ObjectUpdateCompressedPacket.ObjectDataBlock ablock = |
4339 | CreateCompressedUpdateBlock((SceneObjectPart)update.Entity, updateFlags); | 4342 | CreateCompressedUpdateBlock((SceneObjectPart)update.Entity, updateFlags); |
4340 | compressedUpdateBlocks.Value.Add(ablock); | 4343 | compressedUpdateBlocks.Add(ablock); |
4341 | compressedUpdates.Value.Add(update); | 4344 | compressedUpdates.Value.Add(update); |
4342 | maxUpdatesBytes -= ablock.Length; | 4345 | maxUpdatesBytes -= ablock.Length; |
4343 | } | 4346 | } |
@@ -4348,14 +4351,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4348 | { | 4351 | { |
4349 | // ALL presence updates go into a special list | 4352 | // ALL presence updates go into a special list |
4350 | ablock = CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures)); | 4353 | ablock = CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures)); |
4351 | terseAgentUpdateBlocks.Value.Add(ablock); | 4354 | terseAgentUpdateBlocks.Add(ablock); |
4352 | terseAgentUpdates.Value.Add(update); | 4355 | terseAgentUpdates.Value.Add(update); |
4353 | } | 4356 | } |
4354 | else | 4357 | else |
4355 | { | 4358 | { |
4356 | // Everything else goes here | 4359 | // Everything else goes here |
4357 | ablock = CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures)); | 4360 | ablock = CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures)); |
4358 | terseUpdateBlocks.Value.Add(ablock); | 4361 | terseUpdateBlocks.Add(ablock); |
4359 | terseUpdates.Value.Add(update); | 4362 | terseUpdates.Value.Add(update); |
4360 | } | 4363 | } |
4361 | maxUpdatesBytes -= ablock.Length; | 4364 | maxUpdatesBytes -= ablock.Length; |
@@ -4366,74 +4369,72 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4366 | 4369 | ||
4367 | #region Packet Sending | 4370 | #region Packet Sending |
4368 | 4371 | ||
4369 | // const float TIME_DILATION = 1.0f; | ||
4370 | ushort timeDilation; | 4372 | ushort timeDilation; |
4371 | // if(updatesThisCall > 0) | 4373 | |
4372 | // timeDilation = Utils.FloatToUInt16(avgTimeDilation/updatesThisCall, 0.0f, 1.0f); | 4374 | if(m_scene == null) |
4373 | // else | 4375 | return; |
4374 | // timeDilation = ushort.MaxValue; // 1.0; | ||
4375 | 4376 | ||
4376 | timeDilation = Utils.FloatToUInt16(m_scene.TimeDilation, 0.0f, 1.0f); | 4377 | timeDilation = Utils.FloatToUInt16(m_scene.TimeDilation, 0.0f, 1.0f); |
4377 | 4378 | ||
4378 | if (terseAgentUpdateBlocks.IsValueCreated) | 4379 | if (terseAgentUpdateBlocks.Count > 0) |
4379 | { | 4380 | { |
4380 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseAgentUpdateBlocks.Value; | ||
4381 | |||
4382 | ImprovedTerseObjectUpdatePacket packet | 4381 | ImprovedTerseObjectUpdatePacket packet |
4383 | = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate); | 4382 | = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate); |
4384 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | 4383 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; |
4385 | packet.RegionData.TimeDilation = timeDilation; | 4384 | packet.RegionData.TimeDilation = timeDilation; |
4386 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; | 4385 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[terseAgentUpdateBlocks.Count]; |
4386 | |||
4387 | for (int i = 0; i < terseAgentUpdateBlocks.Count; i++) | ||
4388 | packet.ObjectData[i] = terseAgentUpdateBlocks[i]; | ||
4387 | 4389 | ||
4388 | for (int i = 0; i < blocks.Count; i++) | 4390 | terseAgentUpdateBlocks.Clear(); |
4389 | packet.ObjectData[i] = blocks[i]; | ||
4390 | 4391 | ||
4391 | OutPacket(packet, ThrottleOutPacketType.Unknown, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseAgentUpdates.Value, oPacket); }); | 4392 | OutPacket(packet, ThrottleOutPacketType.Unknown, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseAgentUpdates.Value, oPacket); }); |
4392 | } | 4393 | } |
4393 | 4394 | ||
4394 | if (objectUpdateBlocks.IsValueCreated) | 4395 | if (objectUpdateBlocks.Count > 0) |
4395 | { | 4396 | { |
4396 | List<ObjectUpdatePacket.ObjectDataBlock> blocks = objectUpdateBlocks.Value; | ||
4397 | |||
4398 | ObjectUpdatePacket packet = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); | 4397 | ObjectUpdatePacket packet = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); |
4399 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | 4398 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; |
4400 | packet.RegionData.TimeDilation = timeDilation; | 4399 | packet.RegionData.TimeDilation = timeDilation; |
4401 | packet.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[blocks.Count]; | 4400 | packet.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[objectUpdateBlocks.Count]; |
4402 | 4401 | ||
4403 | for (int i = 0; i < blocks.Count; i++) | 4402 | for (int i = 0; i < objectUpdateBlocks.Count; i++) |
4404 | packet.ObjectData[i] = blocks[i]; | 4403 | packet.ObjectData[i] = objectUpdateBlocks[i]; |
4404 | |||
4405 | objectUpdateBlocks.Clear(); | ||
4405 | 4406 | ||
4406 | OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(objectUpdates.Value, oPacket); }); | 4407 | OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(objectUpdates.Value, oPacket); }); |
4407 | } | 4408 | } |
4408 | 4409 | ||
4409 | if (compressedUpdateBlocks.IsValueCreated) | 4410 | if (compressedUpdateBlocks.Count > 0) |
4410 | { | 4411 | { |
4411 | List<ObjectUpdateCompressedPacket.ObjectDataBlock> blocks = compressedUpdateBlocks.Value; | ||
4412 | |||
4413 | ObjectUpdateCompressedPacket packet = (ObjectUpdateCompressedPacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdateCompressed); | 4412 | ObjectUpdateCompressedPacket packet = (ObjectUpdateCompressedPacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdateCompressed); |
4414 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | 4413 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; |
4415 | packet.RegionData.TimeDilation = timeDilation; | 4414 | packet.RegionData.TimeDilation = timeDilation; |
4416 | packet.ObjectData = new ObjectUpdateCompressedPacket.ObjectDataBlock[blocks.Count]; | 4415 | packet.ObjectData = new ObjectUpdateCompressedPacket.ObjectDataBlock[compressedUpdateBlocks.Count]; |
4416 | |||
4417 | for (int i = 0; i < compressedUpdateBlocks.Count; i++) | ||
4418 | packet.ObjectData[i] = compressedUpdateBlocks[i]; | ||
4417 | 4419 | ||
4418 | for (int i = 0; i < blocks.Count; i++) | 4420 | compressedUpdateBlocks.Clear(); |
4419 | packet.ObjectData[i] = blocks[i]; | ||
4420 | 4421 | ||
4421 | OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(compressedUpdates.Value, oPacket); }); | 4422 | OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(compressedUpdates.Value, oPacket); }); |
4422 | } | 4423 | } |
4423 | 4424 | ||
4424 | if (terseUpdateBlocks.IsValueCreated) | 4425 | if (terseUpdateBlocks.Count > 0) |
4425 | { | 4426 | { |
4426 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseUpdateBlocks.Value; | ||
4427 | |||
4428 | ImprovedTerseObjectUpdatePacket packet | 4427 | ImprovedTerseObjectUpdatePacket packet |
4429 | = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket( | 4428 | = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket( |
4430 | PacketType.ImprovedTerseObjectUpdate); | 4429 | PacketType.ImprovedTerseObjectUpdate); |
4431 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | 4430 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; |
4432 | packet.RegionData.TimeDilation = timeDilation; | 4431 | packet.RegionData.TimeDilation = timeDilation; |
4433 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; | 4432 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[terseUpdateBlocks.Count]; |
4434 | 4433 | ||
4435 | for (int i = 0; i < blocks.Count; i++) | 4434 | for (int i = 0; i < terseUpdateBlocks.Count; i++) |
4436 | packet.ObjectData[i] = blocks[i]; | 4435 | packet.ObjectData[i] = terseUpdateBlocks[i]; |
4436 | |||
4437 | terseUpdateBlocks.Clear(); | ||
4437 | 4438 | ||
4438 | OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseUpdates.Value, oPacket); }); | 4439 | OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseUpdates.Value, oPacket); }); |
4439 | } | 4440 | } |
@@ -4634,6 +4635,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4634 | 4635 | ||
4635 | void HandleQueueEmpty(ThrottleOutPacketTypeFlags categories) | 4636 | void HandleQueueEmpty(ThrottleOutPacketTypeFlags categories) |
4636 | { | 4637 | { |
4638 | if(m_scene == null) | ||
4639 | return; | ||
4640 | |||
4637 | if ((categories & ThrottleOutPacketTypeFlags.Task) != 0) | 4641 | if ((categories & ThrottleOutPacketTypeFlags.Task) != 0) |
4638 | { | 4642 | { |
4639 | int maxUpdateBytes = m_udpClient.GetCatBytesCanSend(ThrottleOutPacketType.Task, 30); | 4643 | int maxUpdateBytes = m_udpClient.GetCatBytesCanSend(ThrottleOutPacketType.Task, 30); |
@@ -4828,21 +4832,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4828 | m_entityProps.Enqueue(priority, new ObjectPropertyUpdate(entity,0,false,true)); | 4832 | m_entityProps.Enqueue(priority, new ObjectPropertyUpdate(entity,0,false,true)); |
4829 | } | 4833 | } |
4830 | 4834 | ||
4835 | List<ObjectPropertiesFamilyPacket.ObjectDataBlock> objectFamilyBlocks = new | ||
4836 | List<ObjectPropertiesFamilyPacket.ObjectDataBlock>(); | ||
4837 | List<ObjectPropertiesPacket.ObjectDataBlock> objectPropertiesBlocks = | ||
4838 | new List<ObjectPropertiesPacket.ObjectDataBlock>(); | ||
4839 | List<SceneObjectPart> needPhysics = new List<SceneObjectPart>(); | ||
4840 | |||
4831 | private void ProcessEntityPropertyRequests(int maxUpdateBytes) | 4841 | private void ProcessEntityPropertyRequests(int maxUpdateBytes) |
4832 | { | 4842 | { |
4833 | OpenSim.Framework.Lazy<List<ObjectPropertiesFamilyPacket.ObjectDataBlock>> objectFamilyBlocks = | 4843 | // OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>> familyUpdates = |
4834 | new OpenSim.Framework.Lazy<List<ObjectPropertiesFamilyPacket.ObjectDataBlock>>(); | 4844 | // new OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>>(); |
4835 | |||
4836 | OpenSim.Framework.Lazy<List<ObjectPropertiesPacket.ObjectDataBlock>> objectPropertiesBlocks = | ||
4837 | new OpenSim.Framework.Lazy<List<ObjectPropertiesPacket.ObjectDataBlock>>(); | ||
4838 | 4845 | ||
4839 | OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>> familyUpdates = | 4846 | // OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>> propertyUpdates = |
4840 | new OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>>(); | 4847 | // new OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>>(); |
4841 | |||
4842 | OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>> propertyUpdates = | ||
4843 | new OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>>(); | ||
4844 | 4848 | ||
4845 | List<SceneObjectPart> needPhysics = new List<SceneObjectPart>(); | ||
4846 | 4849 | ||
4847 | EntityUpdate iupdate; | 4850 | EntityUpdate iupdate; |
4848 | Int32 timeinqueue; // this is just debugging code & can be dropped later | 4851 | Int32 timeinqueue; // this is just debugging code & can be dropped later |
@@ -4860,8 +4863,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4860 | { | 4863 | { |
4861 | SceneObjectPart sop = (SceneObjectPart)update.Entity; | 4864 | SceneObjectPart sop = (SceneObjectPart)update.Entity; |
4862 | ObjectPropertiesFamilyPacket.ObjectDataBlock objPropDB = CreateObjectPropertiesFamilyBlock(sop,update.Flags); | 4865 | ObjectPropertiesFamilyPacket.ObjectDataBlock objPropDB = CreateObjectPropertiesFamilyBlock(sop,update.Flags); |
4863 | objectFamilyBlocks.Value.Add(objPropDB); | 4866 | objectFamilyBlocks.Add(objPropDB); |
4864 | familyUpdates.Value.Add(update); | 4867 | // familyUpdates.Value.Add(update); |
4865 | maxUpdateBytes -= objPropDB.Length; | 4868 | maxUpdateBytes -= objPropDB.Length; |
4866 | } | 4869 | } |
4867 | } | 4870 | } |
@@ -4873,23 +4876,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4873 | SceneObjectPart sop = (SceneObjectPart)update.Entity; | 4876 | SceneObjectPart sop = (SceneObjectPart)update.Entity; |
4874 | needPhysics.Add(sop); | 4877 | needPhysics.Add(sop); |
4875 | ObjectPropertiesPacket.ObjectDataBlock objPropDB = CreateObjectPropertiesBlock(sop); | 4878 | ObjectPropertiesPacket.ObjectDataBlock objPropDB = CreateObjectPropertiesBlock(sop); |
4876 | objectPropertiesBlocks.Value.Add(objPropDB); | 4879 | objectPropertiesBlocks.Add(objPropDB); |
4877 | propertyUpdates.Value.Add(update); | 4880 | // propertyUpdates.Value.Add(update); |
4878 | maxUpdateBytes -= objPropDB.Length; | 4881 | maxUpdateBytes -= objPropDB.Length; |
4879 | } | 4882 | } |
4880 | } | 4883 | } |
4881 | } | 4884 | } |
4882 | 4885 | ||
4883 | if (objectPropertiesBlocks.IsValueCreated) | 4886 | if (objectPropertiesBlocks.Count > 0) |
4884 | { | 4887 | { |
4885 | List<ObjectPropertiesPacket.ObjectDataBlock> blocks = objectPropertiesBlocks.Value; | ||
4886 | List<ObjectPropertyUpdate> updates = propertyUpdates.Value; | ||
4887 | |||
4888 | ObjectPropertiesPacket packet = (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties); | 4888 | ObjectPropertiesPacket packet = (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties); |
4889 | packet.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[blocks.Count]; | 4889 | packet.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[objectPropertiesBlocks.Count]; |
4890 | for (int i = 0; i < blocks.Count; i++) | 4890 | for (int i = 0; i < objectPropertiesBlocks.Count; i++) |
4891 | packet.ObjectData[i] = blocks[i]; | 4891 | packet.ObjectData[i] = objectPropertiesBlocks[i]; |
4892 | 4892 | ||
4893 | |||
4894 | objectPropertiesBlocks.Clear(); | ||
4893 | packet.Header.Zerocoded = true; | 4895 | packet.Header.Zerocoded = true; |
4894 | 4896 | ||
4895 | // Pass in the delegate so that if this packet needs to be resent, we send the current properties | 4897 | // Pass in the delegate so that if this packet needs to be resent, we send the current properties |
@@ -4898,7 +4900,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4898 | //OutPacket(packet, ThrottleOutPacketType.Task, true, | 4900 | //OutPacket(packet, ThrottleOutPacketType.Task, true, |
4899 | // delegate(OutgoingPacket oPacket) | 4901 | // delegate(OutgoingPacket oPacket) |
4900 | // { | 4902 | // { |
4901 | // ResendPropertyUpdates(updates, oPacket); | 4903 | // ResendPropertyUpdates(propertyUpdates.Value, oPacket); |
4902 | // }); | 4904 | // }); |
4903 | OutPacket(packet, ThrottleOutPacketType.Task, true); | 4905 | OutPacket(packet, ThrottleOutPacketType.Task, true); |
4904 | 4906 | ||
@@ -4909,23 +4911,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4909 | // Int32 fpcnt = 0; | 4911 | // Int32 fpcnt = 0; |
4910 | // Int32 fbcnt = 0; | 4912 | // Int32 fbcnt = 0; |
4911 | 4913 | ||
4912 | if (objectFamilyBlocks.IsValueCreated) | 4914 | if (objectFamilyBlocks.Count > 0) |
4913 | { | 4915 | { |
4914 | List<ObjectPropertiesFamilyPacket.ObjectDataBlock> blocks = objectFamilyBlocks.Value; | ||
4915 | |||
4916 | // one packet per object block... uggh... | 4916 | // one packet per object block... uggh... |
4917 | for (int i = 0; i < blocks.Count; i++) | 4917 | for (int i = 0; i < objectFamilyBlocks.Count; i++) |
4918 | { | 4918 | { |
4919 | ObjectPropertiesFamilyPacket packet = | 4919 | ObjectPropertiesFamilyPacket packet = |
4920 | (ObjectPropertiesFamilyPacket)PacketPool.Instance.GetPacket(PacketType.ObjectPropertiesFamily); | 4920 | (ObjectPropertiesFamilyPacket)PacketPool.Instance.GetPacket(PacketType.ObjectPropertiesFamily); |
4921 | 4921 | ||
4922 | packet.ObjectData = blocks[i]; | 4922 | packet.ObjectData = objectFamilyBlocks[i]; |
4923 | packet.Header.Zerocoded = true; | 4923 | packet.Header.Zerocoded = true; |
4924 | 4924 | ||
4925 | // Pass in the delegate so that if this packet needs to be resent, we send the current properties | 4925 | // Pass in the delegate so that if this packet needs to be resent, we send the current properties |
4926 | // of the object rather than the properties when the packet was created | 4926 | // of the object rather than the properties when the packet was created |
4927 | List<ObjectPropertyUpdate> updates = new List<ObjectPropertyUpdate>(); | 4927 | // List<ObjectPropertyUpdate> updates = new List<ObjectPropertyUpdate>(); |
4928 | updates.Add(familyUpdates.Value[i]); | 4928 | // updates.Add(familyUpdates.Value[i]); |
4929 | // HACK : Remove intelligent resending until it's fixed in core | 4929 | // HACK : Remove intelligent resending until it's fixed in core |
4930 | //OutPacket(packet, ThrottleOutPacketType.Task, true, | 4930 | //OutPacket(packet, ThrottleOutPacketType.Task, true, |
4931 | // delegate(OutgoingPacket oPacket) | 4931 | // delegate(OutgoingPacket oPacket) |
@@ -4937,6 +4937,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4937 | // fpcnt++; | 4937 | // fpcnt++; |
4938 | // fbcnt++; | 4938 | // fbcnt++; |
4939 | } | 4939 | } |
4940 | objectFamilyBlocks.Clear(); | ||
4940 | } | 4941 | } |
4941 | 4942 | ||
4942 | if(needPhysics.Count > 0) | 4943 | if(needPhysics.Count > 0) |
@@ -4962,6 +4963,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4962 | 4963 | ||
4963 | eq.Enqueue(BuildEvent("ObjectPhysicsProperties", llsdBody),AgentId); | 4964 | eq.Enqueue(BuildEvent("ObjectPhysicsProperties", llsdBody),AgentId); |
4964 | } | 4965 | } |
4966 | needPhysics.Clear(); | ||
4965 | } | 4967 | } |
4966 | 4968 | ||
4967 | // m_log.WarnFormat("[PACKETCOUNTS] queued {0} property packets with {1} blocks",ppcnt,pbcnt); | 4969 | // m_log.WarnFormat("[PACKETCOUNTS] queued {0} property packets with {1} blocks",ppcnt,pbcnt); |
@@ -6251,9 +6253,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6251 | return false; | 6253 | return false; |
6252 | } | 6254 | } |
6253 | 6255 | ||
6256 | uint seq = packet.Header.Sequence; | ||
6257 | |||
6254 | TotalAgentUpdates++; | 6258 | TotalAgentUpdates++; |
6255 | // dont let ignored updates pollute this throttles | 6259 | // dont let ignored updates pollute this throttles |
6256 | if(SceneAgent == null || SceneAgent.IsChildAgent || SceneAgent.IsInTransit) | 6260 | if(SceneAgent == null || SceneAgent.IsChildAgent || |
6261 | SceneAgent.IsInTransit || seq <= m_thisAgentUpdateArgs.lastpacketSequence ) | ||
6257 | { | 6262 | { |
6258 | // throttle reset is done at MoveAgentIntoRegion() | 6263 | // throttle reset is done at MoveAgentIntoRegion() |
6259 | // called by scenepresence on completemovement | 6264 | // called by scenepresence on completemovement |
@@ -6261,6 +6266,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6261 | return true; | 6266 | return true; |
6262 | } | 6267 | } |
6263 | 6268 | ||
6269 | m_thisAgentUpdateArgs.lastpacketSequence = seq; | ||
6270 | |||
6264 | bool movement = CheckAgentMovementUpdateSignificance(x); | 6271 | bool movement = CheckAgentMovementUpdateSignificance(x); |
6265 | bool camera = CheckAgentCameraUpdateSignificance(x); | 6272 | bool camera = CheckAgentCameraUpdateSignificance(x); |
6266 | 6273 | ||