2021-12-09 14:23:33 -06:00
|
|
|
|
namespace OpenMetaverse.TestClient
|
2009-07-10 01:58:39 +00:00
|
|
|
|
{
|
|
|
|
|
|
public class DeRezCommand : Command
|
|
|
|
|
|
{
|
|
|
|
|
|
public DeRezCommand(TestClient testClient)
|
|
|
|
|
|
{
|
|
|
|
|
|
Name = "derez";
|
|
|
|
|
|
Description = "De-Rezes a specified prim. " + "Usage: derez [prim-uuid]";
|
|
|
|
|
|
Category = CommandCategory.Objects;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string Execute(string[] args, UUID fromAgentID)
|
|
|
|
|
|
{
|
|
|
|
|
|
UUID primID;
|
|
|
|
|
|
|
|
|
|
|
|
if (args.Length != 1)
|
|
|
|
|
|
return "Usage: derez [prim-uuid]";
|
|
|
|
|
|
|
|
|
|
|
|
if (UUID.TryParse(args[0], out primID))
|
|
|
|
|
|
{
|
|
|
|
|
|
Primitive target = Client.Network.CurrentSim.ObjectsPrimitives.Find(
|
2020-05-09 12:59:06 -05:00
|
|
|
|
prim => prim.ID == primID
|
2009-07-10 01:58:39 +00:00
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
if (target != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
uint objectLocalID = target.LocalID;
|
|
|
|
|
|
Client.Inventory.RequestDeRezToInventory(objectLocalID, DeRezDestination.AgentInventoryTake,
|
2015-08-05 11:38:32 -04:00
|
|
|
|
Client.Inventory.FindFolderForType(FolderType.Trash),
|
2009-07-10 01:58:39 +00:00
|
|
|
|
UUID.Random());
|
|
|
|
|
|
return "removing " + target;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
return "Could not find prim " + primID.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
return "Usage: derez [prim-uuid]";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|