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/Shared/Api/Implementation/OSSL_Api.cs | |
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/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 37 |
1 files changed, 37 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> |