Provides data for the ObjectManager.ObjectUpdate event

The ObjectManager.ObjectUpdate event occurs when the simulator sends an ObjectUpdatePacket containing a Primitive, Foliage or Attachment data

Note 1: The ObjectManager.ObjectUpdate event will not be raised when the object is an Avatar

Note 2: It is possible for the ObjectManager.ObjectUpdate to be raised twice for the same object if for example the primitive moved to a new simulator, then returned to the current simulator or if an Avatar crosses the border into a new simulator and returns to the current simulator

Inheritance: System.EventArgs
Example #1
0
        void Objects_ObjectUpdate(object sender, PrimEventArgs e)
        {
            if (active == false)
                return;

            if (e.IsAttachment)
                return;

            // we only care about new objects from now
            if (!e.IsNew)
                return;

            if (e.Simulator != client.Network.CurrentSim)
                return;

            total_objects++;

            if (e.Prim.ParentID == 0)
            {
                total_linksets++;
                intereset_list.Add(e.Prim.ID);
                lock (requested_props)
                    requested_props.Add(e.Prim.ID);

                lock (requested_propsfamily)
                    requested_propsfamily.Add(e.Prim.ID);

                client.Objects.RequestObjectPropertiesFamily(e.Simulator, e.Prim.ID);
                client.Objects.SelectObject(e.Simulator, e.Prim.LocalID);
            }
        }
 void Objects_ObjectUpdate(object sender, PrimEventArgs e)
 {
     // If we know of this avatar, update its position and rotation, and send an AvatarUpdated callback.
     if (this.nearbyAvatars.ContainsKey(e.Prim.LocalID))
     {
         Avatar avatar;
         lock (this.nearbyAvatars) avatar = this.nearbyAvatars[e.Prim.LocalID];
         avatar.Position = e.Prim.Position;
         avatar.Rotation = e.Prim.Rotation;
     }
 }
Example #3
0
        void Objects_OnNewPrim(object sender, PrimEventArgs e)
        {
            Primitive prim = e.Prim;

            if (enabled)
            {
                // Search this prim for textures
                for (int i = 0; i < prim.Textures.FaceTextures.Length; i++)
                {
                    Primitive.TextureEntryFace face = prim.Textures.FaceTextures[i];

                    if (face != null)
                    {
                        if (!alreadyRequested.ContainsKey(face.TextureID))
                        {
                            alreadyRequested[face.TextureID] = face.TextureID;
                            Client.Assets.RequestImage(face.TextureID, ImageType.Normal, Assets_OnImageReceived);
                        }
                    }
                }
            }
        }
Example #4
0
        public void Objects_NewPrim(object sender, PrimEventArgs args)
        {
            if (!RequestObjectTextures)
                return;

            Primitive prim = args.Prim;

            if (prim != null)
            {
                lock (m_objects)
                    m_objects[prim.ID] = prim;

                if (prim.Textures != null)
                {
                    if (prim.Textures.DefaultTexture.TextureID != UUID.Zero)
                    {
                        GetTextureOrMesh(prim.Textures.DefaultTexture.TextureID, true);
                    }

                    for (int i = 0; i < prim.Textures.FaceTextures.Length; i++)
                    {
                        Primitive.TextureEntryFace face = prim.Textures.FaceTextures[i];

                        if (face != null)
                        {
                            UUID textureID = prim.Textures.FaceTextures[i].TextureID;

                            if (textureID != UUID.Zero)
                                GetTextureOrMesh(textureID, true);
                        }
                    }
                }

                if (prim.Sculpt != null && prim.Sculpt.SculptTexture != UUID.Zero)
                {
                    bool mesh = (prim.Sculpt.Type == SculptType.Mesh);
                    GetTextureOrMesh(prim.Sculpt.SculptTexture, !mesh);
                }
            }
        }
        private void OnObjectPropertiesNewesh(object sender, PrimEventArgs e)
        {
            Primitive prim = e.Prim;
            lock (MustExportUINT)
            {
                if (MustExportUINT.Contains(prim.ParentID))
                {
                    MustExportUINT.Add(prim.LocalID);
                    lock (MustExport) MustExport.Add(prim.ID);
                }
            }
            lock (MustExportUINT)
            {
                if (MustExportUINT.Contains(prim.LocalID))
                {
                    MustExport.Add(prim.ID);
                }
            }
            if (ExportHolder.Count > 0)
            {
                var pp = prim.Properties;                
                Client.Objects.SelectObject(e.Simulator, prim.LocalID);
                if (pp != null)
                {

                }
            }
        }
Example #6
0
 public override void Objects_OnNewPrim(object sender, PrimEventArgs e)
 {                        
     var simulator = e.Simulator;
     var prim = e.Prim;
     var regionHandle = e.Simulator.Handle;
     Objects_OnNewPrimReal(simulator, prim, regionHandle);
 }
Example #7
0
        static void Objects_OnNewPrim(object sender, PrimEventArgs e)
        {
            Primitive prim = e.Prim;
            if (CurrentSculpt != null && (prim.Flags & PrimFlags.CreateSelected) != 0 &&
                !RezzedPrims.Contains(prim.LocalID))
            {
                lock (RezzedPrims) RezzedPrims.Add(prim.LocalID);

                Console.WriteLine("Rezzed prim " + CurrentSculpt.Name + ", setting properties");

                // Deselect the prim
                Client.Objects.DeselectObject(Client.Network.CurrentSim, prim.LocalID);

                // Set the prim position
                Client.Objects.SetPosition(Client.Network.CurrentSim, prim.LocalID,
                    RootPosition + CurrentSculpt.Offset);

                // Set the texture
                Primitive.TextureEntry textures = new Primitive.TextureEntry(CurrentSculpt.TextureID);
                Client.Objects.SetTextures(Client.Network.CurrentSim, prim.LocalID, textures);

                // Turn it in to a sculpted prim
                Primitive.SculptData sculpt = new Primitive.SculptData();
                sculpt.SculptTexture = CurrentSculpt.SculptID;
                sculpt.Type = SculptType.Sphere;
                Client.Objects.SetSculpt(Client.Network.CurrentSim, prim.LocalID, sculpt);

                // Set the prim name
                if (!String.IsNullOrEmpty(CurrentSculpt.Name))
                    Client.Objects.SetName(Client.Network.CurrentSim, prim.LocalID, CurrentSculpt.Name);

                RezzedEvent.Set();
            }
        }
        void Objects_AttachmentUpdate(object sender, PrimEventArgs e)
        {
            Primitive prim = e.Prim;

            if (client.Self.LocalID == 0 ||
                prim.ParentID != client.Self.LocalID ||
                prim.NameValues == null) return;

            for (int i = 0; i < prim.NameValues.Length; i++)
            {
                if (prim.NameValues[i].Name == "AttachItemID")
                {
                    AttachmentInfo attachment = new AttachmentInfo();
                    attachment.Prim = prim;
                    attachment.InventoryID = new UUID(prim.NameValues[i].Value.ToString());
                    attachment.PrimID = prim.ID;

                    lock (attachments)
                    {
                        // Add new attachment info
                        if (!attachments.ContainsKey(attachment.InventoryID))
                        {
                            attachments.Add(attachment.InventoryID, attachment);

                        }
                        else
                        {
                            attachment = attachments[attachment.InventoryID];
                            if (attachment.Prim == null)
                            {
                                attachment.Prim = prim;
                            }
                        }

                        // Don't update the tree yet if we're still updating invetory tree from server
                        if (!TreeUpdateInProgress)
                        {
                            if (Inventory.Contains(attachment.InventoryID))
                            {
                                if (attachment.Item == null)
                                {
                                    InventoryItem item = (InventoryItem)Inventory[attachment.InventoryID];
                                    attachment.Item = item;
                                }
                                if (!attachment.MarkedAttached)
                                {
                                    attachment.MarkedAttached = true;
                                    UpdateNodeLabel(attachment.InventoryID);
                                }
                            }
                            else
                            {
                                client.Inventory.RequestFetchInventory(attachment.InventoryID, client.Self.AgentID);
                            }
                        }
                    }
                    break;
                }
            }
        }
        void Objects_AttachmentUpdate(object sender, PrimEventArgs e)
        {
            Primitive prim = e.Prim;

            if (client.Self.LocalID == 0 ||
                prim.ParentID != client.Self.LocalID ||
                prim.NameValues == null) return;

            for (int i = 0; i < prim.NameValues.Length; i++)
            {
                if (prim.NameValues[i].Name == "AttachItemID")
                {
                    AttachmentInfo attachment = new AttachmentInfo();
                    attachment.Prim = prim;
                    attachment.InventoryID = new UUID(prim.NameValues[i].Value.ToString());
                    attachment.PrimID = prim.ID;

                    lock (attachments)
                    {
                        // Do we have attachmetns already on this spot?
                        AttachmentInfo oldAttachment = null;
                        UUID oldAttachmentUUID = UUID.Zero;
                        foreach (KeyValuePair<UUID, AttachmentInfo> att in attachments)
                        {
                            if (att.Value.Point == prim.PrimData.AttachmentPoint)
                            {
                                oldAttachment = att.Value;
                                oldAttachmentUUID = att.Key;
                                break;
                            }
                        }

                        if (oldAttachment != null && oldAttachment.InventoryID != attachment.InventoryID)
                        {
                            attachments.Remove(oldAttachmentUUID);
                            if (oldAttachment.Item != null)
                            {
                                attachment.MarkedAttached = false;
                                Inventory_InventoryObjectUpdated(this, new InventoryObjectUpdatedEventArgs(oldAttachment.Item, oldAttachment.Item));
                            }
                        }

                        // Add new attachment info
                        if (!attachments.ContainsKey(attachment.InventoryID))
                        {
                            attachments.Add(attachment.InventoryID, attachment);

                        }
                        else
                        {
                            attachment = attachments[attachment.InventoryID];
                            if (attachment.Prim == null)
                            {
                                attachment.Prim = prim;
                            }
                        }

                        // Don't update the tree yet if we're still updating invetory tree from server
                        if (!TreeUpdateInProgress)
                        {
                            if (Inventory.Contains(attachment.InventoryID))
                            {
                                if (attachment.Item == null)
                                {
                                    InventoryItem item = (InventoryItem)Inventory[attachment.InventoryID];
                                    attachment.Item = item;
                                }
                                if (!attachment.MarkedAttached)
                                {
                                    attachment.MarkedAttached = true;
                                    Inventory_InventoryObjectUpdated(this, new InventoryObjectUpdatedEventArgs(attachments[attachment.InventoryID].Item, attachments[attachment.InventoryID].Item));
                                }
                            }
                            else
                            {
                                client.Inventory.RequestFetchInventory(attachment.InventoryID, client.Self.AgentID);
                            }
                        }
                    }
                    break;
                }
            }
        }
Example #10
0
 /// <summary>
 /// Handle object updates, looking for sound events
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Objects_ObjectUpdate(object sender, PrimEventArgs e)
 {
     HandleObjectSound(e.Prim, e.Simulator);
 }
Example #11
0
        void Objects_ObjectUpdate(object sender, PrimEventArgs e)
        {
            if (!this.IsHandleCreated) return;

            if (Prims.ContainsKey(e.Prim.LocalID) || Prims.ContainsKey(e.Prim.ParentID))
            {
                UpdatePrimBlocking(e.Prim);
            }
        }
        void Objects_ObjectUpdate(object sender, PrimEventArgs e)
        {
            if ((e.Prim.Flags & PrimFlags.CreateSelected) == 0)
                return; // We received an update for an object we didn't create

            switch (state)
            {
                case ImporterState.RezzingParent:
                    rootLocalID = e.Prim.LocalID;
                    goto case ImporterState.RezzingChildren;
                case ImporterState.RezzingChildren:
                    if (!primsCreated.Contains(e.Prim))
                    {
                        Console.WriteLine("Setting properties for " + e.Prim.LocalID);
                        // TODO: Is there a way to set all of this at once, and update more ObjectProperties stuff?
                        Client.Objects.SetPosition(e.Simulator, e.Prim.LocalID, currentPosition);
                        Client.Objects.SetTextures(e.Simulator, e.Prim.LocalID, currentPrim.Textures);

                        if (currentPrim.Light != null && currentPrim.Light.Intensity > 0)
                        {
                            Client.Objects.SetLight(e.Simulator, e.Prim.LocalID, currentPrim.Light);
                        }

                        if (currentPrim.Flexible != null)
                        {
                            Client.Objects.SetFlexible(e.Simulator, e.Prim.LocalID, currentPrim.Flexible);
                        }

                        if (currentPrim.Sculpt != null && currentPrim.Sculpt.SculptTexture != UUID.Zero)
                        {
                            Client.Objects.SetSculpt(e.Simulator, e.Prim.LocalID, currentPrim.Sculpt);
                        }

                        if (currentPrim.Properties != null && !String.IsNullOrEmpty(currentPrim.Properties.Name))
                        {
                            Client.Objects.SetName(e.Simulator, e.Prim.LocalID, currentPrim.Properties.Name);
                        }

                        if (currentPrim.Properties != null && !String.IsNullOrEmpty(currentPrim.Properties.Description))
                        {
                            Client.Objects.SetDescription(e.Simulator, e.Prim.LocalID, currentPrim.Properties.Description);
                        }

                        primsCreated.Add(e.Prim);
                        primDone.Set();
                    }
                    break;
                case ImporterState.Linking:
                    lock (linkQueue)
                    {
                        int index = linkQueue.IndexOf(e.Prim.LocalID);
                        if (index != -1)
                        {
                            linkQueue.RemoveAt(index);
                            if (linkQueue.Count == 0)
                                primDone.Set();
                        }
                    }
                    break;
            }
        }
Example #13
0
 public virtual void Objects_OnNewPrim(object sender, PrimEventArgs e) { OnEvent("On-New-Prim", paramNamesOnNewPrim, paramTypesOnNewPrim, e); }
    void Objects_OnObjectUpdate(object sender, PrimEventArgs e)
    {
        //leave other regions out temporarily
        if (e.Simulator.Handle != Client.Network.CurrentSim.Handle) return;

        //leave tree out temporarily. Radegast doesn't implement tree rendering yet.
        if (e.Prim.PrimData.PCode != PCode.Prim)
        {
            //Debug.Log("Receive " + e.Prim.PrimData.PCode.ToString());
            return;
        }

        //FIXME : need to update prims?
        if (objects.ContainsKey(e.Prim.LocalID))
        {
            //Debug.Log ("receive prim with LocalID " + e.Prim.LocalID.ToString() + " again!");
            return;
        }

        if (e.Prim.Sculpt != null)
        {
            //leave sculpt prim out temporarily
        }
        else
        {
            FacetedMesh mesh = Utility.R.GenerateFacetedMesh(e.Prim, DetailLevel.Highest);
            lock (newPrims)
            {
                newPrims[e.Prim.LocalID] = mesh;
            }
            if (Application.platform == RuntimePlatform.WindowsPlayer
                || Application.platform == RuntimePlatform.WindowsEditor)
            {
                foreach (Face face in mesh.Faces)
                    m_textures.DownloadTexture(face.TextureFace.TextureID);
            }
        }
    }
Example #15
0
        //Separate thread
        private void Objects_OnNewPrim(object sender, PrimEventArgs e)
        {
            //if (!this.IsHandleCreated) return;

            if (e.Simulator.Handle != client.Network.CurrentSim.Handle || e.Prim.Position == Vector3.Zero || e.Prim is Avatar) return;

            try
            {
                if (e.Prim.ParentID != 0)
                {
                    lock (childItems)
                    {
                        ObjectsListItem citem = new ObjectsListItem(e.Prim, client, lbxChildren);

                        if (!childItems.ContainsKey(e.Prim.LocalID))
                        {
                            try
                            {
                                childItems.Add(e.Prim.LocalID, citem);
                            }
                            catch
                            {
                                ;
                            }
                        }
                    }
                }
                else
                {
                    BeginInvoke(new MethodInvoker(delegate()
                            {
                                lock (listItems)
                                {
                                    ObjectsListItem item = new ObjectsListItem(e.Prim, client, lbxPrims);

                                    Vector3 location = new Vector3(Vector3.Zero);
                                    location = instance.SIMsittingPos();
                                    Vector3 pos = new Vector3(Vector3.Zero);
                                    pos = item.Prim.Position;

                                    float dist = Vector3.Distance(location, pos);

                                    if (dist < range)
                                    {
                                        try
                                        {
                                            if (!listItems.ContainsKey(e.Prim.LocalID))
                                            {
                                                listItems.Add(e.Prim.LocalID, item);

                                                item.PropertiesReceived += new EventHandler(iitem_PropertiesReceived);
                                                item.RequestProperties();
                                            }
                                            //else
                                            //{
                                            //    listItems.Remove(e.Prim.LocalID);
                                            //    listItems.Add(e.Prim.LocalID, item);

                                            //    lock (lbxPrims.Items)
                                            //    {
                                            //        lbxPrims.BeginUpdate();

                                            //        if (lbxPrims.Items.Contains(item))
                                            //        {
                                            //            lbxPrims.Items.Remove(item);
                                            //        }

                                            //        lbxPrims.Items.Add(item);
                                            //        lbxPrims.EndUpdate();
                                            //    }

                                            //    lbxPrims.SortList();
                                            //}
                                        }
                                        catch
                                        {
                                            ;
                                        }

                                        //BeginInvoke(new MethodInvoker(delegate()
                                        //{
                                        //    pB1.Maximum += 1;
                                        //}));
                                    }
                                }
                            }));
                }
            }
            catch
            {
                ;
            }
        }
Example #16
0
 void Objects_ObjectUpdate(object sender, PrimEventArgs e)
 {
     if (e.IsNew)
     {
         // if the new object is already registered, then it must have
         // come from the ObjectProperties event, and we now know both.
         if (mergeObjectIDAndLocalID.ContainsKey(e.Prim.ID))
         {
             objectoColocado = e.Prim.LocalID;
             gotMyObject.Set();
         }
         //else
         //{
         //    // workaround for a bug in OpenSim, where you cannot trust the owner id of the first
         //    // object properties package, by selecting it we force another object properties package
         //    // to be sent
         //    registaLog("BUG???");
         //    cliente.Objects.SelectObject(cliente.Network.CurrentSim, prim.LocalID);
         //}
        // mergeObjectIDAndLocalID[e.Prim.ID] = e.Prim.LocalID;
     }
 }
Example #17
0
        private void Objects_OnNewPrim(object sender, PrimEventArgs e)
        {
            //if (!this.IsHandleCreated) return;

            if (e.Simulator.Handle != client.Network.CurrentSim.Handle || e.Prim is Avatar) return;

            //if (e.Prim.ParentID != 0) return;

            if (!e.Prim.IsAttachment) return;

            if (e.Prim.ParentID != av.LocalID) return;

            lock (listItems)
            {
                listItems.Clear();
            }

            BeginInvoke(new MethodInvoker(delegate()
            {
                pBar3.Visible = true;
                lbxPrims.Items.Clear();
                lbxPrimGroup.Items.Clear();

                ReLoadItems();
            }));
        }
Example #18
0
 void Objects_ObjectUpdate(object sender, PrimEventArgs e)
 {
     if (Prims.ContainsKey(e.Prim.LocalID) || Prims.ContainsKey(e.Prim.ParentID))
     {
         UpdatePrimBlocking(e.Prim);
     }
 }
        void Objects_ObjectUpdate(object sender, PrimEventArgs e)
        {
            if (e.Prim.LocalID == MainClass.client.Self.LocalID)
            {
                if(userclicked==false)
                {
                    Gtk.Application.Invoke(delegate
                    {

                        localupdate=true;
                        this.spinbutton_x.Value = MainClass.client.Self.SimPosition.X;
                        this.spinbutton_y.Value = MainClass.client.Self.SimPosition.Y;
                        this.spinbutton_z.Value = MainClass.client.Self.SimPosition.Z;
                        localupdate=false;
                    });

                        if(target==true)
                        {
                            if(Math.Abs(MainClass.client.Self.SimPosition.X-spinbutton_x.Value)<1)
                                if(Math.Abs(MainClass.client.Self.SimPosition.Y-spinbutton_y.Value)<1)
                                {
                                   target=false;
                                   MainClass.client.Self.AutoPilotCancel();
                                }
                        }
                }
            }
        }
Example #20
0
        void Objects_OnNewPrim(object sender, PrimEventArgs e)
        {
            Primitive prim = e.Prim;

            if ((prim.Flags & PrimFlags.CreateSelected) == 0)
                return; // We received an update for an object we didn't create

            if (String.IsNullOrEmpty(ObjectName))
                ObjectName = "SimpleBuilder " + DateTime.Now.ToString("hmmss");

            client.Objects.SetName(client.Network.CurrentSim, prim.LocalID, ObjectName);

            client.Objects.ObjectUpdate -= Objects_OnNewPrim;

            primDone.Set();

            instance.MainForm.TabConsole.DisplayNotificationInChat(pluginName + ": Object '"+ txt_ObjectName.Text +"' has been successfully built and rezzed", ChatBufferTextStyle.Normal);

            MessageBox.Show("Object '" + txt_ObjectName.Text + "' has been built and rezzed", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Example #21
0
        public void Objects_NewPrim(object sender, PrimEventArgs args)
        {
            Primitive prim = args.Prim;

            if (prim != null)
            {
                if (prim.Textures != null)
                {
                    if (prim.Textures.DefaultTexture.TextureID != UUID.Zero)
                    {
                        client.Assets.RequestImage(prim.Textures.DefaultTexture.TextureID, ImageType.Normal, Asset_TextureCallback_Texture);
                    }
                    for (int i = 0; i < prim.Textures.FaceTextures.Length; i++)
                    {
                        if (prim.Textures.FaceTextures[i] != null)
                        {
                            if (prim.Textures.FaceTextures[i].TextureID != UUID.Zero)
                            {
                                client.Assets.RequestImage(prim.Textures.FaceTextures[i].TextureID, ImageType.Normal, Asset_TextureCallback_Texture);
                            }

                        }
                    }
                }
                if (prim.Sculpt.SculptTexture != UUID.Zero)
                {
                    client.Assets.RequestImage(prim.Sculpt.SculptTexture, ImageType.Normal, Asset_TextureCallback_Texture);
                }
            }
        }
Example #22
0
 void Objects_ObjectUpdate(object sender, PrimEventArgs e)
 {
     if (e.Prim.LocalID == MainClass.client.Self.LocalID)
     {
         Gtk.Application.Invoke(delegate
         {
             dirupdate();
         });
     }
 }
        void Objects_ObjectUpdate(object sender, PrimEventArgs e)
        {
            if (e.Simulator.Handle != client.Network.CurrentSim.Handle || e.Prim.Position == Vector3.Zero || e.Prim is Avatar) return;

            if (e.Prim.ParentID == 0)
            {
                int distance = (int)Vector3.Distance(client.Self.SimPosition, e.Prim.Position);
                if (distance < searchRadius)
                {
                    if (e.Prim.Properties == null)
                    {
                        propRequester.RequestProps(e.Prim.LocalID);
                    }
                    AddPrim(e.Prim);
                }
            }

            if (e.Prim.ID == currentPrim.ID)
            {
                if (currentPrim.Properties != null)
                {
                    UpdateCurrentObject(false);
                }
                propRequester.RequestProps(e.Prim.LocalID);
            }
        }
Example #24
0
        void Objects_OnNewPrim(object sender, PrimEventArgs e)
        {
            Primitive prim = e.Prim;

            if ((prim.Flags & PrimFlags.CreateSelected) == 0)
                return; // We received an update for an object we didn't create

            switch (state)
            {
                case ImporterState.RezzingParent:
                    rootLocalID = prim.LocalID;
                    goto case ImporterState.RezzingChildren;
                case ImporterState.RezzingChildren:
                    if (!primsCreated.Contains(prim))
                    {
                        // Need to set the textures first, and we have the old UUID's, which will work fine
                        // for anyone who has the cached UUID for the texture in question.

                        // TODO: Is there a way to set all of this at once, and update more ObjectProperties stuff?
                        Client.Objects.SetPosition(e.Simulator, prim.LocalID, currentPosition);
                        if (TextureUse == TextureSet.NewUUID)
                        {
                            if (Textures[currentPrim.Textures.DefaultTexture.TextureID] == UUID.Zero)
                                currentPrim.Textures.DefaultTexture.TextureID = Primitive.TextureEntry.WHITE_TEXTURE;
                            else
                                currentPrim.Textures.DefaultTexture.TextureID = Textures[currentPrim.Textures.DefaultTexture.TextureID];

                            for (int j = 0; j < currentPrim.Textures.FaceTextures.Length; j++)
                            {
                                if (currentPrim.Textures.FaceTextures[j] != null &&
                                    currentPrim.Textures.FaceTextures[j].TextureID != Primitive.TextureEntry.WHITE_TEXTURE)
                                {
                                    if (Textures[currentPrim.Textures.FaceTextures[j].TextureID] == UUID.Zero)
                                        currentPrim.Textures.FaceTextures[j] = null;
                                    else
                                        currentPrim.Textures.FaceTextures[j].TextureID = Textures[currentPrim.Textures.FaceTextures[j].TextureID];
                                }
                            }
                        }
                        else if (TextureUse == TextureSet.WhiteUUID || TextureUse == TextureSet.SculptUUID)
                        {
                            currentPrim.Textures.DefaultTexture.TextureID = Primitive.TextureEntry.WHITE_TEXTURE;
                            for (int j = 0; j < currentPrim.Textures.FaceTextures.Length; j++)
                            {
                                currentPrim.Textures.FaceTextures[j] = null;
                            }
                        }
                        Client.Objects.SetTextures(e.Simulator, prim.LocalID, currentPrim.Textures);

                        if (currentPrim.Light != null && currentPrim.Light.Intensity > 0)
                        {
                            Client.Objects.SetLight(e.Simulator, prim.LocalID, currentPrim.Light);
                        }

                        if (currentPrim.Flexible != null)
                        {
                            Client.Objects.SetFlexible(e.Simulator, prim.LocalID, currentPrim.Flexible);
                        }

                        if (currentPrim.Sculpt != null && currentPrim.Sculpt.SculptTexture != UUID.Zero)
                        {
                            if (TextureUse == TextureSet.NewUUID || TextureUse == TextureSet.SculptUUID)
                            {
                                if (Textures[currentPrim.Sculpt.SculptTexture] == UUID.Zero)
                                    currentPrim.Sculpt.SculptTexture = Primitive.TextureEntry.WHITE_TEXTURE;
                                else
                                    currentPrim.Sculpt.SculptTexture = Textures[currentPrim.Sculpt.SculptTexture];
                            }
                            else if (TextureUse == TextureSet.WhiteUUID)
                                currentPrim.Sculpt.SculptTexture = Primitive.TextureEntry.WHITE_TEXTURE;

                            Client.Objects.SetSculpt(e.Simulator, prim.LocalID, currentPrim.Sculpt);
                        }

                        if (currentPrim.Properties != null && !String.IsNullOrEmpty(currentPrim.Properties.Name))
                        {
                            Client.Objects.SetName(e.Simulator, prim.LocalID, currentPrim.Properties.Name);
                        }

                        if (currentPrim.Properties != null && !String.IsNullOrEmpty(currentPrim.Properties.Description))
                        {
                            Client.Objects.SetDescription(e.Simulator, prim.LocalID, currentPrim.Properties.Description);
                        }

                        primsCreated.Add(prim);
                        primDone.Set();
                    }
                    break;
                case ImporterState.Linking:
                    lock(linkQueue)
                    {
                        int indx = linkQueue.IndexOf(prim.LocalID);
                        if (indx != -1)
                        {
                            linkQueue.RemoveAt(indx);
                            if (linkQueue.Count == 0)
                                primDone.Set();
                        }
                    }
                    break;
            }
        }
Example #25
0
 public void OnObjectUpdate(object sender, PrimEventArgs e)
 {
     // Console.WriteLine("OnObjectUpdated" + e.Prim);
 }
Example #26
0
 void Objects_ObjectUpdate(object sender, PrimEventArgs e)
 {
     if (e.Simulator.Handle != Client.Network.CurrentSim.Handle) return;
     UpdatePrimBlocking(e.Prim);
 }
Example #27
0
File: Bot.cs Project: 4U2NV/opensim
        public void Objects_NewPrim(object sender, PrimEventArgs args)
        {
            Primitive prim = args.Prim;

            if (prim != null)
            {
                lock (m_objects)
                    m_objects[prim.ID] = prim;

                if (prim.Textures != null)
                {
                    if (prim.Textures.DefaultTexture.TextureID != UUID.Zero)
                    {
                        GetTexture(prim.Textures.DefaultTexture.TextureID);
                    }

                    for (int i = 0; i < prim.Textures.FaceTextures.Length; i++)
                    {
                        Primitive.TextureEntryFace face = prim.Textures.FaceTextures[i];

                        if (face != null)
                        {
                            UUID textureID = prim.Textures.FaceTextures[i].TextureID;

                            if (textureID != UUID.Zero)
                                GetTexture(textureID);
                        }
                    }
                }

                if (prim.Sculpt != null && prim.Sculpt.SculptTexture != UUID.Zero)
                    GetTexture(prim.Sculpt.SculptTexture);
            }
        }
Example #28
0
 ///<summary>Raises the ObjectUpdate Event</summary>
 /// <param name="e">A ObjectUpdateEventArgs object containing
 /// the data sent from the simulator</param>
 protected virtual void OnObjectUpdate(PrimEventArgs e)
 {
     EventHandler<PrimEventArgs> handler = m_ObjectUpdate;
     if (handler != null)
         handler(this, e);
 }
 void Objects_ObjectUpdate(object sender, PrimEventArgs e)
 {
     if (e.Prim.LocalID == MainClass.client.Self.LocalID)
     {
         if (MainClass.client.Network.CurrentSim.ObjectsAvatars[MainClass.client.Self.LocalID].ParentID == 0)
         {
             //Logger.Log("** Update is " + update.ToString() + " \nbyes are " + update.State.ToString() + "\n parent is " + MainClass.client.Network.CurrentSim.ObjectsAvatars[MainClass.client.Self.LocalID].ParentID,Helpers.LogLevel.Debug);
             if (sat == true)
             {
                 sat = false;
                 Gtk.Application.Invoke(delegate
                 {
                     this.button_siton.Label = "Sit";
                 });
             }
         }
     }
 }