diff options
author | Melanie | 2009-10-28 18:25:37 +0000 |
---|---|---|
committer | Melanie | 2009-10-28 18:25:37 +0000 |
commit | c17359fea51bc6c2dbe610a8e790a463fb9b5e51 (patch) | |
tree | 3c5637ad8ac0a404a3f5e5f129df99826fcb2066 | |
parent | patch kill by UUID (diff) | |
download | opensim-SC-c17359fea51bc6c2dbe610a8e790a463fb9b5e51.zip opensim-SC-c17359fea51bc6c2dbe610a8e790a463fb9b5e51.tar.gz opensim-SC-c17359fea51bc6c2dbe610a8e790a463fb9b5e51.tar.bz2 opensim-SC-c17359fea51bc6c2dbe610a8e790a463fb9b5e51.tar.xz |
Adding changes to previous patch to make it fit into core better
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index e7ae7bd..60c34df 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -343,9 +343,9 @@ namespace OpenSim | |||
343 | "Add-InventoryHost <host>", | 343 | "Add-InventoryHost <host>", |
344 | String.Empty, RunCommand); | 344 | String.Empty, RunCommand); |
345 | 345 | ||
346 | m_console.Commands.AddCommand("region", false, "killuuid", | 346 | m_console.Commands.AddCommand("region", false, "kill uuid", |
347 | "killuuid <UUID>", | 347 | "kill uuid <UUID>", |
348 | "kill an object by UUID", KillUUID); | 348 | "Kill an object by UUID", KillUUID); |
349 | 349 | ||
350 | if (ConfigurationSettings.Standalone) | 350 | if (ConfigurationSettings.Standalone) |
351 | { | 351 | { |
@@ -1342,38 +1342,36 @@ namespace OpenSim | |||
1342 | /// <param name="cmdparams"></param> | 1342 | /// <param name="cmdparams"></param> |
1343 | protected void KillUUID(string module, string[] cmdparams) | 1343 | protected void KillUUID(string module, string[] cmdparams) |
1344 | { | 1344 | { |
1345 | if (cmdparams.Length > 1) | 1345 | if (cmdparams.Length > 2) |
1346 | { | 1346 | { |
1347 | UUID id = UUID.Zero; | 1347 | UUID id = UUID.Zero; |
1348 | SceneObjectGroup grp = null; | 1348 | SceneObjectGroup grp = null; |
1349 | Scene sc = null; | 1349 | Scene sc = null; |
1350 | 1350 | ||
1351 | try | 1351 | if (!UUID.TryParse(cmdparams[2], out id)) |
1352 | { | 1352 | { |
1353 | Guid x = new Guid((string)cmdparams[1]); | 1353 | MainConsole.Instance.Output("[KillUUID]: Error bad UUID format!"); |
1354 | id = (UUID)(string)cmdparams[1]; | ||
1355 | } | ||
1356 | catch (Exception) | ||
1357 | { | ||
1358 | m_log.Error("[KillUUID]: Error bad UUID formating !"); | ||
1359 | return; | 1354 | return; |
1360 | } | 1355 | } |
1361 | 1356 | ||
1362 | m_sceneManager.ForEachScene( | 1357 | m_sceneManager.ForEachScene( |
1363 | delegate(Scene scene) | 1358 | delegate(Scene scene) |
1364 | { | 1359 | { |
1365 | if (scene.Entities[id] != null) | 1360 | SceneObjectPart part = scene.GetSceneObjectPart(id); |
1366 | { | 1361 | if (part == null) |
1367 | grp = (SceneObjectGroup) scene.Entities[id]; | 1362 | return; |
1368 | sc = scene; | 1363 | |
1369 | } | 1364 | grp = part.ParentGroup; |
1365 | sc = scene; | ||
1370 | }); | 1366 | }); |
1371 | 1367 | ||
1372 | if (grp == null) | 1368 | if (grp == null) |
1373 | m_log.ErrorFormat("[KillUUID]: Given UUID {0} not found !", id); | 1369 | { |
1370 | MainConsole.Instance.Output(String.Format("[KillUUID]: Given UUID {0} not found!", id)); | ||
1371 | } | ||
1374 | else | 1372 | else |
1375 | { | 1373 | { |
1376 | m_log.InfoFormat("[KillUUID]: Found UUID {0} in scene {1}", id, sc.RegionInfo.RegionName); | 1374 | MainConsole.Instance.Output(String.Format("[KillUUID]: Found UUID {0} in scene {1}", id, sc.RegionInfo.RegionName)); |
1377 | try | 1375 | try |
1378 | { | 1376 | { |
1379 | sc.DeleteSceneObject(grp, false); | 1377 | sc.DeleteSceneObject(grp, false); |
@@ -1386,7 +1384,7 @@ namespace OpenSim | |||
1386 | } | 1384 | } |
1387 | else | 1385 | else |
1388 | { | 1386 | { |
1389 | m_log.Error("[KillUUID]: Usage: killuuid <UUID>"); | 1387 | MainConsole.Instance.Output("[KillUUID]: Usage: kill uuid <UUID>"); |
1390 | } | 1388 | } |
1391 | } | 1389 | } |
1392 | 1390 | ||