Exemple #1
0
        public List <LandAccessEntry> CreateAccessListArrayByFlag(AccessList flag)
        {
            ExpireAccessList();

            List <LandAccessEntry> list = new List <LandAccessEntry>();

            foreach (LandAccessEntry entry in LandData.ParcelAccessList)
            {
                if (entry.Flags == flag)
                {
                    list.Add(entry);
                }
            }
            if (list.Count == 0)
            {
                LandAccessEntry e = new LandAccessEntry();
                e.AgentID = UUID.Zero;
                e.Flags   = 0;
                e.Expires = 0;

                list.Add(e);
            }

            return(list);
        }
Exemple #2
0
        public void UpdateAccessList(uint flags, UUID transactionID,
                                     int sequenceID, int sections,
                                     List <LandAccessEntry> entries,
                                     IClientAPI remote_client)
        {
            LandData newData = LandData.Copy();

            if ((!m_listTransactions.ContainsKey(flags)) ||
                m_listTransactions[flags] != transactionID)
            {
                m_listTransactions[flags] = transactionID;

                List <LandAccessEntry> toRemove =
                    new List <LandAccessEntry>();

                foreach (LandAccessEntry entry in newData.ParcelAccessList)
                {
                    if (entry.Flags == (AccessList)flags)
                    {
                        toRemove.Add(entry);
                    }
                }

                foreach (LandAccessEntry entry in toRemove)
                {
                    newData.ParcelAccessList.Remove(entry);
                }

                // Checked here because this will always be the first
                // and only packet in a transaction
                if (entries.Count == 1 && entries[0].AgentID == UUID.Zero)
                {
                    m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);

                    return;
                }
            }

            foreach (LandAccessEntry entry in entries)
            {
                LandAccessEntry temp =
                    new LandAccessEntry();

                temp.AgentID = entry.AgentID;
                temp.Expires = entry.Expires;
                temp.Flags   = (AccessList)flags;

                newData.ParcelAccessList.Add(temp);
            }

            m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
        }
        public void setup()
        {
            // setup LandData object
            this.land                = new LandData();
            this.land.AABBMax        = new Vector3(1, 2, 3);
            this.land.AABBMin        = new Vector3(129, 130, 131);
            this.land.Area           = 128;
            this.land.AuctionID      = 4;
            this.land.AuthBuyerID    = new UUID("7176df0c-6c50-45db-8a37-5e78be56a0cd");
            this.land.Category       = ParcelCategory.Residential;
            this.land.ClaimDate      = 1;
            this.land.ClaimPrice     = 2;
            this.land.GlobalID       = new UUID("54ff9641-dd40-4a2c-b1f1-47dd3af24e50");
            this.land.GroupID        = new UUID("d740204e-bbbf-44aa-949d-02c7d739f6a5");
            this.land.Description    = "land data to test LandDataSerializer";
            this.land.Flags          = (uint)(ParcelFlags.AllowDamage | ParcelFlags.AllowVoiceChat);
            this.land.LandingType    = (byte)LandingType.Direct;
            this.land.Name           = "LandDataSerializerTest Land";
            this.land.Status         = ParcelStatus.Leased;
            this.land.LocalID        = 1;
            this.land.MediaAutoScale = (byte)0x01;
            this.land.MediaID        = new UUID("d4452578-2f25-4b97-a81b-819af559cfd7");
            this.land.MediaURL       = "http://videos.opensimulator.org/bumblebee.mp4";
            this.land.OwnerID        = new UUID("1b8eedf9-6d15-448b-8015-24286f1756bf");

            this.landWithParcelAccessList = this.land.Copy();
            this.landWithParcelAccessList.ParcelAccessList.Clear();

            LandAccessEntry pae0 = new LandAccessEntry();

            pae0.AgentID = new UUID("62d65d45-c91a-4f77-862c-46557d978b6c");
            pae0.Flags   = AccessList.Ban;
            pae0.Expires = 0;
            this.landWithParcelAccessList.ParcelAccessList.Add(pae0);

            LandAccessEntry pae1 = new LandAccessEntry();

            pae1.AgentID = new UUID("ec2a8d18-2378-4fe0-8b68-2a31b57c481e");
            pae1.Flags   = AccessList.Access;
            pae1.Expires = 0;
            this.landWithParcelAccessList.ParcelAccessList.Add(pae1);
        }
Exemple #4
0
        public static void ProcessParcelAccessList(LandData ld, XmlReader xtr)
        {
            if (!xtr.IsEmptyElement)
            {
                while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement)
                {
                    LandAccessEntry lae = new LandAccessEntry();

                    xtr.ReadStartElement("ParcelAccessEntry");

                    ExternalRepresentationUtils.ExecuteReadProcessors <LandAccessEntry>(lae, m_laeProcessors, xtr);

                    xtr.ReadEndElement();

                    ld.ParcelAccessList.Add(lae);
                }
            }

            xtr.Read();
        }
        public static void ProcessParcelAccessList(LandData ld, XmlReader xtr)
        {
            if (!xtr.IsEmptyElement)
            {
                while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement)
                {
                    LandAccessEntry lae = new LandAccessEntry();

                    xtr.ReadStartElement("ParcelAccessEntry");

                    ExternalRepresentationUtils.ExecuteReadProcessors<LandAccessEntry>(lae, m_laeProcessors, xtr);

                    xtr.ReadEndElement();

                    ld.ParcelAccessList.Add(lae);
                }
            }

            xtr.Read();
        }