Merged in patches #1828, #1833, #1835, #1836, #1832 (c/o omegaworks and happyguy)

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@856 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
otakup0pe
2007-01-19 10:05:16 +00:00
parent 0b046ed6ee
commit e5d591a950
6 changed files with 814 additions and 4 deletions

View File

@@ -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)
{
PrimObject targetSeat = null;
lock (Client.SimPrims)
{
if (Client.SimPrims.ContainsKey(Client.Network.CurrentSim))
{
foreach (PrimObject 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";
}
}
}
}