2007-04-28 20:54:02 +00:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
2008-07-21 21:12:59 +00:00
|
|
|
using OpenMetaverse;
|
|
|
|
|
using OpenMetaverse.Packets;
|
2007-04-28 20:54:02 +00:00
|
|
|
|
2008-07-21 21:12:59 +00:00
|
|
|
namespace OpenMetaverse.TestClient
|
2007-04-28 20:54:02 +00:00
|
|
|
{
|
|
|
|
|
public class TouchCommand: Command
|
|
|
|
|
{
|
|
|
|
|
public TouchCommand(TestClient testClient)
|
|
|
|
|
{
|
|
|
|
|
Name = "touch";
|
|
|
|
|
Description = "Attempt to touch a prim with specified UUID";
|
2008-07-25 08:55:36 +00:00
|
|
|
Category = CommandCategory.Objects;
|
2007-04-28 20:54:02 +00:00
|
|
|
}
|
|
|
|
|
|
2008-07-25 05:15:05 +00:00
|
|
|
public override string Execute(string[] args, UUID fromAgentID)
|
2007-04-28 20:54:02 +00:00
|
|
|
{
|
2008-07-25 05:15:05 +00:00
|
|
|
UUID target;
|
2007-04-28 20:54:02 +00:00
|
|
|
|
2007-08-20 09:26:21 +00:00
|
|
|
if (args.Length != 1)
|
|
|
|
|
return "Usage: touch UUID";
|
|
|
|
|
|
2008-07-25 05:15:05 +00:00
|
|
|
if (UUID.TryParse(args[0], out target))
|
2007-08-20 09:26:21 +00:00
|
|
|
{
|
2008-01-03 21:55:49 +00:00
|
|
|
Primitive targetPrim = Client.Network.CurrentSim.ObjectsPrimitives.Find(
|
2007-08-29 08:55:53 +00:00
|
|
|
delegate(Primitive prim)
|
2007-04-28 20:54:02 +00:00
|
|
|
{
|
2007-08-29 08:55:53 +00:00
|
|
|
return prim.ID == target;
|
2007-04-28 20:54:02 +00:00
|
|
|
}
|
2007-08-29 08:55:53 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (targetPrim != null)
|
|
|
|
|
{
|
|
|
|
|
Client.Self.Touch(targetPrim.LocalID);
|
|
|
|
|
return "Touched prim " + targetPrim.LocalID;
|
2007-04-28 20:54:02 +00:00
|
|
|
}
|
|
|
|
|
}
|
2007-08-20 09:26:21 +00:00
|
|
|
|
|
|
|
|
return "Couldn't find a prim to touch with UUID " + args[0];
|
2007-04-28 20:54:02 +00:00
|
|
|
}
|
|
|
|
|
}
|
2008-01-03 21:55:49 +00:00
|
|
|
}
|