2007-09-06 04:17:45 +00:00
|
|
|
using System;
|
2008-07-21 21:12:59 +00:00
|
|
|
using OpenMetaverse;
|
2007-09-06 04:17:45 +00:00
|
|
|
|
2008-07-21 21:12:59 +00:00
|
|
|
namespace OpenMetaverse.TestClient
|
2007-09-06 04:17:45 +00:00
|
|
|
{
|
|
|
|
|
public class FindTextureCommand : Command
|
|
|
|
|
{
|
|
|
|
|
public FindTextureCommand(TestClient testClient)
|
|
|
|
|
{
|
|
|
|
|
Name = "findtexture";
|
|
|
|
|
Description = "Checks if a specified texture is currently visible on a specified face. " +
|
|
|
|
|
"Usage: findtexture [face-index] [texture-uuid]";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string Execute(string[] args, LLUUID fromAgentID)
|
|
|
|
|
{
|
|
|
|
|
int faceIndex;
|
|
|
|
|
LLUUID textureID;
|
|
|
|
|
|
|
|
|
|
if (args.Length != 2)
|
|
|
|
|
return "Usage: findtexture [face-index] [texture-uuid]";
|
|
|
|
|
|
|
|
|
|
if (Int32.TryParse(args[0], out faceIndex) &&
|
|
|
|
|
LLUUID.TryParse(args[1], out textureID))
|
|
|
|
|
{
|
2008-01-03 21:55:49 +00:00
|
|
|
Client.Network.CurrentSim.ObjectsPrimitives.ForEach(
|
2007-09-06 04:17:45 +00:00
|
|
|
delegate(Primitive prim)
|
|
|
|
|
{
|
|
|
|
|
if (prim.Textures != null && prim.Textures.FaceTextures[faceIndex] != null)
|
|
|
|
|
{
|
|
|
|
|
if (prim.Textures.FaceTextures[faceIndex].TextureID == textureID)
|
|
|
|
|
{
|
2008-05-06 23:57:26 +00:00
|
|
|
Logger.Log(String.Format("Primitive {0} ({1}) has face index {2} set to {3}",
|
2007-11-30 13:15:31 +00:00
|
|
|
prim.ID.ToString(), prim.LocalID, faceIndex, textureID.ToString()),
|
2008-05-06 23:57:26 +00:00
|
|
|
Helpers.LogLevel.Info, Client);
|
2007-09-06 04:17:45 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return "Done searching";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return "Usage: findtexture [face-index] [texture-uuid]";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|