From 97d83c87ec27f355844016281ce1be156fe7cd3f Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 11 Jun 2010 17:23:06 +0200 Subject: [PATCH 1/3] Rename cm* function set to ls* (for LightShare) --- .../Shared/Api/Implementation/CM_Api.cs | 18 ++++++++-------- .../Shared/Api/Interface/ICM_Api.cs | 6 +++--- .../Shared/Api/Runtime/CM_Stub.cs | 21 ++++++++++++++++--- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs index 880ca1bb7d..9a99f5ee33 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs @@ -70,7 +70,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_localID = localID; m_itemID = itemID; - if (m_ScriptEngine.Config.GetBoolean("AllowCareminsterFunctions", false)) + if (m_ScriptEngine.Config.GetBoolean("AllowLightShareFunctions", false)) m_CMFunctionsEnabled = true; m_comms = m_ScriptEngine.World.RequestModuleInterface(); @@ -116,11 +116,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// Get the current Windlight scene /// /// List of windlight parameters - public LSL_List cmGetWindlightScene(LSL_List rules) + public LSL_List lsGetWindlightScene(LSL_List rules) { if (!m_CMFunctionsEnabled) { - CMShoutError("Careminster functions are not enabled."); + CMShoutError("LightShare functions are not enabled."); return new LSL_List(); } m_host.AddScriptLPS(1); @@ -440,16 +440,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// /// /// success: true or false - public int cmSetWindlightScene(LSL_List rules) + public int lsSetWindlightScene(LSL_List rules) { if (!m_CMFunctionsEnabled) { - CMShoutError("Careminster functions are not enabled."); + CMShoutError("LightShare functions are not enabled."); return 0; } if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) { - CMShoutError("cmSetWindlightScene can only be used by estate managers or owners."); + CMShoutError("lsSetWindlightScene can only be used by estate managers or owners."); return 0; } int success = 0; @@ -472,16 +472,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// /// /// success: true or false - public int cmSetWindlightSceneTargeted(LSL_List rules, LSL_Key target) + public int lsSetWindlightSceneTargeted(LSL_List rules, LSL_Key target) { if (!m_CMFunctionsEnabled) { - CMShoutError("Careminster functions are not enabled."); + CMShoutError("LightShare functions are not enabled."); return 0; } if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) { - CMShoutError("cmSetWindlightSceneTargeted can only be used by estate managers or owners."); + CMShoutError("lsSetWindlightSceneTargeted can only be used by estate managers or owners."); return 0; } int success = 0; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs index f13b6e50e3..f47ae7d485 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs @@ -41,8 +41,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces public interface ICM_Api { // Windlight Functions - LSL_List cmGetWindlightScene(LSL_List rules); - int cmSetWindlightScene(LSL_List rules); - int cmSetWindlightSceneTargeted(LSL_List rules, key target); + LSL_List lsGetWindlightScene(LSL_List rules); + int lsSetWindlightScene(LSL_List rules); + int lsSetWindlightSceneTargeted(LSL_List rules, key target); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs index c0edaae6bc..92c3d982d2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs @@ -58,19 +58,34 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase m_CM_Functions = (ICM_Api)api; } + public LSL_List lsGetWindlightScene(LSL_List rules) + { + return m_CM_Functions.lsGetWindlightScene(rules); + } + + public int lsSetWindlightScene(LSL_List rules) + { + return m_CM_Functions.lsSetWindlightScene(rules); + } + + public int lsSetWindlightSceneTargeted(LSL_List rules, key target) + { + return m_CM_Functions.lsSetWindlightSceneTargeted(rules, target); + } + public LSL_List cmGetWindlightScene(LSL_List rules) { - return m_CM_Functions.cmGetWindlightScene(rules); + return m_CM_Functions.lsGetWindlightScene(rules); } public int cmSetWindlightScene(LSL_List rules) { - return m_CM_Functions.cmSetWindlightScene(rules); + return m_CM_Functions.lsSetWindlightScene(rules); } public int cmSetWindlightSceneTargeted(LSL_List rules, key target) { - return m_CM_Functions.cmSetWindlightSceneTargeted(rules, target); + return m_CM_Functions.lsSetWindlightSceneTargeted(rules, target); } } } From 10ef80cf153a9fd3d841a47a5033bb3c1344c39d Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 11 Jun 2010 17:42:16 +0200 Subject: [PATCH 2/3] Rename CM files to LS --- .../Implementation/{CM_Api.cs => LS_Api.cs} | 30 +++++++++---------- .../Api/Interface/{ICM_Api.cs => ILS_Api.cs} | 2 +- .../Api/Runtime/{CM_Stub.cs => LS_Stub.cs} | 20 ++++++------- 3 files changed, 26 insertions(+), 26 deletions(-) rename OpenSim/Region/ScriptEngine/Shared/Api/Implementation/{CM_Api.cs => LS_Api.cs} (96%) rename OpenSim/Region/ScriptEngine/Shared/Api/Interface/{ICM_Api.cs => ILS_Api.cs} (98%) rename OpenSim/Region/ScriptEngine/Shared/Api/Runtime/{CM_Stub.cs => LS_Stub.cs} (85%) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs similarity index 96% rename from OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs rename to OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs index 9a99f5ee33..fe71ed54cd 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs @@ -54,13 +54,13 @@ using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3; namespace OpenSim.Region.ScriptEngine.Shared.Api { [Serializable] - public class CM_Api : MarshalByRefObject, ICM_Api, IScriptApi + public class LS_Api : MarshalByRefObject, ILS_Api, IScriptApi { internal IScriptEngine m_ScriptEngine; internal SceneObjectPart m_host; internal uint m_localID; internal UUID m_itemID; - internal bool m_CMFunctionsEnabled = false; + internal bool m_LSFunctionsEnabled = false; internal IScriptModuleComms m_comms = null; public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID) @@ -71,11 +71,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_itemID = itemID; if (m_ScriptEngine.Config.GetBoolean("AllowLightShareFunctions", false)) - m_CMFunctionsEnabled = true; + m_LSFunctionsEnabled = true; m_comms = m_ScriptEngine.World.RequestModuleInterface(); if (m_comms == null) - m_CMFunctionsEnabled = false; + m_LSFunctionsEnabled = false; } public override Object InitializeLifetimeService() @@ -100,7 +100,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api //Dumps an error message on the debug console. // - internal void CMShoutError(string message) + internal void LSShoutError(string message) { if (message.Length > 1023) message = message.Substring(0, 1023); @@ -118,9 +118,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// List of windlight parameters public LSL_List lsGetWindlightScene(LSL_List rules) { - if (!m_CMFunctionsEnabled) + if (!m_LSFunctionsEnabled) { - CMShoutError("LightShare functions are not enabled."); + LSShoutError("LightShare functions are not enabled."); return new LSL_List(); } m_host.AddScriptLPS(1); @@ -442,14 +442,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// success: true or false public int lsSetWindlightScene(LSL_List rules) { - if (!m_CMFunctionsEnabled) + if (!m_LSFunctionsEnabled) { - CMShoutError("LightShare functions are not enabled."); + LSShoutError("LightShare functions are not enabled."); return 0; } if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) { - CMShoutError("lsSetWindlightScene can only be used by estate managers or owners."); + LSShoutError("lsSetWindlightScene can only be used by estate managers or owners."); return 0; } int success = 0; @@ -462,7 +462,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else { - CMShoutError("Windlight module is disabled"); + LSShoutError("Windlight module is disabled"); return 0; } return success; @@ -474,14 +474,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// success: true or false public int lsSetWindlightSceneTargeted(LSL_List rules, LSL_Key target) { - if (!m_CMFunctionsEnabled) + if (!m_LSFunctionsEnabled) { - CMShoutError("LightShare functions are not enabled."); + LSShoutError("LightShare functions are not enabled."); return 0; } if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) { - CMShoutError("lsSetWindlightSceneTargeted can only be used by estate managers or owners."); + LSShoutError("lsSetWindlightSceneTargeted can only be used by estate managers or owners."); return 0; } int success = 0; @@ -494,7 +494,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else { - CMShoutError("Windlight module is disabled"); + LSShoutError("Windlight module is disabled"); return 0; } return success; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs similarity index 98% rename from OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs rename to OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs index f47ae7d485..9aa437b37e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs @@ -38,7 +38,7 @@ using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces { - public interface ICM_Api + public interface ILS_Api { // Windlight Functions LSL_List lsGetWindlightScene(LSL_List rules); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs similarity index 85% rename from OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs rename to OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs index 92c3d982d2..8280ca5b5c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs @@ -48,44 +48,44 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { public partial class ScriptBaseClass : MarshalByRefObject { - public ICM_Api m_CM_Functions; + public ILS_Api m_LS_Functions; - public void ApiTypeCM(IScriptApi api) + public void ApiTypeLS(IScriptApi api) { - if (!(api is ICM_Api)) + if (!(api is ILS_Api)) return; - m_CM_Functions = (ICM_Api)api; + m_LS_Functions = (ILS_Api)api; } public LSL_List lsGetWindlightScene(LSL_List rules) { - return m_CM_Functions.lsGetWindlightScene(rules); + return m_LS_Functions.lsGetWindlightScene(rules); } public int lsSetWindlightScene(LSL_List rules) { - return m_CM_Functions.lsSetWindlightScene(rules); + return m_LS_Functions.lsSetWindlightScene(rules); } public int lsSetWindlightSceneTargeted(LSL_List rules, key target) { - return m_CM_Functions.lsSetWindlightSceneTargeted(rules, target); + return m_LS_Functions.lsSetWindlightSceneTargeted(rules, target); } public LSL_List cmGetWindlightScene(LSL_List rules) { - return m_CM_Functions.lsGetWindlightScene(rules); + return m_LS_Functions.lsGetWindlightScene(rules); } public int cmSetWindlightScene(LSL_List rules) { - return m_CM_Functions.lsSetWindlightScene(rules); + return m_LS_Functions.lsSetWindlightScene(rules); } public int cmSetWindlightSceneTargeted(LSL_List rules, key target) { - return m_CM_Functions.lsSetWindlightSceneTargeted(rules, target); + return m_LS_Functions.lsSetWindlightSceneTargeted(rules, target); } } } From ef93ac44528f5e3294e1674e33f100b19dee61f0 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 11 Jun 2010 17:48:33 +0200 Subject: [PATCH 3/3] Remove the cm* function namespace --- .../ScriptEngine/Shared/Api/Runtime/LS_Stub.cs | 15 --------------- ...Sim.Region.ScriptEngine.Shared.Api.Runtime.mdp | 2 +- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs index 8280ca5b5c..f8dbe03ccc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs @@ -72,20 +72,5 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { return m_LS_Functions.lsSetWindlightSceneTargeted(rules, target); } - - public LSL_List cmGetWindlightScene(LSL_List rules) - { - return m_LS_Functions.lsGetWindlightScene(rules); - } - - public int cmSetWindlightScene(LSL_List rules) - { - return m_LS_Functions.lsSetWindlightScene(rules); - } - - public int cmSetWindlightSceneTargeted(LSL_List rules, key target) - { - return m_LS_Functions.lsSetWindlightSceneTargeted(rules, target); - } } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OpenSim.Region.ScriptEngine.Shared.Api.Runtime.mdp b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OpenSim.Region.ScriptEngine.Shared.Api.Runtime.mdp index 23138efc4a..f02d2d90dc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OpenSim.Region.ScriptEngine.Shared.Api.Runtime.mdp +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OpenSim.Region.ScriptEngine.Shared.Api.Runtime.mdp @@ -18,10 +18,10 @@ - +