diff --git a/OpenSim/Framework/InventoryFolderBase.cs b/OpenSim/Framework/InventoryFolderBase.cs index fb66056fba..3b262cc1e3 100644 --- a/OpenSim/Framework/InventoryFolderBase.cs +++ b/OpenSim/Framework/InventoryFolderBase.cs @@ -48,9 +48,7 @@ namespace OpenSim.Framework private short _type; /// - /// This is used to denote the version of the client, needed - /// because of the changes clients have with inventory from - /// time to time (1.19.1 caused us some fits there). + /// This is used to denote the version of folder /// private ushort _version; diff --git a/OpenSim/Framework/OutboundUrlFilter.cs b/OpenSim/Framework/OutboundUrlFilter.cs index 63ae361448..2e3cc2ca15 100644 --- a/OpenSim/Framework/OutboundUrlFilter.cs +++ b/OpenSim/Framework/OutboundUrlFilter.cs @@ -33,6 +33,8 @@ using System.Reflection; using log4net; using LukeSkywalker.IPNetwork; using Nini.Config; +using IPNetwork = LukeSkywalker.IPNetwork.IPNetwork; + namespace OpenSim.Framework { diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index b17637ccc1..139f94c360 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -9694,6 +9694,83 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api break; + case ScriptBaseClass.PRIM_REFLECTION_PROBE: + if (remain < 4) + return new LSL_List(); + + bool reflection_probe_active; + float reflection_probe_ambiance; + float reflection_probe_clip_distance; + int reflection_probe_flags; + + try + { + reflection_probe_active = rules.GetIntegerItem(idx++) != 0; + } + catch (InvalidCastException) + { + Error(originFunc, $"Error running rule #{rulesParsed} -> PRIM_REFLECTION_PROBE: arg #{idx - idxStart - 1} - parameter 1 (active) must be integer"); + return new LSL_List(); + } + try + { + reflection_probe_ambiance = rules.GetStrictFloatItem(idx++); + } + catch (InvalidCastException) + { + Error(originFunc, $"Error running rule #{rulesParsed} -> PRIM_REFLECTION_PROBE: arg #{idx - idxStart - 1} - parameter 2 (ambiance) must be float"); + return new LSL_List(); + } + try + { + reflection_probe_clip_distance = rules.GetStrictFloatItem(idx++); + } + catch (InvalidCastException) + { + Error(originFunc, $"Error running rule #{rulesParsed} -> PRIM_REFLECTION_PROBE: arg #{idx - idxStart - 1} - parameter 3 (clip_distance) must be float"); + return new LSL_List(); + } + try + { + reflection_probe_flags = rules.GetIntegerItem(idx++); + } + catch (InvalidCastException) + { + Error(originFunc, $"Error running rule #{rulesParsed} -> PRIM_REFLECTION_PROBE: arg #{idx - idxStart - 1} - parameter 4 (flags) must be integer"); + return new LSL_List(); + } + + bool probechanged; + if(reflection_probe_active) + { + probechanged = part.Shape.ReflectionProbe is null; + if(probechanged) + part.Shape.ReflectionProbe = new(); + + reflection_probe_ambiance = Utils.Clamp(reflection_probe_ambiance, 0f, 100f); + probechanged |= part.Shape.ReflectionProbe.Ambiance != reflection_probe_ambiance; + part.Shape.ReflectionProbe.Ambiance = reflection_probe_ambiance; + + reflection_probe_clip_distance = Utils.Clamp(reflection_probe_clip_distance, 0f, 1024f); + probechanged |= part.Shape.ReflectionProbe.ClipDistance != reflection_probe_clip_distance; + part.Shape.ReflectionProbe.ClipDistance = reflection_probe_clip_distance; + + probechanged |= part.Shape.ReflectionProbe.Flags != reflection_probe_flags; + part.Shape.ReflectionProbe.Flags = (byte)reflection_probe_flags; + } + else + { + probechanged = part.Shape.ReflectionProbe is not null; + part.Shape.ReflectionProbe = null; + } + + if(probechanged) + { + part.ParentGroup.HasGroupChanged = true; + part.ScheduleFullUpdate(); + } + break; + case ScriptBaseClass.PRIM_GLOW: if (remain < 2) return new LSL_List(); @@ -11450,6 +11527,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api res.Add(new LSL_Float(shape.LightFalloff)); // falloff break; + case ScriptBaseClass.PRIM_REFLECTION_PROBE: + shape = part.Shape; + if (shape.ReflectionProbe is null) + { + res.Add(new LSL_Integer(0)); + res.Add(new LSL_Float(0f)); // ambiance + res.Add(new LSL_Float(0f)); // clip + res.Add(new LSL_Float(0f)); // flags + } + else + { + res.Add(new LSL_Integer(1)); + res.Add(new LSL_Float(shape.ReflectionProbe.Ambiance)); // ambiance + res.Add(new LSL_Float(shape.ReflectionProbe.ClipDistance)); // clip + res.Add(new LSL_Float(shape.ReflectionProbe.Flags)); // flags + } + break; + case ScriptBaseClass.PRIM_GLOW: if (remain < 1) return new LSL_List(); @@ -17208,12 +17303,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case ScriptBaseClass.PRIM_POINT_LIGHT: res.Add(new LSL_Integer(0)); - res.Add(new LSL_Vector(0f,0f,0f)); + res.Add(new LSL_Vector(0f, 0f, 0f)); res.Add(new LSL_Float(0f)); // intensity res.Add(new LSL_Float(0f)); // radius res.Add(new LSL_Float(0f)); // falloff break; + case ScriptBaseClass.PRIM_REFLECTION_PROBE: + res.Add(new LSL_Integer(0)); + res.Add(new LSL_Float(0f)); // ambiance + res.Add(new LSL_Float(0f)); // clip + res.Add(new LSL_Float(0f)); // flags + break; + case ScriptBaseClass.PRIM_GLOW: if (remain < 1) return new LSL_List(); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index 5ea728d9de..bca218d713 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs @@ -433,7 +433,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public const int PRIM_FULLBRIGHT = 20; public const int PRIM_FLEXIBLE = 21; public const int PRIM_TEXGEN = 22; - public const int PRIM_POINT_LIGHT = 23; // Huh? + public const int PRIM_POINT_LIGHT = 23; //ApiDesc not supported public const int PRIM_CAST_SHADOWS = 24; // Not implemented, here for completeness sake public const int PRIM_GLOW = 25; @@ -457,6 +457,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public const int PRIM_SIT_TARGET = 41; public const int PRIM_PROJECTOR = 42; + public const int PRIM_REFLECTION_PROBE = 44; + // parameters @@ -529,6 +531,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public const int PRIM_PHYSICS_SHAPE_NONE = 1; public const int PRIM_PHYSICS_SHAPE_CONVEX = 2; + // PRIM_REFLECTION_PROBE flags + public const int PRIM_REFLECTION_PROBE_BOX = 1 << 0; // 1 + public const int PRIM_REFLECTION_PROBE_DYNAMIC = 1 << 1; // 2 + public const int PROFILE_NONE = 0; public const int PROFILE_SCRIPT_MEMORY = 1; diff --git a/OpenSim/Region/ScriptEngine/Shared/ScriptException.cs b/OpenSim/Region/ScriptEngine/Shared/ScriptException.cs index f55ba7e6c5..653658ebfe 100644 --- a/OpenSim/Region/ScriptEngine/Shared/ScriptException.cs +++ b/OpenSim/Region/ScriptEngine/Shared/ScriptException.cs @@ -39,6 +39,5 @@ namespace OpenSim.Region.ScriptEngine.Shared public ScriptException(string message, Exception innerException) : base(message, innerException) {} - public ScriptException(SerializationInfo info, StreamingContext context) :base(info, context) {} } } \ No newline at end of file diff --git a/OpenSim/Region/ScriptEngine/YEngine/MMRScriptCodeGen.cs b/OpenSim/Region/ScriptEngine/YEngine/MMRScriptCodeGen.cs index 7726f17b5f..dd42551443 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/MMRScriptCodeGen.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/MMRScriptCodeGen.cs @@ -6320,9 +6320,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine { this.stateName = stateName; } - protected ScriptUndefinedStateException(SerializationInfo info, StreamingContext context) : base(info, context) - { - } } /** @@ -6346,13 +6343,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine { this.thrown = thrown; } - - /** - * @brief Used by serialization/deserialization. - */ - protected ScriptThrownException(SerializationInfo info, StreamingContext context) : base(info, context) - { - } } /** @@ -6366,9 +6356,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine { this.newState = newState; } - protected ScriptChangeStateException(SerializationInfo info, StreamingContext context) : base(info, context) - { - } } /** @@ -6419,9 +6406,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine public class ScriptBadCallNoException: Exception { public ScriptBadCallNoException(int callNo) : base("bad callNo " + callNo) { } - protected ScriptBadCallNoException(SerializationInfo info, StreamingContext context) : base(info, context) - { - } } public class CVVMismatchException: Exception diff --git a/ThirdParty/SmartThreadPool/Exceptions.cs b/ThirdParty/SmartThreadPool/Exceptions.cs index 728df853be..91f88d54b0 100644 --- a/ThirdParty/SmartThreadPool/Exceptions.cs +++ b/ThirdParty/SmartThreadPool/Exceptions.cs @@ -64,43 +64,5 @@ namespace Amib.Threading { } } - - - /// - /// Represents an exception in case IWorkItemResult.GetResult has been canceled - /// - [Serializable] - public sealed partial class WorkItemCancelException - { - public WorkItemCancelException(SerializationInfo si, StreamingContext sc) - : base(si, sc) - { - } - } - - /// - /// Represents an exception in case IWorkItemResult.GetResult has been timed out - /// - [Serializable] - public sealed partial class WorkItemTimeoutException - { - public WorkItemTimeoutException(SerializationInfo si, StreamingContext sc) - : base(si, sc) - { - } - } - - /// - /// Represents an exception in case IWorkItemResult.GetResult has been timed out - /// - [Serializable] - public sealed partial class WorkItemResultException - { - public WorkItemResultException(SerializationInfo si, StreamingContext sc) - : base(si, sc) - { - } - } - #endregion }