diff options
Merge branch 'master' of /home/opensim/var/repo/opensim
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 890115d..893fda1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -209,6 +209,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
209 | throw new Exception("OSSL Runtime Error: " + msg); | 209 | throw new Exception("OSSL Runtime Error: " + msg); |
210 | } | 210 | } |
211 | 211 | ||
212 | /// <summary> | ||
213 | /// Initialize the LSL interface. | ||
214 | /// </summary> | ||
215 | /// <remarks> | ||
216 | /// FIXME: This is an abomination. We should be able to set this up earlier but currently we have no | ||
217 | /// guarantee the interface is present on Initialize(). There needs to be another post initialize call from | ||
218 | /// ScriptInstance. | ||
219 | /// </remarks> | ||
212 | private void InitLSL() | 220 | private void InitLSL() |
213 | { | 221 | { |
214 | if (m_LSL_Api != null) | 222 | if (m_LSL_Api != null) |
@@ -1609,7 +1617,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1609 | 1617 | ||
1610 | public Object osParseJSONNew(string JSON) | 1618 | public Object osParseJSONNew(string JSON) |
1611 | { | 1619 | { |
1612 | CheckThreatLevel(ThreatLevel.None, "osParseJSON"); | 1620 | CheckThreatLevel(ThreatLevel.None, "osParseJSONNew"); |
1613 | 1621 | ||
1614 | m_host.AddScriptLPS(1); | 1622 | m_host.AddScriptLPS(1); |
1615 | 1623 | ||
@@ -3132,5 +3140,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3132 | estate.setEstateTerrainTextureHeights(corner, (float)low, (float)high); | 3140 | estate.setEstateTerrainTextureHeights(corner, (float)low, (float)high); |
3133 | } | 3141 | } |
3134 | } | 3142 | } |
3143 | |||
3144 | public void osForceAttachToAvatar(int attachmentPoint) | ||
3145 | { | ||
3146 | CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatar"); | ||
3147 | |||
3148 | m_host.AddScriptLPS(1); | ||
3149 | |||
3150 | InitLSL(); | ||
3151 | ((LSL_Api)m_LSL_Api).AttachToAvatar(attachmentPoint); | ||
3152 | } | ||
3153 | |||
3154 | public void osForceDetachFromAvatar() | ||
3155 | { | ||
3156 | CheckThreatLevel(ThreatLevel.High, "osForceDetachFromAvatar"); | ||
3157 | |||
3158 | m_host.AddScriptLPS(1); | ||
3159 | |||
3160 | InitLSL(); | ||
3161 | ((LSL_Api)m_LSL_Api).DetachFromAvatar(); | ||
3162 | } | ||
3135 | } | 3163 | } |
3136 | } \ No newline at end of file | 3164 | } \ No newline at end of file |