예제 #1
0
        protected void ObjectPropertiesHandler(Packet p, Simulator sim)
        {
            ObjectPropertiesPacket op = (ObjectPropertiesPacket)p;
            ObjectPropertiesPacket.ObjectDataBlock[] datablocks = op.ObjectData;

            for (int i = 0; i < datablocks.Length; ++i)
            {
                ObjectPropertiesPacket.ObjectDataBlock objectData = datablocks[i];
                LLObject.ObjectProperties props = new LLObject.ObjectProperties();

                props.AggregatePerms = objectData.AggregatePerms;
                props.AggregatePermTextures = objectData.AggregatePermTextures;
                props.AggregatePermTexturesOwner = objectData.AggregatePermTexturesOwner;
                props.Permissions = new Permissions(objectData.BaseMask, objectData.EveryoneMask, objectData.GroupMask,
                    objectData.NextOwnerMask, objectData.OwnerMask);
                props.Category = objectData.Category;
                props.CreationDate = objectData.CreationDate;
                props.CreatorID = objectData.CreatorID;
                props.Description = Helpers.FieldToUTF8String(objectData.Description);
                props.FolderID = objectData.FolderID;
                props.FromTaskID = objectData.FromTaskID;
                props.GroupID = objectData.GroupID;
                props.InventorySerial = objectData.InventorySerial;
                props.ItemID = objectData.ItemID;
                props.LastOwnerID = objectData.LastOwnerID;
                props.Name = Helpers.FieldToUTF8String(objectData.Name);
                props.ObjectID = objectData.ObjectID;
                props.OwnerID = objectData.OwnerID;
                props.OwnershipCost = objectData.OwnershipCost;
                props.SalePrice = objectData.SalePrice;
                props.SaleType = objectData.SaleType;
                props.SitName = Helpers.FieldToUTF8String(objectData.SitName);
                props.TouchName = Helpers.FieldToUTF8String(objectData.TouchName);

                int numTextures = objectData.TextureID.Length / 16;
                props.TextureIDs = new LLUUID[numTextures];
                for (int j = 0; j < numTextures; ++j)
                    props.TextureIDs[j] = new LLUUID(objectData.TextureID, j * 16);

                if (Client.Settings.OBJECT_TRACKING)
                {
                    Primitive findPrim = sim.ObjectsPrimitives.Find(
                        delegate(Primitive prim) { return prim.ID == props.ObjectID; });

                    if (findPrim != null)
                    {
                        lock (sim.ObjectsPrimitives.Dictionary)
                        {
                            if (sim.ObjectsPrimitives.Dictionary.ContainsKey(findPrim.LocalID))
                                sim.ObjectsPrimitives.Dictionary[findPrim.LocalID].Properties = props;
                        }
                    }
                }

                FireOnObjectProperties(sim, props);
            }
        }
예제 #2
0
        protected void ObjectPropertiesHandler(Packet p, Simulator sim)
        {
            ObjectPropertiesPacket op = (ObjectPropertiesPacket)p;
            ObjectPropertiesPacket.ObjectDataBlock[] datablocks = op.ObjectData;

            for (int i = 0; i < datablocks.Length; ++i)
            {
                ObjectPropertiesPacket.ObjectDataBlock objectData = datablocks[i];
                LLObject.ObjectProperties props = new LLObject.ObjectProperties();

                props.AggregatePerms = objectData.AggregatePerms;
                props.AggregatePermTextures = objectData.AggregatePermTextures;
                props.AggregatePermTexturesOwner = objectData.AggregatePermTexturesOwner;
                props.BaseMask = objectData.BaseMask;
                props.Category = objectData.Category;
                props.CreationDate = objectData.CreationDate;
                props.CreatorID = objectData.CreatorID;
                props.Description = Helpers.FieldToUTF8String(objectData.Description);
                props.EveryoneMask = objectData.EveryoneMask;
                props.FolderID = objectData.FolderID;
                props.FromTaskID = objectData.FromTaskID;
                props.GroupID = objectData.GroupID;
                props.GroupMask = objectData.GroupMask;
                props.InventorySerial = objectData.InventorySerial;
                props.ItemID = objectData.ItemID;
                props.LastOwnerID = objectData.LastOwnerID;
                props.Name = Helpers.FieldToUTF8String(objectData.Name);
                props.NextOwnerMask = objectData.NextOwnerMask;
                props.ObjectID = objectData.ObjectID;
                props.OwnerID = objectData.OwnerID;
                props.OwnerMask = objectData.OwnerMask;
                props.OwnershipCost = objectData.OwnershipCost;
                props.SalePrice = objectData.SalePrice;
                props.SaleType = objectData.SaleType;
                props.SitName = Helpers.FieldToUTF8String(objectData.SitName);
                props.TouchName = Helpers.FieldToUTF8String(objectData.TouchName);

                int numTextures = objectData.TextureID.Length / 16;
                props.TextureIDs = new LLUUID[numTextures];
                for (int j = 0; j < numTextures; ++j)
                    props.TextureIDs[j] = new LLUUID(objectData.TextureID, j * 16);

                FireOnObjectProperties(sim, props);
            }
        }