OpenSim.Region.Framework.Scenes.Scene.SendKillObject C# (CSharp) Method

SendKillObject() public method

public SendKillObject ( uint localID ) : void
localID uint
return void
        public void SendKillObject(uint localID)
        {
            SceneObjectPart part = GetSceneObjectPart(localID);
            if (part != null) // It is a prim
            {
                if (part.ParentGroup != null && !part.ParentGroup.IsDeleted) // Valid
                {
                    if (part.ParentGroup.RootPart != part) // Child part
                        return;
                }
            }
            ForEachClient(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, localID); });
        }

Usage Example

Ejemplo n.º 1
0
        /// <summary>
        /// Delete the given object from the scene
        /// </summary>
        public void DeleteToInventory(DeRezAction action, UUID folderID,
                                      List <SceneObjectGroup> objectGroups, IClientAPI remoteClient,
                                      bool permissionToDelete)
        {
            if (Enabled)
            {
                lock (m_inventoryTicker)
                    m_inventoryTicker.Stop();
            }

            lock (m_inventoryDeletes)
            {
                DeleteToInventoryHolder dtis = new DeleteToInventoryHolder();
                dtis.action             = action;
                dtis.folderID           = folderID;
                dtis.objectGroups       = objectGroups;
                dtis.remoteClient       = remoteClient;
                dtis.permissionToDelete = permissionToDelete;

                m_inventoryDeletes.Enqueue(dtis);
            }

            if (Enabled)
            {
                lock (m_inventoryTicker)
                    m_inventoryTicker.Start();
            }

            // Visually remove it, even if it isnt really gone yet.  This means that if we crash before the object
            // has gone to inventory, it will reappear in the region again on restart instead of being lost.
            // This is not ideal since the object will still be available for manipulation when it should be, but it's
            // better than losing the object for now.
            if (permissionToDelete)
            {
                List <uint> killIDs = new List <uint>();

                foreach (SceneObjectGroup g in objectGroups)
                {
                    killIDs.Add(g.LocalId);
                    g.DeleteGroupFromScene(true);
                }

                m_scene.SendKillObject(killIDs);
            }
        }
All Usage Examples Of OpenSim.Region.Framework.Scenes.Scene::SendKillObject
Scene