remove some obsolete code

This commit is contained in:
UbitUmarov 2023-11-29 12:17:08 +00:00
parent a948cccbe2
commit 79ac5c7f54
7 changed files with 113 additions and 60 deletions

View File

@ -48,9 +48,7 @@ namespace OpenSim.Framework
private short _type;
/// <summary>
/// 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
/// </summary>
private ushort _version;

View File

@ -33,6 +33,8 @@ using System.Reflection;
using log4net;
using LukeSkywalker.IPNetwork;
using Nini.Config;
using IPNetwork = LukeSkywalker.IPNetwork.IPNetwork;
namespace OpenSim.Framework
{

View File

@ -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();

View File

@ -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;

View File

@ -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) {}
}
}

View File

@ -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

View File

@ -64,43 +64,5 @@ namespace Amib.Threading
{
}
}
/// <summary>
/// Represents an exception in case IWorkItemResult.GetResult has been canceled
/// </summary>
[Serializable]
public sealed partial class WorkItemCancelException
{
public WorkItemCancelException(SerializationInfo si, StreamingContext sc)
: base(si, sc)
{
}
}
/// <summary>
/// Represents an exception in case IWorkItemResult.GetResult has been timed out
/// </summary>
[Serializable]
public sealed partial class WorkItemTimeoutException
{
public WorkItemTimeoutException(SerializationInfo si, StreamingContext sc)
: base(si, sc)
{
}
}
/// <summary>
/// Represents an exception in case IWorkItemResult.GetResult has been timed out
/// </summary>
[Serializable]
public sealed partial class WorkItemResultException
{
public WorkItemResultException(SerializationInfo si, StreamingContext sc)
: base(si, sc)
{
}
}
#endregion
}