From 490ac0be005a989c86ebde62aad137fd2da7cbd8 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 8 Sep 2008 02:40:20 +0000 Subject: Implement proper persistence of the following prim properties: Floating text, Rotation, Texture animation, Particle System This will make "Eye Candy" scripts work without modification in XEngine. The use of the CHANGED_REGION_RESTART hack is no longer needed. Implemented in MySQL only, hovertext also in SQLite. --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 17 ++++++++++++----- .../ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | 2 +- .../ScriptEngine/Shared/Instance/ScriptInstance.cs | 13 ++++++++++--- 3 files changed, 23 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 20dc46e..38d9728 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2173,7 +2173,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams( "object_rez", new Object[] { new LSL_Types.LSLString( - new_group.RootPart.ToString()) }, + new_group.RootPart.UUID.ToString()) }, new DetectParams[0])); float groupmass = new_group.GetMass(); @@ -2542,6 +2542,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AngularVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); m_host.ScheduleTerseUpdate(); m_host.SendTerseUpdateToAllClients(); + m_host.ParentGroup.HasGroupChanged = true; } public LSL_Types.LSLInteger llGetStartParameter() @@ -3009,6 +3010,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); Vector3 av3 = new Vector3((float)color.x, (float)color.y, (float)color.z); m_host.SetText(text, av3, alpha); + m_host.ParentGroup.HasGroupChanged = true; } public double llWater(LSL_Types.Vector3 offset) @@ -4396,6 +4398,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddTextureAnimation(pTexAnim); m_host.SendFullUpdateToAllClients(); + m_host.ParentGroup.HasGroupChanged = true; } public void llTriggerSoundLimited(string sound, double volume, LSL_Types.Vector3 top_north_east, @@ -4713,6 +4716,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (rules.Length == 0) { m_host.RemoveParticleSystem(); + m_host.ParentGroup.HasGroupChanged = true; } else { @@ -4857,6 +4861,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api prules.CRC = 1; m_host.AddNewParticleSystem(prules); + m_host.ParentGroup.HasGroupChanged = true; } m_host.SendFullUpdateToAllClients(); } @@ -7260,10 +7265,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; } m_host.ParentGroup.RootPart.PayPrice[0]=price; - m_host.ParentGroup.RootPart.PayPrice[1]=(int)quick_pay_buttons.Data[0]; - m_host.ParentGroup.RootPart.PayPrice[2]=(int)quick_pay_buttons.Data[1]; - m_host.ParentGroup.RootPart.PayPrice[3]=(int)quick_pay_buttons.Data[2]; - m_host.ParentGroup.RootPart.PayPrice[4]=(int)quick_pay_buttons.Data[3]; + + m_host.ParentGroup.RootPart.PayPrice[1]=(LSL_Types.LSLInteger)quick_pay_buttons.Data[0]; + m_host.ParentGroup.RootPart.PayPrice[2]=(LSL_Types.LSLInteger)quick_pay_buttons.Data[1]; + m_host.ParentGroup.RootPart.PayPrice[3]=(LSL_Types.LSLInteger)quick_pay_buttons.Data[2]; + m_host.ParentGroup.RootPart.PayPrice[4]=(LSL_Types.LSLInteger)quick_pay_buttons.Data[3]; + m_host.ParentGroup.HasGroupChanged = true; } public LSL_Types.Vector3 llGetCameraPos() diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index e3b81b7..6de7ca4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs @@ -260,7 +260,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public const int CHANGED_REGION_RESTART = 256; public const int TYPE_INVALID = 0; public const int TYPE_INTEGER = 1; - public const int TYPE_double = 2; + public const int TYPE_FLOAT = 2; public const int TYPE_STRING = 3; public const int TYPE_KEY = 4; public const int TYPE_VECTOR = 5; diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 08f9545..30002e8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -74,6 +74,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance private bool m_InSelfDelete = false; private int m_MaxScriptQueue; private bool m_SaveState = true; + private bool m_ShuttingDown = false; private Dictionary m_Apis = new Dictionary(); @@ -88,6 +89,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance set { m_RunEvents = value; } } + public bool ShuttingDown + { + get { return m_ShuttingDown; } + set { m_ShuttingDown = value; } + } + public string State { get { return m_State; } @@ -248,7 +255,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance m_Engine.Log.DebugFormat("[Script] Successfully retrieved state for script {0}.{1}", m_PrimName, m_ScriptName); - if (m_RunEvents) + if (m_RunEvents && (!m_ShuttingDown)) { m_RunEvents = false; Start(); @@ -517,7 +524,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance { lock (m_EventQueue) { - if ((m_EventQueue.Count > 0) && m_RunEvents) + if ((m_EventQueue.Count > 0) && m_RunEvents && (!m_ShuttingDown)) { m_CurrentResult=m_Engine.QueueEventHandler(this); } @@ -564,7 +571,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance lock (m_EventQueue) { - if ((m_EventQueue.Count > 0) && m_RunEvents) + if ((m_EventQueue.Count > 0) && m_RunEvents && (!m_ShuttingDown)) { m_CurrentResult = m_Engine.QueueEventHandler(this); } -- cgit v1.1