Merge branch 'opensim:master' into master

This commit is contained in:
AdilElFarissi
2024-03-26 22:16:17 +00:00
committed by GitHub
13 changed files with 49 additions and 15 deletions

View File

@@ -79,7 +79,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/// <summary>
/// Contains all LSL ll-functions. This class will be in Default AppDomain.
/// </summary>
public class LSL_Api : MarshalByRefObject, ILSL_Api, IScriptApi
public class LSL_Api : ILSL_Api, IScriptApi
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

View File

@@ -54,7 +54,7 @@ using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3;
namespace OpenSim.Region.ScriptEngine.Shared.Api
{
[Serializable]
public class LS_Api : MarshalByRefObject, ILS_Api, IScriptApi
public class LS_Api : ILS_Api, IScriptApi
{
internal IScriptEngine m_ScriptEngine;
internal SceneObjectPart m_host;

View File

@@ -54,7 +54,7 @@ using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3;
namespace OpenSim.Region.ScriptEngine.Shared.Api
{
[Serializable]
public class MOD_Api : MarshalByRefObject, IMOD_Api, IScriptApi
public class MOD_Api : IMOD_Api, IScriptApi
{
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

View File

@@ -134,7 +134,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
[Serializable]
public class OSSL_Api : MarshalByRefObject, IOSSL_Api, IScriptApi
public class OSSL_Api : IOSSL_Api, IScriptApi
{
public const string GridInfoServiceConfigSectionName = "GridInfoService";
@@ -5541,6 +5541,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return (item == null) ? LSL_String.Empty : item.Description;
}
public LSL_Key osGetLinkInventoryKey(LSL_Integer linkNumber, LSL_String name, LSL_Integer type)
{
SceneObjectPart part = GetSingleLinkPart(linkNumber);
if(part == null)
return LSL_String.NullKey;
TaskInventoryItem item = part.Inventory.GetInventoryItem(name, type);
if (item is null)
return LSL_String.NullKey;
if ((item.CurrentPermissions
& (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify))
== (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify))
{
return new LSL_Key(item.AssetID.ToString());
}
return LSL_String.NullKey;
}
public LSL_Key osGetLinkInventoryItemKey(LSL_Integer linkNumber, LSL_String name)
{
SceneObjectPart part = GetSingleLinkPart(linkNumber);

View File

@@ -561,6 +561,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_Integer osApproxEquals(rotation ra, rotation rb, LSL_Float margin);
LSL_Key osGetInventoryLastOwner(LSL_String itemNameOrId);
LSL_Key osGetInventoryItemKey(LSL_String name);
LSL_Key osGetLinkInventoryKey(LSL_Integer linkNumber, LSL_String name, LSL_Integer type);
LSL_Key osGetLinkInventoryItemKey(LSL_Integer linkNumber, LSL_String name);
LSL_String osGetInventoryName(LSL_Key itemId);
LSL_String osGetLinkInventoryName(LSL_Integer linkNumber, LSL_Key itemId);

View File

@@ -43,7 +43,7 @@ using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3;
namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
public partial class ScriptBaseClass : MarshalByRefObject
public partial class ScriptBaseClass
{
public ILSL_Api m_LSL_Functions;

View File

@@ -45,7 +45,7 @@ using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger;
namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
public partial class ScriptBaseClass : MarshalByRefObject
public partial class ScriptBaseClass
{
public ILS_Api m_LS_Functions;

View File

@@ -49,7 +49,7 @@ using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3;
namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
public partial class ScriptBaseClass : MarshalByRefObject
public partial class ScriptBaseClass
{
public IMOD_Api m_MOD_Functions;

View File

@@ -44,7 +44,7 @@ using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger;
namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
public partial class ScriptBaseClass : MarshalByRefObject
public partial class ScriptBaseClass
{
public IOSSL_Api m_OSSL_Functions;
@@ -1460,6 +1460,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osGetInventoryItemKey(name);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public LSL_Key osGetLinkInventoryKey(LSL_Integer linkNumber, LSL_String name, LSL_Integer type)
{
return m_OSSL_Functions.osGetLinkInventoryKey(linkNumber, name, type);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public LSL_Key osGetLinkInventoryItemKey(LSL_Integer linkNumber, LSL_String name)
{

View File

@@ -33,7 +33,7 @@ using OpenSim.Region.ScriptEngine.Interfaces;
namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
public partial class ScriptBaseClass : MarshalByRefObject, IScript
public partial class ScriptBaseClass : IScript
{
private Dictionary<string, MethodInfo> inits = new Dictionary<string, MethodInfo>();
public ScriptBaseClass()

View File

@@ -202,11 +202,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
Owner = Key;
Position = new LSL_Types.Vector3(presence.AbsolutePosition);
Rotation = new LSL_Types.Quaternion(
presence.Rotation.X,
presence.Rotation.Y,
presence.Rotation.Z,
presence.Rotation.W);
Rotation = new LSL_Types.Quaternion(presence.Rotation);
Velocity = new LSL_Types.Vector3(presence.Velocity);
Type = 0x01; // Avatar