diff options
author | Melanie | 2012-02-23 01:40:30 +0000 |
---|---|---|
committer | Melanie | 2012-02-23 01:40:30 +0000 |
commit | 1dfc9902649bfb4f02340644a0589fe139a3322a (patch) | |
tree | 631a932e9317c50d96c7dbaa91ffc675421a9b48 /OpenSim/Region/CoreModules/Framework | |
parent | Restore the taskItem null check that I accidentally blatted in 5397a6d (diff) | |
download | opensim-SC_OLD-1dfc9902649bfb4f02340644a0589fe139a3322a.zip opensim-SC_OLD-1dfc9902649bfb4f02340644a0589fe139a3322a.tar.gz opensim-SC_OLD-1dfc9902649bfb4f02340644a0589fe139a3322a.tar.bz2 opensim-SC_OLD-1dfc9902649bfb4f02340644a0589fe139a3322a.tar.xz |
Add a position parameter to region crossing of objects. This avoids the
potential bad update that places an object at the opposite side of the
origin sim for a moment before actually crossing it. Especially important in
grids like OSG where lag between sims is high.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 8f047ea..f6e4dbf 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -1704,14 +1704,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1704 | 1704 | ||
1705 | // Offset the positions for the new region across the border | 1705 | // Offset the positions for the new region across the border |
1706 | Vector3 oldGroupPosition = grp.RootPart.GroupPosition; | 1706 | Vector3 oldGroupPosition = grp.RootPart.GroupPosition; |
1707 | grp.RootPart.GroupPosition = pos; | ||
1708 | 1707 | ||
1709 | // If we fail to cross the border, then reset the position of the scene object on that border. | 1708 | // If we fail to cross the border, then reset the position of the scene object on that border. |
1710 | uint x = 0, y = 0; | 1709 | uint x = 0, y = 0; |
1711 | Utils.LongToUInts(newRegionHandle, out x, out y); | 1710 | Utils.LongToUInts(newRegionHandle, out x, out y); |
1712 | GridRegion destination = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y); | 1711 | GridRegion destination = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y); |
1713 | 1712 | ||
1714 | if (destination == null || !CrossPrimGroupIntoNewRegion(destination, grp, silent)) | 1713 | if (destination == null || !CrossPrimGroupIntoNewRegion(destination, pos, grp, silent)) |
1715 | { | 1714 | { |
1716 | m_log.InfoFormat("[ENTITY TRANSFER MODULE] cross region transfer failed for object {0}",grp.UUID); | 1715 | m_log.InfoFormat("[ENTITY TRANSFER MODULE] cross region transfer failed for object {0}",grp.UUID); |
1717 | 1716 | ||
@@ -1741,7 +1740,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1741 | /// true if the crossing itself was successful, false on failure | 1740 | /// true if the crossing itself was successful, false on failure |
1742 | /// FIMXE: we still return true if the crossing object was not successfully deleted from the originating region | 1741 | /// FIMXE: we still return true if the crossing object was not successfully deleted from the originating region |
1743 | /// </returns> | 1742 | /// </returns> |
1744 | protected bool CrossPrimGroupIntoNewRegion(GridRegion destination, SceneObjectGroup grp, bool silent) | 1743 | protected bool CrossPrimGroupIntoNewRegion(GridRegion destination, Vector3 newPosition, SceneObjectGroup grp, bool silent) |
1745 | { | 1744 | { |
1746 | //m_log.Debug(" >>> CrossPrimGroupIntoNewRegion <<<"); | 1745 | //m_log.Debug(" >>> CrossPrimGroupIntoNewRegion <<<"); |
1747 | 1746 | ||
@@ -1766,7 +1765,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1766 | //if (m_interregionCommsOut != null) | 1765 | //if (m_interregionCommsOut != null) |
1767 | // successYN = m_interregionCommsOut.SendCreateObject(newRegionHandle, grp, true); | 1766 | // successYN = m_interregionCommsOut.SendCreateObject(newRegionHandle, grp, true); |
1768 | if (m_aScene.SimulationService != null) | 1767 | if (m_aScene.SimulationService != null) |
1769 | successYN = m_aScene.SimulationService.CreateObject(destination, grp, true); | 1768 | successYN = m_aScene.SimulationService.CreateObject(destination, newPosition, grp, true); |
1770 | 1769 | ||
1771 | if (successYN) | 1770 | if (successYN) |
1772 | { | 1771 | { |
@@ -1825,7 +1824,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1825 | gobj.IsAttachment = false; | 1824 | gobj.IsAttachment = false; |
1826 | //gobj.RootPart.LastOwnerID = gobj.GetFromAssetID(); | 1825 | //gobj.RootPart.LastOwnerID = gobj.GetFromAssetID(); |
1827 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending attachment {0} to region {1}", gobj.UUID, destination.RegionName); | 1826 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending attachment {0} to region {1}", gobj.UUID, destination.RegionName); |
1828 | CrossPrimGroupIntoNewRegion(destination, gobj, silent); | 1827 | CrossPrimGroupIntoNewRegion(destination, Vector3.Zero, gobj, silent); |
1829 | } | 1828 | } |
1830 | } | 1829 | } |
1831 | 1830 | ||