示例#1
0
        /// <summary>
        /// Copy constructor
        /// </summary>
        public SceneParcel(SceneParcel parcel)
        {
            if (parcel.AccessBlackList != null)
            {
                AccessBlackList = new List <ParcelAccessEntry>(parcel.AccessBlackList);
            }
            if (parcel.AccessWhiteList != null)
            {
                AccessWhiteList = new List <ParcelAccessEntry>(parcel.AccessWhiteList);
            }
            AuthBuyerID    = parcel.AuthBuyerID;
            AutoReturnTime = parcel.AutoReturnTime;
            Bitmap         = new byte[512];
            Buffer.BlockCopy(parcel.Bitmap, 0, Bitmap, 0, 512);
            Category     = parcel.Category;
            ClaimDate    = parcel.ClaimDate;
            Desc         = parcel.Desc;
            Dwell        = parcel.Dwell;
            Flags        = parcel.Flags;
            GroupID      = parcel.GroupID;
            IsGroupOwned = parcel.IsGroupOwned;
            Landing      = parcel.Landing;
            LocalID      = parcel.LocalID;
            MaxPrims     = parcel.MaxPrims;
            ParcelMedia oldMedia = parcel.Media;

            Media = new ParcelMedia
            {
                MediaAutoScale = oldMedia.MediaAutoScale,
                MediaDesc      = oldMedia.MediaDesc,
                MediaHeight    = oldMedia.MediaHeight,
                MediaID        = oldMedia.MediaID,
                MediaLoop      = oldMedia.MediaLoop,
                MediaType      = oldMedia.MediaType,
                MediaURL       = oldMedia.MediaURL,
                MediaWidth     = oldMedia.MediaWidth
            };
            MusicURL          = parcel.MusicURL;
            Name              = parcel.Name;
            ObscureMedia      = parcel.ObscureMedia;
            ObscureMusic      = parcel.ObscureMusic;
            OwnerID           = parcel.OwnerID;
            PassHours         = parcel.PassHours;
            PassPrice         = parcel.PassPrice;
            DenyAgeUnverified = parcel.DenyAgeUnverified;
            DenyAnonymous     = parcel.DenyAnonymous;
            PushOverride      = parcel.PushOverride;
            SalePrice         = parcel.SalePrice;
            SnapshotID        = parcel.SnapshotID;
            Status            = parcel.Status;
            LandingLocation   = parcel.LandingLocation;
            LandingLookAt     = parcel.LandingLookAt;
        }
示例#2
0
        public int InsertLoggingLanding(string userName, string pageName, LandingTypeEnum landingTypeEnum)
        {
            var landingTyp = DbContextCRM.LandingTypes.FirstOrDefault(s => s.Type == (int)landingTypeEnum);

            if (landingTyp == null)
            {
                landingTyp = new LandingType
                {
                    Created = DateTime.UtcNow,
                    Type    = (int)landingTypeEnum
                };
                DbContextCRM.LandingTypes.Add(landingTyp);
            }
            var landingpage = DbContextCRM.LandingPageNames.FirstOrDefault(s => s.PageName == pageName);

            if (landingpage == null)
            {
                landingpage = new LandingPageName
                {
                    Created  = DateTime.UtcNow,
                    PageName = pageName
                };
                DbContextCRM.LandingPageNames.Add(landingpage);
            }
            var user = !string.IsNullOrEmpty(userName) ?
                       DbContextCRM.AspNetUserse.FirstOrDefault(s => s.UserName == userName) : null;
            var loggingLandingPage = new LoggingLandingPage
            {
                LandingPageName = landingpage,
                LandingType     = landingTyp,
                Created         = DateTime.UtcNow,
                UserId          = user != null ? user.Id : string.Empty
            };

            DbContextCRM.LoggingLandingPages.Add(loggingLandingPage);
            return(DbContextCRM.SaveChanges());
        }
 /// <summary>
 /// Deserialize the message
 /// </summary>
 /// <param name="map">An <see cref="OSDMap"/> containing the data</param>
 public void Deserialize(OSDMap map)
 {
     AuthBuyerID = map["auth_buyer_id"].AsUUID();
     MediaAutoScale = map["auto_scale"].AsBoolean();
     Category = (ParcelCategory)map["category"].AsInteger();
     Desc = map["description"].AsString();
     GroupID = map["group_id"].AsUUID();
     Landing = (LandingType)map["landing_type"].AsUInteger();
     LocalID = map["local_id"].AsInteger();
     MediaDesc = map["media_desc"].AsString();
     MediaHeight = map["media_height"].AsInteger();
     MediaLoop = map["media_loop"].AsBoolean();
     MediaID = map["media_id"].AsUUID();
     MediaType = map["media_type"].AsString();
     MediaURL = map["media_url"].AsString();
     MediaWidth = map["media_width"].AsInteger();
     MusicURL = map["music_url"].AsString();
     Name = map["name"].AsString();
     ObscureMedia = map["obscure_media"].AsBoolean();
     ObscureMusic = map["obscure_music"].AsBoolean();
     ParcelFlags = (ParcelFlags)map["parcel_flags"].AsUInteger();
     PassHours = (float)map["pass_hours"].AsReal();
     PassPrice = map["pass_price"].AsUInteger();
     Privacy = map["privacy"].AsBoolean();
     SalePrice = map["sale_price"].AsUInteger();
     SnapshotID = map["snapshot_id"].AsUUID();
     UserLocation = map["user_location"].AsVector3();
     UserLookAt = map["user_look_at"].AsVector3();
 }
        /// <summary>
        /// Deserialize the message
        /// </summary>
        /// <param name="map">An <see cref="OSDMap"/> containing the data</param>
        public void Deserialize(OSDMap map)
        {
            OSDMap parcelDataMap = (OSDMap)((OSDArray)map["ParcelData"])[0];
            LocalID = parcelDataMap["LocalID"].AsInteger();
            AABBMax = parcelDataMap["AABBMax"].AsVector3();
            AABBMin = parcelDataMap["AABBMin"].AsVector3();
            Area = parcelDataMap["Area"].AsInteger();
            AuctionID = (uint)parcelDataMap["AuctionID"].AsInteger();
            AuthBuyerID = parcelDataMap["AuthBuyerID"].AsUUID();
            Bitmap = parcelDataMap["Bitmap"].AsBinary();
            Category = (ParcelCategory)parcelDataMap["Category"].AsInteger();
            ClaimDate = Utils.UnixTimeToDateTime((uint)parcelDataMap["ClaimDate"].AsInteger());
            ClaimPrice = parcelDataMap["ClaimPrice"].AsInteger();
            Desc = parcelDataMap["Desc"].AsString();

            // LL sends this as binary, we'll convert it here
            if (parcelDataMap["ParcelFlags"].Type == OSDType.Binary)
            {
                byte[] bytes = parcelDataMap["ParcelFlags"].AsBinary();
                if (BitConverter.IsLittleEndian)
                    Array.Reverse(bytes);
                ParcelFlags = (ParcelFlags)BitConverter.ToUInt32(bytes, 0);
            }
            else
            {
                ParcelFlags = (ParcelFlags)parcelDataMap["ParcelFlags"].AsUInteger();
            }
            GroupID = parcelDataMap["GroupID"].AsUUID();
            GroupPrims = parcelDataMap["GroupPrims"].AsInteger();
            IsGroupOwned = parcelDataMap["IsGroupOwned"].AsBoolean();
            LandingType = (LandingType)parcelDataMap["LandingType"].AsInteger();
            MaxPrims = parcelDataMap["MaxPrims"].AsInteger();
            MediaID = parcelDataMap["MediaID"].AsUUID();
            MediaURL = parcelDataMap["MediaURL"].AsString();
            MediaAutoScale = parcelDataMap["MediaAutoScale"].AsBoolean(); // 0x1 = yes
            MusicURL = parcelDataMap["MusicURL"].AsString();
            Name = parcelDataMap["Name"].AsString();
            OtherCleanTime = parcelDataMap["OtherCleanTime"].AsInteger();
            OtherCount = parcelDataMap["OtherCount"].AsInteger();
            OtherPrims = parcelDataMap["OtherPrims"].AsInteger();
            OwnerID = parcelDataMap["OwnerID"].AsUUID();
            OwnerPrims = parcelDataMap["OwnerPrims"].AsInteger();
            ParcelPrimBonus = (float)parcelDataMap["ParcelPrimBonus"].AsReal();
            PassHours = (float)parcelDataMap["PassHours"].AsReal();
            PassPrice = parcelDataMap["PassPrice"].AsInteger();
            PublicCount = parcelDataMap["PublicCount"].AsInteger();
            Privacy = parcelDataMap["Privacy"].AsBoolean();
            RegionDenyAnonymous = parcelDataMap["RegionDenyAnonymous"].AsBoolean();
            RegionDenyIdentified = parcelDataMap["RegionDenyIdentified"].AsBoolean();
            RegionDenyTransacted = parcelDataMap["RegionDenyTransacted"].AsBoolean();
            RegionPushOverride = parcelDataMap["RegionPushOverride"].AsBoolean();
            RentPrice = parcelDataMap["RentPrice"].AsInteger();
            RequestResult = (ParcelResult)parcelDataMap["RequestResult"].AsInteger();
            SalePrice = parcelDataMap["SalePrice"].AsInteger();
            SelectedPrims = parcelDataMap["SelectedPrims"].AsInteger();
            SelfCount = parcelDataMap["SelfCount"].AsInteger();
            SequenceID = parcelDataMap["SequenceID"].AsInteger();
            SimWideMaxPrims = parcelDataMap["SimWideMaxPrims"].AsInteger();
            SimWideTotalPrims = parcelDataMap["SimWideTotalPrims"].AsInteger();
            SnapSelection = parcelDataMap["SnapSelection"].AsBoolean();
            SnapshotID = parcelDataMap["SnapshotID"].AsUUID();
            Status = (ParcelStatus)parcelDataMap["Status"].AsInteger();
            TotalPrims = parcelDataMap["TotalPrims"].AsInteger();
            UserLocation = parcelDataMap["UserLocation"].AsVector3();
            UserLookAt = parcelDataMap["UserLookAt"].AsVector3();

            if (map.ContainsKey("MediaData")) // temporary, OpenSim doesn't send this block
            {
                OSDMap mediaDataMap = (OSDMap)((OSDArray)map["MediaData"])[0];
                MediaDesc = mediaDataMap["MediaDesc"].AsString();
                MediaHeight = mediaDataMap["MediaHeight"].AsInteger();
                MediaWidth = mediaDataMap["MediaWidth"].AsInteger();
                MediaLoop = mediaDataMap["MediaLoop"].AsBoolean();
                MediaType = mediaDataMap["MediaType"].AsString();
                ObscureMedia = mediaDataMap["ObscureMedia"].AsBoolean();
                ObscureMusic = mediaDataMap["ObscureMusic"].AsBoolean();
            }

            OSDMap ageVerificationBlockMap = (OSDMap)((OSDArray)map["AgeVerificationBlock"])[0];
            RegionDenyAgeUnverified = ageVerificationBlockMap["RegionDenyAgeUnverified"].AsBoolean();
        }
示例#5
0
文件: IParcels.cs 项目: thoys/simian
 /// <summary>
 /// Copy constructor
 /// </summary>
 public SceneParcel(SceneParcel parcel)
 {
     if (parcel.AccessBlackList != null)
         AccessBlackList = new List<ParcelAccessEntry>(parcel.AccessBlackList);
     if (parcel.AccessWhiteList != null)
         AccessWhiteList = new List<ParcelAccessEntry>(parcel.AccessWhiteList);
     AuthBuyerID = parcel.AuthBuyerID;
     AutoReturnTime = parcel.AutoReturnTime;
     Bitmap = new byte[512];
     Buffer.BlockCopy(parcel.Bitmap, 0, Bitmap, 0, 512);
     Category = parcel.Category;
     ClaimDate = parcel.ClaimDate;
     Desc = parcel.Desc;
     Dwell = parcel.Dwell;
     Flags = parcel.Flags;
     GroupID = parcel.GroupID;
     IsGroupOwned = parcel.IsGroupOwned;
     Landing = parcel.Landing;
     LocalID = parcel.LocalID;
     MaxPrims = parcel.MaxPrims;
     ParcelMedia oldMedia = parcel.Media;
     Media = new ParcelMedia
     {
         MediaAutoScale = oldMedia.MediaAutoScale,
         MediaDesc = oldMedia.MediaDesc,
         MediaHeight = oldMedia.MediaHeight,
         MediaID = oldMedia.MediaID,
         MediaLoop = oldMedia.MediaLoop,
         MediaType = oldMedia.MediaType,
         MediaURL = oldMedia.MediaURL,
         MediaWidth = oldMedia.MediaWidth
     };
     MusicURL = parcel.MusicURL;
     Name = parcel.Name;
     ObscureMedia = parcel.ObscureMedia;
     ObscureMusic = parcel.ObscureMusic;
     OwnerID = parcel.OwnerID;
     PassHours = parcel.PassHours;
     PassPrice = parcel.PassPrice;
     DenyAgeUnverified = parcel.DenyAgeUnverified;
     DenyAnonymous = parcel.DenyAnonymous;
     PushOverride = parcel.PushOverride;
     SalePrice = parcel.SalePrice;
     SnapshotID = parcel.SnapshotID;
     Status = parcel.Status;
     LandingLocation = parcel.LandingLocation;
     LandingLookAt = parcel.LandingLookAt;
 }
示例#6
0
 /// <summary>
 /// Defalt constructor
 /// </summary>
 /// <param name="localID">Local ID of this parcel</param>
 public Parcel(int localID)
 {
     LocalID = localID;
     SelfCount = 0;
     OtherCount = 0;
     PublicCount = 0;
     OwnerID = UUID.Zero;
     IsGroupOwned = false;
     AuctionID = 0;
     ClaimDate = Utils.Epoch;
     ClaimPrice = 0;
     RentPrice = 0;
     AABBMin = Vector3.Zero;
     AABBMax = Vector3.Zero;
     Bitmap = Utils.EmptyBytes;
     Area = 0;
     Status = ParcelStatus.None;
     SimWideMaxPrims = 0;
     SimWideTotalPrims = 0;
     MaxPrims = 0;
     TotalPrims = 0;
     OwnerPrims = 0;
     GroupPrims = 0;
     OtherPrims = 0;
     ParcelPrimBonus = 0;
     OtherCleanTime = 0;
     Flags = ParcelFlags.None;
     SalePrice = 0;
     Name = String.Empty;
     Desc = String.Empty;
     MusicURL = String.Empty;
     GroupID = UUID.Zero;
     PassPrice = 0;
     PassHours = 0;
     Category = ParcelCategory.None;
     AuthBuyerID = UUID.Zero;
     SnapshotID = UUID.Zero;
     UserLocation = Vector3.Zero;
     UserLookAt = Vector3.Zero;
     Landing = LandingType.None;
     Dwell = 0;
     RegionDenyAnonymous = false;
     RegionPushOverride = false;
     AccessWhiteList = new List<ParcelManager.ParcelAccessEntry>();
     AccessBlackList = new List<ParcelManager.ParcelAccessEntry>(0);
     RegionDenyAgeUnverified = false;
     Media = new ParcelMedia();
     ObscureMedia = false;
     ObscureMusic = false;
 }
示例#7
0
 /// <summary>
 /// Filters launches by landing type. Note that you have to call <see cref="BuilderBase{TReturn}.Execute"/> or <see cref="BuilderBase{TReturn}.ExecuteAsync"/>
 /// to get result from the API. Every next call of this method will override previously saved landing type filter.
 /// </summary>
 /// <param name="landingType">The landing type (ASDS, Ocean, etc).</param>
 /// <returns>The launch builder.</returns>
 public TBuilder WithLandingType(LandingType landingType)
 {
     AddFilter("landing_type", landingType.GetEnumMemberAttributeValue(landingType));
     return((TBuilder)this);
 }