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).

This commit is contained in:
diva
2009-02-13 00:49:58 +00:00
parent ebf268a593
commit a54758eef3
4 changed files with 17 additions and 8 deletions

View File

@@ -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;

View File

@@ -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();