diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 49fbe33..76ab299 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -587,6 +587,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
587 | "reload estate", | 587 | "reload estate", |
588 | "Reload the estate data", HandleReloadEstate); | 588 | "Reload the estate data", HandleReloadEstate); |
589 | 589 | ||
590 | MainConsole.Instance.Commands.AddCommand("region", false, "delete object owner", | ||
591 | "delete object owner <UUID>", | ||
592 | "Delete object by owner", HandleDeleteObject); | ||
593 | MainConsole.Instance.Commands.AddCommand("region", false, "delete object creator", | ||
594 | "delete object creator <UUID>", | ||
595 | "Delete object by creator", HandleDeleteObject); | ||
596 | MainConsole.Instance.Commands.AddCommand("region", false, "delete object uuid", | ||
597 | "delete object uuid <UUID>", | ||
598 | "Delete object by uuid", HandleDeleteObject); | ||
599 | MainConsole.Instance.Commands.AddCommand("region", false, "delete object name", | ||
600 | "delete object name <UUID>", | ||
601 | "Delete object by name", HandleDeleteObject); | ||
602 | |||
590 | //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 |
591 | EventManager.OnLandObjectAdded += | 604 | EventManager.OnLandObjectAdded += |
592 | new EventManager.LandObjectAdded(simDataService.StoreLandObject); | 605 | new EventManager.LandObjectAdded(simDataService.StoreLandObject); |
@@ -4852,6 +4865,60 @@ namespace OpenSim.Region.Framework.Scenes | |||
4852 | } | 4865 | } |
4853 | } | 4866 | } |
4854 | 4867 | ||
4868 | private void HandleDeleteObject(string module, string[] cmd) | ||
4869 | { | ||
4870 | if (cmd.Length < 4) | ||
4871 | return; | ||
4872 | |||
4873 | string mode = cmd[2]; | ||
4874 | string o = cmd[3]; | ||
4875 | |||
4876 | List<SceneObjectGroup> deletes = new List<SceneObjectGroup>(); | ||
4877 | |||
4878 | UUID match; | ||
4879 | |||
4880 | switch (mode) | ||
4881 | { | ||
4882 | case "owner": | ||
4883 | if (!UUID.TryParse(o, out match)) | ||
4884 | return; | ||
4885 | ForEachSOG(delegate (SceneObjectGroup g) | ||
4886 | { | ||
4887 | if (g.OwnerID == match && !g.IsAttachment) | ||
4888 | deletes.Add(g); | ||
4889 | }); | ||
4890 | break; | ||
4891 | case "creator": | ||
4892 | if (!UUID.TryParse(o, out match)) | ||
4893 | return; | ||
4894 | ForEachSOG(delegate (SceneObjectGroup g) | ||
4895 | { | ||
4896 | if (g.RootPart.CreatorID == match && !g.IsAttachment) | ||
4897 | deletes.Add(g); | ||
4898 | }); | ||
4899 | break; | ||
4900 | case "uuid": | ||
4901 | if (!UUID.TryParse(o, out match)) | ||
4902 | return; | ||
4903 | ForEachSOG(delegate (SceneObjectGroup g) | ||
4904 | { | ||
4905 | if (g.UUID == match && !g.IsAttachment) | ||
4906 | deletes.Add(g); | ||
4907 | }); | ||
4908 | break; | ||
4909 | case "name": | ||
4910 | ForEachSOG(delegate (SceneObjectGroup g) | ||
4911 | { | ||
4912 | if (g.RootPart.Name == o && !g.IsAttachment) | ||
4913 | deletes.Add(g); | ||
4914 | }); | ||
4915 | break; | ||
4916 | } | ||
4917 | |||
4918 | foreach (SceneObjectGroup g in deletes) | ||
4919 | DeleteSceneObject(g, false); | ||
4920 | } | ||
4921 | |||
4855 | private void HandleReloadEstate(string module, string[] cmd) | 4922 | private void HandleReloadEstate(string module, string[] cmd) |
4856 | { | 4923 | { |
4857 | if (MainConsole.Instance.ConsoleScene == null || | 4924 | if (MainConsole.Instance.ConsoleScene == null || |