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 --- .../Commands/Movement/SitOnCommand.cs | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 tools/mass test client/Commands/Movement/SitOnCommand.cs (limited to 'tools/mass test client/Commands/Movement/SitOnCommand.cs') diff --git a/tools/mass test client/Commands/Movement/SitOnCommand.cs b/tools/mass test client/Commands/Movement/SitOnCommand.cs new file mode 100644 index 0000000..381f50c --- /dev/null +++ b/tools/mass test client/Commands/Movement/SitOnCommand.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Text; +using libsecondlife; +using libsecondlife.Packets; + +namespace libsecondlife.TestClient +{ + public class SitOnCommand: Command + { + public SitOnCommand(TestClient testClient) + { + Name = "siton"; + Description = "Attempt to sit on a particular prim, with specified UUID"; + } + + public override string Execute(string[] args, LLUUID fromAgentID) + { + LLObject targetSeat = null; + + lock (Client.SimPrims) + { + if (Client.SimPrims.ContainsKey(Client.Network.CurrentSim)) + { + foreach (LLObject p in Client.SimPrims[Client.Network.CurrentSim].Values) + { + try + { + if (p.ID == args[0]) + targetSeat = p; + } + catch + { + // handle exception + return "Sorry, I don't think " + args[0] + " is a valid UUID. I'm unable to sit there."; + } + } + } + } + + if (targetSeat != null) + { + Client.Self.RequestSit(targetSeat.ID, LLVector3.Zero); + Client.Self.Sit(); + + return "Sat on prim " + targetSeat.ID + "."; + } + else + { + return "Couldn't find specified prim to sit on"; + } + } + } +} \ No newline at end of file -- cgit v1.1