From e93869c7a785a4f375685ffa33c913033ed1c85a Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Thu, 21 Jun 2007 17:08:21 +0000 Subject: * Importing Ming's mass test client --- tools/mass test client/Commands/TouchCommand.cs | 55 +++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 tools/mass test client/Commands/TouchCommand.cs (limited to 'tools/mass test client/Commands/TouchCommand.cs') diff --git a/tools/mass test client/Commands/TouchCommand.cs b/tools/mass test client/Commands/TouchCommand.cs new file mode 100644 index 0000000..f585b87 --- /dev/null +++ b/tools/mass test client/Commands/TouchCommand.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Text; +using libsecondlife; +using libsecondlife.Packets; + +namespace libsecondlife.TestClient +{ + public class TouchCommand: Command + { + public TouchCommand(TestClient testClient) + { + Name = "touch"; + Description = "Attempt to touch a prim with specified UUID"; + } + + public override string Execute(string[] args, LLUUID fromAgentID) + { + Primitive target = null; + + lock (Client.SimPrims) + { + if (Client.SimPrims.ContainsKey(Client.Network.CurrentSim)) + { + foreach (Primitive p in Client.SimPrims[Client.Network.CurrentSim].Values) + { + if (args.Length == 0) + return "You must specify a UUID of the prim."; + + try + { + if (p.ID == args[0]) + target = p; + } + catch + { + // handle exception + return "Sorry, I don't think " + args[0] + " is a valid UUID. I'm unable to touch it."; + } + } + } + } + + if (target != null) + { + Client.Self.Touch(target.LocalID); + return "Touched prim " + target.ID + "."; + } + else + { + return "Couldn't find that prim."; + } + } + } +} \ No newline at end of file -- cgit v1.1