Exemplo n.º 1
0
        public void TextureEntry()
        {
            LLObject.TextureEntry     te   = new LLObject.TextureEntry(LLUUID.Random());
            LLObject.TextureEntryFace face = te.CreateFace(0);
            face.Bump       = Bumpiness.Concrete;
            face.Fullbright = true;
            face.MediaFlags = true;
            face.OffsetU    = 0.5f;
            face.OffsetV    = -0.5f;
            face.RepeatU    = 3.0f;
            face.RepeatV    = 4.0f;
            face.RGBA       = new LLColor(0f, 0.25f, 0.75f, 1f);
            face.Rotation   = 1.5f;
            face.Shiny      = Shininess.Medium;
            face.TexMapType = MappingType.Planar;
            face.TextureID  = LLUUID.Random();

            byte[] teBytes = te.ToBytes();

            LLObject.TextureEntry te2 = new LLObject.TextureEntry(teBytes, 0, teBytes.Length);

            byte[] teBytes2 = te2.ToBytes();

            Assert.IsTrue(teBytes.Length == teBytes2.Length);

            for (int i = 0; i < teBytes.Length; i++)
            {
                Assert.IsTrue(teBytes[i] == teBytes2[i], "Byte " + i + " is not equal");
            }
        }
 void Avatars_OnAvatarAppearance(LLUUID avatarID, bool isTrial, LLObject.TextureEntryFace defaultTexture, LLObject.TextureEntryFace[] faceTextures, System.Collections.Generic.List <byte> visualParams)
 {
     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 " + avatarID.ToString() + " may be a bot");
     }
 }
Exemplo n.º 3
0
 private bool IsNullOrZero(LLObject.TextureEntryFace face)
 {
     return(face == null || face.TextureID == LLUUID.Zero);
 }
Exemplo n.º 4
0
        public override string Execute(string[] args, LLUUID fromAgentID)
        {
            if (args.Length != 1)
            {
                return("Usage: dumpoutfit [avatar-uuid]");
            }

            LLUUID target;

            if (!LLUUID.TryParse(args[0], out target))
            {
                return("Usage: dumpoutfit [avatar-uuid]");
            }

            lock (Client.Network.Simulators)
            {
                for (int i = 0; i < Client.Network.Simulators.Count; i++)
                {
                    Avatar targetAv;

                    targetAv = Client.Network.Simulators[i].Objects.Find(
                        delegate(Avatar avatar)
                    {
                        return(avatar.ID == target);
                    }
                        );

                    if (targetAv != null)
                    {
                        StringBuilder output = new StringBuilder("Downloading ");

                        lock (OutfitAssets) OutfitAssets.Clear();
                        Client.Assets.OnImageReceived += ImageReceivedHandler;

                        for (int j = 0; j < targetAv.Textures.FaceTextures.Length; j++)
                        {
                            LLObject.TextureEntryFace face = targetAv.Textures.FaceTextures[j];

                            if (face != null)
                            {
                                ImageType type = ImageType.Normal;

                                switch ((AppearanceManager.TextureIndex)j)
                                {
                                case AppearanceManager.TextureIndex.HeadBaked:
                                case AppearanceManager.TextureIndex.EyesBaked:
                                case AppearanceManager.TextureIndex.UpperBaked:
                                case AppearanceManager.TextureIndex.LowerBaked:
                                case AppearanceManager.TextureIndex.SkirtBaked:
                                    type = ImageType.Baked;
                                    break;
                                }

                                OutfitAssets.Add(face.TextureID);
                                Client.Assets.RequestImage(face.TextureID, type, 100000.0f, 0);

                                output.Append(((AppearanceManager.TextureIndex)j).ToString());
                                output.Append(" ");
                            }
                        }

                        return(output.ToString());
                    }
                }
            }

            return("Couldn't find avatar " + target.ToString());
        }