diff options
author | Jeff Kelley | 2016-05-22 00:57:30 +0200 |
---|---|---|
committer | UbitUmarov | 2016-12-14 15:14:22 +0000 |
commit | 95d6396300d8788ac3b0e5a3ae2d184016eef9cc (patch) | |
tree | 0bdaa26b71eadb042e8cc31ded715c777aa17e8c /OpenSim/Region/ScriptEngine | |
parent | show online on profile, if target is in same region.( possible should be done... (diff) | |
download | opensim-SC-95d6396300d8788ac3b0e5a3ae2d184016eef9cc.zip opensim-SC-95d6396300d8788ac3b0e5a3ae2d184016eef9cc.tar.gz opensim-SC-95d6396300d8788ac3b0e5a3ae2d184016eef9cc.tar.bz2 opensim-SC-95d6396300d8788ac3b0e5a3ae2d184016eef9cc.tar.xz |
Add osDie(key)
Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
3 files changed, 49 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 9742119..8ecbaba 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -1874,6 +1874,43 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1874 | "dataserver", resobj, new DetectParams[0])); | 1874 | "dataserver", resobj, new DetectParams[0])); |
1875 | } | 1875 | } |
1876 | 1876 | ||
1877 | |||
1878 | /// <summary> | ||
1879 | /// Similar to llDie but given an object UUID | ||
1880 | /// </summary> | ||
1881 | /// <param name="objectUUID"></param> | ||
1882 | |||
1883 | public void osDie(LSL_Key objectUUID) | ||
1884 | { | ||
1885 | CheckThreatLevel(ThreatLevel.VeryHigh, "osDie"); | ||
1886 | m_host.AddScriptLPS(1); | ||
1887 | |||
1888 | UUID objUUID; | ||
1889 | if (!UUID.TryParse(objectUUID, out objUUID)) // prior to patching, a thrown exception regarding invalid GUID format would be shouted instead. | ||
1890 | { | ||
1891 | OSSLShoutError("osDie() cannot delete objects with invalid UUIDs"); | ||
1892 | return; | ||
1893 | } | ||
1894 | |||
1895 | DeleteObject(objUUID); | ||
1896 | } | ||
1897 | |||
1898 | private void DeleteObject(UUID objUUID) | ||
1899 | { | ||
1900 | SceneObjectGroup sceneOG = World.GetSceneObjectGroup(objUUID); | ||
1901 | |||
1902 | if (sceneOG == null) // prior to patching, PostObjectEvent() would cause a throw exception to be shouted instead. | ||
1903 | { | ||
1904 | OSSLShoutError("osDie() cannot delete " + objUUID.ToString() + ", object was not found in scene."); | ||
1905 | return; | ||
1906 | } | ||
1907 | |||
1908 | if (sceneOG.OwnerID != m_host.OwnerID) | ||
1909 | return; | ||
1910 | |||
1911 | World.DeleteSceneObject(sceneOG, false); | ||
1912 | } | ||
1913 | |||
1877 | /// <summary> | 1914 | /// <summary> |
1878 | /// Write a notecard directly to the prim's inventory. | 1915 | /// Write a notecard directly to the prim's inventory. |
1879 | /// </summary> | 1916 | /// </summary> |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index cf3e6df..7415fea 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -317,6 +317,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
317 | void osForceBreakAllLinks(); | 317 | void osForceBreakAllLinks(); |
318 | 318 | ||
319 | /// <summary> | 319 | /// <summary> |
320 | /// Similar to llDie but given an object UUID | ||
321 | /// </summary> | ||
322 | /// <param name="objectUUID"></param> | ||
323 | |||
324 | void osDie(LSL_Key objectUUID); | ||
325 | |||
326 | /// <summary> | ||
320 | /// Check if the given key is an npc | 327 | /// Check if the given key is an npc |
321 | /// </summary> | 328 | /// </summary> |
322 | /// <param name="npc"></param> | 329 | /// <param name="npc"></param> |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 2e8a76c..c34ccd0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -577,6 +577,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
577 | m_OSSL_Functions.osForceBreakAllLinks(); | 577 | m_OSSL_Functions.osForceBreakAllLinks(); |
578 | } | 578 | } |
579 | 579 | ||
580 | public void osDie(LSL_Key objectUUID) | ||
581 | { | ||
582 | m_OSSL_Functions.osDie(objectUUID); | ||
583 | } | ||
584 | |||
580 | public LSL_Integer osIsNpc(LSL_Key npc) | 585 | public LSL_Integer osIsNpc(LSL_Key npc) |
581 | { | 586 | { |
582 | return m_OSSL_Functions.osIsNpc(npc); | 587 | return m_OSSL_Functions.osIsNpc(npc); |