diff options
-rw-r--r-- | OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs index 57c109e..42eeb6c 100644 --- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs | |||
@@ -50,6 +50,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
50 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 50 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
51 | 51 | ||
52 | private Scene m_scene; | 52 | private Scene m_scene; |
53 | private ICommandConsole m_console; | ||
53 | 54 | ||
54 | public string Name { get { return "Object Commands Module"; } } | 55 | public string Name { get { return "Object Commands Module"; } } |
55 | 56 | ||
@@ -75,36 +76,40 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
75 | // m_log.DebugFormat("[OBJECT COMMANDS MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName); | 76 | // m_log.DebugFormat("[OBJECT COMMANDS MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName); |
76 | 77 | ||
77 | m_scene = scene; | 78 | m_scene = scene; |
78 | } | 79 | m_console = MainConsole.Instance; |
79 | |||
80 | public void RemoveRegion(Scene scene) | ||
81 | { | ||
82 | // m_log.DebugFormat("[OBJECTS COMMANDS MODULE]: REGION {0} REMOVED", scene.RegionInfo.RegionName); | ||
83 | } | ||
84 | 80 | ||
85 | public void RegionLoaded(Scene scene) | 81 | m_console.Commands.AddCommand("region", false, "delete object owner", |
86 | { | ||
87 | // m_log.DebugFormat("[OBJECTS COMMANDS MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName); | ||
88 | |||
89 | MainConsole.Instance.Commands.AddCommand("region", false, "delete object owner", | ||
90 | "delete object owner <UUID>", | 82 | "delete object owner <UUID>", |
91 | "Delete object by owner", HandleDeleteObject); | 83 | "Delete object by owner", HandleDeleteObject); |
92 | MainConsole.Instance.Commands.AddCommand("region", false, "delete object creator", | 84 | m_console.Commands.AddCommand("region", false, "delete object creator", |
93 | "delete object creator <UUID>", | 85 | "delete object creator <UUID>", |
94 | "Delete object by creator", HandleDeleteObject); | 86 | "Delete object by creator", HandleDeleteObject); |
95 | MainConsole.Instance.Commands.AddCommand("region", false, "delete object uuid", | 87 | m_console.Commands.AddCommand("region", false, "delete object uuid", |
96 | "delete object uuid <UUID>", | 88 | "delete object uuid <UUID>", |
97 | "Delete object by uuid", HandleDeleteObject); | 89 | "Delete object by uuid", HandleDeleteObject); |
98 | MainConsole.Instance.Commands.AddCommand("region", false, "delete object name", | 90 | m_console.Commands.AddCommand("region", false, "delete object name", |
99 | "delete object name <name>", | 91 | "delete object name <name>", |
100 | "Delete object by name", HandleDeleteObject); | 92 | "Delete object by name", HandleDeleteObject); |
101 | MainConsole.Instance.Commands.AddCommand("region", false, "delete object outside", | 93 | m_console.Commands.AddCommand("region", false, "delete object outside", |
102 | "delete object outside", | 94 | "delete object outside", |
103 | "Delete all objects outside boundaries", HandleDeleteObject); | 95 | "Delete all objects outside boundaries", HandleDeleteObject); |
104 | } | 96 | } |
105 | 97 | ||
98 | public void RemoveRegion(Scene scene) | ||
99 | { | ||
100 | // m_log.DebugFormat("[OBJECTS COMMANDS MODULE]: REGION {0} REMOVED", scene.RegionInfo.RegionName); | ||
101 | } | ||
102 | |||
103 | public void RegionLoaded(Scene scene) | ||
104 | { | ||
105 | // m_log.DebugFormat("[OBJECTS COMMANDS MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName); | ||
106 | } | ||
107 | |||
106 | private void HandleDeleteObject(string module, string[] cmd) | 108 | private void HandleDeleteObject(string module, string[] cmd) |
107 | { | 109 | { |
110 | if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene)) | ||
111 | return; | ||
112 | |||
108 | if (cmd.Length < 3) | 113 | if (cmd.Length < 3) |
109 | return; | 114 | return; |
110 | 115 | ||
@@ -198,7 +203,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
198 | 203 | ||
199 | foreach (SceneObjectGroup g in deletes) | 204 | foreach (SceneObjectGroup g in deletes) |
200 | { | 205 | { |
201 | MainConsole.Instance.OutputFormat("Deleting object {0}", g.UUID); | 206 | m_console.OutputFormat("Deleting object {0}", g.UUID); |
202 | m_scene.DeleteSceneObject(g, false); | 207 | m_scene.DeleteSceneObject(g, false); |
203 | } | 208 | } |
204 | } | 209 | } |