diff options
author | Melanie | 2012-02-23 01:49:14 +0000 |
---|---|---|
committer | Melanie | 2012-02-23 01:49:14 +0000 |
commit | f1a76195ea58b8efb22f6f56980c1d7960e195b8 (patch) | |
tree | 972beaa1d2a234f7792d9beaedbdef58e963c690 /OpenSim/Region | |
parent | Add permission checks to scripted object movements, which didn't respect bans (diff) | |
parent | Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff) | |
download | opensim-SC-f1a76195ea58b8efb22f6f56980c1d7960e195b8.zip opensim-SC-f1a76195ea58b8efb22f6f56980c1d7960e195b8.tar.gz opensim-SC-f1a76195ea58b8efb22f6f56980c1d7960e195b8.tar.bz2 opensim-SC-f1a76195ea58b8efb22f6f56980c1d7960e195b8.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
Diffstat (limited to 'OpenSim/Region')
5 files changed, 18 insertions, 24 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 6286689..2498705 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -1660,19 +1660,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1660 | } | 1660 | } |
1661 | 1661 | ||
1662 | // Offset the positions for the new region across the border | 1662 | // Offset the positions for the new region across the border |
1663 | // NOT here | 1663 | Vector3 oldGroupPosition = grp.RootPart.GroupPosition; |
1664 | 1664 | ||
1665 | // If we fail to cross the border, then reset the position of the scene object on that border. | 1665 | // If we fail to cross the border, then reset the position of the scene object on that border. |
1666 | uint x = 0, y = 0; | 1666 | uint x = 0, y = 0; |
1667 | Utils.LongToUInts(newRegionHandle, out x, out y); | 1667 | Utils.LongToUInts(newRegionHandle, out x, out y); |
1668 | GridRegion destination = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y); | 1668 | GridRegion destination = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y); |
1669 | 1669 | ||
1670 | Vector3 oldGroupPosition = grp.RootPart.GroupPosition; | ||
1671 | |||
1672 | if (destination != null) | 1670 | if (destination != null) |
1673 | { | 1671 | { |
1674 | grp.RootPart.GroupPosition = pos; // only change this if we think there is anywhere to go | 1672 | if (CrossPrimGroupIntoNewRegion(destination, pos, grp, silent)) |
1675 | if (CrossPrimGroupIntoNewRegion(destination, grp, silent)) | ||
1676 | return; // we did it | 1673 | return; // we did it |
1677 | } | 1674 | } |
1678 | 1675 | ||
@@ -1701,7 +1698,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1701 | /// true if the crossing itself was successful, false on failure | 1698 | /// true if the crossing itself was successful, false on failure |
1702 | /// FIMXE: we still return true if the crossing object was not successfully deleted from the originating region | 1699 | /// FIMXE: we still return true if the crossing object was not successfully deleted from the originating region |
1703 | /// </returns> | 1700 | /// </returns> |
1704 | protected bool CrossPrimGroupIntoNewRegion(GridRegion destination, SceneObjectGroup grp, bool silent) | 1701 | protected bool CrossPrimGroupIntoNewRegion(GridRegion destination, Vector3 newPosition, SceneObjectGroup grp, bool silent) |
1705 | { | 1702 | { |
1706 | //m_log.Debug(" >>> CrossPrimGroupIntoNewRegion <<<"); | 1703 | //m_log.Debug(" >>> CrossPrimGroupIntoNewRegion <<<"); |
1707 | 1704 | ||
@@ -1726,7 +1723,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1726 | //if (m_interregionCommsOut != null) | 1723 | //if (m_interregionCommsOut != null) |
1727 | // successYN = m_interregionCommsOut.SendCreateObject(newRegionHandle, grp, true); | 1724 | // successYN = m_interregionCommsOut.SendCreateObject(newRegionHandle, grp, true); |
1728 | if (m_aScene.SimulationService != null) | 1725 | if (m_aScene.SimulationService != null) |
1729 | successYN = m_aScene.SimulationService.CreateObject(destination, grp, true); | 1726 | successYN = m_aScene.SimulationService.CreateObject(destination, newPosition, grp, true); |
1730 | 1727 | ||
1731 | if (successYN) | 1728 | if (successYN) |
1732 | { | 1729 | { |
@@ -1785,7 +1782,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1785 | gobj.IsAttachment = false; | 1782 | gobj.IsAttachment = false; |
1786 | //gobj.RootPart.LastOwnerID = gobj.GetFromAssetID(); | 1783 | //gobj.RootPart.LastOwnerID = gobj.GetFromAssetID(); |
1787 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending attachment {0} to region {1}", gobj.UUID, destination.RegionName); | 1784 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending attachment {0} to region {1}", gobj.UUID, destination.RegionName); |
1788 | CrossPrimGroupIntoNewRegion(destination, gobj, silent); | 1785 | CrossPrimGroupIntoNewRegion(destination, Vector3.Zero, gobj, silent); |
1789 | } | 1786 | } |
1790 | } | 1787 | } |
1791 | 1788 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index faa1def..6e75692 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | |||
@@ -328,7 +328,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
328 | * Object-related communications | 328 | * Object-related communications |
329 | */ | 329 | */ |
330 | 330 | ||
331 | public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall) | 331 | public bool CreateObject(GridRegion destination, Vector3 newPosition, ISceneObject sog, bool isLocalCall) |
332 | { | 332 | { |
333 | if (destination == null) | 333 | if (destination == null) |
334 | return false; | 334 | return false; |
@@ -343,12 +343,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
343 | // We need to make a local copy of the object | 343 | // We need to make a local copy of the object |
344 | ISceneObject sogClone = sog.CloneForNewScene(); | 344 | ISceneObject sogClone = sog.CloneForNewScene(); |
345 | sogClone.SetState(sog.GetStateSnapshot(), s); | 345 | sogClone.SetState(sog.GetStateSnapshot(), s); |
346 | return s.IncomingCreateObject(sogClone); | 346 | return s.IncomingCreateObject(newPosition, sogClone); |
347 | } | 347 | } |
348 | else | 348 | else |
349 | { | 349 | { |
350 | // Use the object as it came through the wire | 350 | // Use the object as it came through the wire |
351 | return s.IncomingCreateObject(sog); | 351 | return s.IncomingCreateObject(newPosition, sog); |
352 | } | 352 | } |
353 | } | 353 | } |
354 | } | 354 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index 391b1a1..4b70692 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | |||
@@ -297,13 +297,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
297 | * Object-related communications | 297 | * Object-related communications |
298 | */ | 298 | */ |
299 | 299 | ||
300 | public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall) | 300 | public bool CreateObject(GridRegion destination, Vector3 newPosition, ISceneObject sog, bool isLocalCall) |
301 | { | 301 | { |
302 | if (destination == null) | 302 | if (destination == null) |
303 | return false; | 303 | return false; |
304 | 304 | ||
305 | // Try local first | 305 | // Try local first |
306 | if (m_localBackend.CreateObject(destination, sog, isLocalCall)) | 306 | if (m_localBackend.CreateObject(destination, newPosition, sog, isLocalCall)) |
307 | { | 307 | { |
308 | //m_log.Debug("[REST COMMS]: LocalBackEnd SendCreateObject succeeded"); | 308 | //m_log.Debug("[REST COMMS]: LocalBackEnd SendCreateObject succeeded"); |
309 | return true; | 309 | return true; |
@@ -311,7 +311,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
311 | 311 | ||
312 | // else do the remote thing | 312 | // else do the remote thing |
313 | if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) | 313 | if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) |
314 | return m_remoteConnector.CreateObject(destination, sog, isLocalCall); | 314 | return m_remoteConnector.CreateObject(destination, newPosition, sog, isLocalCall); |
315 | 315 | ||
316 | return false; | 316 | return false; |
317 | } | 317 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index a7cca44..b7162da 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2403,7 +2403,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2403 | /// </summary> | 2403 | /// </summary> |
2404 | /// <param name="sog"></param> | 2404 | /// <param name="sog"></param> |
2405 | /// <returns></returns> | 2405 | /// <returns></returns> |
2406 | public bool IncomingCreateObject(ISceneObject sog) | 2406 | public bool IncomingCreateObject(Vector3 newPosition, ISceneObject sog) |
2407 | { | 2407 | { |
2408 | //m_log.DebugFormat(" >>> IncomingCreateObject(sog) <<< {0} deleted? {1} isAttach? {2}", ((SceneObjectGroup)sog).AbsolutePosition, | 2408 | //m_log.DebugFormat(" >>> IncomingCreateObject(sog) <<< {0} deleted? {1} isAttach? {2}", ((SceneObjectGroup)sog).AbsolutePosition, |
2409 | // ((SceneObjectGroup)sog).IsDeleted, ((SceneObjectGroup)sog).RootPart.IsAttachment); | 2409 | // ((SceneObjectGroup)sog).IsDeleted, ((SceneObjectGroup)sog).RootPart.IsAttachment); |
@@ -2419,6 +2419,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2419 | return false; | 2419 | return false; |
2420 | } | 2420 | } |
2421 | 2421 | ||
2422 | if (newPosition != Vector3.Zero) | ||
2423 | newObject.RootPart.GroupPosition = newPosition; | ||
2424 | |||
2422 | if (!AddSceneObject(newObject)) | 2425 | if (!AddSceneObject(newObject)) |
2423 | { | 2426 | { |
2424 | m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName); | 2427 | m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName); |
@@ -4431,10 +4434,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4431 | /// <param name="action"></param> | 4434 | /// <param name="action"></param> |
4432 | public void ForEachRootScenePresence(Action<ScenePresence> action) | 4435 | public void ForEachRootScenePresence(Action<ScenePresence> action) |
4433 | { | 4436 | { |
4434 | if (m_sceneGraph != null) | 4437 | m_sceneGraph.ForEachAvatar(action); |
4435 | { | ||
4436 | m_sceneGraph.ForEachAvatar(action); | ||
4437 | } | ||
4438 | } | 4438 | } |
4439 | 4439 | ||
4440 | /// <summary> | 4440 | /// <summary> |
@@ -4443,10 +4443,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4443 | /// <param name="action"></param> | 4443 | /// <param name="action"></param> |
4444 | public void ForEachScenePresence(Action<ScenePresence> action) | 4444 | public void ForEachScenePresence(Action<ScenePresence> action) |
4445 | { | 4445 | { |
4446 | if (m_sceneGraph != null) | 4446 | m_sceneGraph.ForEachScenePresence(action); |
4447 | { | ||
4448 | m_sceneGraph.ForEachScenePresence(action); | ||
4449 | } | ||
4450 | } | 4447 | } |
4451 | 4448 | ||
4452 | /// <summary> | 4449 | /// <summary> |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index ec8716b..a3839c2 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -3297,7 +3297,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3297 | ((SceneObjectGroup)so).LocalId = 0; | 3297 | ((SceneObjectGroup)so).LocalId = 0; |
3298 | ((SceneObjectGroup)so).RootPart.ClearUpdateSchedule(); | 3298 | ((SceneObjectGroup)so).RootPart.ClearUpdateSchedule(); |
3299 | so.SetState(cAgent.AttachmentObjectStates[i++], m_scene); | 3299 | so.SetState(cAgent.AttachmentObjectStates[i++], m_scene); |
3300 | m_scene.IncomingCreateObject(so); | 3300 | m_scene.IncomingCreateObject(Vector3.Zero, so); |
3301 | } | 3301 | } |
3302 | } | 3302 | } |
3303 | } | 3303 | } |