From e2167716aab0d11e09317fcda2001dcabb3a04a5 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 7 Jan 2017 21:44:01 +0000 Subject: change OSSL enable option GOD to use IsGod, so it means a active god, as my original idea --- .../ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 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 066f6a4..07549f8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -415,24 +415,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } - //Only gods may use the function - if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("GOD")) + + //Only grid gods may use the function + if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("GRID_GOD")) { - if (World.Permissions.IsGod(ownerID)) + if (World.Permissions.IsGridGod(ownerID)) { return String.Empty; } } - //Only grid gods may use the function - if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("GRID_GOD")) + //Only active gods may use the function + if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("GOD")) { - if (World.Permissions.IsGridGod(ownerID)) + ScenePresence sp = World.GetScenePresence(ownerID); + if (sp != null && !sp.IsDeleted && sp.IsGod) { return String.Empty; } } + if (!m_FunctionPerms[function].AllowedCreators.Contains(m_item.CreatorID)) return( String.Format("{0} permission denied. Script creator is not in the list of users allowed to execute this function and prim owner also has no permission.", -- cgit v1.1 From 2d0860ac513f27885620279b83a6be2f703cc8c7 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 7 Jan 2017 22:51:56 +0000 Subject: rename OSSL enable option GOD as ACTIVE_GOD so its use is more clear --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 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 07549f8..f40bf20 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -310,7 +310,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api foreach (string id in ids) { string current = id.Trim(); - if (current.ToUpper() == "PARCEL_GROUP_MEMBER" || current.ToUpper() == "PARCEL_OWNER" || current.ToUpper() == "ESTATE_MANAGER" || current.ToUpper() == "ESTATE_OWNER" || current.ToUpper() == "GOD" || current.ToUpper() == "GRID_GOD") + if (current.ToUpper() == "PARCEL_GROUP_MEMBER" || current.ToUpper() == "PARCEL_OWNER" || current.ToUpper() == "ESTATE_MANAGER" || current.ToUpper() == "ESTATE_OWNER" || current.ToUpper() == "ACTIVE_GOD" || current.ToUpper() == "GRID_GOD") { if (!perms.AllowedOwnerClasses.Contains(current)) perms.AllowedOwnerClasses.Add(current.ToUpper()); @@ -426,7 +426,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } //Only active gods may use the function - if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("GOD")) + if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("ACTIVE_GOD")) { ScenePresence sp = World.GetScenePresence(ownerID); if (sp != null && !sp.IsDeleted && sp.IsGod) -- cgit v1.1 From e5244fe70830d6c9ece23d26039d5cbabe9ce9ff Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 7 Jan 2017 22:53:46 +0000 Subject: Allow OSSL scripts to softfail --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 +- OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (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 07549f8..06717c6 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -431,7 +431,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ScenePresence sp = World.GetScenePresence(ownerID); if (sp != null && !sp.IsDeleted && sp.IsGod) { - return String.Empty; + return "Softfail"; } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 9d72b1c..f4ea5e9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -927,6 +927,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance if(e.InnerException != null && e.InnerException is ScriptException) { + if (e.InnerException.Message == "Softfail") + return; + string text = e.InnerException.Message + "(script: " + ScriptName + " event: " + data.EventName + -- cgit v1.1 From f457925f80ec1651975fc5208cbc06be3ae8891e Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 7 Jan 2017 23:12:51 +0000 Subject: Fix a compile issue and reintroduce the "GOD" script option --- .../Shared/Api/Implementation/OSSL_Api.cs | 11 +++++- .../ScriptEngine/Shared/Instance/ScriptInstance.cs | 44 +++++++++++----------- 2 files changed, 32 insertions(+), 23 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 bb475a2..5b783f7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -310,7 +310,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api foreach (string id in ids) { string current = id.Trim(); - if (current.ToUpper() == "PARCEL_GROUP_MEMBER" || current.ToUpper() == "PARCEL_OWNER" || current.ToUpper() == "ESTATE_MANAGER" || current.ToUpper() == "ESTATE_OWNER" || current.ToUpper() == "ACTIVE_GOD" || current.ToUpper() == "GRID_GOD") + if (current.ToUpper() == "PARCEL_GROUP_MEMBER" || current.ToUpper() == "PARCEL_OWNER" || current.ToUpper() == "ESTATE_MANAGER" || current.ToUpper() == "ESTATE_OWNER" || current.ToUpper() == "ACTIVE_GOD" || current.ToUpper() == "GRID_GOD" || current.ToUpper() == "GOD") { if (!perms.AllowedOwnerClasses.Contains(current)) perms.AllowedOwnerClasses.Add(current.ToUpper()); @@ -425,6 +425,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } + //Any god may use the function + if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("GOD")) + { + if (World.Permissions.IsAdministrator(ownerID)) + { + return String.Empty; + } + } + //Only active gods may use the function if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("ACTIVE_GOD")) { diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index f4ea5e9..de0a80d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -927,28 +927,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance if(e.InnerException != null && e.InnerException is ScriptException) { - if (e.InnerException.Message == "Softfail") - return; - - string text = e.InnerException.Message + - "(script: " + ScriptName + - " event: " + data.EventName + - " at " + Part.AbsolutePosition + ")"; - if (text.Length > 1000) - text = text.Substring(0, 1000); - Engine.World.SimChat(Utils.StringToBytes(text), - ChatTypeEnum.DebugChannel, 2147483647, - Part.AbsolutePosition, - Part.Name, Part.UUID, false); - m_log.Debug(string.Format( - "[SCRIPT INSTANCE]: {0} (at event {1}, part {2} {3} at {4} in {5}", - e.InnerException.Message, - data.EventName, - PrimName, - Part.UUID, - Part.AbsolutePosition, - Part.ParentGroup.Scene.Name)); - + if (e.InnerException.Message != "Softfail") + { + string text = e.InnerException.Message + + "(script: " + ScriptName + + " event: " + data.EventName + + " at " + Part.AbsolutePosition + ")"; + if (text.Length > 1000) + text = text.Substring(0, 1000); + Engine.World.SimChat(Utils.StringToBytes(text), + ChatTypeEnum.DebugChannel, 2147483647, + Part.AbsolutePosition, + Part.Name, Part.UUID, false); + m_log.Debug(string.Format( + "[SCRIPT INSTANCE]: {0} (at event {1}, part {2} {3} at {4} in {5}", + e.InnerException.Message, + data.EventName, + PrimName, + Part.UUID, + Part.AbsolutePosition, + Part.ParentGroup.Scene.Name)); + + } } else { -- cgit v1.1 From 556d95ef0581c01e9018e80cc06f755f288d2bca Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 7 Jan 2017 23:36:07 +0000 Subject: Revert "Allow OSSL scripts to softfail" This reverts commit e5244fe70830d6c9ece23d26039d5cbabe9ce9ff. Conflicts: OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs --- .../Shared/Api/Implementation/OSSL_Api.cs | 2 +- .../ScriptEngine/Shared/Instance/ScriptInstance.cs | 41 ++++++++++------------ 2 files changed, 20 insertions(+), 23 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 5b783f7..e769c6d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -440,7 +440,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ScenePresence sp = World.GetScenePresence(ownerID); if (sp != null && !sp.IsDeleted && sp.IsGod) { - return "Softfail"; + return String.Empty; } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index de0a80d..9d72b1c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -927,28 +927,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance if(e.InnerException != null && e.InnerException is ScriptException) { - if (e.InnerException.Message != "Softfail") - { - string text = e.InnerException.Message + - "(script: " + ScriptName + - " event: " + data.EventName + - " at " + Part.AbsolutePosition + ")"; - if (text.Length > 1000) - text = text.Substring(0, 1000); - Engine.World.SimChat(Utils.StringToBytes(text), - ChatTypeEnum.DebugChannel, 2147483647, - Part.AbsolutePosition, - Part.Name, Part.UUID, false); - m_log.Debug(string.Format( - "[SCRIPT INSTANCE]: {0} (at event {1}, part {2} {3} at {4} in {5}", - e.InnerException.Message, - data.EventName, - PrimName, - Part.UUID, - Part.AbsolutePosition, - Part.ParentGroup.Scene.Name)); - - } + string text = e.InnerException.Message + + "(script: " + ScriptName + + " event: " + data.EventName + + " at " + Part.AbsolutePosition + ")"; + if (text.Length > 1000) + text = text.Substring(0, 1000); + Engine.World.SimChat(Utils.StringToBytes(text), + ChatTypeEnum.DebugChannel, 2147483647, + Part.AbsolutePosition, + Part.Name, Part.UUID, false); + m_log.Debug(string.Format( + "[SCRIPT INSTANCE]: {0} (at event {1}, part {2} {3} at {4} in {5}", + e.InnerException.Message, + data.EventName, + PrimName, + Part.UUID, + Part.AbsolutePosition, + Part.ParentGroup.Scene.Name)); + } else { -- cgit v1.1