aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-01-31 21:57:45 +0000
committerJustin Clark-Casey (justincc)2012-01-31 21:57:45 +0000
commit9bd02b5da19ae758bfb7a543976b26ced0cd1ba2 (patch)
treeb93dfbe692746cf0e178d0d7beffd56e7d7f8ae6 /OpenSim/Region/Framework/Scenes/Scene.cs
parentminor: remove mono compiler warning (diff)
downloadopensim-SC-9bd02b5da19ae758bfb7a543976b26ced0cd1ba2.zip
opensim-SC-9bd02b5da19ae758bfb7a543976b26ced0cd1ba2.tar.gz
opensim-SC-9bd02b5da19ae758bfb7a543976b26ced0cd1ba2.tar.bz2
opensim-SC-9bd02b5da19ae758bfb7a543976b26ced0cd1ba2.tar.xz
Move object delete commands into a commands region module, in preparation for adding similar show commands.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs104
1 files changed, 0 insertions, 104 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 975d769..df6c88f 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -600,23 +600,6 @@ namespace OpenSim.Region.Framework.Scenes
600 "reload estate", 600 "reload estate",
601 "Reload the estate data", HandleReloadEstate); 601 "Reload the estate data", HandleReloadEstate);
602 602
603 MainConsole.Instance.Commands.AddCommand("region", false, "delete object owner",
604 "delete object owner <UUID>",
605 "Delete object by owner", HandleDeleteObject);
606 MainConsole.Instance.Commands.AddCommand("region", false, "delete object creator",
607 "delete object creator <UUID>",
608 "Delete object by creator", HandleDeleteObject);
609 MainConsole.Instance.Commands.AddCommand("region", false, "delete object uuid",
610 "delete object uuid <UUID>",
611 "Delete object by uuid", HandleDeleteObject);
612 MainConsole.Instance.Commands.AddCommand("region", false, "delete object name",
613 "delete object name <name>",
614 "Delete object by name", HandleDeleteObject);
615
616 MainConsole.Instance.Commands.AddCommand("region", false, "delete object outside",
617 "delete object outside",
618 "Delete all objects outside boundaries", HandleDeleteObject);
619
620 //Bind Storage Manager functions to some land manager functions for this scene 603 //Bind Storage Manager functions to some land manager functions for this scene
621 EventManager.OnLandObjectAdded += 604 EventManager.OnLandObjectAdded +=
622 new EventManager.LandObjectAdded(simDataService.StoreLandObject); 605 new EventManager.LandObjectAdded(simDataService.StoreLandObject);
@@ -4860,93 +4843,6 @@ namespace OpenSim.Region.Framework.Scenes
4860 } 4843 }
4861 } 4844 }
4862 4845
4863 private void HandleDeleteObject(string module, string[] cmd)
4864 {
4865 if (cmd.Length < 3)
4866 return;
4867
4868 string mode = cmd[2];
4869 string o = "";
4870
4871 if (mode != "outside")
4872 {
4873 if (cmd.Length < 4)
4874 return;
4875
4876 o = cmd[3];
4877 }
4878
4879 List<SceneObjectGroup> deletes = new List<SceneObjectGroup>();
4880
4881 UUID match;
4882
4883 switch (mode)
4884 {
4885 case "owner":
4886 if (!UUID.TryParse(o, out match))
4887 return;
4888 ForEachSOG(delegate (SceneObjectGroup g)
4889 {
4890 if (g.OwnerID == match && !g.IsAttachment)
4891 deletes.Add(g);
4892 });
4893 break;
4894 case "creator":
4895 if (!UUID.TryParse(o, out match))
4896 return;
4897 ForEachSOG(delegate (SceneObjectGroup g)
4898 {
4899 if (g.RootPart.CreatorID == match && !g.IsAttachment)
4900 deletes.Add(g);
4901 });
4902 break;
4903 case "uuid":
4904 if (!UUID.TryParse(o, out match))
4905 return;
4906 ForEachSOG(delegate (SceneObjectGroup g)
4907 {
4908 if (g.UUID == match && !g.IsAttachment)
4909 deletes.Add(g);
4910 });
4911 break;
4912 case "name":
4913 ForEachSOG(delegate (SceneObjectGroup g)
4914 {
4915 if (g.RootPart.Name == o && !g.IsAttachment)
4916 deletes.Add(g);
4917 });
4918 break;
4919 case "outside":
4920 ForEachSOG(delegate (SceneObjectGroup g)
4921 {
4922 SceneObjectPart rootPart = g.RootPart;
4923 bool delete = false;
4924
4925 if (rootPart.GroupPosition.Z < 0.0 || rootPart.GroupPosition.Z > 10000.0)
4926 {
4927 delete = true;
4928 }
4929 else
4930 {
4931 ILandObject parcel = LandChannel.GetLandObject(rootPart.GroupPosition.X, rootPart.GroupPosition.Y);
4932
4933 if (parcel == null || parcel.LandData.Name == "NO LAND")
4934 delete = true;
4935 }
4936
4937 if (delete && !g.IsAttachment && !deletes.Contains(g))
4938 deletes.Add(g);
4939 });
4940 break;
4941 }
4942
4943 foreach (SceneObjectGroup g in deletes)
4944 {
4945 m_log.InfoFormat("[SCENE]: Deleting object {0}", g.UUID);
4946 DeleteSceneObject(g, false);
4947 }
4948 }
4949
4950 private void HandleReloadEstate(string module, string[] cmd) 4846 private void HandleReloadEstate(string module, string[] cmd)
4951 { 4847 {
4952 if (MainConsole.Instance.ConsoleScene == null || 4848 if (MainConsole.Instance.ConsoleScene == null ||