2007-01-30 20:07:18 +00:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using libsecondlife;
|
|
|
|
|
using libsecondlife.Packets;
|
|
|
|
|
|
|
|
|
|
namespace libsecondlife.TestClient
|
|
|
|
|
{
|
2007-08-20 09:26:21 +00:00
|
|
|
public class SitOnCommand : Command
|
2007-01-30 20:07:18 +00:00
|
|
|
{
|
|
|
|
|
public SitOnCommand(TestClient testClient)
|
2007-08-20 09:26:21 +00:00
|
|
|
{
|
|
|
|
|
Name = "siton";
|
|
|
|
|
Description = "Attempt to sit on a particular prim, with specified UUID";
|
|
|
|
|
}
|
|
|
|
|
|
2007-01-30 20:07:18 +00:00
|
|
|
public override string Execute(string[] args, LLUUID fromAgentID)
|
2007-08-20 09:26:21 +00:00
|
|
|
{
|
|
|
|
|
if (args.Length != 1)
|
|
|
|
|
return "Usage: siton UUID";
|
2007-01-30 20:07:18 +00:00
|
|
|
|
2007-08-20 09:26:21 +00:00
|
|
|
LLUUID target;
|
2007-01-30 20:07:18 +00:00
|
|
|
|
2007-08-20 09:26:21 +00:00
|
|
|
if (LLUUID.TryParse(args[0], out target))
|
2007-01-30 20:07:18 +00:00
|
|
|
{
|
2007-08-29 08:55:53 +00:00
|
|
|
Primitive targetPrim = Client.Network.CurrentSim.Objects.Find(
|
|
|
|
|
delegate(Primitive prim)
|
2007-08-20 09:26:21 +00:00
|
|
|
{
|
2007-08-29 08:55:53 +00:00
|
|
|
return prim.ID == target;
|
2007-08-20 09:26:21 +00:00
|
|
|
}
|
2007-08-29 08:55:53 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (targetPrim != null)
|
|
|
|
|
{
|
|
|
|
|
Client.Self.RequestSit(targetPrim.ID, LLVector3.Zero);
|
|
|
|
|
Client.Self.Sit();
|
2007-11-30 13:15:31 +00:00
|
|
|
return "Requested to sit on prim " + targetPrim.ID.ToString() +
|
2007-08-29 08:55:53 +00:00
|
|
|
" (" + targetPrim.LocalID + ")";
|
2007-08-20 09:26:21 +00:00
|
|
|
}
|
2007-01-30 20:07:18 +00:00
|
|
|
}
|
2007-08-20 09:26:21 +00:00
|
|
|
|
|
|
|
|
return "Couldn't find a prim to sit on with UUID " + args[0];
|
|
|
|
|
}
|
2007-01-30 20:07:18 +00:00
|
|
|
}
|
2007-01-19 10:05:16 +00:00
|
|
|
}
|