Holds group information on an individual profile pick
示例#1
0
        /// <summary>
        /// Process an incoming details of a profile pick
        /// </summary>
        private void PickInfoHandler(Packet packet, Simulator simulator)
        {
            if (OnPickInfo == null)
            {
                return;
            }

            PickInfoReplyPacket p   = (PickInfoReplyPacket)packet;
            ProfilePick         ret = new ProfilePick();

            ret.CreatorID    = p.Data.CreatorID;
            ret.Desc         = Utils.BytesToString(p.Data.Desc);
            ret.Enabled      = p.Data.Enabled;
            ret.Name         = Utils.BytesToString(p.Data.Name);
            ret.OriginalName = Utils.BytesToString(p.Data.OriginalName);
            ret.ParcelID     = p.Data.ParcelID;
            ret.PickID       = p.Data.PickID;
            ret.PosGlobal    = p.Data.PosGlobal;
            ret.SimName      = Utils.BytesToString(p.Data.SimName);
            ret.SnapshotID   = p.Data.SnapshotID;
            ret.SortOrder    = p.Data.SortOrder;
            ret.TopPick      = p.Data.TopPick;
            ret.User         = Utils.BytesToString(p.Data.User);

            try {
                OnPickInfo(ret.PickID, ret);
            } catch (Exception ex) {
                Logger.Log(ex.Message, Helpers.LogLevel.Error, Client, ex);
            }
        }
示例#2
0
        void Avatars_PickInfoReply(object sender, PickInfoReplyEventArgs e)
        {
            if (e.PickID != requestedPick) return;

            if (InvokeRequired)
            {
                BeginInvoke(new MethodInvoker(() => Avatars_PickInfoReply(sender, e)));
                return;
            }

            lock (pickCache)
            {
                if (!pickCache.ContainsKey(e.PickID))
                    pickCache.Add(e.PickID, e.Pick);
            }

            currentPick = e.Pick;

            if (pickPicturePanel.Controls.Count > 0)
                pickPicturePanel.Controls[0].Dispose();
            pickPicturePanel.Controls.Clear();

            if (agentID == client.Self.AgentID || e.Pick.SnapshotID != UUID.Zero)
            {
                SLImageHandler img = new SLImageHandler(instance, e.Pick.SnapshotID, string.Empty);
                img.Dock = DockStyle.Fill;
                img.SizeMode = PictureBoxSizeMode.StretchImage;
                pickPicturePanel.Controls.Add(img);

                if (agentID == client.Self.AgentID)
                {
                    img.AllowUpdateImage = true;
                    ProfilePick p = e.Pick;
                    img.ImageUpdated += (psender, pe) =>
                    {
                        img.UpdateImage(pe.NewImageID);
                        p.SnapshotID = pe.NewImageID;
                        client.Self.PickInfoUpdate(p.PickID, p.TopPick, p.ParcelID, p.Name, p.PosGlobal, p.SnapshotID, p.Desc);
                    };
                }
            }

            pickTitle.Text = e.Pick.Name;

            pickDetail.Text = e.Pick.Desc;

            if (!parcelCache.ContainsKey(e.Pick.ParcelID))
            {
                pickLocation.Text = string.Format("Unkown parcel, {0} ({1}, {2}, {3})",
                    e.Pick.SimName,
                    ((int)e.Pick.PosGlobal.X) % 256,
                    ((int)e.Pick.PosGlobal.Y) % 256,
                    ((int)e.Pick.PosGlobal.Z) % 256
                );
                client.Parcels.RequestParcelInfo(e.Pick.ParcelID);
            }
            else
            {
                Parcels_ParcelInfoReply(this, new ParcelInfoReplyEventArgs(parcelCache[e.Pick.ParcelID]));
            }
        }
示例#3
0
 public PickInfoReplyEventArgs(UUID pickid, ProfilePick pick)
 {
     this.m_PickID = pickid;
     this.m_Pick = pick;
 }
示例#4
0
        /// <summary>Process an incoming packet and raise the appropriate events</summary>
        /// <param name="sender">The sender</param>
        /// <param name="e">The EventArgs object containing the packet data</param>
        protected void PickInfoReplyHandler(object sender, PacketReceivedEventArgs e)
        {
            if (m_PickInfoReply != null)
            {
                Packet packet = e.Packet;
                PickInfoReplyPacket p = (PickInfoReplyPacket)packet;
                ProfilePick ret = new ProfilePick();
                ret.CreatorID = p.Data.CreatorID;
                ret.Desc = Utils.BytesToString(p.Data.Desc);
                ret.Enabled = p.Data.Enabled;
                ret.Name = Utils.BytesToString(p.Data.Name);
                ret.OriginalName = Utils.BytesToString(p.Data.OriginalName);
                ret.ParcelID = p.Data.ParcelID;
                ret.PickID = p.Data.PickID;
                ret.PosGlobal = p.Data.PosGlobal;
                ret.SimName = Utils.BytesToString(p.Data.SimName);
                ret.SnapshotID = p.Data.SnapshotID;
                ret.SortOrder = p.Data.SortOrder;
                ret.TopPick = p.Data.TopPick;
                ret.User = Utils.BytesToString(p.Data.User);

                OnPickInfoReply(new PickInfoReplyEventArgs(ret.PickID, ret));
            }
        }
示例#5
0
        /// <summary>
        /// Process an incoming details of a profile pick
        /// </summary>
        private void PickInfoHandler(Packet packet, Simulator simulator)
        {
            if (OnPickInfo == null) {
                return;
            }

            PickInfoReplyPacket p = (PickInfoReplyPacket)packet;
            ProfilePick ret = new ProfilePick();
            ret.CreatorID = p.Data.CreatorID;
            ret.Desc = Utils.BytesToString(p.Data.Desc);
            ret.Enabled = p.Data.Enabled;
            ret.Name = Utils.BytesToString(p.Data.Name);
            ret.OriginalName = Utils.BytesToString(p.Data.OriginalName);
            ret.ParcelID = p.Data.ParcelID;
            ret.PickID = p.Data.PickID;
            ret.PosGlobal = p.Data.PosGlobal;
            ret.SimName = Utils.BytesToString(p.Data.SimName);
            ret.SnapshotID = p.Data.SnapshotID;
            ret.SortOrder = p.Data.SortOrder;
            ret.TopPick = p.Data.TopPick;
            ret.User = Utils.BytesToString(p.Data.User);

            try {
                OnPickInfo(ret.PickID, ret);
            } catch (Exception ex) {
                Logger.Log(ex.Message, Helpers.LogLevel.Error, Client, ex);
            }
        }
示例#6
0
 void Avatars_OnPickInfo(UUID pickid, ProfilePick pick)
 {
     Client.Self.PickInfoUpdate(pickid, pick.TopPick, pick.ParcelID, pick.Name, pick.PosGlobal, pick.SnapshotID, pick.Desc);
 }