OpenSim.Region.ScriptEngine.Shared.Api.OSSL_Api.osDie C# (CSharp) Méthode

osDie() public méthode

Similar to llDie but given an object UUID
public osDie ( OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString objectUUID ) : void
objectUUID OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString
Résultat void
        public void osDie(LSL_Key objectUUID)
        {
//            CheckThreatLevel(ThreatLevel.VeryHigh, "osDie");
            // if this is restricted to objects rezzed by this host level can be reduced
          
            CheckThreatLevel(ThreatLevel.Low, "osDie");
            m_host.AddScriptLPS(1);

            UUID objUUID;
            if (!UUID.TryParse(objectUUID, out objUUID))
            {
                OSSLShoutError("osDie() cannot delete objects with invalid UUIDs");
                return;
            }

            // harakiri check
            if(objUUID == UUID.Zero)
            {
                if (!m_host.ParentGroup.IsAttachment)
                    throw new SelfDeleteException();
                return;
            }

            SceneObjectGroup sceneOG = World.GetSceneObjectGroup(objUUID);

            if (sceneOG == null || sceneOG.IsDeleted)
                return;

            if(sceneOG.IsAttachment)
                return;

            if (sceneOG.OwnerID != m_host.OwnerID)
                return;
            
            // harakiri check
            if(sceneOG.UUID == m_host.ParentGroup.UUID)
                throw new SelfDeleteException();

            // restrict to objects rezzed by host
            if(sceneOG.RezzerID == m_host.ParentGroup.UUID)
                World.DeleteSceneObject(sceneOG, false);
        }
OSSL_Api