From ee1fb81376041f6eef27bbb3e84b56ae6e2357b3 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sat, 16 Jan 2010 08:42:20 -0800
Subject: Finished moving object crossings into EntityTransferModule
---
OpenSim/Region/Framework/Scenes/Scene.cs | 268 -----------------------
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 30 ---
2 files changed, 298 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index bd753cc..5654f67 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2040,7 +2040,6 @@ namespace OpenSim.Region.Framework.Scenes
/// Move the given scene object into a new region depending on which region its absolute position has moved
/// into.
///
- /// This method locates the new region handle and offsets the prim position for the new region
///
/// the attempted out of region position of the scene object
/// the scene object that we're crossing
@@ -2054,202 +2053,6 @@ namespace OpenSim.Region.Framework.Scenes
if (m_teleportModule != null)
m_teleportModule.Cross(grp, attemptedPosition, silent);
- //if (grp.RootPart.DIE_AT_EDGE)
- //{
- // // We remove the object here
- // try
- // {
- // DeleteSceneObject(grp, false);
- // }
- // catch (Exception)
- // {
- // m_log.Warn("[DATABASE]: exception when trying to remove the prim that crossed the border.");
- // }
- // return;
- //}
-
- //int thisx = (int)RegionInfo.RegionLocX;
- //int thisy = (int)RegionInfo.RegionLocY;
- //Vector3 EastCross = new Vector3(0.1f,0,0);
- //Vector3 WestCross = new Vector3(-0.1f, 0, 0);
- //Vector3 NorthCross = new Vector3(0, 0.1f, 0);
- //Vector3 SouthCross = new Vector3(0, -0.1f, 0);
-
-
- //// use this if no borders were crossed!
- //ulong newRegionHandle
- // = Util.UIntsToLong((uint)((thisx) * Constants.RegionSize),
- // (uint)((thisy) * Constants.RegionSize));
-
- //Vector3 pos = attemptedPosition;
-
- //int changeX = 1;
- //int changeY = 1;
-
- //if (TestBorderCross(attemptedPosition + WestCross, Cardinals.W))
- //{
- // if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S))
- // {
-
- // Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W);
-
- // if (crossedBorderx.BorderLine.Z > 0)
- // {
- // pos.X = ((pos.X + crossedBorderx.BorderLine.Z));
- // changeX = (int)(crossedBorderx.BorderLine.Z /(int) Constants.RegionSize);
- // }
- // else
- // pos.X = ((pos.X + Constants.RegionSize));
-
- // Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S);
- // //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize)
-
- // if (crossedBordery.BorderLine.Z > 0)
- // {
- // pos.Y = ((pos.Y + crossedBordery.BorderLine.Z));
- // changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize);
- // }
- // else
- // pos.Y = ((pos.Y + Constants.RegionSize));
-
-
-
- // newRegionHandle
- // = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize),
- // (uint)((thisy - changeY) * Constants.RegionSize));
- // // x - 1
- // // y - 1
- // }
- // else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N))
- // {
- // Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W);
-
- // if (crossedBorderx.BorderLine.Z > 0)
- // {
- // pos.X = ((pos.X + crossedBorderx.BorderLine.Z));
- // changeX = (int)(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize);
- // }
- // else
- // pos.X = ((pos.X + Constants.RegionSize));
-
-
- // Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S);
- // //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize)
-
- // if (crossedBordery.BorderLine.Z > 0)
- // {
- // pos.Y = ((pos.Y + crossedBordery.BorderLine.Z));
- // changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize);
- // }
- // else
- // pos.Y = ((pos.Y + Constants.RegionSize));
-
- // newRegionHandle
- // = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize),
- // (uint)((thisy + changeY) * Constants.RegionSize));
- // // x - 1
- // // y + 1
- // }
- // else
- // {
- // Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W);
-
- // if (crossedBorderx.BorderLine.Z > 0)
- // {
- // pos.X = ((pos.X + crossedBorderx.BorderLine.Z));
- // changeX = (int)(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize);
- // }
- // else
- // pos.X = ((pos.X + Constants.RegionSize));
-
- // newRegionHandle
- // = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize),
- // (uint) (thisy*Constants.RegionSize));
- // // x - 1
- // }
- //}
- //else if (TestBorderCross(attemptedPosition + EastCross, Cardinals.E))
- //{
- // if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S))
- // {
-
- // pos.X = ((pos.X - Constants.RegionSize));
- // Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S);
- // //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize)
-
- // if (crossedBordery.BorderLine.Z > 0)
- // {
- // pos.Y = ((pos.Y + crossedBordery.BorderLine.Z));
- // changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize);
- // }
- // else
- // pos.Y = ((pos.Y + Constants.RegionSize));
-
-
- // newRegionHandle
- // = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize),
- // (uint)((thisy - changeY) * Constants.RegionSize));
- // // x + 1
- // // y - 1
- // }
- // else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N))
- // {
- // pos.X = ((pos.X - Constants.RegionSize));
- // pos.Y = ((pos.Y - Constants.RegionSize));
- // newRegionHandle
- // = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize),
- // (uint)((thisy + changeY) * Constants.RegionSize));
- // // x + 1
- // // y + 1
- // }
- // else
- // {
- // pos.X = ((pos.X - Constants.RegionSize));
- // newRegionHandle
- // = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize),
- // (uint) (thisy*Constants.RegionSize));
- // // x + 1
- // }
- //}
- //else if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S))
- //{
- // Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S);
- // //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize)
-
- // if (crossedBordery.BorderLine.Z > 0)
- // {
- // pos.Y = ((pos.Y + crossedBordery.BorderLine.Z));
- // changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize);
- // }
- // else
- // pos.Y = ((pos.Y + Constants.RegionSize));
-
- // newRegionHandle
- // = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy - changeY) * Constants.RegionSize));
- // // y - 1
- //}
- //else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N))
- //{
-
- // pos.Y = ((pos.Y - Constants.RegionSize));
- // newRegionHandle
- // = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy + changeY) * Constants.RegionSize));
- // // y + 1
- //}
-
- //// Offset the positions for the new region across the border
- //Vector3 oldGroupPosition = grp.RootPart.GroupPosition;
- //grp.OffsetForNewRegion(pos);
-
- //// If we fail to cross the border, then reset the position of the scene object on that border.
- //uint x = 0, y = 0;
- //Utils.LongToUInts(newRegionHandle, out x, out y);
- //GridRegion destination = GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
- //if (destination != null && !CrossPrimGroupIntoNewRegion(destination, grp, silent))
- //{
- // grp.OffsetForNewRegion(oldGroupPosition);
- // grp.ScheduleGroupForFullUpdate();
- //}
}
public Border GetCrossedBorder(Vector3 position, Cardinals gridline)
@@ -2432,77 +2235,6 @@ namespace OpenSim.Region.Framework.Scenes
}
- ///
- /// Move the given scene object into a new region
- ///
- ///
- /// Scene Object Group that we're crossing
- ///
- /// true if the crossing itself was successful, false on failure
- /// FIMXE: we still return true if the crossing object was not successfully deleted from the originating region
- ///
- public bool CrossPrimGroupIntoNewRegion(GridRegion destination, SceneObjectGroup grp, bool silent)
- {
- //m_log.Debug(" >>> CrossPrimGroupIntoNewRegion <<<");
-
- bool successYN = false;
- grp.RootPart.UpdateFlag = 0;
- //int primcrossingXMLmethod = 0;
-
- if (destination != null)
- {
- //string objectState = grp.GetStateSnapshot();
-
- //successYN
- // = m_sceneGridService.PrimCrossToNeighboringRegion(
- // newRegionHandle, grp.UUID, m_serialiser.SaveGroupToXml2(grp), primcrossingXMLmethod);
- //if (successYN && (objectState != "") && m_allowScriptCrossings)
- //{
- // successYN = m_sceneGridService.PrimCrossToNeighboringRegion(
- // newRegionHandle, grp.UUID, objectState, 100);
- //}
-
- //// And the new channel...
- //if (m_interregionCommsOut != null)
- // successYN = m_interregionCommsOut.SendCreateObject(newRegionHandle, grp, true);
- if (m_simulationService != null)
- successYN = m_simulationService.CreateObject(destination, grp, true);
-
- if (successYN)
- {
- // We remove the object here
- try
- {
- DeleteSceneObject(grp, silent);
- }
- catch (Exception e)
- {
- m_log.ErrorFormat(
- "[INTERREGION]: Exception deleting the old object left behind on a border crossing for {0}, {1}",
- grp, e);
- }
- }
- else
- {
- if (!grp.IsDeleted)
- {
- if (grp.RootPart.PhysActor != null)
- {
- grp.RootPart.PhysActor.CrossingFailure();
- }
- }
-
- m_log.ErrorFormat("[INTERREGION]: Prim crossing failed for {0}", grp);
- }
- }
- else
- {
- m_log.Error("[INTERREGION]: destination was unexpectedly null in Scene.CrossPrimGroupIntoNewRegion()");
- }
-
- return successYN;
- }
-
public bool IncomingCreateObject(ISceneObject sog)
{
//m_log.Debug(" >>> IncomingCreateObject <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted);
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index d185fba..afb5b9a 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3431,36 +3431,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- public bool CrossAttachmentsIntoNewRegion(GridRegion destination, bool silent)
- {
- lock (m_attachments)
- {
- // Validate
- foreach (SceneObjectGroup gobj in m_attachments)
- {
- if (gobj == null || gobj.IsDeleted)
- return false;
- }
-
- foreach (SceneObjectGroup gobj in m_attachments)
- {
- // If the prim group is null then something must have happened to it!
- if (gobj != null && gobj.RootPart != null)
- {
- // Set the parent localID to 0 so it transfers over properly.
- gobj.RootPart.SetParentLocalId(0);
- gobj.AbsolutePosition = gobj.RootPart.AttachedPos;
- gobj.RootPart.IsAttachment = false;
- //gobj.RootPart.LastOwnerID = gobj.GetFromAssetID();
- m_log.DebugFormat("[ATTACHMENT]: Sending attachment {0} to region {1}", gobj.UUID, destination.RegionName);
- m_scene.CrossPrimGroupIntoNewRegion(destination, gobj, silent);
- }
- }
- m_attachments.Clear();
-
- return true;
- }
- }
public void initializeScenePresence(IClientAPI client, RegionInfo region, Scene scene)
{
--
cgit v1.1