Some information about a parcel of land returned from a DirectoryManager search
예제 #1
0
 /// <summary>
 /// Construct a new instance of the ParcelInfoReplyEventArgs class
 /// </summary>
 /// <param name="parcel">The <see cref="ParcelInfo"/> object containing basic parcel info</param>
 public ParcelInfoReplyEventArgs(ParcelInfo parcel)
 {
     this.m_Parcel = parcel;
 }
예제 #2
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>
        /// <remarks>Raises the <see cref="ParcelInfoReply"/> event</remarks>
        protected void ParcelInfoReplyHandler(object sender, PacketReceivedEventArgs e)
        {            
            if (m_ParcelInfo != null)
            {
                Packet packet = e.Packet;
                ParcelInfoReplyPacket info = (ParcelInfoReplyPacket)packet;

                ParcelInfo parcelInfo = new ParcelInfo();

                parcelInfo.ActualArea = info.Data.ActualArea;
                parcelInfo.AuctionID = info.Data.AuctionID;
                parcelInfo.BillableArea = info.Data.BillableArea;
                parcelInfo.Description = Utils.BytesToString(info.Data.Desc);
                parcelInfo.Dwell = info.Data.Dwell;
                parcelInfo.GlobalX = info.Data.GlobalX;
                parcelInfo.GlobalY = info.Data.GlobalY;
                parcelInfo.GlobalZ = info.Data.GlobalZ;
                parcelInfo.ID = info.Data.ParcelID;
                parcelInfo.Mature = ((info.Data.Flags & 1) != 0) ? true : false;
                parcelInfo.Name = Utils.BytesToString(info.Data.Name);
                parcelInfo.OwnerID = info.Data.OwnerID;
                parcelInfo.SalePrice = info.Data.SalePrice;
                parcelInfo.SimName = Utils.BytesToString(info.Data.SimName);
                parcelInfo.SnapshotID = info.Data.SnapshotID;

                OnParcelInfoReply(new ParcelInfoReplyEventArgs(parcelInfo));                
            }
        }
예제 #3
0
파일: Landmark.cs 프로젝트: Nuriat/radegast
        void Parcels_ParcelInfoReply(object sender, ParcelInfoReplyEventArgs e)
        {
            if (e.Parcel.ID != parcelID) return;

            if (InvokeRequired)
            {
                if (!instance.MonoRuntime || IsHandleCreated)
                    BeginInvoke(new MethodInvoker(() => Parcels_ParcelInfoReply(sender, e)));
                return;
            }

            this.parcel = e.Parcel;

            pnlDetail.Visible = true;
            if (parcel.SnapshotID != UUID.Zero)
            {
                SLImageHandler img = new SLImageHandler(instance, parcel.SnapshotID, "");
                img.Dock = DockStyle.Fill;
                pnlDetail.Controls.Add(img);
                pnlDetail.Disposed += (object senderx, EventArgs ex) =>
                {
                    img.Dispose();
                };
                img.BringToFront();
            }

            btnTeleport.Enabled = true;
            btnShowOnMap.Enabled = true;

            if (parcelLocation)
            {
                localPosition = new Vector3();
                localPosition.X = parcel.GlobalX % 256;
                localPosition.Y = parcel.GlobalY % 256;
                localPosition.Z = parcel.GlobalZ;
            }

            if (decodedLandmark == null)
            {
                txtParcelName.Text = string.Format("{0} - {1} ", parcel.Name, parcel.SimName);
            }
            else
            {
                txtParcelName.Text = string.Format("{0} - {1} ({2}, {3}, {4}) ", parcel.Name, parcel.SimName, (int)decodedLandmark.Position.X, (int)decodedLandmark.Position.Y, (int)decodedLandmark.Position.Z);
            }

            txtParcelDescription.Text = parcel.Description;
        }
예제 #4
0
        private void ParcelInfoReplyHandler(Packet packet, Simulator simulator)
        {
            if (OnParcelInfo != null)
            {
                ParcelInfoReplyPacket info = (ParcelInfoReplyPacket)packet;

                ParcelInfo parcelInfo = new ParcelInfo();

                parcelInfo.ActualArea = info.Data.ActualArea;
                parcelInfo.AuctionID = info.Data.AuctionID;
                parcelInfo.BillableArea = info.Data.BillableArea;
                parcelInfo.Description = Helpers.FieldToUTF8String(info.Data.Desc);
                parcelInfo.Dwell = info.Data.Dwell;
                parcelInfo.GlobalX = info.Data.GlobalX;
                parcelInfo.GlobalY = info.Data.GlobalY;
                parcelInfo.GlobalZ = info.Data.GlobalZ;
                parcelInfo.ID = info.Data.ParcelID;
                parcelInfo.Mature = ((info.Data.Flags & 1) != 0) ? true : false;
                parcelInfo.Name = Helpers.FieldToUTF8String(info.Data.Name);
                parcelInfo.OwnerID = info.Data.OwnerID;
                parcelInfo.SalePrice = info.Data.SalePrice;
                parcelInfo.SimName = Helpers.FieldToUTF8String(info.Data.SimName);
                parcelInfo.SnapshotID = info.Data.SnapshotID;

                try { OnParcelInfo(parcelInfo); }
                catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
            }
        }
예제 #5
0
 public void Parcels_OnParcelInfo(ParcelInfo parcel)
 {
     lock (parcelsI)
     {
         if (parcelsI.ContainsKey(parcel.ID)) return;
         parcelsI[parcel.ID] = parcel;
     }
    // Client.Parcels.GetParcelLocalID()
    // base.Parcels_OnParcelInfo(parcel);
 }
예제 #6
0
        // UI thread
        public void DisplayPlace(ParcelInfo place)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new MethodInvoker(() => DisplayPlace(place)));
                return;
            }

            if (place.Name == null)
                return;

            string sForSale = "";

            if (place.SalePrice > 0)
            {
                sForSale = "For Sale for L$" + place.SalePrice.ToString(CultureInfo.CurrentCulture);
            }

            txtName.Text = place.Name;

            txtDescription.Text = place.Description;
            txtInformation.Text = "Traffic: " + place.Dwell + " Area: " + place.ActualArea.ToString(CultureInfo.CurrentCulture) + " sq. m. " + sForSale;

            // Convert Global pos to local
            float locX = (float)place.GlobalX; ;
            float locY = (float)place.GlobalY;
            float locX1;
            float locY1;
            Helpers.GlobalPosToRegionHandle(locX, locY, out locX1, out locY1);

            fX = locX1;
            fY = locY1;
            fZ = (float)place.GlobalZ;
            //sSIM = place.SimName;

            txtLocation.Text = place.SimName.ToString(CultureInfo.CurrentCulture) + " " + fX.ToString(CultureInfo.CurrentCulture) + ", " + fY.ToString(CultureInfo.CurrentCulture) + ", " + fZ.ToString(CultureInfo.CurrentCulture);
        }