Details of a Parcel of land
예제 #1
0
        public void setup()
        {
            // setup LandData object
            this.land = new LandData();
            this.land.AABBMax = new Vector3(0, 0, 0);
            this.land.AABBMin = new Vector3(128, 128, 128);
            this.land.Area = 128;
            this.land.AuctionID = 0;
            this.land.AuthBuyerID = new UUID();
            this.land.Category = ParcelCategory.Residential;
            this.land.ClaimDate = 0;
            this.land.ClaimPrice = 0;
            this.land.GlobalID = new UUID("54ff9641-dd40-4a2c-b1f1-47dd3af24e50");
            this.land.GroupID = new UUID("d740204e-bbbf-44aa-949d-02c7d739f6a5");
            this.land.GroupPrims = 0;
            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 = 0;
            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();

            ParcelManager.ParcelAccessEntry pae0 = new ParcelManager.ParcelAccessEntry();
            pae0.AgentID = new UUID("62d65d45-c91a-4f77-862c-46557d978b6c");
            pae0.Flags = AccessList.Ban;
            pae0.Time = new DateTime(2009, 10, 01);
            this.landWithParcelAccessList.ParcelAccessList.Add(pae0);

            ParcelManager.ParcelAccessEntry pae1 = new ParcelManager.ParcelAccessEntry();
            pae1.AgentID = new UUID("ec2a8d18-2378-4fe0-8b68-2a31b57c481e");
            pae1.Flags = AccessList.Access;
            pae1.Time = new DateTime(2010, 10, 20);
            this.landWithParcelAccessList.ParcelAccessList.Add(pae1);
        }
예제 #2
0
        private string GetBuildPermissions(LandData parcel)
        {
            if ((parcel.Flags & (uint)ParcelFlags.CreateObjects) == (uint)ParcelFlags.CreateObjects)
                return "true";
            else
                return "false";

        }
예제 #3
0
        private string GetScriptsPermissions(LandData parcel)
        {
            if ((parcel.Flags & (uint)ParcelFlags.AllowOtherScripts) == (uint)ParcelFlags.AllowOtherScripts)
                return "true";
            else
                return "false";

        }
        private string ChannelName(Scene scene, LandData land)
        {
            // Create parcel voice channel. If no parcel exists, then the voice channel ID is the same
            // as the directory ID. Otherwise, it reflects the parcel's ID.

            //            if (land.LocalID != 1 && (land.Flags & (uint)ParcelFlags.UseEstateVoiceChan) == 0)
            if ((land.Flags & (uint)ParcelFlags.UseEstateVoiceChan) == 0)
            {
                m_log.DebugFormat("[MurmurVoice]: use Region:Parcel \"{0}:{1}\": parcel id {2}",
                                  scene.RegionInfo.RegionName, land.Name, land.LocalID);
                return land.GlobalID.ToString().Replace("-","");
            }
            else
            {
                m_log.DebugFormat("[MurmurVoice]: use EstateVoice Region:Parcel \"{0}:{1}\": parcel id {2}",
                                  scene.RegionInfo.RegionName, scene.RegionInfo.RegionName, land.LocalID);
            //                return scene.RegionInfo.RegionID.ToString().Replace("-","");
                return MurmurVoiceModule.m_murmurd_EstateChannel;
            }
        }
예제 #5
0
 public void SendLandObjectOwners(LandData land, List<UUID> groups, Dictionary<UUID, int> ownersAndCount)
 {
 }
예제 #6
0
        private string ChannelUri(Scene scene, LandData land)
        {
            string channelUri = null;

            string landUUID;
            string landName;

            // Create parcel voice channel. If no parcel exists, then the voice channel ID is the same
            // as the directory ID. Otherwise, it reflects the parcel's ID.

            lock (m_ParcelAddress)
            {
                if (m_ParcelAddress.ContainsKey(land.GlobalID.ToString()))
                {
                    m_log.DebugFormat("[FreeSwitchVoice]: parcel id {0}: using sip address {1}",
                                      land.GlobalID, m_ParcelAddress[land.GlobalID.ToString()]);
                    return m_ParcelAddress[land.GlobalID.ToString()];
                }
            }

            if (land.LocalID != 1 && (land.Flags & (uint)ParcelFlags.UseEstateVoiceChan) == 0)
            {
                landName = String.Format("{0}:{1}", scene.RegionInfo.RegionName, land.Name);
                landUUID = land.GlobalID.ToString();
                m_log.DebugFormat("[FreeSwitchVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}",
                                  landName, land.LocalID, landUUID);
            }
            else
            {
                landName = String.Format("{0}:{1}", scene.RegionInfo.RegionName, scene.RegionInfo.RegionName);
                landUUID = scene.RegionInfo.RegionID.ToString();
                m_log.DebugFormat("[FreeSwitchVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}",
                                  landName, land.LocalID, landUUID);
            }

            // slvoice handles the sip address differently if it begins with confctl, hiding it from the user in the friends list. however it also disables
            // the personal speech indicators as well unless some siren14-3d codec magic happens. we dont have siren143d so we'll settle for the personal speech indicator.
            channelUri = String.Format("sip:conf-{0}@{1}", "x" + Convert.ToBase64String(Encoding.ASCII.GetBytes(landUUID)), m_freeSwitchRealm);

            lock (m_ParcelAddress)
            {
                if (!m_ParcelAddress.ContainsKey(land.GlobalID.ToString()))
                {
                    m_ParcelAddress.Add(land.GlobalID.ToString(),channelUri);
                }
            }

            return channelUri;
        }
예제 #7
0
        public virtual LandData GetLandData(ulong regionHandle, uint x, uint y)
        {
            LandData landData = null;
            Hashtable hash = new Hashtable();
            hash["region_handle"] = regionHandle.ToString();
            hash["x"] = x.ToString();
            hash["y"] = y.ToString();

            IList paramList = new ArrayList();
            paramList.Add(hash);

            try
            {
                uint xpos = 0, ypos = 0;
                Utils.LongToUInts(regionHandle, out xpos, out ypos);
                GridRegion info = m_GridService.GetRegionByPosition(UUID.Zero, (int)xpos, (int)ypos);
                if (info != null) // just to be sure
                {
                    XmlRpcRequest request = new XmlRpcRequest("land_data", paramList);
                    string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/";
                    XmlRpcResponse response = request.Send(uri, 10000);
                    if (response.IsFault)
                    {
                        m_log.ErrorFormat("[LAND CONNECTOR] remote call returned an error: {0}", response.FaultString);
                    }
                    else
                    {
                        hash = (Hashtable)response.Value;
                        try
                        {
                            landData = new LandData();
                            landData.AABBMax = Vector3.Parse((string)hash["AABBMax"]);
                            landData.AABBMin = Vector3.Parse((string)hash["AABBMin"]);
                            landData.Area = Convert.ToInt32(hash["Area"]);
                            landData.AuctionID = Convert.ToUInt32(hash["AuctionID"]);
                            landData.Description = (string)hash["Description"];
                            landData.Flags = Convert.ToUInt32(hash["Flags"]);
                            landData.GlobalID = new UUID((string)hash["GlobalID"]);
                            landData.Name = (string)hash["Name"];
                            landData.OwnerID = new UUID((string)hash["OwnerID"]);
                            landData.SalePrice = Convert.ToInt32(hash["SalePrice"]);
                            landData.SnapshotID = new UUID((string)hash["SnapshotID"]);
                            landData.UserLocation = Vector3.Parse((string)hash["UserLocation"]);
                            m_log.DebugFormat("[OGS1 GRID SERVICES] Got land data for parcel {0}", landData.Name);
                        }
                        catch (Exception e)
                        {
                            m_log.Error("[LAND CONNECTOR] Got exception while parsing land-data:", e);
                        }
                    }
                }
                else m_log.WarnFormat("[LAND CONNECTOR] Couldn't find region with handle {0}", regionHandle);
            }
            catch (Exception e)
            {
                m_log.ErrorFormat("[LAND CONNECTOR] Couldn't contact region {0}: {1}", regionHandle, e);
            }
        
            return landData;
        }
예제 #8
0
        private string RegionGetOrCreateChannel(Scene scene, LandData land)
        {

            string channelUri = null;
            string channelId = null;

            string landUUID;
            string landName;
            string parentId;

           lock (m_parents) parentId = m_parents[scene.RegionInfo.RegionID.ToString()];

            // Create parcel voice channel. If no parcel exists, then the voice channel ID is the same
            // as the directory ID. Otherwise, it reflects the parcel's ID.

            if (land.LocalID != 1 && (land.Flags & (uint)ParcelFlags.UseEstateVoiceChan) == 0)
            {
                landName = String.Format("{0}:{1}", scene.RegionInfo.RegionName, land.Name);
                landUUID = land.GlobalID.ToString();
                m_log.DebugFormat("[VivoxVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}", 
                                  landName, land.LocalID, landUUID);
            }
            else
            {
                landName = String.Format("{0}:{1}", scene.RegionInfo.RegionName, scene.RegionInfo.RegionName);
                landUUID = scene.RegionInfo.RegionID.ToString();
                m_log.DebugFormat("[VivoxVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}", 
                                  landName, land.LocalID, landUUID);
            }
                    
            lock (vlock)
            {
                // Added by Adam to help debug channel not availible errors.
                if (VivoxTryGetChannel(parentId, landUUID, out channelId, out channelUri))
                    m_log.DebugFormat("[VivoxVoice] Found existing channel at " + channelUri);
                else if (VivoxTryCreateChannel(parentId, landUUID, landName, out channelUri))
                    m_log.DebugFormat("[VivoxVoice] Created new channel at " + channelUri);
                else
                    throw new Exception("vivox channel uri not available");

                m_log.DebugFormat("[VivoxVoice]: Region:Parcel \"{0}\": parent channel id {1}: retrieved parcel channel_uri {2} ", 
                                  landName, parentId, channelUri);


            }

            return channelUri;
        }
예제 #9
0
        /// <summary>
        /// Make a new copy of the land data
        /// </summary>
        /// <returns></returns>
        public LandData Copy()
        {
            LandData landData = new LandData();

            landData._AABBMax          = _AABBMax;
            landData._AABBMin          = _AABBMin;
            landData._area             = _area;
            landData._auctionID        = _auctionID;
            landData._authBuyerID      = _authBuyerID;
            landData._category         = _category;
            landData._claimDate        = _claimDate;
            landData._claimPrice       = _claimPrice;
            landData._globalID         = _globalID;
            landData._groupID          = _groupID;
            landData._groupPrims       = _groupPrims;
            landData._otherPrims       = _otherPrims;
            landData._ownerPrims       = _ownerPrims;
            landData._selectedPrims    = _selectedPrims;
            landData._isGroupOwned     = _isGroupOwned;
            landData._localID          = _localID;
            landData._landingType      = _landingType;
            landData._mediaAutoScale   = _mediaAutoScale;
            landData._mediaID          = _mediaID;
            landData._mediaURL         = _mediaURL;
            landData._musicURL         = _musicURL;
            landData._ownerID          = _ownerID;
            landData._bitmap           = (byte[])_bitmap.Clone();
            landData._description      = _description;
            landData._flags            = _flags;
            landData._name             = _name;
            landData._status           = _status;
            landData._passHours        = _passHours;
            landData._passPrice        = _passPrice;
            landData._salePrice        = _salePrice;
            landData._snapshotID       = _snapshotID;
            landData._userLocation     = _userLocation;
            landData._userLookAt       = _userLookAt;
            landData._otherCleanTime   = _otherCleanTime;
            landData._mediaType        = _mediaType;
            landData._mediaDescription = _mediaDescription;
            landData._mediaWidth       = _mediaWidth;
            landData._mediaHeight      = _mediaHeight;
            landData._mediaLoop        = _mediaLoop;
            landData._obscureMusic     = _obscureMusic;
            landData._obscureMedia     = _obscureMedia;
            landData._simwideArea      = _simwideArea;
            landData._simwidePrims     = _simwidePrims;
            landData._dwell            = _dwell;

            landData._parcelAccessList.Clear();
            foreach (ParcelManager.ParcelAccessEntry entry in _parcelAccessList)
            {
                ParcelManager.ParcelAccessEntry newEntry = new ParcelManager.ParcelAccessEntry();
                newEntry.AgentID = entry.AgentID;
                newEntry.Flags   = entry.Flags;
                newEntry.Time    = entry.Time;

                landData._parcelAccessList.Add(newEntry);
            }

            return(landData);
        }
예제 #10
0
        /// <summary>
        /// Make a new copy of the land data
        /// </summary>
        /// <returns></returns>
        public LandData Copy()
        {
            LandData landData = new LandData();

            landData._AABBMax          = _AABBMax;
            landData._AABBMin          = _AABBMin;
            landData._area             = _area;
            landData._auctionID        = _auctionID;
            landData._authBuyerID      = _authBuyerID;
            landData._category         = _category;
            landData._claimDate        = _claimDate;
            landData._claimPrice       = _claimPrice;
            landData._globalID         = _globalID;
            landData.m_fakeID          = m_fakeID;
            landData._groupID          = _groupID;
            landData._isGroupOwned     = _isGroupOwned;
            landData._localID          = _localID;
            landData._landingType      = _landingType;
            landData._mediaAutoScale   = _mediaAutoScale;
            landData._mediaID          = _mediaID;
            landData._mediaURL         = _mediaURL;
            landData._musicURL         = _musicURL;
            landData._ownerID          = _ownerID;
            landData._bitmap           = (byte[])_bitmap.Clone();
            landData._description      = _description;
            landData._flags            = _flags;
            landData._name             = _name;
            landData._status           = _status;
            landData._passHours        = _passHours;
            landData._passPrice        = _passPrice;
            landData._salePrice        = _salePrice;
            landData._snapshotID       = _snapshotID;
            landData._userLocation     = _userLocation;
            landData._userLookAt       = _userLookAt;
            landData._otherCleanTime   = _otherCleanTime;
            landData._mediaType        = _mediaType;
            landData._mediaDescription = _mediaDescription;
            landData._mediaWidth       = _mediaWidth;
            landData._mediaHeight      = _mediaHeight;
            landData._mediaLoop        = _mediaLoop;
            landData._obscureMusic     = _obscureMusic;
            landData._obscureMedia     = _obscureMedia;
            landData._simwideArea      = _simwideArea;
            landData._simwidePrims     = _simwidePrims;
            landData.m_dwell           = m_dwell;
            landData.SeeAVs            = SeeAVs;
            landData.AnyAVSounds       = AnyAVSounds;
            landData.GroupAVSounds     = GroupAVSounds;

            landData._parcelAccessList.Clear();
            foreach (LandAccessEntry entry in _parcelAccessList)
            {
                LandAccessEntry newEntry = new LandAccessEntry();
                newEntry.AgentID = entry.AgentID;
                newEntry.Flags   = entry.Flags;
                newEntry.Expires = entry.Expires;

                landData._parcelAccessList.Add(newEntry);
            }

            if (Environment == null)
            {
                landData.Environment        = null;
                landData.EnvironmentVersion = -1;
            }
            else
            {
                landData.Environment        = Environment.Clone();
                landData.EnvironmentVersion = EnvironmentVersion;
            }

            return(landData);
        }
예제 #11
0
파일: LandObject.cs 프로젝트: velus/opensim
        public LandObject(UUID owner_id, bool is_group_owned, Scene scene)
        {
            m_scene = scene;
            if (m_scene == null)
                LandBitmap = new bool[Constants.RegionSize / landUnit, Constants.RegionSize / landUnit];
            else
                LandBitmap = new bool[m_scene.RegionInfo.RegionSizeX / landUnit, m_scene.RegionInfo.RegionSizeY / landUnit];

            LandData = new LandData(); 
            LandData.OwnerID = owner_id;
            if (is_group_owned)
                LandData.GroupID = owner_id;
            else
                LandData.GroupID = UUID.Zero;
            LandData.IsGroupOwned = is_group_owned;
        }
예제 #12
0
파일: LandObject.cs 프로젝트: velus/opensim
 public LandObject(LandData landData, Scene scene)
 {
     LandData = landData.Copy();
     m_scene = scene;
 }
예제 #13
0
        public void UpdateLandObject(int local_id, LandData data)
        {
            LandData newData = data.Copy();
            newData.LocalID = local_id;

            ILandObject land;
            lock (m_landList)
            {
                if (m_landList.TryGetValue(local_id, out land))
                    land.LandData = newData;
            }

            if (land != null)
                m_scene.EventManager.TriggerLandObjectUpdated((uint)local_id, land);
        }
예제 #14
0
        private string GetShowInSearch(LandData parcel)
        {
            if ((parcel.Flags & (uint)ParcelFlags.ShowDirectory) == (uint)ParcelFlags.ShowDirectory)
                return "true";
            else
                return "false";

        }
예제 #15
0
 public void IncomingLandObjectFromStorage(LandData data)
 {
     ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene);
     new_land.LandData = data.Copy();
     new_land.SetLandBitmapFromByteArray();            
     AddLandObject(new_land);
 }
예제 #16
0
 void OnLandObjectAdded(LandData newParcel)
 {
     //Taint it!
     TaintPrimCount(m_Scene.RequestModuleInterface<IParcelManagementModule>().GetLandObject(newParcel.GlobalID));
 }
예제 #17
0
        /// <summary>
        /// Builds the land data from a datarecord.
        /// </summary>
        /// <param name="row">datarecord with land data</param>
        /// <returns></returns>
        private static LandData BuildLandData(IDataRecord row)
        {
            LandData newData = new LandData();

            newData.GlobalID = new UUID((Guid)row["UUID"]);
            newData.LocalID = Convert.ToInt32(row["LocalLandID"]);

            // Bitmap is a byte[512]
            newData.Bitmap = (Byte[])row["Bitmap"];

            newData.Name = (string)row["Name"];
            newData.Description = (string)row["Description"];
            newData.OwnerID = new UUID((Guid)row["OwnerUUID"]);
            newData.IsGroupOwned = Convert.ToBoolean(row["IsGroupOwned"]);
            newData.Area = Convert.ToInt32(row["Area"]);
            newData.AuctionID = Convert.ToUInt32(row["AuctionID"]); //Unemplemented
            newData.Category = (ParcelCategory)Convert.ToInt32(row["Category"]);
            //Enum libsecondlife.Parcel.ParcelCategory
            newData.ClaimDate = Convert.ToInt32(row["ClaimDate"]);
            newData.ClaimPrice = Convert.ToInt32(row["ClaimPrice"]);
            newData.GroupID = new UUID((Guid)row["GroupUUID"]);
            newData.SalePrice = Convert.ToInt32(row["SalePrice"]);
            newData.Status = (ParcelStatus)Convert.ToInt32(row["LandStatus"]);
            //Enum. libsecondlife.Parcel.ParcelStatus
            newData.Flags = Convert.ToUInt32(row["LandFlags"]);
            newData.LandingType = Convert.ToByte(row["LandingType"]);
            newData.MediaAutoScale = Convert.ToByte(row["MediaAutoScale"]);
            newData.MediaID = new UUID((Guid)row["MediaTextureUUID"]);
            newData.MediaURL = (string)row["MediaURL"];
            newData.MusicURL = (string)row["MusicURL"];
            newData.PassHours = Convert.ToSingle(row["PassHours"]);
            newData.PassPrice = Convert.ToInt32(row["PassPrice"]);

            //            UUID authedbuyer;
            //            UUID snapshotID;
            //
            //            if (UUID.TryParse((string)row["AuthBuyerID"], out authedbuyer))
            //                newData.AuthBuyerID = authedbuyer;
            //
            //            if (UUID.TryParse((string)row["SnapshotUUID"], out snapshotID))
            //                newData.SnapshotID = snapshotID;
            newData.AuthBuyerID = new UUID((Guid)row["AuthBuyerID"]);
            newData.SnapshotID = new UUID((Guid)row["SnapshotUUID"]);

            newData.OtherCleanTime = Convert.ToInt32(row["OtherCleanTime"]);

            try
            {
                newData.UserLocation =
                    new Vector3(Convert.ToSingle(row["UserLocationX"]), Convert.ToSingle(row["UserLocationY"]),
                                  Convert.ToSingle(row["UserLocationZ"]));
                newData.UserLookAt =
                    new Vector3(Convert.ToSingle(row["UserLookAtX"]), Convert.ToSingle(row["UserLookAtY"]),
                                  Convert.ToSingle(row["UserLookAtZ"]));
            }
            catch (InvalidCastException)
            {
                newData.UserLocation = Vector3.Zero;
                newData.UserLookAt = Vector3.Zero;
            }

            newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>();

            return newData;
        }
        /// <summary>
        /// Creates the land parameters.
        /// </summary>
        /// <param name="land">land parameters.</param>
        /// <param name="regionUUID">region UUID.</param>
        /// <returns></returns>
        private SqlParameter[] CreateLandParameters(LandData land, UUID regionUUID)
        {
            List<SqlParameter> parameters = new List<SqlParameter>();

            parameters.Add(_Database.CreateParameter("UUID", land.GlobalID));
            parameters.Add(_Database.CreateParameter("RegionUUID", regionUUID));
            parameters.Add(_Database.CreateParameter("LocalLandID", land.LocalID));

            // Bitmap is a byte[512]
            parameters.Add(_Database.CreateParameter("Bitmap", land.Bitmap));

            parameters.Add(_Database.CreateParameter("Name", land.Name));
            parameters.Add(_Database.CreateParameter("Description", land.Description));
            parameters.Add(_Database.CreateParameter("OwnerUUID", land.OwnerID));
            parameters.Add(_Database.CreateParameter("IsGroupOwned", land.IsGroupOwned));
            parameters.Add(_Database.CreateParameter("Area", land.Area));
            parameters.Add(_Database.CreateParameter("AuctionID", land.AuctionID)); //Unemplemented
            parameters.Add(_Database.CreateParameter("Category", (int)land.Category)); //Enum libsecondlife.Parcel.ParcelCategory
            parameters.Add(_Database.CreateParameter("ClaimDate", land.ClaimDate));
            parameters.Add(_Database.CreateParameter("ClaimPrice", land.ClaimPrice));
            parameters.Add(_Database.CreateParameter("GroupUUID", land.GroupID));
            parameters.Add(_Database.CreateParameter("SalePrice", land.SalePrice));
            parameters.Add(_Database.CreateParameter("LandStatus", (int)land.Status)); //Enum. libsecondlife.Parcel.ParcelStatus
            parameters.Add(_Database.CreateParameter("LandFlags", land.Flags));
            parameters.Add(_Database.CreateParameter("LandingType", land.LandingType));
            parameters.Add(_Database.CreateParameter("MediaAutoScale", land.MediaAutoScale));
            parameters.Add(_Database.CreateParameter("MediaTextureUUID", land.MediaID));
            parameters.Add(_Database.CreateParameter("MediaURL", land.MediaURL));
            parameters.Add(_Database.CreateParameter("MusicURL", land.MusicURL));
            parameters.Add(_Database.CreateParameter("PassHours", land.PassHours));
            parameters.Add(_Database.CreateParameter("PassPrice", land.PassPrice));
            parameters.Add(_Database.CreateParameter("SnapshotUUID", land.SnapshotID));
            parameters.Add(_Database.CreateParameter("UserLocationX", land.UserLocation.X));
            parameters.Add(_Database.CreateParameter("UserLocationY", land.UserLocation.Y));
            parameters.Add(_Database.CreateParameter("UserLocationZ", land.UserLocation.Z));
            parameters.Add(_Database.CreateParameter("UserLookAtX", land.UserLookAt.X));
            parameters.Add(_Database.CreateParameter("UserLookAtY", land.UserLookAt.Y));
            parameters.Add(_Database.CreateParameter("UserLookAtZ", land.UserLookAt.Z));
            parameters.Add(_Database.CreateParameter("AuthBuyerID", land.AuthBuyerID));
            parameters.Add(_Database.CreateParameter("OtherCleanTime", land.OtherCleanTime));

            return parameters.ToArray();
        }
예제 #19
0
        /// <summary>
        /// Restore a LandData object from the serialized xml representation.
        /// </summary>
        /// <param name="xmlReader"></param>
        /// <returns></returns>
        public static LandData FromXml(XmlReader xmlReader)
        {
            LandData land = (LandData)serializer.Deserialize(xmlReader);

            return(land);
        }
예제 #20
0
 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags)
 {
 }
예제 #21
0
        /// <summary>
        /// Build a Land Data from the persisted data.
        /// </summary>
        /// <param name="row"></param>
        /// <returns></returns>
        private LandData buildLandData(DataRow row)
        {
            LandData newData = new LandData();

            newData.GlobalID = new UUID((String) row["UUID"]);
            newData.LocalID = Convert.ToInt32(row["LocalLandID"]);

            // Bitmap is a byte[512]
            newData.Bitmap = (Byte[]) row["Bitmap"];

            newData.Name = (String) row["Name"];
            newData.Description = (String) row["Desc"];
            newData.OwnerID = (UUID)(String) row["OwnerUUID"];
            newData.IsGroupOwned = (Boolean) row["IsGroupOwned"];
            newData.Area = Convert.ToInt32(row["Area"]);
            newData.AuctionID = Convert.ToUInt32(row["AuctionID"]); //Unemplemented
            newData.Category = (ParcelCategory) Convert.ToInt32(row["Category"]);
                //Enum OpenMetaverse.Parcel.ParcelCategory
            newData.ClaimDate = Convert.ToInt32(row["ClaimDate"]);
            newData.ClaimPrice = Convert.ToInt32(row["ClaimPrice"]);
            newData.GroupID = new UUID((String) row["GroupUUID"]);
            newData.SalePrice = Convert.ToInt32(row["SalePrice"]);
            newData.Status = (ParcelStatus) Convert.ToInt32(row["LandStatus"]);
                //Enum. OpenMetaverse.Parcel.ParcelStatus
            newData.Flags = Convert.ToUInt32(row["LandFlags"]);
            newData.LandingType = (Byte) row["LandingType"];
            newData.MediaAutoScale = (Byte) row["MediaAutoScale"];
            newData.MediaID = new UUID((String) row["MediaTextureUUID"]);
            newData.MediaURL = (String) row["MediaURL"];
            newData.MusicURL = (String) row["MusicURL"];
            newData.PassHours = Convert.ToSingle(row["PassHours"]);
            newData.PassPrice = Convert.ToInt32(row["PassPrice"]);
            newData.SnapshotID = (UUID)(String) row["SnapshotUUID"];
            try
            {

                newData.UserLocation =
                    new Vector3(Convert.ToSingle(row["UserLocationX"]), Convert.ToSingle(row["UserLocationY"]),
                                  Convert.ToSingle(row["UserLocationZ"]));
                newData.UserLookAt =
                    new Vector3(Convert.ToSingle(row["UserLookAtX"]), Convert.ToSingle(row["UserLookAtY"]),
                                  Convert.ToSingle(row["UserLookAtZ"]));

            }
            catch (InvalidCastException)
            {
                m_log.ErrorFormat(":[SQLITE REGION DB]: unable to get parcel telehub settings for {1}", newData.Name);
                newData.UserLocation = Vector3.Zero;
                newData.UserLookAt = Vector3.Zero;
            }
            newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>();
            UUID authBuyerID = UUID.Zero;

            UUID.TryParse((string)row["AuthbuyerID"], out authBuyerID);

            newData.OtherCleanTime = Convert.ToInt32(row["OtherCleanTime"]);
            newData.Dwell = Convert.ToInt32(row["Dwell"]);

            return newData;
        }
예제 #22
0
 public void SendParcelInfo (RegionInfo info, LandData land, UUID parcelID, uint x, uint y)
 {
 }
예제 #23
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="row"></param>
        /// <param name="land"></param>
        /// <param name="regionUUID"></param>
        private void fillLandRow(DataRow row, LandData land, UUID regionUUID)
        {
            row["UUID"] = land.GlobalID.ToString();
            row["RegionUUID"] = regionUUID.ToString();
            row["LocalLandID"] = land.LocalID;

            // Bitmap is a byte[512]
            row["Bitmap"] = land.Bitmap;

            row["Name"] = land.Name;
            row["Desc"] = land.Description;
            row["OwnerUUID"] = land.OwnerID.ToString();
            row["IsGroupOwned"] = land.IsGroupOwned;
            row["Area"] = land.Area;
            row["AuctionID"] = land.AuctionID; //Unemplemented
            row["Category"] = land.Category; //Enum OpenMetaverse.Parcel.ParcelCategory
            row["ClaimDate"] = land.ClaimDate;
            row["ClaimPrice"] = land.ClaimPrice;
            row["GroupUUID"] = land.GroupID.ToString();
            row["SalePrice"] = land.SalePrice;
            row["LandStatus"] = land.Status; //Enum. OpenMetaverse.Parcel.ParcelStatus
            row["LandFlags"] = land.Flags;
            row["LandingType"] = land.LandingType;
            row["MediaAutoScale"] = land.MediaAutoScale;
            row["MediaTextureUUID"] = land.MediaID.ToString();
            row["MediaURL"] = land.MediaURL;
            row["MusicURL"] = land.MusicURL;
            row["PassHours"] = land.PassHours;
            row["PassPrice"] = land.PassPrice;
            row["SnapshotUUID"] = land.SnapshotID.ToString();
            row["UserLocationX"] = land.UserLocation.X;
            row["UserLocationY"] = land.UserLocation.Y;
            row["UserLocationZ"] = land.UserLocation.Z;
            row["UserLookAtX"] = land.UserLookAt.X;
            row["UserLookAtY"] = land.UserLookAt.Y;
            row["UserLookAtZ"] = land.UserLookAt.Z;
            row["AuthbuyerID"] = land.AuthBuyerID.ToString();
            row["OtherCleanTime"] = land.OtherCleanTime;
            row["Dwell"] = land.Dwell;
        }
예제 #24
0
 public void TriggerLandObjectAdded (LandData newParcel)
 {
     LandObjectAdded handlerLandObjectAdded = OnLandObjectAdded;
     if (handlerLandObjectAdded != null)
     {
         foreach (LandObjectAdded d in handlerLandObjectAdded.GetInvocationList ())
         {
             try
             {
                 d (newParcel);
             }
             catch (Exception e)
             {
                 m_log.ErrorFormat (
                     "[EVENT MANAGER]: Delegate for TriggerLandObjectAdded failed - continuing.  {0} {1}",
                     e.ToString (), e.StackTrace);
             }
         }
     }
 }
예제 #25
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="parcel"></param>
        public void StoreLandObject(LandData parcel)
        {
            lock (ds)
            {
                DataTable land = ds.Tables["land"];
                DataTable landaccesslist = ds.Tables["landaccesslist"];

                DataRow landRow = land.Rows.Find(parcel.GlobalID.ToString());
                if (landRow == null)
                {
                    landRow = land.NewRow();
                    fillLandRow(landRow, parcel, parcel.RegionID);
                    land.Rows.Add(landRow);
                }
                else
                {
                    fillLandRow(landRow, parcel, parcel.RegionID);
                }

                // I know this caused someone issues before, but OpenSim is unusable if we leave this stuff around
                //using (SqliteCommand cmd = new SqliteCommand(":delete from landaccesslist where LandUUID=:LandUUID", m_conn))
                //{
                //    cmd.Parameters.Add(new SqliteParameter("::LandUUID", parcel.LandData.GlobalID.ToString()));
                //    cmd.ExecuteNonQuery();

//                }

                // This is the slower..  but more appropriate thing to do

                // We can't modify the table with direct queries before calling Commit() and re-filling them.
                List<DataRow> rowsToDelete = new List<DataRow>();
                foreach (DataRow rowToCheck in landaccesslist.Rows)
                {
                    if (rowToCheck["LandUUID"].ToString() == parcel.GlobalID.ToString())
                        rowsToDelete.Add(rowToCheck);
                }
                for (int iter = 0; iter < rowsToDelete.Count; iter++)
                {
                    rowsToDelete[iter].Delete();
                    landaccesslist.Rows.Remove(rowsToDelete[iter]);
                }
                rowsToDelete.Clear();
                foreach (ParcelManager.ParcelAccessEntry entry in parcel.ParcelAccessList)
                {
                    DataRow newAccessRow = landaccesslist.NewRow();
                    fillLandAccessRow(newAccessRow, entry, parcel.GlobalID);
                    landaccesslist.Rows.Add(newAccessRow);
                }
            }

            Commit();
        }
예제 #26
0
        private string GetPublicPermissions(LandData parcel)
        {
            if ((parcel.Flags & (uint)ParcelFlags.UseAccessList) == (uint)ParcelFlags.UseAccessList)
                return "false";
            else
                return "true";

        }
예제 #27
0
        /// <summary>
        /// Make a new copy of the land data
        /// </summary>
        /// <returns></returns>
        public LandData Copy()
        {
            LandData landData = new LandData();

            landData._AABBMax = _AABBMax;
            landData._AABBMin = _AABBMin;
            landData._area = _area;
            landData._auctionID = _auctionID;
            landData._authBuyerID = _authBuyerID;
            landData._category = _category;
            landData._claimDate = _claimDate;
            landData._claimPrice = _claimPrice;
            landData._globalID = _globalID;
            landData._groupID = _groupID;
            landData._isGroupOwned = _isGroupOwned;
            landData._localID = _localID;
            landData._landingType = _landingType;
            landData._mediaAutoScale = _mediaAutoScale;
            landData._mediaID = _mediaID;
            landData._mediaURL = _mediaURL;
            landData._musicURL = _musicURL;
            landData._ownerID = _ownerID;
            landData._bitmap = (byte[])_bitmap.Clone();
            landData._description = _description;
            landData._flags = _flags;
            landData._name = _name;
            landData._status = _status;
            landData._passHours = _passHours;
            landData._passPrice = _passPrice;
            landData._salePrice = _salePrice;
            landData._snapshotID = _snapshotID;
            landData._userLocation = _userLocation;
            landData._userLookAt = _userLookAt;
            landData._otherCleanTime = _otherCleanTime;
            landData._mediaType = _mediaType;
            landData._mediaDescription = _mediaDescription;
            landData._mediaWidth = _mediaWidth;
            landData._mediaHeight = _mediaHeight;
            landData._mediaLoop = _mediaLoop;
            landData._obscureMusic = _obscureMusic;
            landData._obscureMedia = _obscureMedia;
            landData._simwideArea = _simwideArea;
            landData._simwidePrims = _simwidePrims;
            landData._dwell = _dwell;
            landData.SeeAVs = SeeAVs;
            landData.AnyAVSounds = AnyAVSounds;
            landData.GroupAVSounds = GroupAVSounds;

            landData._parcelAccessList.Clear();
            foreach (LandAccessEntry entry in _parcelAccessList)
            {
                LandAccessEntry newEntry = new LandAccessEntry();
                newEntry.AgentID = entry.AgentID;
                newEntry.Flags = entry.Flags;
                newEntry.Expires = entry.Expires;

                landData._parcelAccessList.Add(newEntry);
            }

            return landData;
        }
예제 #28
0
 private string CheckForSale(LandData parcel)
 {
     if ((parcel.Flags & (uint)ParcelFlags.ForSale) == (uint)ParcelFlags.ForSale)
         return "true";
     else
         return "false";
 }
예제 #29
0
        public void StoreLandObject(LandData parcel)
        {
            lock (m_dbLock)
            {
                using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
                {
                    dbcon.Open();

                    using (MySqlCommand cmd = dbcon.CreateCommand())
                    {
                        cmd.CommandText = "replace into land (UUID, RegionUUID, " +
                            "LocalLandID, Bitmap, Name, Description, " +
                            "OwnerUUID, IsGroupOwned, Area, AuctionID, " +
                            "Category, ClaimDate, ClaimPrice, GroupUUID, " +
                            "SalePrice, LandStatus, LandFlags, LandingType, " +
                            "MediaAutoScale, MediaTextureUUID, MediaURL, " +
                            "MusicURL, PassHours, PassPrice, SnapshotUUID, " +
                            "UserLocationX, UserLocationY, UserLocationZ, " +
                            "UserLookAtX, UserLookAtY, UserLookAtZ, " +
                            "AuthbuyerID, OtherCleanTime, MediaType, MediaDescription, " +
                            "MediaSize, MediaLoop, ObscureMusic, ObscureMedia) values (" +
                            "?UUID, ?RegionUUID, " +
                            "?LocalLandID, ?Bitmap, ?Name, ?Description, " +
                            "?OwnerUUID, ?IsGroupOwned, ?Area, ?AuctionID, " +
                            "?Category, ?ClaimDate, ?ClaimPrice, ?GroupUUID, " +
                            "?SalePrice, ?LandStatus, ?LandFlags, ?LandingType, " +
                            "?MediaAutoScale, ?MediaTextureUUID, ?MediaURL, " +
                            "?MusicURL, ?PassHours, ?PassPrice, ?SnapshotUUID, " +
                            "?UserLocationX, ?UserLocationY, ?UserLocationZ, " +
                            "?UserLookAtX, ?UserLookAtY, ?UserLookAtZ, " +
                            "?AuthbuyerID, ?OtherCleanTime, ?MediaType, ?MediaDescription, "+
                            "CONCAT(?MediaWidth, ',', ?MediaHeight), ?MediaLoop, ?ObscureMusic, ?ObscureMedia)";

                        FillLandCommand(cmd, parcel, parcel.RegionID);

                        ExecuteNonQuery(cmd);

                        cmd.CommandText = "delete from landaccesslist where LandUUID = ?UUID";

                        ExecuteNonQuery(cmd);

                        cmd.Parameters.Clear();
                        cmd.CommandText = "insert into landaccesslist (LandUUID, " +
                                "AccessUUID, Flags) values (?LandUUID, ?AccessUUID, " +
                                "?Flags)";

                        foreach (ParcelManager.ParcelAccessEntry entry in parcel.ParcelAccessList)
                        {
                            FillLandAccessCommand(cmd, entry, parcel.GlobalID);
                            ExecuteNonQuery(cmd);
                            cmd.Parameters.Clear();
                        }
                    }
                }
            }
        }
예제 #30
0
 public void UpdateLandObject(int localID, LandData data)
 {
     if (m_landManagementModule != null)
     {
         m_landManagementModule.UpdateLandObject(localID, data);
     }
 }
예제 #31
0
 public void SendParcelInfo(RegionInfo info, LandData land, OpenMetaverse.UUID parcelID, uint x, uint y)
 {
 }