Prevent object loss and positioning outside the region with failed object sim
crossingsavinationmerge
parent
acfe7e555e
commit
e321306517
|
@ -1731,17 +1731,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[ENTITY TRANSFER MODULE] cross region transfer failed for object {0}",grp.UUID);
|
m_log.InfoFormat("[ENTITY TRANSFER MODULE] cross region transfer failed for object {0}",grp.UUID);
|
||||||
|
|
||||||
|
// Need to turn off the physics flags, otherwise the object will continue to attempt to
|
||||||
|
// move out of the region creating an infinite loop of failed attempts to cross
|
||||||
|
grp.UpdatePrimFlags(grp.RootPart.LocalId,false,grp.IsTemporary,grp.IsPhantom,false);
|
||||||
|
|
||||||
// We are going to move the object back to the old position so long as the old position
|
// We are going to move the object back to the old position so long as the old position
|
||||||
// is in the region
|
// is in the region
|
||||||
oldGroupPosition.X = Util.Clamp<float>(oldGroupPosition.X,1.0f,(float)Constants.RegionSize-1);
|
oldGroupPosition.X = Util.Clamp<float>(oldGroupPosition.X,1.0f,(float)Constants.RegionSize-1);
|
||||||
oldGroupPosition.Y = Util.Clamp<float>(oldGroupPosition.Y,1.0f,(float)Constants.RegionSize-1);
|
oldGroupPosition.Y = Util.Clamp<float>(oldGroupPosition.Y,1.0f,(float)Constants.RegionSize-1);
|
||||||
oldGroupPosition.Z = Util.Clamp<float>(oldGroupPosition.Z,1.0f,4096.0f);
|
oldGroupPosition.Z = Util.Clamp<float>(oldGroupPosition.Z,1.0f,4096.0f);
|
||||||
|
|
||||||
grp.RootPart.GroupPosition = oldGroupPosition;
|
grp.AbsolutePosition = oldGroupPosition;
|
||||||
|
|
||||||
// Need to turn off the physics flags, otherwise the object will continue to attempt to
|
|
||||||
// move out of the region creating an infinite loop of failed attempts to cross
|
|
||||||
grp.UpdatePrimFlags(grp.RootPart.LocalId,false,grp.IsTemporary,grp.IsPhantom,false);
|
|
||||||
|
|
||||||
grp.ScheduleGroupForFullUpdate();
|
grp.ScheduleGroupForFullUpdate();
|
||||||
}
|
}
|
||||||
|
|
|
@ -466,6 +466,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
&& !IsAttachmentCheckFull() && (!Scene.LoadingPrims))
|
&& !IsAttachmentCheckFull() && (!Scene.LoadingPrims))
|
||||||
{
|
{
|
||||||
m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
|
m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
|
||||||
|
|
||||||
|
if (IsDeleted)
|
||||||
|
return;
|
||||||
|
val = AbsolutePosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2188,7 +2188,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
if (part.ParentGroup.RootPart == part)
|
if (part.ParentGroup.RootPart == part)
|
||||||
{
|
{
|
||||||
SceneObjectGroup parent = part.ParentGroup;
|
SceneObjectGroup parent = part.ParentGroup;
|
||||||
|
Util.FireAndForget(delegate(object x) {
|
||||||
parent.UpdateGroupPosition(new Vector3((float)toPos.x, (float)toPos.y, (float)toPos.z));
|
parent.UpdateGroupPosition(new Vector3((float)toPos.x, (float)toPos.y, (float)toPos.z));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -7973,7 +7975,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
if (part.ParentGroup.RootPart == part)
|
if (part.ParentGroup.RootPart == part)
|
||||||
{
|
{
|
||||||
SceneObjectGroup parent = part.ParentGroup;
|
SceneObjectGroup parent = part.ParentGroup;
|
||||||
|
Util.FireAndForget(delegate(object x) {
|
||||||
parent.UpdateGroupPosition(new Vector3((float)currentPosition.x, (float)currentPosition.y, (float)currentPosition.z));
|
parent.UpdateGroupPosition(new Vector3((float)currentPosition.x, (float)currentPosition.y, (float)currentPosition.z));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -7990,7 +7994,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
if (part.ParentGroup.RootPart == part)
|
if (part.ParentGroup.RootPart == part)
|
||||||
{
|
{
|
||||||
SceneObjectGroup parent = part.ParentGroup;
|
SceneObjectGroup parent = part.ParentGroup;
|
||||||
|
Util.FireAndForget(delegate(object x) {
|
||||||
parent.UpdateGroupPosition(new Vector3((float)currentPosition.x, (float)currentPosition.y, (float)currentPosition.z));
|
parent.UpdateGroupPosition(new Vector3((float)currentPosition.x, (float)currentPosition.y, (float)currentPosition.z));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -433,11 +433,14 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||||
args["destination_name"] = OSD.FromString(destination.RegionName);
|
args["destination_name"] = OSD.FromString(destination.RegionName);
|
||||||
args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
|
args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
|
||||||
|
|
||||||
WebUtil.PostToService(uri, args, 40000);
|
OSDMap response = WebUtil.PostToService(uri, args, 40000);
|
||||||
|
if (response["Success"] == "False")
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR] CreateObject failed with exception; {0}",e.ToString());
|
m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR] CreateObject failed with exception; {0}",e.ToString());
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue