From 0dd3281caf09090e86036d67a34939b0e31c1b16 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Tue, 21 Jun 2011 12:43:44 +0300 Subject: Optionally, don't delete previously compiled scripts on startup --- .../Region/ScriptEngine/Shared/CodeTools/Compiler.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index 49d6abe..734d4d5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs @@ -106,6 +106,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools // Get some config WriteScriptSourceToDebugFile = m_scriptEngine.Config.GetBoolean("WriteScriptSourceToDebugFile", false); CompileWithDebugInformation = m_scriptEngine.Config.GetBoolean("CompileWithDebugInformation", true); + bool DeleteScriptsOnStartup = m_scriptEngine.Config.GetBoolean("DeleteScriptsOnStartup", true); // Get file prefix from scriptengine name and make it file system safe: FilePrefix = "CommonCompiler"; @@ -114,11 +115,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools FilePrefix = FilePrefix.Replace(c, '_'); } - // First time we start? Delete old files if (in_startup) { in_startup = false; - DeleteOldFiles(); + CreateScriptsDirectory(); + + // First time we start? Delete old files + if (DeleteScriptsOnStartup) + DeleteOldFiles(); } // Map name and enum type of our supported languages @@ -187,11 +191,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools } /// - /// Delete old script files + /// Create the directory where compiled scripts are stored. /// - private void DeleteOldFiles() + private void CreateScriptsDirectory() { - // CREATE FOLDER IF IT DOESNT EXIST if (!Directory.Exists(ScriptEnginesPath)) { try @@ -218,7 +221,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools m_scriptEngine.World.RegionInfo.RegionID.ToString()) + "\": " + ex.ToString()); } } + } + /// + /// Delete old script files + /// + private void DeleteOldFiles() + { foreach (string file in Directory.GetFiles(Path.Combine(ScriptEnginesPath, m_scriptEngine.World.RegionInfo.RegionID.ToString()), FilePrefix + "_compiled*")) { -- cgit v1.1 From 882d5c82b308a95c4897893d2b8e6b816f827d31 Mon Sep 17 00:00:00 2001 From: Makopoppo Date: Fri, 24 Jun 2011 19:40:21 +0900 Subject: [PATCH 1/2] Fixed the function names of some OSSL functions shown as threat-level check error message Signed-off-by: BlueWall --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 64931d0..201fef4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -970,7 +970,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osDrawPolygon(string drawList, LSL_List x, LSL_List y) { - CheckThreatLevel(ThreatLevel.None, "osDrawFilledPolygon"); + CheckThreatLevel(ThreatLevel.None, "osDrawPolygon"); m_host.AddScriptLPS(1); @@ -1409,7 +1409,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { // What actually is the difference to the LL function? // - CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelMediaURL"); + CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelSIPAddress"); m_host.AddScriptLPS(1); @@ -2301,7 +2301,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules) { - CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams"); + CheckThreatLevel(ThreatLevel.High, "osSetPrimitiveParams"); m_host.AddScriptLPS(1); m_LSL_Api.SetPrimitiveParamsEx(prim, rules); -- cgit v1.1 From ffa790d69d4e9b1b50470f84b0ad198098dc2736 Mon Sep 17 00:00:00 2001 From: Makopoppo Date: Mon, 27 Jun 2011 19:30:42 +0900 Subject: [PATCH] Get osGetWindParam() and osSetWindParam() accessible Signed-off-by: BlueWall --- .../Shared/Api/Implementation/OSSL_Api.cs | 6 +++--- .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 4 ++-- .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 19 +++++++++---------- 3 files changed, 14 insertions(+), 15 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 201fef4..f32ecca 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1241,7 +1241,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return String.Empty; } - public void osSetWindParam(string plugin, string param, float value) + public void osSetWindParam(string plugin, string param, LSL_Float value) { CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam"); m_host.AddScriptLPS(1); @@ -1251,13 +1251,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { try { - module.WindParamSet(plugin, param, value); + module.WindParamSet(plugin, param, (float)value); } catch (Exception) { } } } - public float osGetWindParam(string plugin, string param) + public LSL_Float osGetWindParam(string plugin, string param) { CheckThreatLevel(ThreatLevel.VeryLow, "osGetWindParam"); m_host.AddScriptLPS(1); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 63007c6..7227b40 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -129,8 +129,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces // Wind Module Functions string osWindActiveModelPluginName(); - void osSetWindParam(string plugin, string param, float value); - float osGetWindParam(string plugin, string param); + void osSetWindParam(string plugin, string param, LSL_Float value); + LSL_Float osGetWindParam(string plugin, string param); // Parcel commands void osParcelJoin(vector pos1, vector pos2); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index e3ea556..f5bdc68 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -106,16 +106,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osWindActiveModelPluginName(); } -// Not yet plugged in as available OSSL functions, so commented out -// void osSetWindParam(string plugin, string param, float value) -// { -// m_OSSL_Functions.osSetWindParam(plugin, param, value); -// } -// -// float osGetWindParam(string plugin, string param) -// { -// return m_OSSL_Functions.osGetWindParam(plugin, param); -// } + public void osSetWindParam(string plugin, string param, LSL_Float value) + { + m_OSSL_Functions.osSetWindParam(plugin, param, value); + } + + public LSL_Float osGetWindParam(string plugin, string param) + { + return m_OSSL_Functions.osGetWindParam(plugin, param); + } public void osParcelJoin(vector pos1, vector pos2) { -- cgit v1.1 From 80010f89085af9517e26af01dfe7cbc99788aa31 Mon Sep 17 00:00:00 2001 From: Makopoppo Date: Tue, 28 Jun 2011 22:21:53 +0900 Subject: [PATCH] osSetSpeed() will accept float number Signed-off-by: BlueWall --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 4 ++-- OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 2 +- OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index f32ecca..b098f09 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -2209,12 +2209,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return (int)pws; } - public void osSetSpeed(string UUID, float SpeedModifier) + public void osSetSpeed(string UUID, LSL_Float SpeedModifier) { CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); m_host.AddScriptLPS(1); ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); - avatar.SpeedModifier = SpeedModifier; + avatar.SpeedModifier = (float)SpeedModifier; } public void osKickAvatar(string FirstName,string SurName,string alert) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 7227b40..19352f0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -180,7 +180,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces int osGetSimulatorMemory(); void osKickAvatar(string FirstName,string SurName,string alert); - void osSetSpeed(string UUID, float SpeedModifier); + void osSetSpeed(string UUID, LSL_Float SpeedModifier); void osCauseHealing(string avatar, double healing); void osCauseDamage(string avatar, double damage); LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index f5bdc68..7c59098 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -713,7 +713,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase m_OSSL_Functions.osKickAvatar(FirstName, SurName, alert); } - public void osSetSpeed(string UUID, float SpeedModifier) + public void osSetSpeed(string UUID, LSL_Float SpeedModifier) { m_OSSL_Functions.osSetSpeed(UUID, SpeedModifier); } -- cgit v1.1 From ee92f22f2ab9a1f2926ac3a9d4e1b9c26945d898 Mon Sep 17 00:00:00 2001 From: Makopoppo Date: Sat, 25 Jun 2011 11:13:55 +0900 Subject: [PATCH 2/2] [FIX] osGetPrimitiveParams() and osSetPrimitiveParams() crashes throwing System.NullReferenceException Signed-off-by: BlueWall --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index b098f09..963727d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -2295,6 +2295,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams"); m_host.AddScriptLPS(1); + InitLSL(); return m_LSL_Api.GetLinkPrimitiveParamsEx(prim, rules); } @@ -2303,6 +2304,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.High, "osSetPrimitiveParams"); m_host.AddScriptLPS(1); + InitLSL(); m_LSL_Api.SetPrimitiveParamsEx(prim, rules); } -- cgit v1.1