From a54758eef38e911fcdca1cf200e97f56d6bf5e8f Mon Sep 17 00:00:00 2001 From: diva Date: Fri, 13 Feb 2009 00:49:58 +0000 Subject: [PATCH] Bug fix in prim crossing: making it clear when the local object needs to be cloned (regions on the same instance) and when it doesn't (regions on different instances). --- .../Communications/Local/LocalInterregionComms.cs | 15 ++++++++++++--- .../Communications/REST/RESTInterregionComms.cs | 6 +++--- .../Framework/Interfaces/IInterregionComms.cs | 2 +- OpenSim/Region/Framework/Scenes/Scene.cs | 2 +- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/CoreModules/Communications/Local/LocalInterregionComms.cs b/OpenSim/Region/CoreModules/Communications/Local/LocalInterregionComms.cs index 48f737e39d..6e813f46c8 100644 --- a/OpenSim/Region/CoreModules/Communications/Local/LocalInterregionComms.cs +++ b/OpenSim/Region/CoreModules/Communications/Local/LocalInterregionComms.cs @@ -204,15 +204,24 @@ namespace OpenSim.Region.CoreModules.Communications.Local * Object-related communications */ - public bool SendCreateObject(ulong regionHandle, ISceneObject sog) + public bool SendCreateObject(ulong regionHandle, ISceneObject sog, bool isLocalCall) { foreach (Scene s in m_sceneList) { if (s.RegionInfo.RegionHandle == regionHandle) { //m_log.Debug("[LOCAL COMMS]: Found region to SendCreateObject"); - ISceneObject sogClone = sog.CloneForNewScene(); - return s.IncomingCreateObject(sogClone); + if (isLocalCall) + { + // We need to make a local copy of the object + ISceneObject sogClone = sog.CloneForNewScene(); + return s.IncomingCreateObject(sogClone); + } + else + { + // Use the object as it came through the wire + return s.IncomingCreateObject(sog); + } } } return false; diff --git a/OpenSim/Region/CoreModules/Communications/REST/RESTInterregionComms.cs b/OpenSim/Region/CoreModules/Communications/REST/RESTInterregionComms.cs index afc34419d0..f533553f00 100644 --- a/OpenSim/Region/CoreModules/Communications/REST/RESTInterregionComms.cs +++ b/OpenSim/Region/CoreModules/Communications/REST/RESTInterregionComms.cs @@ -214,10 +214,10 @@ namespace OpenSim.Region.CoreModules.Communications.REST * Object-related communications */ - public bool SendCreateObject(ulong regionHandle, ISceneObject sog) + public bool SendCreateObject(ulong regionHandle, ISceneObject sog, bool isLocalCall) { // Try local first - if (m_localBackend.SendCreateObject(regionHandle, sog)) + if (m_localBackend.SendCreateObject(regionHandle, sog, true)) { //m_log.Debug("[REST COMMS]: LocalBackEnd SendCreateObject succeeded"); return true; @@ -865,7 +865,7 @@ namespace OpenSim.Region.CoreModules.Communications.REST } } // This is the meaning of POST object - bool result = m_localBackend.SendCreateObject(regionhandle, sog); + bool result = m_localBackend.SendCreateObject(regionhandle, sog, false); responsedata["int_response_code"] = 200; responsedata["str_response_string"] = result.ToString(); diff --git a/OpenSim/Region/Framework/Interfaces/IInterregionComms.cs b/OpenSim/Region/Framework/Interfaces/IInterregionComms.cs index 06ef1aaa71..d3f44bbcca 100644 --- a/OpenSim/Region/Framework/Interfaces/IInterregionComms.cs +++ b/OpenSim/Region/Framework/Interfaces/IInterregionComms.cs @@ -70,7 +70,7 @@ namespace OpenSim.Region.Framework.Interfaces /// bool SendCloseAgent(ulong regionHandle, UUID id); - bool SendCreateObject(ulong regionHandle, ISceneObject sog); + bool SendCreateObject(ulong regionHandle, ISceneObject sog, bool isLocalCall); } diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 30b44b15b2..ffe0b819a5 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2028,7 +2028,7 @@ namespace OpenSim.Region.Framework.Scenes // And the new channel... if (m_interregionCommsOut != null) - successYN = m_interregionCommsOut.SendCreateObject(newRegionHandle, grp); + successYN = m_interregionCommsOut.SendCreateObject(newRegionHandle, grp, true); if (successYN) {