From 5aa56b12743c19a68cb371609be797e5fb3e2c4b Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 28 Jul 2010 18:55:29 +0100 Subject: [PATCH] Fix problem where changes to media textures for prims duplicated by shify copy would change both prims until server restart I also found out that you can crash the current viewer by giving it more media entrys than it's expecting --- .../World/Media/Moap/MoapModule.cs | 18 +++++++++--------- .../World/Permissions/PermissionsModule.cs | 12 ++++++------ .../Framework/Scenes/SceneObjectPart.cs | 19 ++++++++++++++++++- 3 files changed, 33 insertions(+), 16 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs index d53f573cab..6d74b8e503 100644 --- a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs +++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs @@ -350,9 +350,9 @@ namespace OpenSim.Region.CoreModules.Media.Moap if (null == part) { -// m_log.WarnFormat( -// "[MOAP]: Received a GET ObjectMediaRequest for prim {0} but this doesn't exist in region {1}", -// primId, m_scene.RegionInfo.RegionName); + m_log.WarnFormat( + "[MOAP]: Received a GET ObjectMediaRequest for prim {0} but this doesn't exist in region {1}", + primId, m_scene.RegionInfo.RegionName); return string.Empty; } @@ -386,9 +386,9 @@ namespace OpenSim.Region.CoreModules.Media.Moap if (null == part) { -// m_log.WarnFormat( -// "[MOAP]: Received an UPDATE ObjectMediaRequest for prim {0} but this doesn't exist in region {1}", -// primId, m_scene.RegionInfo.RegionName); + m_log.WarnFormat( + "[MOAP]: Received an UPDATE ObjectMediaRequest for prim {0} but this doesn't exist in region {1}", + primId, m_scene.RegionInfo.RegionName); return string.Empty; } @@ -403,9 +403,9 @@ namespace OpenSim.Region.CoreModules.Media.Moap if (omu.FaceMedia.Length > part.GetNumberOfSides()) { -// m_log.WarnFormat( -// "[MOAP]: Received {0} media entries from client for prim {1} {2} but this prim has only {3} faces. Dropping request.", -// omu.FaceMedia.Length, part.Name, part.UUID, part.GetNumberOfSides()); + m_log.WarnFormat( + "[MOAP]: Received {0} media entries from client for prim {1} {2} but this prim has only {3} faces. Dropping request.", + omu.FaceMedia.Length, part.Name, part.UUID, part.GetNumberOfSides()); return string.Empty; } diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 982ac523a4..3a642f4292 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -1923,9 +1923,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (null == me) return true; - m_log.DebugFormat( - "[PERMISSIONS]: Checking CanControlPrimMedia for {0} on {1} face {2} with control permissions {3}", - agentID, primID, face, me.ControlPermissions); +// m_log.DebugFormat( +// "[PERMISSIONS]: Checking CanControlPrimMedia for {0} on {1} face {2} with control permissions {3}", +// agentID, primID, face, me.ControlPermissions); return GenericPrimMediaPermission(part, agentID, me.ControlPermissions); } @@ -1949,9 +1949,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (null == me) return true; - m_log.DebugFormat( - "[PERMISSIONS]: Checking CanInteractWithPrimMedia for {0} on {1} face {2} with interact permissions {3}", - agentID, primID, face, me.InteractPermissions); +// m_log.DebugFormat( +// "[PERMISSIONS]: Checking CanInteractWithPrimMedia for {0} on {1} face {2} with interact permissions {3}", +// agentID, primID, face, me.InteractPermissions); return GenericPrimMediaPermission(part, agentID, me.InteractPermissions); } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 444a23938c..085da191ca 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1617,7 +1617,24 @@ namespace OpenSim.Region.Framework.Scenes dupe.DoPhysicsPropertyUpdate(UsePhysics, true); } - return dupe; + if (Shape.Media != null) + { + List dupeMedia = new List(); + + foreach (MediaEntry me in Shape.Media) + { + if (me != null) + dupeMedia.Add(MediaEntry.FromOSD(me.GetOSD())); + else + dupeMedia.Add(null); + } + + dupe.Shape.Media = dupeMedia; + } + +// m_log.DebugFormat("[SCENE OBJECT PART]: Clone of {0} {1} finished", Name, UUID); + + return dupe; } protected void AssetReceived(string id, Object sender, AssetBase asset)