* Updated OnAvatarAppearance event to include sender ID and bool isTrial parameter.

* Updated TestClient's detectbot command to use OnAvatarAppearance.

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1858 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
2008-05-13 22:57:37 +00:00
parent c124d016ab
commit 640cb4b69e
2 changed files with 10 additions and 15 deletions

View File

@@ -11,7 +11,7 @@ namespace libsecondlife.TestClient
Name = "detectbot";
Description = "Runs in the background, reporting any potential bots";
testClient.Network.RegisterCallback(PacketType.AvatarAppearance, new NetworkManager.PacketCallback(AvatarAppearanceHandler));
testClient.Avatars.OnAvatarAppearance += new AvatarManager.AvatarAppearanceCallback(Avatars_OnAvatarAppearance);
}
public override string Execute(string[] args, LLUUID fromAgentID)
@@ -19,20 +19,15 @@ namespace libsecondlife.TestClient
return "This command is always running";
}
private void AvatarAppearanceHandler(Packet packet, Simulator simulator)
void Avatars_OnAvatarAppearance(LLUUID avatarID, bool isTrial, LLObject.TextureEntryFace defaultTexture, LLObject.TextureEntryFace[] faceTextures, System.Collections.Generic.List<byte> visualParams)
{
AvatarAppearancePacket appearance = (AvatarAppearancePacket)packet;
LLObject.TextureEntry te = new LLObject.TextureEntry(appearance.ObjectData.TextureEntry, 0,
appearance.ObjectData.TextureEntry.Length);
if (IsNullOrZero(te.FaceTextures[(int)AppearanceManager.TextureIndex.EyesBaked] ) &&
IsNullOrZero(te.FaceTextures[(int)AppearanceManager.TextureIndex.HeadBaked]) &&
IsNullOrZero(te.FaceTextures[(int)AppearanceManager.TextureIndex.LowerBaked]) &&
IsNullOrZero(te.FaceTextures[(int)AppearanceManager.TextureIndex.SkirtBaked]) &&
IsNullOrZero(te.FaceTextures[(int)AppearanceManager.TextureIndex.UpperBaked]))
if (IsNullOrZero(faceTextures[(int)AppearanceManager.TextureIndex.EyesBaked]) &&
IsNullOrZero(faceTextures[(int)AppearanceManager.TextureIndex.HeadBaked]) &&
IsNullOrZero(faceTextures[(int)AppearanceManager.TextureIndex.LowerBaked]) &&
IsNullOrZero(faceTextures[(int)AppearanceManager.TextureIndex.SkirtBaked]) &&
IsNullOrZero(faceTextures[(int)AppearanceManager.TextureIndex.UpperBaked]))
{
Console.WriteLine("Avatar " + appearance.Sender.ID.ToString() + " may be a bot");
Console.WriteLine("Avatar " + avatarID.ToString() + " may be a bot");
}
}