mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
Add osForceAttachToAvatar() and osForceDetachFromAvatar()
These behave identically to llAttachToAvatar() and llDetachFromAvatar() except that they do not enforce the PERMISSION_ATTACH check Intended for use in completely controlled dedicated environments where these checks are more a UI hinderance than a help. Threat level high.
This commit is contained in:
@@ -209,6 +209,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new Exception("OSSL Runtime Error: " + msg);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the LSL interface.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// FIXME: This is an abomination. We should be able to set this up earlier but currently we have no
|
||||
/// guarantee the interface is present on Initialize(). There needs to be another post initialize call from
|
||||
/// ScriptInstance.
|
||||
/// </remarks>
|
||||
private void InitLSL()
|
||||
{
|
||||
if (m_LSL_Api != null)
|
||||
@@ -3093,5 +3101,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
estate.setEstateTerrainTextureHeights(corner, (float)low, (float)high);
|
||||
}
|
||||
}
|
||||
|
||||
public void osForceAttachToAvatar(int attachmentPoint)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatar");
|
||||
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
InitLSL();
|
||||
((LSL_Api)m_LSL_Api).AttachToAvatar(attachmentPoint);
|
||||
}
|
||||
|
||||
public void osForceDetachFromAvatar()
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High, "osForceDetachFromAvatar");
|
||||
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
InitLSL();
|
||||
((LSL_Api)m_LSL_Api).DetachFromAvatar();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user