very useless changes

This commit is contained in:
UbitUmarov
2025-06-25 02:22:28 +01:00
parent f1d84b7866
commit 0d71b6d871
78 changed files with 123 additions and 223 deletions

View File

@@ -579,7 +579,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
[DebuggerNonUserCode]
public void llResetScript()
{
// We need to tell the URL module, if we hav one, to release
// the allocated URLs
m_UrlModule?.ScriptRemoved(m_item.ItemID);
@@ -1314,7 +1313,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (gr is not null)
return gr.GroupName;
}
return String.Empty;
return string.Empty;
}
return SensedObject.Name;
@@ -1680,7 +1679,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llSetContentType(LSL_Key reqid, LSL_Integer type)
{
if (m_UrlModule == null)
return;
@@ -2228,7 +2226,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llScaleTexture(double u, double v, int face)
{
ScaleTexture(m_host, u, v, face);
ScriptSleep(m_sleepMsOnScaleTexture);
}
@@ -2532,7 +2529,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llSetRot(LSL_Rotation rot)
{
// try to let this work as in SL...
if (m_host.ParentID == 0 || (m_host.ParentGroup != null && m_host == m_host.ParentGroup.RootPart))
{
@@ -2999,7 +2995,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/// </summary>
public LSL_String llGetSubString(string src, int start, int end)
{
// Normalize indices (if negative).
// After normlaization they may still be
// negative, but that is now relative to
@@ -3936,7 +3931,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Float llGetMass()
{
if (m_host.ParentGroup.IsAttachment)
{
ScenePresence attachedAvatar = World.GetScenePresence(m_host.ParentGroup.AttachedAvatar);
@@ -4391,7 +4385,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
}
public void llStopAnimation(string anim)
{
@@ -4965,7 +4958,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_String llGetLinkName(int linknum)
{
ISceneEntity entity = GetLinkEntity(m_host, linknum);
return (entity is null) ? ScriptBaseClass.NULL_KEY : entity.Name;
}
@@ -5117,7 +5109,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
if (visualparams.Length < 1)
return new LSL_List();
if (UUID.TryParse(id, out UUID agentid))
{
ScenePresence agent = World.GetScenePresence(agentid);
@@ -5125,7 +5116,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return new LSL_List();
LSL_List returns = new LSL_List();
for (int i = 0; i < visualparams.Length; i++)
{
int val = visualparams[i].ToString() switch
@@ -5154,7 +5144,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
returns.Add(fval.ToString());
}
}
if (returns.Length > 0)
return returns;
}
@@ -5273,7 +5262,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
Error("llRequestAgentData","Invalid UUID passed to llRequestAgentData.");
}
return String.Empty;
return string.Empty;
}
//bad if lm is HG
@@ -5281,7 +5270,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
void act(string eventID)
{
string reply = String.Empty;
string reply = string.Empty;
foreach (TaskInventoryItem item in m_host.Inventory.GetInventoryItems())
{
if (item.Type == 3 && item.Name == name)
@@ -5685,7 +5674,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
float scaling_factor = 1f;
scaling_factor *= distance_attenuation;
applied_linear_impulse *= scaling_factor;
}
if (pusheeIsAvatar)
@@ -5720,8 +5708,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_String llGetScriptName()
{
return m_item.Name ?? String.Empty;
return m_item.Name ?? string.Empty;
}
public LSL_Integer llGetLinkNumberOfSides(int link)
@@ -5741,7 +5728,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Integer llGetNumberOfSides()
{
return m_host.GetNumberOfSides();
}
@@ -5755,7 +5741,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// q = cos(a/2) + i (x * sin(a/2)) + j (y * sin(a/2)) + k (z * sin(a/2))
public LSL_Rotation llAxisAngle2Rot(LSL_Vector axis, double angle)
{
double x, y, z, s, t;
s = Math.Cos(angle * 0.5);
@@ -5775,7 +5760,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/// <param name='rot'></param>
public LSL_Vector llRot2Axis(LSL_Rotation rot)
{
rot.Normalize();
double s = Math.Sqrt(1 - rot.s * rot.s);
@@ -5792,7 +5776,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// Returns the angle of a quaternion (see llRot2Axis for the axis)
public LSL_Float llRot2Angle(LSL_Rotation rot)
{
rot.Normalize();
double angle = 2 * Math.Acos(rot.s);
@@ -5815,7 +5798,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// jcochran 5/jan/2012
public LSL_Float llAngleBetween(LSL_Rotation a, LSL_Rotation b)
{
double aa = (a.x * a.x + a.y * a.y + a.z * a.z + a.s * a.s);
double bb = (b.x * b.x + b.y * b.y + b.z * b.z + b.s * b.s);
double aa_bb = aa * bb;
@@ -5828,7 +5810,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Key llGetInventoryKey(string name)
{
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name);
if (item is null)
return ScriptBaseClass.NULL_KEY;
@@ -6070,7 +6051,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if(item is LSL_Vector vec)
return vec;
if (item is LSL_String lsv)
return new LSL_Vector(lsv);
if (item is string sv) // xengine sees string
@@ -6140,7 +6120,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return 0;
}
/// <summary>
/// Process the supplied list and return the
/// content of the list formatted as a comma
@@ -6280,8 +6259,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return result;
}
public LSL_List llList2ListStrided(LSL_List src, int start, int end, int stride)
{
if (start < 0)
@@ -6357,6 +6334,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (end < 0)
end = 0;
}
if (start > end)
{
start = 0;
@@ -6369,8 +6347,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (end >= src.Length)
end = src.Length - 1;
}
if (stride < 1)
stride = 1;
if (stride_index < 0)
{
stride_index += stride;
@@ -6379,6 +6359,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
else if (stride_index >= stride)
return new LSL_List();
int size;
if (stride > 1)
{
@@ -6388,6 +6369,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
sst *= stride;
if (sst != start)
start = sst + stride;
if (start > end)
return new LSL_List();
}
@@ -6400,6 +6382,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
else
size = end - start + 1;
object[] res = new object[size];
int j = 0;
for (int i = start; i <= end; i += stride, j++)
@@ -6548,6 +6531,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
/// <summary>
/// Returns the index of the first occurrence of test
/// in src.
@@ -6675,7 +6660,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
}
return -1;
}
@@ -7080,7 +7064,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Key llName2Key(LSL_String name)
{
if(string.IsNullOrWhiteSpace(name))
return ScriptBaseClass.NULL_KEY;
@@ -7107,7 +7090,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Key llRequestUserKey(LSL_String username)
{
if (string.IsNullOrWhiteSpace(username))
return ScriptBaseClass.NULL_KEY;
@@ -7220,7 +7202,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
private static void SetTextureAnim(SceneObjectPart part, int mode, int face, int sizex, int sizey, double start, double length, double rate)
{
//ALL_SIDES
if (face == ScriptBaseClass.ALL_SIDES)
face = 255;
@@ -7481,7 +7462,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_List llGetAttachedList(LSL_Key id)
{
if(!UUID.TryParse(id, out UUID avID) || avID.IsZero())
return new LSL_List("NOT_FOUND");
@@ -9003,7 +8983,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llSetPrimitiveParams(LSL_List rules)
{
SetLinkPrimParams(ScriptBaseClass.LINK_THIS, rules, "llSetPrimitiveParams");
ScriptSleep(m_sleepMsOnSetPrimitiveParams);
@@ -9011,7 +8990,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llSetLinkPrimitiveParams(int linknumber, LSL_List rules)
{
SetLinkPrimParams(linknumber, rules, "llSetLinkPrimitiveParams");
ScriptSleep(m_sleepMsOnSetLinkPrimitiveParams);
@@ -9019,7 +8997,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llSetLinkPrimitiveParamsFast(int linknumber, LSL_List rules)
{
SetLinkPrimParams(linknumber, rules, "llSetLinkPrimitiveParamsFast");
}
@@ -12888,7 +12865,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
int i, j;
string d;
/*
* Convert separator and spacer lists to C# strings.
* Also filter out null strings so we don't hang.
@@ -13172,7 +13148,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (item is null)
{
Error("llGetInventoryCreator", $"Can't find item '{itemName}'");
return String.Empty;
return string.Empty;
}
return item.CreatorID.ToString();
@@ -13180,7 +13156,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_String llGetInventoryAcquireTime(string itemName)
{
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(itemName);
if (item is null)
{
@@ -13405,7 +13380,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
LSL_List pref;
// Note that although we have normalized, both
// indices could still be negative.
if (start < 0)
@@ -13785,7 +13759,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
//PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later)
for (int i = 0; i < aList.Data.Length; i++)
{
if (aList.Data[i] != null)
{
switch ((ParcelMediaCommandEnum) Convert.ToInt32(aList.Data[i].ToString()))
@@ -13838,7 +13811,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Integer llGetInventoryType(string name)
{
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name);
return item is null ? -1 : item.Type;
}
@@ -13887,7 +13859,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Rotation llGetCameraRot()
{
if (m_item.PermsGranter.IsZero())
return LSL_Rotation.Identity;
@@ -14697,7 +14668,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return reqID.IsZero() ? string.Empty : reqID.ToString();
}
public void llHTTPResponse(LSL_Key id, int status, string body)
{
// Partial implementation: support for parameter flags needed
@@ -14800,7 +14770,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Integer llGetObjectPrimCount(LSL_Key object_id)
{
if(!UUID.TryParse(object_id, out UUID id) || id.IsZero())
return 0;
@@ -15198,7 +15167,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
break;
case ScriptBaseClass.OBJECT_ROT:
Quaternion rot;
if (obj.ParentGroup.IsAttachment)
{
ScenePresence sp = World.GetScenePresence(obj.ParentGroup.AttachedAvatar);
@@ -15844,7 +15812,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
void act(string eventID)
{
string name = String.Empty;
string name = string.Empty;
ScenePresence presence = World.GetScenePresence(key);
if (presence is not null)
{
@@ -17385,7 +17353,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llGodLikeRezObject(string inventory, LSL_Vector pos)
{
if (!World.Permissions.IsGod(m_host.OwnerID))
NotImplemented("llGodLikeRezObject");
@@ -18097,7 +18064,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return LSL_String.Empty;
}
string state = String.Empty;
string state = string.Empty;
foreach (KeyValuePair<string, string> kvp in MovementAnimationsForLSL)
{

View File

@@ -529,7 +529,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
if ((m_item.CurrentPermissions & (uint)PermissionMask.Modify) != 0)
return $"{function} permission denied. Script creator is not prim owner";
}
return string.Empty;
@@ -3175,7 +3174,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return;
ScenePresence sp = World.GetScenePresence(npcId);
if (sp is not null)
sp.Rotation = rotation;
}
@@ -5672,7 +5670,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
== (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify))
ret.Add(inv.Value.ItemID.ToString());
}
m_host.TaskInventory.LockItemsForRead(false);
return ret;
}
@@ -5735,7 +5732,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void osRemoveLinkInventory(LSL_Integer linkNumber, LSL_String name)
{
SceneObjectPart part = GetSingleLinkPart(linkNumber);
if(part == null)
return;
@@ -5780,7 +5776,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if(!World.TryGetScenePresence(destId, out ScenePresence _))
{
UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, destId);
if (account == null)
{
GridUserInfo info = World.GridUserService.GetGridUserInfo(destId.ToString());
@@ -5982,7 +5977,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_UrlModule?.ScriptRemoved(me);
m_ScriptEngine.ApiResetScript(me);
}
public LSL_Integer osIsNotValidNumber(LSL_Float v)
@@ -6186,7 +6180,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
bool changed = false;
if (!string.IsNullOrEmpty(daycycle) && (daycycle != ScriptBaseClass.NULL_KEY))
{
UUID envID = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, daycycle);
if (envID.IsZero())
return -4;

View File

@@ -175,7 +175,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
newSenseRepeaters.Add(ts);
}
}
SenseRepeaters = newSenseRepeaters;
}
}

View File

@@ -470,7 +470,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_String llXorBase64StringsCorrect(string str1, string str2);
LSL_Integer llGetLinkNumberOfSides(LSL_Integer link);
void llSetPhysicsMaterial(int material_bits, LSL_Float material_gravity_modifier, LSL_Float material_restitution, LSL_Float material_friction, LSL_Float material_density);
void SetPrimitiveParamsEx(LSL_Key prim, LSL_List rules, string originFunc);
void llSetKeyframedMotion(LSL_List frames, LSL_List options);
LSL_List GetPrimitiveParamsEx(LSL_Key prim, LSL_List rules);
@@ -484,7 +483,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_String llJsonSetValue(LSL_String json, LSL_List specifiers, LSL_String value);
LSL_String llJsonValueType(LSL_String json, LSL_List specifiers);
LSL_Integer llGetDayLength();
LSL_Integer llGetRegionDayLength();
LSL_Integer llGetDayOffset();

View File

@@ -1754,6 +1754,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
return m_OSSL_Functions.osGetParcelIDs();
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public LSL_Key osGetParcelID()
{

View File

@@ -602,7 +602,6 @@ namespace OpenSim.Region.ScriptEngine.Shared
}
else
{
double invLength = 1.0 / Math.Sqrt(lengthsq);
x *= invLength;
y *= invLength;
@@ -909,7 +908,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
return new LSL_Types.LSLFloat(io);
if (o is float fo)
return new LSL_Types.LSLFloat(fo);
if (o is Double dov)
if (o is double dov)
return new LSL_Types.LSLFloat(dov);
if (o is LSL_Types.LSLString lso)
return new LSL_Types.LSLFloat(lso.m_string);
@@ -1008,7 +1007,6 @@ namespace OpenSim.Region.ScriptEngine.Shared
o is not null ? o.GetType().Name : "null"));
}
public LSL_Types.LSLInteger GetLSLIntegerItem(int itemIndex)
{
object o = Data[itemIndex];
@@ -1300,7 +1298,6 @@ namespace OpenSim.Region.ScriptEngine.Shared
public list GetSublist(int start, int end)
{
object[] ret;
// Take care of neg start or end's
@@ -1324,7 +1321,6 @@ namespace OpenSim.Region.ScriptEngine.Shared
if (start <= end)
{
// Start sublist beyond length
// Also deals with start AND end still negative
if (start >= Data.Length || end < 0)
@@ -1339,7 +1335,6 @@ namespace OpenSim.Region.ScriptEngine.Shared
start = 0;
ret = new object[end - start + 1];
Array.Copy(Data, start, ret, 0, end - start + 1);
return new list(ret);
@@ -1350,9 +1345,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
else
{
list result;
// If end is negative, then prefix list is empty
if (end < 0)
{
@@ -1967,9 +1960,9 @@ namespace OpenSim.Region.ScriptEngine.Shared
public string ToCSV()
{
if (m_data is null || m_data.Length == 0)
return String.Empty;
return string.Empty;
Object o = m_data[0];
object o = m_data[0];
int len = m_data.Length;
if (len == 1)
return o.ToString();
@@ -1987,7 +1980,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
private string ToSoup()
{
if (m_data is null || m_data.Length == 0)
return String.Empty;
return string.Empty;
StringBuilder sb = osStringBuilderCache.Acquire();
foreach (object o in m_data)
@@ -2420,7 +2413,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
}
}
static public implicit operator String(LSLString s)
static public implicit operator string(LSLString s)
{
return s.m_string;
}
@@ -2658,7 +2651,6 @@ namespace OpenSim.Region.ScriptEngine.Shared
value = 0;
}
}
#endregion
#region Operators
@@ -3140,7 +3132,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
public override string ToString()
{
return String.Format(Culture.FormatProvider, "{0:0.000000}", this.value);
return string.Format(Culture.FormatProvider, "{0:0.000000}", this.value);
}
public override bool Equals(Object o)
@@ -3155,7 +3147,6 @@ namespace OpenSim.Region.ScriptEngine.Shared
return value.GetHashCode();
}
#endregion
}
}