2025-05-27 14:16:03 -05:00
|
|
|
using System.Linq;
|
|
|
|
|
|
2008-07-21 21:12:59 +00:00
|
|
|
namespace OpenMetaverse.TestClient
|
2007-01-30 20:07:18 +00:00
|
|
|
{
|
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";
|
2008-07-25 08:55:36 +00:00
|
|
|
Category = CommandCategory.Movement;
|
2007-08-20 09:26:21 +00:00
|
|
|
}
|
|
|
|
|
|
2008-07-25 05:15:05 +00:00
|
|
|
public override string Execute(string[] args, UUID 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
|
|
|
|
2025-05-27 14:16:03 -05:00
|
|
|
if (UUID.TryParse(args[0], out var target))
|
2007-01-30 20:07:18 +00:00
|
|
|
{
|
2025-05-27 14:16:03 -05:00
|
|
|
var kvp = Client.Network.CurrentSim.ObjectsPrimitives.FirstOrDefault(prim => prim.Value.ID == target);
|
2007-08-29 08:55:53 +00:00
|
|
|
|
2025-05-27 14:16:03 -05:00
|
|
|
if (kvp.Value != null)
|
2007-08-29 08:55:53 +00:00
|
|
|
{
|
2025-05-27 14:16:03 -05:00
|
|
|
var targetPrim = kvp.Value;
|
2008-07-25 05:15:05 +00:00
|
|
|
Client.Self.RequestSit(targetPrim.ID, Vector3.Zero);
|
2007-08-29 08:55:53 +00:00
|
|
|
Client.Self.Sit();
|
2022-02-25 19:38:11 -06:00
|
|
|
return "Requested to sit on prim " + targetPrim.ID +
|
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
|
|
|
}
|
2008-01-03 21:55:49 +00:00
|
|
|
}
|