2007-04-28 20:54:02 +00:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Xml;
|
|
|
|
|
using System.Xml.Serialization;
|
|
|
|
|
using libsecondlife;
|
|
|
|
|
using libsecondlife.Packets;
|
|
|
|
|
|
|
|
|
|
namespace libsecondlife.TestClient
|
|
|
|
|
{
|
|
|
|
|
public class WearCommand : Command
|
|
|
|
|
{
|
2007-07-11 09:17:46 +00:00
|
|
|
public WearCommand(TestClient testClient)
|
2007-04-28 20:54:02 +00:00
|
|
|
{
|
2007-07-11 09:17:46 +00:00
|
|
|
Client = testClient;
|
2007-04-28 20:54:02 +00:00
|
|
|
Name = "wear";
|
2007-05-12 01:42:28 +00:00
|
|
|
Description = "Wear an outfit folder from inventory. Usage: wear [outfit name]";
|
2007-04-28 20:54:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string Execute(string[] args, LLUUID fromAgentID)
|
|
|
|
|
{
|
2007-05-12 01:42:28 +00:00
|
|
|
string target = String.Empty;
|
2007-08-25 09:36:33 +00:00
|
|
|
bool bake = true;
|
2007-04-28 20:54:02 +00:00
|
|
|
|
2007-05-12 01:42:28 +00:00
|
|
|
for (int ct = 0; ct < args.Length; ct++)
|
2007-08-25 09:36:33 +00:00
|
|
|
{
|
|
|
|
|
if (args[ct].Equals("nobake"))
|
|
|
|
|
bake = false;
|
|
|
|
|
else
|
|
|
|
|
target = target + args[ct] + " ";
|
|
|
|
|
}
|
2007-05-12 01:42:28 +00:00
|
|
|
|
2007-08-25 09:36:33 +00:00
|
|
|
target = target.TrimEnd();
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
Client.Appearance.WearOutfit(target.Split('/'), bake);
|
|
|
|
|
}
|
2007-07-11 09:17:46 +00:00
|
|
|
|
2007-08-25 09:36:33 +00:00
|
|
|
catch (InvalidOutfitException ex)
|
|
|
|
|
{
|
|
|
|
|
return "Invalid outfit (" + ex.Message + ")";
|
|
|
|
|
}
|
2007-04-28 20:54:02 +00:00
|
|
|
|
2007-08-25 09:36:33 +00:00
|
|
|
return String.Empty;
|
2007-04-28 20:54:02 +00:00
|
|
|
}
|
2007-05-12 01:42:28 +00:00
|
|
|
}
|
|
|
|
|
}
|