2007-04-28 20:54:02 +00:00
|
|
|
using System;
|
2008-07-21 21:12:59 +00:00
|
|
|
using OpenMetaverse;
|
2007-04-28 20:54:02 +00:00
|
|
|
|
2008-07-21 21:12:59 +00:00
|
|
|
namespace OpenMetaverse.TestClient
|
2007-04-28 20:54:02 +00:00
|
|
|
{
|
|
|
|
|
public class WearCommand : Command
|
|
|
|
|
{
|
2008-08-21 01:19:06 +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-11-06 09:26:10 +00:00
|
|
|
Description = "Wear an outfit folder from inventory. Usage: wear [outfit name] [nobake]";
|
2008-07-25 08:55:36 +00:00
|
|
|
Category = CommandCategory.Appearance;
|
2007-04-28 20:54:02 +00:00
|
|
|
}
|
|
|
|
|
|
2008-07-25 05:15:05 +00:00
|
|
|
public override string Execute(string[] args, UUID fromAgentID)
|
2007-04-28 20:54:02 +00:00
|
|
|
{
|
2008-04-07 17:12:20 +00:00
|
|
|
if (args.Length < 1)
|
2008-08-21 01:19:06 +00:00
|
|
|
return "Usage: wear [outfit name] eg: 'wear /My Outfit/Dance Party";
|
2008-04-07 17:12:20 +00:00
|
|
|
|
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] + " ";
|
|
|
|
|
}
|
2008-08-12 05:55:42 +00:00
|
|
|
|
2008-08-21 01:19:06 +00:00
|
|
|
target = target.TrimEnd();
|
2007-08-25 09:36:33 +00:00
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
2008-08-21 01:19:06 +00:00
|
|
|
Client.Appearance.WearOutfit(target.Split('/'), bake);
|
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
|
|
|
}
|
|
|
|
|
}
|