Files
libremetaverse/libsecondlife/examples/TestClient/Commands/Appearance/AppearanceCommand.cs
Latif Khalifa fb3c459016 * Added Helpers.StateToAttachmentPoint() that converts a prim.Data.State to the AttachmentPoint enum
* Created an Appearance folder for TestClient commands, put the new AttachmentsCommand in it which shows all of the current agent attachments
* Moved the ObjectManager enums out to the libsecondlife namespace
* Change LLObject.ObjectData.State from a uint to a byte (as it should be)

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1505 52acb1d6-8a22-11de-b505-999d5b087335
2007-11-30 00:25:08 +00:00

43 lines
1.4 KiB
C#

using System;
using System.Threading;
using libsecondlife;
namespace libsecondlife.TestClient
{
public class AppearanceCommand : Command
{
public AppearanceCommand(TestClient testClient)
{
Name = "appearance";
Description = "Set your current appearance to your last saved appearance";
}
public override string Execute(string[] args, LLUUID fromAgentID)
{
bool success = false;
// Register a handler for the appearance event
AutoResetEvent appearanceEvent = new AutoResetEvent(false);
AppearanceManager.AppearanceUpdatedCallback callback =
delegate(LLObject.TextureEntry te) { appearanceEvent.Set(); };
Client.Appearance.OnAppearanceUpdated += callback;
// Start the appearance setting process (with baking enabled or disabled)
Client.Appearance.SetPreviousAppearance(!(args.Length > 0 && args[0].Equals("nobake")));
// Wait for the process to complete or time out
if (appearanceEvent.WaitOne(1000 * 120, false))
success = true;
// Unregister the handler
Client.Appearance.OnAppearanceUpdated -= callback;
// Return success or failure message
if (success)
return "Successfully set appearance";
else
return "Timed out while setting appearance";
}
}
}