diff options
author | UbitUmarov | 2019-01-21 13:15:11 +0000 |
---|---|---|
committer | UbitUmarov | 2019-01-21 13:15:11 +0000 |
commit | 611cfc83d645ea49717bbeb0c4c30c514fb93694 (patch) | |
tree | 04b0fab887837c8891e8dc2c5a34dfd795148d2a /OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |
parent | some cleanup (diff) | |
download | opensim-SC-611cfc83d645ea49717bbeb0c4c30c514fb93694.zip opensim-SC-611cfc83d645ea49717bbeb0c4c30c514fb93694.tar.gz opensim-SC-611cfc83d645ea49717bbeb0c4c30c514fb93694.tar.bz2 opensim-SC-611cfc83d645ea49717bbeb0c4c30c514fb93694.tar.xz |
give up on Lazy<T>
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 124 |
1 files changed, 67 insertions, 57 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index d197f5c..27524b5 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -44,11 +44,11 @@ using OpenSim.Framework.Monitoring; | |||
44 | using OpenSim.Region.Framework.Interfaces; | 44 | using OpenSim.Region.Framework.Interfaces; |
45 | using OpenSim.Region.Framework.Scenes; | 45 | using OpenSim.Region.Framework.Scenes; |
46 | using OpenSim.Services.Interfaces; | 46 | using OpenSim.Services.Interfaces; |
47 | using Caps = OpenSim.Framework.Capabilities.Caps; | ||
48 | 47 | ||
49 | using AssetLandmark = OpenSim.Framework.AssetLandmark; | 48 | using AssetLandmark = OpenSim.Framework.AssetLandmark; |
50 | using RegionFlags = OpenMetaverse.RegionFlags; | 49 | using Caps = OpenSim.Framework.Capabilities.Caps; |
51 | using PermissionMask = OpenSim.Framework.PermissionMask; | 50 | using PermissionMask = OpenSim.Framework.PermissionMask; |
51 | using RegionFlags = OpenMetaverse.RegionFlags; | ||
52 | 52 | ||
53 | namespace OpenSim.Region.ClientStack.LindenUDP | 53 | namespace OpenSim.Region.ClientStack.LindenUDP |
54 | { | 54 | { |
@@ -1169,7 +1169,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1169 | OutPacket(GATRP, ThrottleOutPacketType.Task); | 1169 | OutPacket(GATRP, ThrottleOutPacketType.Task); |
1170 | } | 1170 | } |
1171 | 1171 | ||
1172 | |||
1173 | public virtual bool CanSendLayerData() | 1172 | public virtual bool CanSendLayerData() |
1174 | { | 1173 | { |
1175 | int n = m_udpClient.GetPacketsQueuedCount(ThrottleOutPacketType.Land); | 1174 | int n = m_udpClient.GetPacketsQueuedCount(ThrottleOutPacketType.Land); |
@@ -4093,21 +4092,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4093 | ResendPrimUpdate(update); | 4092 | ResendPrimUpdate(update); |
4094 | } | 4093 | } |
4095 | 4094 | ||
4096 | private List<ObjectUpdatePacket.ObjectDataBlock> objectUpdateBlocks = new List<ObjectUpdatePacket.ObjectDataBlock>(); | ||
4097 | private List<ObjectUpdateCompressedPacket.ObjectDataBlock> compressedUpdateBlocks = new List<ObjectUpdateCompressedPacket.ObjectDataBlock>(); | ||
4098 | private List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> terseUpdateBlocks = new List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>(); | ||
4099 | private List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> terseAgentUpdateBlocks = new List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>(); | ||
4100 | |||
4101 | private void ProcessEntityUpdates(int maxUpdatesBytes) | 4095 | private void ProcessEntityUpdates(int maxUpdatesBytes) |
4102 | { | 4096 | { |
4103 | if (!IsActive) | 4097 | if (!IsActive) |
4104 | return; | 4098 | return; |
4105 | 4099 | ||
4106 | OpenSim.Framework.Lazy<List<EntityUpdate>> objectUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); | 4100 | List<ObjectUpdatePacket.ObjectDataBlock> objectUpdateBlocks = null; |
4107 | OpenSim.Framework.Lazy<List<EntityUpdate>> compressedUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); | 4101 | List<ObjectUpdateCompressedPacket.ObjectDataBlock> compressedUpdateBlocks = null; |
4108 | OpenSim.Framework.Lazy<List<EntityUpdate>> terseUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); | 4102 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> terseUpdateBlocks = null; |
4109 | OpenSim.Framework.Lazy<List<EntityUpdate>> terseAgentUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); | 4103 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> terseAgentUpdateBlocks = null; |
4110 | OpenSim.Framework.Lazy<List<SceneObjectPart>> ObjectAnimationUpdates = new OpenSim.Framework.Lazy<List<SceneObjectPart>>(); | 4104 | List<EntityUpdate> objectUpdates = null; |
4105 | List<EntityUpdate> compressedUpdates = null; | ||
4106 | List<EntityUpdate> terseUpdates = null; | ||
4107 | List<EntityUpdate> terseAgentUpdates = null; | ||
4108 | List<SceneObjectPart> ObjectAnimationUpdates = null; | ||
4111 | 4109 | ||
4112 | // Check to see if this is a flush | 4110 | // Check to see if this is a flush |
4113 | if (maxUpdatesBytes <= 0) | 4111 | if (maxUpdatesBytes <= 0) |
@@ -4284,7 +4282,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4284 | SceneObjectPart sop = (SceneObjectPart)update.Entity; | 4282 | SceneObjectPart sop = (SceneObjectPart)update.Entity; |
4285 | if ( sop.Animations != null) | 4283 | if ( sop.Animations != null) |
4286 | { | 4284 | { |
4287 | ObjectAnimationUpdates.Value.Add(sop); | 4285 | if(ObjectAnimationUpdates == null) |
4286 | ObjectAnimationUpdates = new List<SceneObjectPart>(); | ||
4287 | ObjectAnimationUpdates.Add(sop); | ||
4288 | maxUpdatesBytes -= 32 * sop.Animations.Count + 16; | 4288 | maxUpdatesBytes -= 32 * sop.Animations.Count + 16; |
4289 | } | 4289 | } |
4290 | } | 4290 | } |
@@ -4344,14 +4344,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4344 | if (update.Entity is ScenePresence) | 4344 | if (update.Entity is ScenePresence) |
4345 | { | 4345 | { |
4346 | // ALL presence updates go into a special list | 4346 | // ALL presence updates go into a special list |
4347 | if (terseAgentUpdateBlocks == null) | ||
4348 | { | ||
4349 | terseAgentUpdateBlocks = new List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>(); | ||
4350 | terseAgentUpdates = new List<EntityUpdate>(); | ||
4351 | } | ||
4347 | terseAgentUpdateBlocks.Add(ablock); | 4352 | terseAgentUpdateBlocks.Add(ablock); |
4348 | terseAgentUpdates.Value.Add(update); | 4353 | terseAgentUpdates.Add(update); |
4349 | } | 4354 | } |
4350 | else | 4355 | else |
4351 | { | 4356 | { |
4352 | // Everything else goes here | 4357 | // Everything else goes here |
4358 | if (terseAgentUpdateBlocks == null) | ||
4359 | { | ||
4360 | terseAgentUpdateBlocks = new List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>(); | ||
4361 | terseAgentUpdates = new List<EntityUpdate>(); | ||
4362 | } | ||
4353 | terseUpdateBlocks.Add(ablock); | 4363 | terseUpdateBlocks.Add(ablock); |
4354 | terseUpdates.Value.Add(update); | 4364 | terseUpdates.Add(update); |
4355 | } | 4365 | } |
4356 | maxUpdatesBytes -= ablock.Length; | 4366 | maxUpdatesBytes -= ablock.Length; |
4357 | } | 4367 | } |
@@ -4362,8 +4372,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4362 | ablock = CreateAvatarUpdateBlock((ScenePresence)update.Entity); | 4372 | ablock = CreateAvatarUpdateBlock((ScenePresence)update.Entity); |
4363 | else | 4373 | else |
4364 | ablock = CreatePrimUpdateBlock((SceneObjectPart)update.Entity, mysp); | 4374 | ablock = CreatePrimUpdateBlock((SceneObjectPart)update.Entity, mysp); |
4375 | if(objectUpdateBlocks == null) | ||
4376 | { | ||
4377 | objectUpdateBlocks = new List<ObjectUpdatePacket.ObjectDataBlock>(); | ||
4378 | objectUpdates = new List<EntityUpdate>(); | ||
4379 | } | ||
4365 | objectUpdateBlocks.Add(ablock); | 4380 | objectUpdateBlocks.Add(ablock); |
4366 | objectUpdates.Value.Add(update); | 4381 | objectUpdates.Add(update); |
4367 | maxUpdatesBytes -= ablock.Length; | 4382 | maxUpdatesBytes -= ablock.Length; |
4368 | } | 4383 | } |
4369 | 4384 | ||
@@ -4379,7 +4394,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4379 | 4394 | ||
4380 | timeDilation = Utils.FloatToUInt16(m_scene.TimeDilation, 0.0f, 1.0f); | 4395 | timeDilation = Utils.FloatToUInt16(m_scene.TimeDilation, 0.0f, 1.0f); |
4381 | 4396 | ||
4382 | if (terseAgentUpdateBlocks.Count > 0) | 4397 | if (terseAgentUpdateBlocks!= null) |
4383 | { | 4398 | { |
4384 | ImprovedTerseObjectUpdatePacket packet | 4399 | ImprovedTerseObjectUpdatePacket packet |
4385 | = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate); | 4400 | = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate); |
@@ -4388,10 +4403,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4388 | packet.ObjectData = terseAgentUpdateBlocks.ToArray(); | 4403 | packet.ObjectData = terseAgentUpdateBlocks.ToArray(); |
4389 | terseAgentUpdateBlocks.Clear(); | 4404 | terseAgentUpdateBlocks.Clear(); |
4390 | 4405 | ||
4391 | OutPacket(packet, ThrottleOutPacketType.Unknown, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseAgentUpdates.Value, oPacket); }); | 4406 | OutPacket(packet, ThrottleOutPacketType.Unknown, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseAgentUpdates, oPacket); }); |
4392 | } | 4407 | } |
4393 | 4408 | ||
4394 | if (objectUpdateBlocks.Count > 0) | 4409 | if (objectUpdateBlocks != null) |
4395 | { | 4410 | { |
4396 | ObjectUpdatePacket packet = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); | 4411 | ObjectUpdatePacket packet = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); |
4397 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | 4412 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; |
@@ -4399,10 +4414,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4399 | packet.ObjectData = objectUpdateBlocks.ToArray(); | 4414 | packet.ObjectData = objectUpdateBlocks.ToArray(); |
4400 | objectUpdateBlocks.Clear(); | 4415 | objectUpdateBlocks.Clear(); |
4401 | 4416 | ||
4402 | OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(objectUpdates.Value, oPacket); }); | 4417 | OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(objectUpdates, oPacket); }); |
4403 | } | 4418 | } |
4404 | 4419 | ||
4405 | if (compressedUpdateBlocks.Count > 0) | 4420 | if (compressedUpdateBlocks != null) |
4406 | { | 4421 | { |
4407 | ObjectUpdateCompressedPacket packet = (ObjectUpdateCompressedPacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdateCompressed); | 4422 | ObjectUpdateCompressedPacket packet = (ObjectUpdateCompressedPacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdateCompressed); |
4408 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | 4423 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; |
@@ -4410,10 +4425,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4410 | packet.ObjectData = compressedUpdateBlocks.ToArray(); | 4425 | packet.ObjectData = compressedUpdateBlocks.ToArray(); |
4411 | compressedUpdateBlocks.Clear(); | 4426 | compressedUpdateBlocks.Clear(); |
4412 | 4427 | ||
4413 | OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(compressedUpdates.Value, oPacket); }); | 4428 | OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(compressedUpdates, oPacket); }); |
4414 | } | 4429 | } |
4415 | 4430 | ||
4416 | if (terseUpdateBlocks.Count > 0) | 4431 | if (terseUpdateBlocks != null) |
4417 | { | 4432 | { |
4418 | ImprovedTerseObjectUpdatePacket packet = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket( | 4433 | ImprovedTerseObjectUpdatePacket packet = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket( |
4419 | PacketType.ImprovedTerseObjectUpdate); | 4434 | PacketType.ImprovedTerseObjectUpdate); |
@@ -4422,39 +4437,42 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4422 | packet.ObjectData = terseUpdateBlocks.ToArray(); | 4437 | packet.ObjectData = terseUpdateBlocks.ToArray(); |
4423 | terseUpdateBlocks.Clear(); | 4438 | terseUpdateBlocks.Clear(); |
4424 | 4439 | ||
4425 | OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseUpdates.Value, oPacket); }); | 4440 | OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseUpdates, oPacket); }); |
4426 | } | 4441 | } |
4427 | 4442 | ||
4428 | foreach (SceneObjectPart sop in ObjectAnimationUpdates.Value) | 4443 | if(ObjectAnimationUpdates != null) |
4429 | { | 4444 | { |
4430 | if (sop.Animations == null) | 4445 | foreach (SceneObjectPart sop in ObjectAnimationUpdates) |
4431 | continue; | 4446 | { |
4432 | SceneObjectGroup sog = sop.ParentGroup; | 4447 | if (sop.Animations == null) |
4433 | if (sog == null || sog.IsDeleted) | 4448 | continue; |
4434 | continue; | 4449 | SceneObjectGroup sog = sop.ParentGroup; |
4450 | if (sog == null || sog.IsDeleted) | ||
4451 | continue; | ||
4435 | 4452 | ||
4436 | SceneObjectPart root = sog.RootPart; | 4453 | SceneObjectPart root = sog.RootPart; |
4437 | if (root == null || root.Shape == null || !root.Shape.MeshFlagEntry) | 4454 | if (root == null || root.Shape == null || !root.Shape.MeshFlagEntry) |
4438 | continue; | 4455 | continue; |
4439 | 4456 | ||
4440 | UUID[] ids = null; | 4457 | UUID[] ids = null; |
4441 | int[] seqs = null; | 4458 | int[] seqs = null; |
4442 | int count = sop.GetAnimations(out ids, out seqs); | 4459 | int count = sop.GetAnimations(out ids, out seqs); |
4443 | if(count < 0) | 4460 | if(count < 0) |
4444 | continue; | 4461 | continue; |
4445 | 4462 | ||
4446 | ObjectAnimationPacket ani = (ObjectAnimationPacket)PacketPool.Instance.GetPacket(PacketType.ObjectAnimation); | 4463 | ObjectAnimationPacket ani = (ObjectAnimationPacket)PacketPool.Instance.GetPacket(PacketType.ObjectAnimation); |
4447 | ani.Sender = new ObjectAnimationPacket.SenderBlock(); | 4464 | ani.Sender = new ObjectAnimationPacket.SenderBlock(); |
4448 | ani.Sender.ID = sop.UUID; | 4465 | ani.Sender.ID = sop.UUID; |
4449 | ani.AnimationList = new ObjectAnimationPacket.AnimationListBlock[sop.Animations.Count]; | 4466 | ani.AnimationList = new ObjectAnimationPacket.AnimationListBlock[sop.Animations.Count]; |
4450 | 4467 | ||
4451 | for(int i = 0; i< count; i++) | 4468 | for(int i = 0; i< count; i++) |
4452 | { | 4469 | { |
4453 | ani.AnimationList[i] = new ObjectAnimationPacket.AnimationListBlock(); | 4470 | ani.AnimationList[i] = new ObjectAnimationPacket.AnimationListBlock(); |
4454 | ani.AnimationList[i].AnimID = ids[i]; | 4471 | ani.AnimationList[i].AnimID = ids[i]; |
4455 | ani.AnimationList[i].AnimSequenceID = seqs[i]; | 4472 | ani.AnimationList[i].AnimSequenceID = seqs[i]; |
4473 | } | ||
4474 | OutPacket(ani, ThrottleOutPacketType.Task, true); | ||
4456 | } | 4475 | } |
4457 | OutPacket(ani, ThrottleOutPacketType.Task); | ||
4458 | } | 4476 | } |
4459 | 4477 | ||
4460 | #endregion Packet Sending | 4478 | #endregion Packet Sending |
@@ -5750,14 +5768,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5750 | 5768 | ||
5751 | // Don't send texture entry for avatars here - this is accomplished via the AvatarAppearance packet | 5769 | // Don't send texture entry for avatars here - this is accomplished via the AvatarAppearance packet |
5752 | update.TextureEntry = Utils.EmptyBytes; | 5770 | update.TextureEntry = Utils.EmptyBytes; |
5753 | // update.TextureEntry = (data.Appearance.Texture != null) ? data.Appearance.Texture.GetBytes() : Utils.EmptyBytes; | ||
5754 | |||
5755 | /* all this flags seem related to prims and not avatars. This allow for wrong viewer side move of a avatar in prim edition mode (anv mantis 854) | ||
5756 | update.UpdateFlags = (uint)( | ||
5757 | PrimFlags.Physics | PrimFlags.ObjectModify | PrimFlags.ObjectCopy | PrimFlags.ObjectAnyOwner | | ||
5758 | PrimFlags.ObjectYouOwner | PrimFlags.ObjectMove | PrimFlags.InventoryEmpty | PrimFlags.ObjectTransfer | | ||
5759 | PrimFlags.ObjectOwnerModify); | ||
5760 | */ | ||
5761 | update.UpdateFlags = 0; | 5771 | update.UpdateFlags = 0; |
5762 | 5772 | ||
5763 | return update; | 5773 | return update; |