當前位置: 首頁>>代碼示例>>C#>>正文


C# Scene.DeleteAllSceneObjects方法代碼示例

本文整理匯總了C#中OpenSim.Region.Framework.Scenes.Scene.DeleteAllSceneObjects方法的典型用法代碼示例。如果您正苦於以下問題:C# Scene.DeleteAllSceneObjects方法的具體用法?C# Scene.DeleteAllSceneObjects怎麽用?C# Scene.DeleteAllSceneObjects使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OpenSim.Region.Framework.Scenes.Scene的用法示例。


在下文中一共展示了Scene.DeleteAllSceneObjects方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ClearXmlRpcHandler

 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;
 }
開發者ID:b2rex,項目名稱:b2rex,代碼行數:24,代碼來源:SceneUploadReceiver.cs

示例2: RemoveRegion

        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)
                    {
                    }
                }
            }
        }
開發者ID:Michelle-Argus,項目名稱:opensim,代碼行數:52,代碼來源:OpenSimBase.cs

示例3: RemoveRegion

        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);
            }
        }
開發者ID:MatthewBeardmore,項目名稱:halcyon,代碼行數:22,代碼來源:OpenSimBase.cs


注:本文中的OpenSim.Region.Framework.Scenes.Scene.DeleteAllSceneObjects方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。