diff options
8 files changed, 28 insertions, 29 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 | } |
diff --git a/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs b/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs index 984b843..f0d8f69 100644 --- a/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs | |||
@@ -136,6 +136,8 @@ namespace OpenSim.Server.Handlers.Simulation | |||
136 | int x = 0, y = 0; | 136 | int x = 0, y = 0; |
137 | UUID uuid = UUID.Zero; | 137 | UUID uuid = UUID.Zero; |
138 | string regionname = string.Empty; | 138 | string regionname = string.Empty; |
139 | Vector3 newPosition = Vector3.Zero; | ||
140 | |||
139 | if (args.ContainsKey("destination_x") && args["destination_x"] != null) | 141 | if (args.ContainsKey("destination_x") && args["destination_x"] != null) |
140 | Int32.TryParse(args["destination_x"].AsString(), out x); | 142 | Int32.TryParse(args["destination_x"].AsString(), out x); |
141 | if (args.ContainsKey("destination_y") && args["destination_y"] != null) | 143 | if (args.ContainsKey("destination_y") && args["destination_y"] != null) |
@@ -144,6 +146,8 @@ namespace OpenSim.Server.Handlers.Simulation | |||
144 | UUID.TryParse(args["destination_uuid"].AsString(), out uuid); | 146 | UUID.TryParse(args["destination_uuid"].AsString(), out uuid); |
145 | if (args.ContainsKey("destination_name") && args["destination_name"] != null) | 147 | if (args.ContainsKey("destination_name") && args["destination_name"] != null) |
146 | regionname = args["destination_name"].ToString(); | 148 | regionname = args["destination_name"].ToString(); |
149 | if (args.ContainsKey("new_position") && args["new_position"] != null) | ||
150 | Vector3.TryParse(args["new_position"], out newPosition); | ||
147 | 151 | ||
148 | GridRegion destination = new GridRegion(); | 152 | GridRegion destination = new GridRegion(); |
149 | destination.RegionID = uuid; | 153 | destination.RegionID = uuid; |
@@ -199,7 +203,7 @@ namespace OpenSim.Server.Handlers.Simulation | |||
199 | try | 203 | try |
200 | { | 204 | { |
201 | // This is the meaning of POST object | 205 | // This is the meaning of POST object |
202 | result = CreateObject(destination, sog); | 206 | result = CreateObject(destination, newPosition, sog); |
203 | } | 207 | } |
204 | catch (Exception e) | 208 | catch (Exception e) |
205 | { | 209 | { |
@@ -211,9 +215,9 @@ namespace OpenSim.Server.Handlers.Simulation | |||
211 | } | 215 | } |
212 | 216 | ||
213 | // subclasses can override this | 217 | // subclasses can override this |
214 | protected virtual bool CreateObject(GridRegion destination, ISceneObject sog) | 218 | protected virtual bool CreateObject(GridRegion destination, Vector3 newPosition, ISceneObject sog) |
215 | { | 219 | { |
216 | return m_SimulationService.CreateObject(destination, sog, false); | 220 | return m_SimulationService.CreateObject(destination, newPosition, sog, false); |
217 | } | 221 | } |
218 | 222 | ||
219 | protected virtual void DoObjectPut(Hashtable request, Hashtable responsedata, UUID regionID) | 223 | protected virtual void DoObjectPut(Hashtable request, Hashtable responsedata, UUID regionID) |
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 4132ec7..5037543 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | |||
@@ -420,7 +420,7 @@ namespace OpenSim.Services.Connectors.Simulation | |||
420 | /// <summary> | 420 | /// <summary> |
421 | /// | 421 | /// |
422 | /// </summary> | 422 | /// </summary> |
423 | public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall) | 423 | public bool CreateObject(GridRegion destination, Vector3 newPosition, ISceneObject sog, bool isLocalCall) |
424 | { | 424 | { |
425 | // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: CreateObject start"); | 425 | // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: CreateObject start"); |
426 | 426 | ||
@@ -433,6 +433,7 @@ namespace OpenSim.Services.Connectors.Simulation | |||
433 | args["sog"] = OSD.FromString(sog.ToXml2()); | 433 | args["sog"] = OSD.FromString(sog.ToXml2()); |
434 | args["extra"] = OSD.FromString(sog.ExtraToXmlString()); | 434 | args["extra"] = OSD.FromString(sog.ExtraToXmlString()); |
435 | args["modified"] = OSD.FromBoolean(sog.HasGroupChanged); | 435 | args["modified"] = OSD.FromBoolean(sog.HasGroupChanged); |
436 | args["new_position"] = newPosition.ToString(); | ||
436 | 437 | ||
437 | string state = sog.GetStateSnapshot(); | 438 | string state = sog.GetStateSnapshot(); |
438 | if (state.Length > 0) | 439 | if (state.Length > 0) |
diff --git a/OpenSim/Services/Interfaces/ISimulationService.cs b/OpenSim/Services/Interfaces/ISimulationService.cs index ae6bd72..7940256 100644 --- a/OpenSim/Services/Interfaces/ISimulationService.cs +++ b/OpenSim/Services/Interfaces/ISimulationService.cs | |||
@@ -106,7 +106,7 @@ namespace OpenSim.Services.Interfaces | |||
106 | /// <param name="sog"></param> | 106 | /// <param name="sog"></param> |
107 | /// <param name="isLocalCall"></param> | 107 | /// <param name="isLocalCall"></param> |
108 | /// <returns></returns> | 108 | /// <returns></returns> |
109 | bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall); | 109 | bool CreateObject(GridRegion destination, Vector3 newPosition, ISceneObject sog, bool isLocalCall); |
110 | 110 | ||
111 | /// <summary> | 111 | /// <summary> |
112 | /// Create an object from the user's inventory in the destination region. | 112 | /// Create an object from the user's inventory in the destination region. |