Files
libremetaverse/libsecondlife/examples/TestClient/Commands/Inventory/ExportOutfitCommand.cs
John Hurliman 3013742668 * Increased SIMULATOR_TIMEOUT to 30 seconds
* Converted all timers to System.Threading timers to fix problems running in services and the CF
* UDPBase now uses our own ReaderWriterLock that is more efficient, and CF compatible
* Login uses a hand-created LoginProxy object instead of dynamically building the class with reflection .Emit()
* Replaced ParameterizedThreadStart calls with class-wide variables for CF compat.
* Removed transfer timeout code (irrelevant now that uploads go through CAPS)
* Added several new Helpers methods to wrap desktop and CF conditional code
* Replaced Monitor calls with AutoResetEvent in BlockingQueue
* InventoryNodeDictionary uses generics now
* Removed final lingering piece of XML serialization
* Added CookComputing.XmlRpc.CF.dll for the CF

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1479 52acb1d6-8a22-11de-b505-999d5b087335
2007-11-06 09:26:10 +00:00

58 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.IO;
using libsecondlife;
using libsecondlife.Packets;
namespace libsecondlife.TestClient
{
public class ExportOutfitCommand : Command
{
public ExportOutfitCommand(TestClient testClient)
{
Name = "exportoutfit";
Description = "Exports an avatars outfit to an xml file. Usage: exportoutfit [avataruuid] outputfile.xml";
}
public override string Execute(string[] args, LLUUID fromAgentID)
{
LLUUID id;
string path;
if (args.Length == 1)
{
id = Client.Self.AgentID;
path = args[0];
}
else if (args.Length == 2)
{
if (!LLUUID.TryParse(args[0], out id))
return "Usage: exportoutfit [avataruuid] outputfile.xml";
path = args[1];
}
else
return "Usage: exportoutfit [avataruuid] outputfile.xml";
lock (Client.Appearances)
{
if (Client.Appearances.ContainsKey(id))
{
try
{
File.WriteAllText(path, Packet.SerializeToXml(Client.Appearances[id]));
}
catch (Exception e)
{
return e.ToString();
}
return "Exported appearance for avatar " + id.ToString() + " to " + args[1];
}
else
{
return "Couldn't find an appearance for avatar " + id.ToString();
}
}
}
}
}