Fix: invinite loading for Viewer3 : parcelinfo request of traffic-value (implementation of dwell-value in LandData + eventhandler, return always 0); source-formatting of LandData

Signed-off-by: BlueWall <jamesh@bluewallgroup.com>
integration
PixelTomsen 2012-10-19 21:02:54 +02:00 committed by BlueWall
parent 48bc76ae8d
commit 5cbe2da3ba
2 changed files with 272 additions and 125 deletions

View File

@ -49,7 +49,7 @@ namespace OpenSim.Framework
// use only one serializer to give the runtime a chance to // use only one serializer to give the runtime a chance to
// optimize it (it won't do that if you use a new instance // optimize it (it won't do that if you use a new instance
// every time) // every time)
private static XmlSerializer serializer = new XmlSerializer(typeof (LandData)); private static XmlSerializer serializer = new XmlSerializer(typeof(LandData));
private Vector3 _AABBMax = new Vector3(); private Vector3 _AABBMax = new Vector3();
private Vector3 _AABBMin = new Vector3(); private Vector3 _AABBMin = new Vector3();
@ -65,11 +65,11 @@ namespace OpenSim.Framework
private byte[] _bitmap = new byte[512]; private byte[] _bitmap = new byte[512];
private string _description = String.Empty; private string _description = String.Empty;
private uint _flags = (uint) ParcelFlags.AllowFly | (uint) ParcelFlags.AllowLandmark | private uint _flags = (uint)ParcelFlags.AllowFly | (uint)ParcelFlags.AllowLandmark |
(uint) ParcelFlags.AllowAPrimitiveEntry | (uint)ParcelFlags.AllowAPrimitiveEntry |
(uint) ParcelFlags.AllowDeedToGroup | (uint) ParcelFlags.AllowTerraform | (uint)ParcelFlags.AllowDeedToGroup | (uint)ParcelFlags.AllowTerraform |
(uint) ParcelFlags.CreateObjects | (uint) ParcelFlags.AllowOtherScripts | (uint)ParcelFlags.CreateObjects | (uint)ParcelFlags.AllowOtherScripts |
(uint) ParcelFlags.SoundLocal | (uint) ParcelFlags.AllowVoiceChat; (uint)ParcelFlags.SoundLocal | (uint)ParcelFlags.AllowVoiceChat;
private byte _landingType = 0; private byte _landingType = 0;
private string _name = "Your Parcel"; private string _name = "Your Parcel";
@ -97,16 +97,36 @@ namespace OpenSim.Framework
private bool _mediaLoop = false; private bool _mediaLoop = false;
private bool _obscureMusic = false; private bool _obscureMusic = false;
private bool _obscureMedia = false; private bool _obscureMedia = false;
private float _dwell = 0;
/// <summary>
/// Traffic count of parcel
/// </summary>
[XmlIgnore]
public float Dwell
{
get
{
return _dwell;
}
set
{
_dwell = value;
}
}
/// <summary> /// <summary>
/// Whether to obscure parcel media URL /// Whether to obscure parcel media URL
/// </summary> /// </summary>
[XmlIgnore] [XmlIgnore]
public bool ObscureMedia { public bool ObscureMedia
get { {
get
{
return _obscureMedia; return _obscureMedia;
} }
set { set
{
_obscureMedia = value; _obscureMedia = value;
} }
} }
@ -115,11 +135,14 @@ namespace OpenSim.Framework
/// Whether to obscure parcel music URL /// Whether to obscure parcel music URL
/// </summary> /// </summary>
[XmlIgnore] [XmlIgnore]
public bool ObscureMusic { public bool ObscureMusic
get { {
get
{
return _obscureMusic; return _obscureMusic;
} }
set { set
{
_obscureMusic = value; _obscureMusic = value;
} }
} }
@ -128,11 +151,14 @@ namespace OpenSim.Framework
/// Whether to loop parcel media /// Whether to loop parcel media
/// </summary> /// </summary>
[XmlIgnore] [XmlIgnore]
public bool MediaLoop { public bool MediaLoop
get { {
get
{
return _mediaLoop; return _mediaLoop;
} }
set { set
{
_mediaLoop = value; _mediaLoop = value;
} }
} }
@ -141,11 +167,14 @@ namespace OpenSim.Framework
/// Height of parcel media render /// Height of parcel media render
/// </summary> /// </summary>
[XmlIgnore] [XmlIgnore]
public int MediaHeight { public int MediaHeight
get { {
get
{
return _mediaHeight; return _mediaHeight;
} }
set { set
{
_mediaHeight = value; _mediaHeight = value;
} }
} }
@ -154,11 +183,14 @@ namespace OpenSim.Framework
/// Width of parcel media render /// Width of parcel media render
/// </summary> /// </summary>
[XmlIgnore] [XmlIgnore]
public int MediaWidth { public int MediaWidth
get { {
get
{
return _mediaWidth; return _mediaWidth;
} }
set { set
{
_mediaWidth = value; _mediaWidth = value;
} }
} }
@ -167,11 +199,14 @@ namespace OpenSim.Framework
/// Upper corner of the AABB for the parcel /// Upper corner of the AABB for the parcel
/// </summary> /// </summary>
[XmlIgnore] [XmlIgnore]
public Vector3 AABBMax { public Vector3 AABBMax
get { {
get
{
return _AABBMax; return _AABBMax;
} }
set { set
{
_AABBMax = value; _AABBMax = value;
} }
} }
@ -179,11 +214,14 @@ namespace OpenSim.Framework
/// Lower corner of the AABB for the parcel /// Lower corner of the AABB for the parcel
/// </summary> /// </summary>
[XmlIgnore] [XmlIgnore]
public Vector3 AABBMin { public Vector3 AABBMin
get { {
get
{
return _AABBMin; return _AABBMin;
} }
set { set
{
_AABBMin = value; _AABBMin = value;
} }
} }
@ -191,11 +229,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// Area in meters^2 the parcel contains /// Area in meters^2 the parcel contains
/// </summary> /// </summary>
public int Area { public int Area
get { {
get
{
return _area; return _area;
} }
set { set
{
_area = value; _area = value;
} }
} }
@ -203,11 +244,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// ID of auction (3rd Party Integration) when parcel is being auctioned /// ID of auction (3rd Party Integration) when parcel is being auctioned
/// </summary> /// </summary>
public uint AuctionID { public uint AuctionID
get { {
get
{
return _auctionID; return _auctionID;
} }
set { set
{
_auctionID = value; _auctionID = value;
} }
} }
@ -215,11 +259,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// UUID of authorized buyer of parcel. This is UUID.Zero if anyone can buy it. /// UUID of authorized buyer of parcel. This is UUID.Zero if anyone can buy it.
/// </summary> /// </summary>
public UUID AuthBuyerID { public UUID AuthBuyerID
get { {
get
{
return _authBuyerID; return _authBuyerID;
} }
set { set
{
_authBuyerID = value; _authBuyerID = value;
} }
} }
@ -227,11 +274,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// Category of parcel. Used for classifying the parcel in classified listings /// Category of parcel. Used for classifying the parcel in classified listings
/// </summary> /// </summary>
public ParcelCategory Category { public ParcelCategory Category
get { {
get
{
return _category; return _category;
} }
set { set
{
_category = value; _category = value;
} }
} }
@ -239,11 +289,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// Date that the current owner purchased or claimed the parcel /// Date that the current owner purchased or claimed the parcel
/// </summary> /// </summary>
public int ClaimDate { public int ClaimDate
get { {
get
{
return _claimDate; return _claimDate;
} }
set { set
{
_claimDate = value; _claimDate = value;
} }
} }
@ -251,11 +304,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// The last price that the parcel was sold at /// The last price that the parcel was sold at
/// </summary> /// </summary>
public int ClaimPrice { public int ClaimPrice
get { {
get
{
return _claimPrice; return _claimPrice;
} }
set { set
{
_claimPrice = value; _claimPrice = value;
} }
} }
@ -263,11 +319,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// Global ID for the parcel. (3rd Party Integration) /// Global ID for the parcel. (3rd Party Integration)
/// </summary> /// </summary>
public UUID GlobalID { public UUID GlobalID
get { {
get
{
return _globalID; return _globalID;
} }
set { set
{
_globalID = value; _globalID = value;
} }
} }
@ -275,11 +334,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// Unique ID of the Group that owns /// Unique ID of the Group that owns
/// </summary> /// </summary>
public UUID GroupID { public UUID GroupID
get { {
get
{
return _groupID; return _groupID;
} }
set { set
{
_groupID = value; _groupID = value;
} }
} }
@ -287,11 +349,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// Returns true if the Land Parcel is owned by a group /// Returns true if the Land Parcel is owned by a group
/// </summary> /// </summary>
public bool IsGroupOwned { public bool IsGroupOwned
get { {
get
{
return _isGroupOwned; return _isGroupOwned;
} }
set { set
{
_isGroupOwned = value; _isGroupOwned = value;
} }
} }
@ -299,11 +364,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// jp2 data for the image representative of the parcel in the parcel dialog /// jp2 data for the image representative of the parcel in the parcel dialog
/// </summary> /// </summary>
public byte[] Bitmap { public byte[] Bitmap
get { {
get
{
return _bitmap; return _bitmap;
} }
set { set
{
_bitmap = value; _bitmap = value;
} }
} }
@ -311,11 +379,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// Parcel Description /// Parcel Description
/// </summary> /// </summary>
public string Description { public string Description
get { {
get
{
return _description; return _description;
} }
set { set
{
_description = value; _description = value;
} }
} }
@ -323,11 +394,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// Parcel settings. Access flags, Fly, NoPush, Voice, Scripts allowed, etc. ParcelFlags /// Parcel settings. Access flags, Fly, NoPush, Voice, Scripts allowed, etc. ParcelFlags
/// </summary> /// </summary>
public uint Flags { public uint Flags
get { {
get
{
return _flags; return _flags;
} }
set { set
{
_flags = value; _flags = value;
} }
} }
@ -336,11 +410,14 @@ namespace OpenSim.Framework
/// Determines if people are able to teleport where they please on the parcel or if they /// Determines if people are able to teleport where they please on the parcel or if they
/// get constrainted to a specific point on teleport within the parcel /// get constrainted to a specific point on teleport within the parcel
/// </summary> /// </summary>
public byte LandingType { public byte LandingType
get { {
get
{
return _landingType; return _landingType;
} }
set { set
{
_landingType = value; _landingType = value;
} }
} }
@ -348,11 +425,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// Parcel Name /// Parcel Name
/// </summary> /// </summary>
public string Name { public string Name
get { {
get
{
return _name; return _name;
} }
set { set
{
_name = value; _name = value;
} }
} }
@ -360,11 +440,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// Status of Parcel, Leased, Abandoned, For Sale /// Status of Parcel, Leased, Abandoned, For Sale
/// </summary> /// </summary>
public ParcelStatus Status { public ParcelStatus Status
get { {
get
{
return _status; return _status;
} }
set { set
{
_status = value; _status = value;
} }
} }
@ -372,11 +455,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// Internal ID of the parcel. Sometimes the client will try to use this value /// Internal ID of the parcel. Sometimes the client will try to use this value
/// </summary> /// </summary>
public int LocalID { public int LocalID
get { {
get
{
return _localID; return _localID;
} }
set { set
{
_localID = value; _localID = value;
} }
} }
@ -384,11 +470,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// Determines if we scale the media based on the surface it's on /// Determines if we scale the media based on the surface it's on
/// </summary> /// </summary>
public byte MediaAutoScale { public byte MediaAutoScale
get { {
get
{
return _mediaAutoScale; return _mediaAutoScale;
} }
set { set
{
_mediaAutoScale = value; _mediaAutoScale = value;
} }
} }
@ -396,11 +485,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// Texture Guid to replace with the output of the media stream /// Texture Guid to replace with the output of the media stream
/// </summary> /// </summary>
public UUID MediaID { public UUID MediaID
get { {
get
{
return _mediaID; return _mediaID;
} }
set { set
{
_mediaID = value; _mediaID = value;
} }
} }
@ -408,11 +500,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// URL to the media file to display /// URL to the media file to display
/// </summary> /// </summary>
public string MediaURL { public string MediaURL
get { {
get
{
return _mediaURL; return _mediaURL;
} }
set { set
{
_mediaURL = value; _mediaURL = value;
} }
} }
@ -432,11 +527,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// URL to the shoutcast music stream to play on the parcel /// URL to the shoutcast music stream to play on the parcel
/// </summary> /// </summary>
public string MusicURL { public string MusicURL
get { {
get
{
return _musicURL; return _musicURL;
} }
set { set
{
_musicURL = value; _musicURL = value;
} }
} }
@ -445,11 +543,14 @@ namespace OpenSim.Framework
/// Owner Avatar or Group of the parcel. Naturally, all land masses must be /// Owner Avatar or Group of the parcel. Naturally, all land masses must be
/// owned by someone /// owned by someone
/// </summary> /// </summary>
public UUID OwnerID { public UUID OwnerID
get { {
get
{
return _ownerID; return _ownerID;
} }
set { set
{
_ownerID = value; _ownerID = value;
} }
} }
@ -457,11 +558,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// List of access data for the parcel. User data, some bitflags, and a time /// List of access data for the parcel. User data, some bitflags, and a time
/// </summary> /// </summary>
public List<LandAccessEntry> ParcelAccessList { public List<LandAccessEntry> ParcelAccessList
get { {
get
{
return _parcelAccessList; return _parcelAccessList;
} }
set { set
{
_parcelAccessList = value; _parcelAccessList = value;
} }
} }
@ -469,11 +573,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// How long in hours a Pass to the parcel is given /// How long in hours a Pass to the parcel is given
/// </summary> /// </summary>
public float PassHours { public float PassHours
get { {
get
{
return _passHours; return _passHours;
} }
set { set
{
_passHours = value; _passHours = value;
} }
} }
@ -481,11 +588,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// Price to purchase a Pass to a restricted parcel /// Price to purchase a Pass to a restricted parcel
/// </summary> /// </summary>
public int PassPrice { public int PassPrice
get { {
get
{
return _passPrice; return _passPrice;
} }
set { set
{
_passPrice = value; _passPrice = value;
} }
} }
@ -493,11 +603,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// When the parcel is being sold, this is the price to purchase the parcel /// When the parcel is being sold, this is the price to purchase the parcel
/// </summary> /// </summary>
public int SalePrice { public int SalePrice
get { {
get
{
return _salePrice; return _salePrice;
} }
set { set
{
_salePrice = value; _salePrice = value;
} }
} }
@ -506,11 +619,14 @@ namespace OpenSim.Framework
/// Number of meters^2 in the Simulator /// Number of meters^2 in the Simulator
/// </summary> /// </summary>
[XmlIgnore] [XmlIgnore]
public int SimwideArea { public int SimwideArea
get { {
get
{
return _simwideArea; return _simwideArea;
} }
set { set
{
_simwideArea = value; _simwideArea = value;
} }
} }
@ -519,11 +635,14 @@ namespace OpenSim.Framework
/// Number of SceneObjectPart in the Simulator /// Number of SceneObjectPart in the Simulator
/// </summary> /// </summary>
[XmlIgnore] [XmlIgnore]
public int SimwidePrims { public int SimwidePrims
get { {
get
{
return _simwidePrims; return _simwidePrims;
} }
set { set
{
_simwidePrims = value; _simwidePrims = value;
} }
} }
@ -531,11 +650,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// ID of the snapshot used in the client parcel dialog of the parcel /// ID of the snapshot used in the client parcel dialog of the parcel
/// </summary> /// </summary>
public UUID SnapshotID { public UUID SnapshotID
get { {
get
{
return _snapshotID; return _snapshotID;
} }
set { set
{
_snapshotID = value; _snapshotID = value;
} }
} }
@ -544,11 +666,14 @@ namespace OpenSim.Framework
/// When teleporting is restricted to a certain point, this is the location /// When teleporting is restricted to a certain point, this is the location
/// that the user will be redirected to /// that the user will be redirected to
/// </summary> /// </summary>
public Vector3 UserLocation { public Vector3 UserLocation
get { {
get
{
return _userLocation; return _userLocation;
} }
set { set
{
_userLocation = value; _userLocation = value;
} }
} }
@ -557,11 +682,14 @@ namespace OpenSim.Framework
/// When teleporting is restricted to a certain point, this is the rotation /// When teleporting is restricted to a certain point, this is the rotation
/// that the user will be positioned /// that the user will be positioned
/// </summary> /// </summary>
public Vector3 UserLookAt { public Vector3 UserLookAt
get { {
get
{
return _userLookAt; return _userLookAt;
} }
set { set
{
_userLookAt = value; _userLookAt = value;
} }
} }
@ -570,11 +698,14 @@ namespace OpenSim.Framework
/// Autoreturn number of minutes to return SceneObjectGroup that are owned by someone who doesn't own /// Autoreturn number of minutes to return SceneObjectGroup that are owned by someone who doesn't own
/// the parcel and isn't set to the same 'group' as the parcel. /// the parcel and isn't set to the same 'group' as the parcel.
/// </summary> /// </summary>
public int OtherCleanTime { public int OtherCleanTime
get { {
get
{
return _otherCleanTime; return _otherCleanTime;
} }
set { set
{
_otherCleanTime = value; _otherCleanTime = value;
} }
} }
@ -582,11 +713,14 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// parcel media description /// parcel media description
/// </summary> /// </summary>
public string MediaDescription { public string MediaDescription
get { {
get
{
return _mediaDescription; return _mediaDescription;
} }
set { set
{
_mediaDescription = value; _mediaDescription = value;
} }
} }
@ -622,7 +756,7 @@ namespace OpenSim.Framework
landData._mediaURL = _mediaURL; landData._mediaURL = _mediaURL;
landData._musicURL = _musicURL; landData._musicURL = _musicURL;
landData._ownerID = _ownerID; landData._ownerID = _ownerID;
landData._bitmap = (byte[]) _bitmap.Clone(); landData._bitmap = (byte[])_bitmap.Clone();
landData._description = _description; landData._description = _description;
landData._flags = _flags; landData._flags = _flags;
landData._name = _name; landData._name = _name;
@ -643,6 +777,7 @@ namespace OpenSim.Framework
landData._obscureMedia = _obscureMedia; landData._obscureMedia = _obscureMedia;
landData._simwideArea = _simwideArea; landData._simwideArea = _simwideArea;
landData._simwidePrims = _simwidePrims; landData._simwidePrims = _simwidePrims;
landData._dwell = _dwell;
landData._parcelAccessList.Clear(); landData._parcelAccessList.Clear();
foreach (LandAccessEntry entry in _parcelAccessList) foreach (LandAccessEntry entry in _parcelAccessList)

View File

@ -207,6 +207,7 @@ namespace OpenSim.Region.CoreModules.World.Land
client.OnParcelInfoRequest += ClientOnParcelInfoRequest; client.OnParcelInfoRequest += ClientOnParcelInfoRequest;
client.OnParcelDeedToGroup += ClientOnParcelDeedToGroup; client.OnParcelDeedToGroup += ClientOnParcelDeedToGroup;
client.OnPreAgentUpdate += ClientOnPreAgentUpdate; client.OnPreAgentUpdate += ClientOnPreAgentUpdate;
client.OnParcelDwellRequest += ClientOnParcelDwellRequest;
EntityBase presenceEntity; EntityBase presenceEntity;
if (m_scene.Entities.TryGetValue(client.AgentId, out presenceEntity) && presenceEntity is ScenePresence) if (m_scene.Entities.TryGetValue(client.AgentId, out presenceEntity) && presenceEntity is ScenePresence)
@ -798,6 +799,17 @@ namespace OpenSim.Region.CoreModules.World.Land
} }
} }
private void ClientOnParcelDwellRequest(int localID, IClientAPI client)
{
ILandObject parcel = null;
lock (m_landList)
{
if (!m_landList.TryGetValue(localID, out parcel))
return;
}
client.SendParcelDwellReply(localID, parcel.LandData.GlobalID, parcel.LandData.Dwell);
}
#endregion #endregion
#region Parcel Modification #region Parcel Modification