Finished moving object crossings into EntityTransferModule

slimupdates
Diva Canto 2010-01-16 08:42:20 -08:00
parent 5ce12c92d9
commit ee1fb81376
3 changed files with 3 additions and 301 deletions

View File

@ -339,7 +339,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
m_aScene.SimulationService.UpdateAgent(reg, agent); m_aScene.SimulationService.UpdateAgent(reg, agent);
m_log.DebugFormat( m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Sending new ENTITY TRANSFER MODULE seed url {0} to client {1}", capsPath, sp.UUID); "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, sp.UUID);
if (eq != null) if (eq != null)
@ -745,7 +745,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
"http://" + neighbourRegion.ExternalHostName + ":" + neighbourRegion.HttpPort "http://" + neighbourRegion.ExternalHostName + ":" + neighbourRegion.HttpPort
+ "/CAPS/" + agentcaps /*circuitdata.CapsPath*/ + "0000/"; + "/CAPS/" + agentcaps /*circuitdata.CapsPath*/ + "0000/";
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new ENTITY TRANSFER MODULE seed url {0} to client {1}", capsPath, agent.UUID); m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>(); IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>();
if (eq != null) if (eq != null)
@ -1046,7 +1046,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
eq.EnableSimulator(reg.RegionHandle, endPoint, sp.UUID); eq.EnableSimulator(reg.RegionHandle, endPoint, sp.UUID);
eq.EstablishAgentCommunication(sp.UUID, endPoint, capsPath); eq.EstablishAgentCommunication(sp.UUID, endPoint, capsPath);
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new ENTITY TRANSFER MODULE seed url {0} to client {1} in region {2}", m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1} in region {2}",
capsPath, sp.UUID, sp.Scene.RegionInfo.RegionName); capsPath, sp.UUID, sp.Scene.RegionInfo.RegionName);
} }
else else

View File

@ -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 /// Move the given scene object into a new region depending on which region its absolute position has moved
/// into. /// into.
/// ///
/// This method locates the new region handle and offsets the prim position for the new region
/// </summary> /// </summary>
/// <param name="attemptedPosition">the attempted out of region position of the scene object</param> /// <param name="attemptedPosition">the attempted out of region position of the scene object</param>
/// <param name="grp">the scene object that we're crossing</param> /// <param name="grp">the scene object that we're crossing</param>
@ -2054,202 +2053,6 @@ namespace OpenSim.Region.Framework.Scenes
if (m_teleportModule != null) if (m_teleportModule != null)
m_teleportModule.Cross(grp, attemptedPosition, silent); 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) public Border GetCrossedBorder(Vector3 position, Cardinals gridline)
@ -2432,77 +2235,6 @@ namespace OpenSim.Region.Framework.Scenes
} }
/// <summary>
/// Move the given scene object into a new region
/// </summary>
/// <param name="newRegionHandle"></param>
/// <param name="grp">Scene Object Group that we're crossing</param>
/// <returns>
/// 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
/// </returns>
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) public bool IncomingCreateObject(ISceneObject sog)
{ {
//m_log.Debug(" >>> IncomingCreateObject <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); //m_log.Debug(" >>> IncomingCreateObject <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted);

View File

@ -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) public void initializeScenePresence(IClientAPI client, RegionInfo region, Scene scene)
{ {