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-20 09:26:21 +00:00
|
|
|
lock (Client.Network.CurrentSim.Objects.Prims)
|
|
|
|
|
{
|
|
|
|
|
foreach (Primitive prim in Client.Network.CurrentSim.Objects.Prims.Values)
|
|
|
|
|
{
|
|
|
|
|
if (prim.ID == target)
|
|
|
|
|
{
|
|
|
|
|
Client.Self.RequestSit(prim.ID, LLVector3.Zero);
|
|
|
|
|
Client.Self.Sit();
|
|
|
|
|
return "Requested to sit on prim " + prim.ID.ToStringHyphenated() +
|
|
|
|
|
" (" + prim.LocalID + ")";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
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
|
|
|
}
|