diff options
author | Melanie | 2011-05-09 00:59:32 +0200 |
---|---|---|
committer | Melanie | 2011-05-09 00:59:32 +0200 |
commit | dbf623a3d29cc594b3e3a5188ce58189d5ce65d8 (patch) | |
tree | 1e9ae642e60514508c5689ecf551203a17f187b2 /OpenSim/Region/Framework/Scenes/Scene.cs | |
parent | Merge branch 'master' into careminster-presence-refactor (diff) | |
download | opensim-SC_OLD-dbf623a3d29cc594b3e3a5188ce58189d5ce65d8.zip opensim-SC_OLD-dbf623a3d29cc594b3e3a5188ce58189d5ce65d8.tar.gz opensim-SC_OLD-dbf623a3d29cc594b3e3a5188ce58189d5ce65d8.tar.bz2 opensim-SC_OLD-dbf623a3d29cc594b3e3a5188ce58189d5ce65d8.tar.xz |
Add commands to delete objects by name, UUID, creator or owner
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-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 0d7894f..bac66cb 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -610,6 +610,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
610 | "reload estate", | 610 | "reload estate", |
611 | "Reload the estate data", HandleReloadEstate); | 611 | "Reload the estate data", HandleReloadEstate); |
612 | 612 | ||
613 | MainConsole.Instance.Commands.AddCommand("region", false, "delete object owner", | ||
614 | "delete object owner <UUID>", | ||
615 | "Delete object by owner", HandleDeleteObject); | ||
616 | MainConsole.Instance.Commands.AddCommand("region", false, "delete object creator", | ||
617 | "delete object creator <UUID>", | ||
618 | "Delete object by creator", HandleDeleteObject); | ||
619 | MainConsole.Instance.Commands.AddCommand("region", false, "delete object uuid", | ||
620 | "delete object uuid <UUID>", | ||
621 | "Delete object by uuid", HandleDeleteObject); | ||
622 | MainConsole.Instance.Commands.AddCommand("region", false, "delete object name", | ||
623 | "delete object name <UUID>", | ||
624 | "Delete object by name", HandleDeleteObject); | ||
625 | |||
613 | //Bind Storage Manager functions to some land manager functions for this scene | 626 | //Bind Storage Manager functions to some land manager functions for this scene |
614 | EventManager.OnLandObjectAdded += | 627 | EventManager.OnLandObjectAdded += |
615 | new EventManager.LandObjectAdded(simDataService.StoreLandObject); | 628 | new EventManager.LandObjectAdded(simDataService.StoreLandObject); |
@@ -5042,6 +5055,60 @@ namespace OpenSim.Region.Framework.Scenes | |||
5042 | } | 5055 | } |
5043 | } | 5056 | } |
5044 | 5057 | ||
5058 | private void HandleDeleteObject(string module, string[] cmd) | ||
5059 | { | ||
5060 | if (cmd.Length < 4) | ||
5061 | return; | ||
5062 | |||
5063 | string mode = cmd[2]; | ||
5064 | string o = cmd[3]; | ||
5065 | |||
5066 | List<SceneObjectGroup> deletes = new List<SceneObjectGroup>(); | ||
5067 | |||
5068 | UUID match; | ||
5069 | |||
5070 | switch (mode) | ||
5071 | { | ||
5072 | case "owner": | ||
5073 | if (!UUID.TryParse(o, out match)) | ||
5074 | return; | ||
5075 | ForEachSOG(delegate (SceneObjectGroup g) | ||
5076 | { | ||
5077 | if (g.OwnerID == match && !g.IsAttachment) | ||
5078 | deletes.Add(g); | ||
5079 | }); | ||
5080 | break; | ||
5081 | case "creator": | ||
5082 | if (!UUID.TryParse(o, out match)) | ||
5083 | return; | ||
5084 | ForEachSOG(delegate (SceneObjectGroup g) | ||
5085 | { | ||
5086 | if (g.RootPart.CreatorID == match && !g.IsAttachment) | ||
5087 | deletes.Add(g); | ||
5088 | }); | ||
5089 | break; | ||
5090 | case "uuid": | ||
5091 | if (!UUID.TryParse(o, out match)) | ||
5092 | return; | ||
5093 | ForEachSOG(delegate (SceneObjectGroup g) | ||
5094 | { | ||
5095 | if (g.UUID == match && !g.IsAttachment) | ||
5096 | deletes.Add(g); | ||
5097 | }); | ||
5098 | break; | ||
5099 | case "name": | ||
5100 | ForEachSOG(delegate (SceneObjectGroup g) | ||
5101 | { | ||
5102 | if (g.RootPart.Name == o && !g.IsAttachment) | ||
5103 | deletes.Add(g); | ||
5104 | }); | ||
5105 | break; | ||
5106 | } | ||
5107 | |||
5108 | foreach (SceneObjectGroup g in deletes) | ||
5109 | DeleteSceneObject(g, false); | ||
5110 | } | ||
5111 | |||
5045 | private void HandleReloadEstate(string module, string[] cmd) | 5112 | private void HandleReloadEstate(string module, string[] cmd) |
5046 | { | 5113 | { |
5047 | if (MainConsole.Instance.ConsoleScene == null || | 5114 | if (MainConsole.Instance.ConsoleScene == null || |