123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845 |
- using System;
- using System.Collections.Generic;
- using System.Xml;
- using System.Xml.Serialization;
- using OpenMetaverse;
- namespace OpenSim.Framework
- {
- public class LandAccessEntry
- {
- public UUID AgentID;
- public int Expires;
- public AccessList Flags;
- }
-
-
-
- public class LandData
- {
-
-
-
- private static XmlSerializer serializer = new XmlSerializer(typeof(LandData));
- private Vector3 _AABBMax = new Vector3();
- private Vector3 _AABBMin = new Vector3();
- private int _area = 0;
- private uint _auctionID = 0;
- private UUID _authBuyerID = UUID.Zero;
- private ParcelCategory _category = ParcelCategory.None;
- private int _claimDate = 0;
- private int _claimPrice = 0;
- private UUID _globalID = UUID.Zero;
- private UUID _groupID = UUID.Zero;
- private bool _isGroupOwned = false;
- private byte[] _bitmap = new byte[512];
- private string _description = String.Empty;
- private uint _flags = (uint)ParcelFlags.AllowFly | (uint)ParcelFlags.AllowLandmark |
- (uint)ParcelFlags.AllowAPrimitiveEntry |
- (uint)ParcelFlags.AllowDeedToGroup |
- (uint)ParcelFlags.CreateObjects | (uint)ParcelFlags.AllowOtherScripts |
- (uint)ParcelFlags.AllowVoiceChat;
- private byte _landingType = (byte)OpenMetaverse.LandingType.Direct;
- private string _name = "Your Parcel";
- private ParcelStatus _status = ParcelStatus.Leased;
- private int _localID = 0;
- private byte _mediaAutoScale = 0;
- private UUID _mediaID = UUID.Zero;
- private string _mediaURL = String.Empty;
- private string _musicURL = String.Empty;
- private UUID _ownerID = UUID.Zero;
- private List<LandAccessEntry> _parcelAccessList = new List<LandAccessEntry>();
- private float _passHours = 0;
- private int _passPrice = 0;
- private int _salePrice = 0;
- private int _simwideArea = 0;
- private int _simwidePrims = 0;
- private UUID _snapshotID = UUID.Zero;
- private Vector3 _userLocation = new Vector3();
- private Vector3 _userLookAt = new Vector3();
- private int _otherCleanTime = 0;
- private string _mediaType = "none/none";
- private string _mediaDescription = "";
- private int _mediaHeight = 0;
- private int _mediaWidth = 0;
- private bool _mediaLoop = false;
- private bool _obscureMusic = false;
- private bool _obscureMedia = false;
- private float m_dwell = 0;
- public double LastDwellTimeMS;
- public bool SeeAVs { get; set; }
- public bool AnyAVSounds { get; set; }
- public bool GroupAVSounds { get; set; }
-
-
-
- [XmlIgnore]
- public float Dwell
- {
- get
- {
- return m_dwell;
- }
- set
- {
- m_dwell = value;
- LastDwellTimeMS = Util.GetTimeStampMS();
- }
- }
-
-
-
- [XmlIgnore]
- public bool ObscureMedia
- {
- get
- {
- return _obscureMedia;
- }
- set
- {
- _obscureMedia = value;
- }
- }
-
-
-
- [XmlIgnore]
- public bool ObscureMusic
- {
- get
- {
- return _obscureMusic;
- }
- set
- {
- _obscureMusic = value;
- }
- }
-
-
-
- [XmlIgnore]
- public bool MediaLoop
- {
- get
- {
- return _mediaLoop;
- }
- set
- {
- _mediaLoop = value;
- }
- }
-
-
-
- [XmlIgnore]
- public int MediaHeight
- {
- get
- {
- return _mediaHeight;
- }
- set
- {
- _mediaHeight = value;
- }
- }
-
-
-
- [XmlIgnore]
- public int MediaWidth
- {
- get
- {
- return _mediaWidth;
- }
- set
- {
- _mediaWidth = value;
- }
- }
-
-
-
- [XmlIgnore]
- public Vector3 AABBMax
- {
- get
- {
- return _AABBMax;
- }
- set
- {
- _AABBMax = value;
- }
- }
-
-
-
- [XmlIgnore]
- public Vector3 AABBMin
- {
- get
- {
- return _AABBMin;
- }
- set
- {
- _AABBMin = value;
- }
- }
-
-
-
- public int Area
- {
- get
- {
- return _area;
- }
- set
- {
- _area = value;
- }
- }
-
-
-
- public uint AuctionID
- {
- get
- {
- return _auctionID;
- }
- set
- {
- _auctionID = value;
- }
- }
-
-
-
- public UUID AuthBuyerID
- {
- get
- {
- return _authBuyerID;
- }
- set
- {
- _authBuyerID = value;
- }
- }
-
-
-
- public ParcelCategory Category
- {
- get
- {
- return _category;
- }
- set
- {
- _category = value;
- }
- }
-
-
-
- public int ClaimDate
- {
- get
- {
- return _claimDate;
- }
- set
- {
- _claimDate = value;
- }
- }
-
-
-
- public int ClaimPrice
- {
- get
- {
- return _claimPrice;
- }
- set
- {
- _claimPrice = value;
- }
- }
-
-
-
- public UUID GlobalID
- {
- get
- {
- return _globalID;
- }
- set
- {
- _globalID = value;
- }
- }
-
-
-
- public UUID GroupID
- {
- get
- {
- return _groupID;
- }
- set
- {
- _groupID = value;
- }
- }
-
-
-
- public bool IsGroupOwned
- {
- get
- {
- return _isGroupOwned;
- }
- set
- {
- _isGroupOwned = value;
- }
- }
-
-
-
- public byte[] Bitmap
- {
- get
- {
- return _bitmap;
- }
- set
- {
- _bitmap = value;
- }
- }
-
-
-
- public string Description
- {
- get
- {
- return _description;
- }
- set
- {
- _description = value;
- }
- }
-
-
-
- public uint Flags
- {
- get
- {
- return _flags;
- }
- set
- {
- _flags = value;
- }
- }
-
-
-
-
- public byte LandingType
- {
- get
- {
- return _landingType;
- }
- set
- {
- _landingType = value;
- }
- }
-
-
-
- public string Name
- {
- get
- {
- return _name;
- }
- set
- {
- _name = value;
- }
- }
-
-
-
- public ParcelStatus Status
- {
- get
- {
- return _status;
- }
- set
- {
- _status = value;
- }
- }
-
-
-
- public int LocalID
- {
- get
- {
- return _localID;
- }
- set
- {
- _localID = value;
- }
- }
-
-
-
- public byte MediaAutoScale
- {
- get
- {
- return _mediaAutoScale;
- }
- set
- {
- _mediaAutoScale = value;
- }
- }
-
-
-
- public UUID MediaID
- {
- get
- {
- return _mediaID;
- }
- set
- {
- _mediaID = value;
- }
- }
-
-
-
- public string MediaURL
- {
- get
- {
- return _mediaURL;
- }
- set
- {
- _mediaURL = value;
- }
- }
- public string MediaType
- {
- get
- {
- return _mediaType;
- }
- set
- {
- _mediaType = value;
- }
- }
-
-
-
- public string MusicURL
- {
- get
- {
- return _musicURL;
- }
- set
- {
- _musicURL = value;
- }
- }
-
-
-
-
- public UUID OwnerID
- {
- get
- {
- return _ownerID;
- }
- set
- {
- _ownerID = value;
- }
- }
-
-
-
- public List<LandAccessEntry> ParcelAccessList
- {
- get
- {
- return _parcelAccessList;
- }
- set
- {
- _parcelAccessList = value;
- }
- }
-
-
-
- public float PassHours
- {
- get
- {
- return _passHours;
- }
- set
- {
- _passHours = value;
- }
- }
-
-
-
- public int PassPrice
- {
- get
- {
- return _passPrice;
- }
- set
- {
- _passPrice = value;
- }
- }
-
-
-
- public int SalePrice
- {
- get
- {
- return _salePrice;
- }
- set
- {
- _salePrice = value;
- }
- }
-
-
-
- [XmlIgnore]
- public int SimwideArea
- {
- get
- {
- return _simwideArea;
- }
- set
- {
- _simwideArea = value;
- }
- }
-
-
-
- [XmlIgnore]
- public int SimwidePrims
- {
- get
- {
- return _simwidePrims;
- }
- set
- {
- _simwidePrims = value;
- }
- }
-
-
-
- public UUID SnapshotID
- {
- get
- {
- return _snapshotID;
- }
- set
- {
- _snapshotID = value;
- }
- }
-
-
-
-
- public Vector3 UserLocation
- {
- get
- {
- return _userLocation;
- }
- set
- {
- _userLocation = value;
- }
- }
-
-
-
-
- public Vector3 UserLookAt
- {
- get
- {
- return _userLookAt;
- }
- set
- {
- _userLookAt = value;
- }
- }
-
-
-
-
- public int OtherCleanTime
- {
- get
- {
- return _otherCleanTime;
- }
- set
- {
- _otherCleanTime = value;
- }
- }
-
-
-
- public string MediaDescription
- {
- get
- {
- return _mediaDescription;
- }
- set
- {
- _mediaDescription = value;
- }
- }
- public int EnvironmentVersion = -1;
- [XmlIgnore]
- public ViewerEnvironment Environment { get; set;}
- public LandData()
- {
- _globalID = UUID.Random();
- SeeAVs = true;
- AnyAVSounds = true;
- GroupAVSounds = true;
- LastDwellTimeMS = Util.GetTimeStampMS();
- EnvironmentVersion = -1;
- Environment = null;
- }
-
-
-
-
- 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.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;
- }
-
-
-
-
-
- }
- }
|