diff options
Diffstat (limited to '')
9 files changed, 87 insertions, 35 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 9e72a98..437d150 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -258,10 +258,25 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
258 | { | 258 | { |
259 | m_log.Info("[RADMIN]: Request to restart Region."); | 259 | m_log.Info("[RADMIN]: Request to restart Region."); |
260 | 260 | ||
261 | CheckRegionParams(requestData, responseData); | ||
262 | |||
263 | Scene rebootedScene = null; | 261 | Scene rebootedScene = null; |
264 | GetSceneFromRegionParams(requestData, responseData, out rebootedScene); | 262 | bool restartAll = false; |
263 | |||
264 | IConfig startupConfig = m_configSource.Configs["Startup"]; | ||
265 | if (startupConfig != null) | ||
266 | { | ||
267 | if (startupConfig.GetBoolean("InworldRestartShutsDown", false)) | ||
268 | { | ||
269 | rebootedScene = m_application.SceneManager.CurrentOrFirstScene; | ||
270 | restartAll = true; | ||
271 | } | ||
272 | } | ||
273 | |||
274 | if (rebootedScene == null) | ||
275 | { | ||
276 | CheckRegionParams(requestData, responseData); | ||
277 | |||
278 | GetSceneFromRegionParams(requestData, responseData, out rebootedScene); | ||
279 | } | ||
265 | 280 | ||
266 | IRestartModule restartModule = rebootedScene.RequestModuleInterface<IRestartModule>(); | 281 | IRestartModule restartModule = rebootedScene.RequestModuleInterface<IRestartModule>(); |
267 | 282 | ||
@@ -324,11 +339,20 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
324 | notice = false; | 339 | notice = false; |
325 | } | 340 | } |
326 | 341 | ||
327 | if (restartModule != null) | 342 | List<Scene> restartList; |
343 | |||
344 | if (restartAll) | ||
345 | restartList = m_application.SceneManager.Scenes; | ||
346 | else | ||
347 | restartList = new List<Scene>() { rebootedScene }; | ||
348 | |||
349 | foreach (Scene s in m_application.SceneManager.Scenes) | ||
328 | { | 350 | { |
329 | restartModule.ScheduleRestart(UUID.Zero, message, times.ToArray(), notice); | 351 | restartModule = s.RequestModuleInterface<IRestartModule>(); |
330 | responseData["success"] = true; | 352 | if (restartModule != null) |
353 | restartModule.ScheduleRestart(UUID.Zero, message, times.ToArray(), notice); | ||
331 | } | 354 | } |
355 | responseData["success"] = true; | ||
332 | } | 356 | } |
333 | catch (Exception e) | 357 | catch (Exception e) |
334 | { | 358 | { |
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index de40e59..f1deaa8 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -231,7 +231,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
231 | sp.ClearAttachments(); | 231 | sp.ClearAttachments(); |
232 | } | 232 | } |
233 | 233 | ||
234 | public bool AttachObject(IScenePresence sp, SceneObjectGroup group, uint attachmentPt, bool silent) | 234 | public bool AttachObject(IScenePresence sp, SceneObjectGroup group, uint attachmentPt, bool silent, bool useAttachData) |
235 | { | 235 | { |
236 | lock (sp.AttachmentsSyncLock) | 236 | lock (sp.AttachmentsSyncLock) |
237 | { | 237 | { |
@@ -277,9 +277,27 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
277 | attachPos = Vector3.Zero; | 277 | attachPos = Vector3.Zero; |
278 | } | 278 | } |
279 | 279 | ||
280 | if (useAttachData) | ||
281 | { | ||
282 | group.RootPart.RotationOffset = group.RootPart.AttachRotation; | ||
283 | attachPos = group.RootPart.AttachOffset; | ||
284 | if (attachmentPt == 0) | ||
285 | { | ||
286 | attachmentPt = group.RootPart.AttachPoint; | ||
287 | if (attachmentPt == 0) | ||
288 | { | ||
289 | attachmentPt = (uint)AttachmentPoint.LeftHand; | ||
290 | attachPos = Vector3.Zero; | ||
291 | } | ||
292 | } | ||
293 | else if (group.RootPart.AttachPoint != attachmentPt) | ||
294 | { | ||
295 | attachPos = Vector3.Zero; | ||
296 | } | ||
297 | } | ||
280 | group.AttachmentPoint = attachmentPt; | 298 | group.AttachmentPoint = attachmentPt; |
281 | group.AbsolutePosition = attachPos; | 299 | group.AbsolutePosition = attachPos; |
282 | 300 | ||
283 | // We also don't want to do any of the inventory operations for an NPC. | 301 | // We also don't want to do any of the inventory operations for an NPC. |
284 | if (sp.PresenceType != PresenceType.Npc) | 302 | if (sp.PresenceType != PresenceType.Npc) |
285 | { | 303 | { |
@@ -774,10 +792,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
774 | null, assetID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true, | 792 | null, assetID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true, |
775 | false, false, sp.UUID, true); | 793 | false, false, sp.UUID, true); |
776 | 794 | ||
777 | // m_log.DebugFormat( | 795 | // m_log.DebugFormat( |
778 | // "[ATTACHMENTS MODULE]: Retrieved single object {0} for attachment to {1} on point {2}", | 796 | // "[ATTACHMENTS MODULE]: Retrieved single object {0} for attachment to {1} on point {2}", |
779 | // objatt.Name, remoteClient.Name, AttachmentPt); | 797 | // objatt.Name, remoteClient.Name, AttachmentPt); |
780 | 798 | ||
781 | if (objatt != null) | 799 | if (objatt != null) |
782 | { | 800 | { |
783 | // HasGroupChanged is being set from within RezObject. Ideally it would be set by the caller. | 801 | // HasGroupChanged is being set from within RezObject. Ideally it would be set by the caller. |
@@ -789,7 +807,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
789 | // This will throw if the attachment fails | 807 | // This will throw if the attachment fails |
790 | try | 808 | try |
791 | { | 809 | { |
792 | AttachObject(sp, objatt, attachmentPt, false); | 810 | AttachObject(sp, objatt, attachmentPt, false, false); |
793 | } | 811 | } |
794 | catch (Exception e) | 812 | catch (Exception e) |
795 | { | 813 | { |
@@ -802,6 +820,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
802 | m_scene.DeleteSceneObject(objatt, false); | 820 | m_scene.DeleteSceneObject(objatt, false); |
803 | return null; | 821 | return null; |
804 | } | 822 | } |
823 | |||
824 | if (tainted) | ||
825 | objatt.HasGroupChanged = true; | ||
805 | 826 | ||
806 | if (doc != null) | 827 | if (doc != null) |
807 | { | 828 | { |
@@ -809,9 +830,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
809 | objatt.ResetOwnerChangeFlag(); | 830 | objatt.ResetOwnerChangeFlag(); |
810 | } | 831 | } |
811 | 832 | ||
812 | if (tainted) | ||
813 | objatt.HasGroupChanged = true; | ||
814 | |||
815 | // Fire after attach, so we don't get messy perms dialogs | 833 | // Fire after attach, so we don't get messy perms dialogs |
816 | // 4 == AttachedRez | 834 | // 4 == AttachedRez |
817 | objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 4); | 835 | objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 4); |
@@ -943,7 +961,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
943 | AttachmentPt &= 0x7f; | 961 | AttachmentPt &= 0x7f; |
944 | 962 | ||
945 | // Calls attach with a Zero position | 963 | // Calls attach with a Zero position |
946 | if (AttachObject(sp, part.ParentGroup, AttachmentPt, false)) | 964 | if (AttachObject(sp, part.ParentGroup, AttachmentPt, false, true)) |
947 | { | 965 | { |
948 | // m_log.Debug( | 966 | // m_log.Debug( |
949 | // "[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId | 967 | // "[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId |
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs index 5e89eec..acf0089 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs | |||
@@ -106,7 +106,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
106 | 106 | ||
107 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, attName, m_presence.UUID).ParentGroup; | 107 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, attName, m_presence.UUID).ParentGroup; |
108 | 108 | ||
109 | m_attMod.AttachObject(m_presence, so, (uint)AttachmentPoint.Chest, false); | 109 | m_attMod.AttachObject(m_presence, so, (uint)AttachmentPoint.Chest, false, false); |
110 | 110 | ||
111 | // Check status on scene presence | 111 | // Check status on scene presence |
112 | Assert.That(m_presence.HasAttachments(), Is.True); | 112 | Assert.That(m_presence.HasAttachments(), Is.True); |
@@ -326,4 +326,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
326 | // Assert.That(presence.HasAttachments(), Is.True, "Presence has not received new objects"); | 326 | // Assert.That(presence.HasAttachments(), Is.True, "Presence has not received new objects"); |
327 | // } | 327 | // } |
328 | } | 328 | } |
329 | } \ No newline at end of file | 329 | } |
diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index 69ce967..0516cb1 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs | |||
@@ -65,7 +65,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
65 | /// <param name="AttachmentPt"></param> | 65 | /// <param name="AttachmentPt"></param> |
66 | /// <param name="silent"></param> | 66 | /// <param name="silent"></param> |
67 | /// <returns>true if the object was successfully attached, false otherwise</returns> | 67 | /// <returns>true if the object was successfully attached, false otherwise</returns> |
68 | bool AttachObject(IScenePresence sp, SceneObjectGroup grp, uint AttachmentPt, bool silent); | 68 | bool AttachObject(IScenePresence sp, SceneObjectGroup grp, uint AttachmentPt, bool silent, bool useAttachmentInfo); |
69 | 69 | ||
70 | /// <summary> | 70 | /// <summary> |
71 | /// Rez an attachment from user inventory and change inventory status to match. | 71 | /// Rez an attachment from user inventory and change inventory status to match. |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 315b340..9c80d3e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2701,7 +2701,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2701 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | 2701 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); |
2702 | 2702 | ||
2703 | if (AttachmentsModule != null) | 2703 | if (AttachmentsModule != null) |
2704 | AttachmentsModule.AttachObject(sp, grp, 0, false); | 2704 | AttachmentsModule.AttachObject(sp, grp, 0, false, false); |
2705 | } | 2705 | } |
2706 | else | 2706 | else |
2707 | { | 2707 | { |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 23a0550..a62c1ac 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -359,7 +359,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
359 | if (pa != null && pa.IsPhysical && vel != Vector3.Zero) | 359 | if (pa != null && pa.IsPhysical && vel != Vector3.Zero) |
360 | { | 360 | { |
361 | sceneObject.RootPart.ApplyImpulse((vel * sceneObject.GetMass()), false); | 361 | sceneObject.RootPart.ApplyImpulse((vel * sceneObject.GetMass()), false); |
362 | sceneObject.Velocity = vel; | ||
363 | } | 362 | } |
364 | 363 | ||
365 | return true; | 364 | return true; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index bb8d065..61ef827 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -2640,15 +2640,25 @@ namespace OpenSim.Region.Framework.Scenes | |||
2640 | 2640 | ||
2641 | private void SendLandCollisionEvent(scriptEvents ev, ScriptCollidingNotification notify) | 2641 | private void SendLandCollisionEvent(scriptEvents ev, ScriptCollidingNotification notify) |
2642 | { | 2642 | { |
2643 | if ((ParentGroup.RootPart.ScriptEvents & ev) != 0) | 2643 | bool sendToRoot = true; |
2644 | { | 2644 | |
2645 | ColliderArgs LandCollidingMessage = new ColliderArgs(); | 2645 | ColliderArgs LandCollidingMessage = new ColliderArgs(); |
2646 | List<DetectedObject> colliding = new List<DetectedObject>(); | 2646 | List<DetectedObject> colliding = new List<DetectedObject>(); |
2647 | 2647 | ||
2648 | colliding.Add(CreateDetObjectForGround()); | 2648 | colliding.Add(CreateDetObjectForGround()); |
2649 | LandCollidingMessage.Colliders = colliding; | 2649 | LandCollidingMessage.Colliders = colliding; |
2650 | 2650 | ||
2651 | if (Inventory.ContainsScripts()) | ||
2652 | { | ||
2653 | if (!PassCollisions) | ||
2654 | sendToRoot = false; | ||
2655 | } | ||
2656 | if ((ScriptEvents & ev) != 0) | ||
2651 | notify(LocalId, LandCollidingMessage); | 2657 | notify(LocalId, LandCollidingMessage); |
2658 | |||
2659 | if ((ParentGroup.RootPart.ScriptEvents & ev) != 0 && sendToRoot) | ||
2660 | { | ||
2661 | notify(ParentGroup.RootPart.LocalId, LandCollidingMessage); | ||
2652 | } | 2662 | } |
2653 | } | 2663 | } |
2654 | 2664 | ||
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs index 9a40ab5..9b3b51b 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | |||
@@ -3252,9 +3252,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
3252 | } | 3252 | } |
3253 | 3253 | ||
3254 | 3254 | ||
3255 | private void changeAddImpulse(Vector3 impulse) | 3255 | private void changeAddForce(Vector3 theforce) |
3256 | { | 3256 | { |
3257 | m_forceacc += impulse *m_invTimeStep; | 3257 | m_forceacc += theforce; |
3258 | if (!m_isSelected) | 3258 | if (!m_isSelected) |
3259 | { | 3259 | { |
3260 | lock (this) | 3260 | lock (this) |
@@ -3960,7 +3960,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
3960 | break; | 3960 | break; |
3961 | 3961 | ||
3962 | case changes.AddForce: | 3962 | case changes.AddForce: |
3963 | changeAddImpulse((Vector3)arg); | 3963 | changeAddForce((Vector3)arg); |
3964 | break; | 3964 | break; |
3965 | 3965 | ||
3966 | case changes.AddAngForce: | 3966 | case changes.AddAngForce: |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9595d48..5905958 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -3056,8 +3056,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3056 | 3056 | ||
3057 | if (pa != null && pa.IsPhysical && llvel != Vector3.Zero) | 3057 | if (pa != null && pa.IsPhysical && llvel != Vector3.Zero) |
3058 | { | 3058 | { |
3059 | //Recoil. | 3059 | // recoil |
3060 | llApplyImpulse(new LSL_Vector(llvel.X * groupmass, llvel.Y * groupmass, llvel.Z * groupmass), 0); | 3060 | llvel *= -groupmass; |
3061 | llApplyImpulse(new LSL_Vector(llvel.X, llvel.Y,llvel.Z), 0); | ||
3061 | } | 3062 | } |
3062 | // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay) | 3063 | // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay) |
3063 | return; | 3064 | return; |
@@ -3249,7 +3250,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3249 | IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; | 3250 | IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; |
3250 | 3251 | ||
3251 | if (attachmentsModule != null) | 3252 | if (attachmentsModule != null) |
3252 | return attachmentsModule.AttachObject(presence, grp, (uint)attachmentPoint, false); | 3253 | return attachmentsModule.AttachObject(presence, grp, (uint)attachmentPoint, false, true); |
3253 | else | 3254 | else |
3254 | return false; | 3255 | return false; |
3255 | } | 3256 | } |