From ceabb1b49ae40b31659082a2f7622c1f3586ce46 Mon Sep 17 00:00:00 2001 From: Talun Date: Sat, 26 Jan 2013 00:34:42 +0000 Subject: [PATCH 1/3] Mantis 6343: Turn a prim to flexy to OFF don't work llSetPrimParams Correction so that scripts can turn Flexi off as well as on. --- .../Shared/Api/Implementation/LSL_Api.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 001f4d9bd1..81de9abe6b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1700,10 +1700,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api part.Shape.FlexiForceX = (float)Force.x; part.Shape.FlexiForceY = (float)Force.y; part.Shape.FlexiForceZ = (float)Force.z; - part.Shape.PathCurve = 0x80; - part.ParentGroup.HasGroupChanged = true; - part.ScheduleFullUpdate(); + part.Shape.PathCurve = (byte)Extrusion.Flexible; } + else + { + // Other values not set, they do not seem to be sent to the viewer + // Setting PathCurve appears to be what actually toggles the check box and turns Flexi on and off + part.Shape.PathCurve = (byte)Extrusion.Straight; + part.Shape.FlexiEntry = false; + } + part.ParentGroup.HasGroupChanged = true; + part.ScheduleFullUpdate(); } /// From 53833babf99d83a27d0be2b820efbe41067ef723 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Sat, 26 Jan 2013 03:57:51 +0000 Subject: [PATCH 2/3] Add OnScriptMovingStartEvent and OnScriptMovingEndEvent to EventManager so that these can be triggered by future code (not yet implemented). Also hooks up moving_start and moving_end script events, eliminating itemID on XEngine EventManager methods since this is completely unused. An adaptation of the patch in http://opensimulator.org/mantis/view.php?id=6515 Thanks Garmin Kawaguichi and Signpost Marv. --- .../Region/Framework/Scenes/EventManager.cs | 56 +++++++++++++++++++ .../ScriptEngine/XEngine/EventManager.cs | 6 +- 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 902ded1f03..9ee15204ef 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -549,6 +549,20 @@ namespace OpenSim.Region.Framework.Scenes /// public event ScriptControlEvent OnScriptControlEvent; + public delegate void ScriptMovingStartEvent(uint localID); + + /// + /// TODO: Should be triggered when a physics object starts moving. + /// + public event ScriptMovingStartEvent OnScriptMovingStartEvent; + + public delegate void ScriptMovingEndEvent(uint localID); + + /// + /// TODO: Should be triggered when a physics object stops moving. + /// + public event ScriptMovingEndEvent OnScriptMovingEndEvent; + public delegate void ScriptAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 atpos); /// @@ -2212,6 +2226,48 @@ namespace OpenSim.Region.Framework.Scenes } } + public void TriggerMovingStartEvent(uint localID) + { + ScriptMovingStartEvent handlerScriptMovingStartEvent = OnScriptMovingStartEvent; + if (handlerScriptMovingStartEvent != null) + { + foreach (ScriptMovingStartEvent d in handlerScriptMovingStartEvent.GetInvocationList()) + { + try + { + d(localID); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerMovingStartEvent failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } + } + + public void TriggerMovingEndEvent(uint localID) + { + ScriptMovingEndEvent handlerScriptMovingEndEvent = OnScriptMovingEndEvent; + if (handlerScriptMovingEndEvent != null) + { + foreach (ScriptMovingEndEvent d in handlerScriptMovingEndEvent.GetInvocationList()) + { + try + { + d(localID); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerMovingEndEvent failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } + } + public void TriggerRequestChangeWaterHeight(float height) { if (height < 0) diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs index afde685d68..0ff2da365b 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs @@ -62,6 +62,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target; myScriptEngine.World.EventManager.OnScriptAtRotTargetEvent += at_rot_target; myScriptEngine.World.EventManager.OnScriptNotAtRotTargetEvent += not_at_rot_target; + myScriptEngine.World.EventManager.OnScriptMovingStartEvent += moving_start; + myScriptEngine.World.EventManager.OnScriptMovingEndEvent += moving_end; myScriptEngine.World.EventManager.OnScriptControlEvent += control; myScriptEngine.World.EventManager.OnScriptColliderStart += collision_start; myScriptEngine.World.EventManager.OnScriptColliding += collision; @@ -419,14 +421,14 @@ namespace OpenSim.Region.ScriptEngine.XEngine // dataserver: not handled here // link_message: not handled here - public void moving_start(uint localID, UUID itemID) + public void moving_start(uint localID) { myScriptEngine.PostObjectEvent(localID, new EventParams( "moving_start",new object[0], new DetectParams[0])); } - public void moving_end(uint localID, UUID itemID) + public void moving_end(uint localID) { myScriptEngine.PostObjectEvent(localID, new EventParams( "moving_end",new object[0], From b0cff35d96de4e9cbb252476f49640a4bf1f94e6 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Sat, 26 Jan 2013 04:27:01 +0000 Subject: [PATCH 3/3] Fix issue where the "set terrain texture" console command did not tell the viewers that textures had updated (hence they did not display the changes). Addresses http://opensimulator.org/mantis/view.php?id=6513 --- .../Region/CoreModules/World/Estate/EstateManagementCommands.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs index 3b84d5728f..4d49794347 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs @@ -117,7 +117,7 @@ namespace OpenSim.Region.CoreModules.World.Estate m_module.Scene.RegionInfo.RegionSettings.Save(); m_module.TriggerRegionInfoChange(); - m_module.sendRegionInfoPacketToAll(); + m_module.sendRegionHandshakeToAll(); } } }