From 917d753f1c1474b4ed3f905d8dd95db2e0e2fc9e Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 14 Jun 2012 01:36:37 +0100 Subject: [PATCH 1/6] Fix a race condition where an object update for a hud could be sent to non-owner avatars if the hud was attached directly from within the region. If this happens, then the non-owners would see unremovable huds that they did not own until relog, and sometimes even beyond that. This was due to a race between the entity update and the attachment code when moving an object from within scene to a hud. --- .../ClientStack/Linden/UDP/LLClientView.cs | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 85d83f8486..83e49f318e 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -3722,8 +3722,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } - ++updatesThisCall; - #region UpdateFlags to packet type conversion PrimUpdateFlags updateFlags = (PrimUpdateFlags)update.Flags; @@ -3788,7 +3786,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP } else { - updateBlock = CreatePrimUpdateBlock((SceneObjectPart)update.Entity, AgentId); + SceneObjectPart part = (SceneObjectPart)update.Entity; + updateBlock = CreatePrimUpdateBlock(part, AgentId); + + // If the part has become a private hud since the update was scheduled then we do not + // want to send it to other avatars. + if (part.ParentGroup.IsAttachment + && part.ParentGroup.HasPrivateAttachmentPoint + && part.ParentGroup.AttachedAvatar != AgentId) + continue; } objectUpdateBlocks.Value.Add(updateBlock); @@ -3811,6 +3817,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP { // Everything else goes here terseUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures))); + + if (update.Entity is SceneObjectPart) + { + SceneObjectPart part = (SceneObjectPart)update.Entity; + + // If the part has become a private hud since the update was scheduled then we do not + // want to send it to other avatars. + if (part.ParentGroup.IsAttachment + && part.ParentGroup.HasPrivateAttachmentPoint + && part.ParentGroup.AttachedAvatar != AgentId) + continue; + } + terseUpdates.Value.Add(update); } } @@ -3880,6 +3899,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP // If any of the packets created from this call go unacknowledged, all of the updates will be resent OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseUpdates.Value, oPacket); }); } + + ++updatesThisCall; } #endregion Packet Sending From 3c3ea196201b56407ccf6c21229064f7954c716d Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 14 Jun 2012 02:26:38 +0100 Subject: [PATCH 2/6] Fix a bug where scene objects attached as HUDs through scripts would not disappear for other avatars. We do this by sending a kill message for that object to all other avatars apart from the one that has the hud. --- .../Avatar/Attachments/AttachmentsModule.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 88071f6184..d47b1abbf5 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -562,6 +562,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments { m_scene.SendKillObject(new List { so.RootPart.LocalId }); } + else if (so.HasPrivateAttachmentPoint) + { +// m_log.DebugFormat( +// "[ATTACHMENTS MODULE]: Killing private HUD {0} for avatars other than {1} at attachment point {2}", +// so.Name, sp.Name, so.AttachmentPoint); + + // Remove the client from everyone in the + m_scene.ForEachClient( + client => + { if (client.AgentId != so.AttachedAvatar) + client.SendKillObject(m_scene.RegionInfo.RegionHandle, new List() { so.LocalId }); + }); + } so.IsSelected = false; // fudge.... so.ScheduleGroupForFullUpdate(); From 1aa746925314dea88ab18cef6cb91072993f1bd3 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 14 Jun 2012 02:30:40 +0100 Subject: [PATCH 3/6] correct wrong incomplete comment from previous commit 3c3ea19 in AttachmentsModule --- .../Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index d47b1abbf5..b74c0ba646 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -568,7 +568,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments // "[ATTACHMENTS MODULE]: Killing private HUD {0} for avatars other than {1} at attachment point {2}", // so.Name, sp.Name, so.AttachmentPoint); - // Remove the client from everyone in the + // As this scene object can now only be seen by the attaching avatar, tell everybody else in the + // scene that it's no longer in their awareness. m_scene.ForEachClient( client => { if (client.AgentId != so.AttachedAvatar) From 3888b9a670656cbcdcb5e6cd46365927a1888f27 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 14 Jun 2012 03:32:44 +0100 Subject: [PATCH 4/6] If we're going to discard a terse update block because it's now someone else's hud, then don't still add it to the list of blocks for the update message. --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 9f32c33d0b..4ea977eefd 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -3828,9 +3828,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP } else { - // Everything else goes here - terseUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures))); + ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseUpdateBlock + = CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures)); + // Everything else goes here if (update.Entity is SceneObjectPart) { SceneObjectPart part = (SceneObjectPart)update.Entity; @@ -3843,6 +3844,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP continue; } + terseUpdateBlocks.Value.Add(terseUpdateBlock); terseUpdates.Value.Add(update); } } From 2c6555021fdcf5dcd08a19d41412acf20f514b14 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 14 Jun 2012 03:49:54 +0100 Subject: [PATCH 5/6] Fix very recent regression in 917d753 where I put the ++updatesThisCall outside the batching part of ProcessEntityUpdates() This stopped any batching happening and since this method is called periodically updates were sent very slowly --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 4ea977eefd..4cb7a3a5d4 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -3848,6 +3848,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP terseUpdates.Value.Add(update); } } + + ++updatesThisCall; #endregion Block Construction } @@ -3914,8 +3916,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP // If any of the packets created from this call go unacknowledged, all of the updates will be resent OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseUpdates.Value, oPacket); }); } - - ++updatesThisCall; } #endregion Packet Sending From f4b02f8e39b9e437a5f5ce4ffc307354fa39bd39 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 14 Jun 2012 04:29:15 +0100 Subject: [PATCH 6/6] Fix a regression in BaseHttpServer.HandleXmlRpcRequests() from recent c6e3752 Accidentally make responseString null by default instead of String.Empty. It needs to be something in case the XmlRpcRequest deserialize throws an exception due to bad xml (a failure which we silently swallow!) --- OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index ef6e2594c4..9064464239 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -786,7 +786,7 @@ namespace OpenSim.Framework.Servers.HttpServer requestStream.Close(); //m_log.Debug(requestBody); requestBody = requestBody.Replace("", ""); - string responseString = null; + string responseString = String.Empty; XmlRpcRequest xmlRprcRequest = null; try