DeleteAllSceneObjects() public method

Delete every object from the scene. This does not include attachments worn by avatars.
public DeleteAllSceneObjects ( ) : void
return void
Esempio n. 1
0
 public XmlRpcResponse ClearXmlRpcHandler(XmlRpcRequest request, IPEndPoint client)
 {
     // AuthClient.VerifySession(GetUserServerURL(userID), userID, sessionID);
     XmlRpcResponse response = new XmlRpcResponse();
     Hashtable requestData = (Hashtable)request.Params[0];
     Hashtable resp = new Hashtable();
     if (requestData.ContainsKey("RegionID"))
     {
     UUID regionID = UUID.Parse((string)requestData["RegionID"]);
     m_scene = SelectRegion(regionID);
     m_scene.DeleteAllSceneObjects();
     }
     else
     {
     resp["success"] = false;
     resp["error"] = "no RegionID provided";
     response.Value = resp;
             return response;
     }
     // return ok;
     resp["success"] = true;
     response.Value = resp;
     return response;
 }
Esempio n. 2
0
        public void RemoveRegion(Scene scene, bool cleanup)
        {
            // only need to check this if we are not at the
            // root level
            if ((SceneManager.CurrentScene != null) &&
                (SceneManager.CurrentScene.RegionInfo.RegionID == scene.RegionInfo.RegionID))
            {
                SceneManager.TrySetCurrentScene("..");
            }

            if (cleanup)
            {
                scene.DeleteAllSceneObjects();
			}
            SceneManager.CloseScene(scene);
            ShutdownClientServer(scene.RegionInfo);
            
            if (!cleanup)
                return;

            if (!String.IsNullOrEmpty(scene.RegionInfo.RegionFile))
            {
                if (scene.RegionInfo.RegionFile.ToLower().EndsWith(".xml"))
                {
                    File.Delete(scene.RegionInfo.RegionFile);
                    m_log.InfoFormat("[OPENSIM]: deleting region file \"{0}\"", scene.RegionInfo.RegionFile);
                }
                if (scene.RegionInfo.RegionFile.ToLower().EndsWith(".ini"))
                {
                    try
                    {
                        IniConfigSource source = new IniConfigSource(scene.RegionInfo.RegionFile);
                        if (source.Configs[scene.RegionInfo.RegionName] != null)
                        {
                            source.Configs.Remove(scene.RegionInfo.RegionName);

                            if (source.Configs.Count == 0)
                            {
                                File.Delete(scene.RegionInfo.RegionFile);
                            }
                            else
                            {
                                source.Save(scene.RegionInfo.RegionFile);
                            }
                        }
                    }
                    catch (Exception)
                    {
                    }
                }
            }
        }
Esempio n. 3
0
        public void RemoveRegion(Scene scene, bool cleanup)
        {
            // only need to check this if we are not at the
            // root level
            if ((m_sceneManager.CurrentScene != null) &&
                (m_sceneManager.CurrentScene.RegionInfo.RegionID == scene.RegionInfo.RegionID))
            {
                m_sceneManager.TrySetCurrentScene("..");
            }

            scene.DeleteAllSceneObjects();
            m_sceneManager.CloseScene(scene);

            if (!cleanup)
                return;

            if (!String.IsNullOrEmpty(scene.RegionInfo.RegionFile))
            {
                File.Delete(scene.RegionInfo.RegionFile);
                m_log.InfoFormat("[HALCYON]: deleting region file \"{0}\"", scene.RegionInfo.RegionFile);
            }
        }