From d2b19f00dafe2c7c89c07b6a713fdd359cf9dcab Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 20 Oct 2012 02:49:16 +0100
Subject: Fix minor issues from commit 28483150
Fix spelling of collide, change to more self-documenting property BadMeshAssetCollideBits, add method doc, change to private to reduce code analysis complexity
---
OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 29 +++++++++++++++++------------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index 5a1fdf9..d11dff1 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -67,6 +67,17 @@ namespace OpenSim.Region.Physics.OdePlugin
private int m_expectedCollisionContacts = 0;
///
+ /// Gets collide bits so that we can still perform land collisions if a mesh fails to load.
+ ///
+ ///
+ /// The bad asset collide bits.
+ ///
+ private int BadMeshAssetCollideBits
+ {
+ get { return m_isphysical ? (int)CollisionCategories.Land : 0; }
+ }
+
+ ///
/// Is this prim subject to physics? Even if not, it's still solid for collision purposes.
///
public override bool IsPhysical
@@ -344,11 +355,10 @@ namespace OpenSim.Region.Physics.OdePlugin
if (m_assetFailed)
{
d.GeomSetCategoryBits(prim_geom, 0);
- d.GeomSetCollideBits(prim_geom, BadAssetColideBits());
+ d.GeomSetCollideBits(prim_geom, BadMeshAssetCollideBits);
}
else
{
-
d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
}
@@ -418,7 +428,7 @@ namespace OpenSim.Region.Physics.OdePlugin
if (m_assetFailed)
{
d.GeomSetCategoryBits(prim_geom, 0);
- d.GeomSetCollideBits(prim_geom, BadAssetColideBits());
+ d.GeomSetCollideBits(prim_geom, BadMeshAssetCollideBits);
}
else
{
@@ -851,11 +861,6 @@ namespace OpenSim.Region.Physics.OdePlugin
private static Dictionary m_MeshToTriMeshMap = new Dictionary();
- public int BadAssetColideBits()
- {
- return (m_isphysical ? (int)CollisionCategories.Land : 0);
- }
-
private void setMesh(OdeScene parent_scene, IMesh mesh)
{
// m_log.DebugFormat("[ODE PRIM]: Setting mesh on {0} to {1}", Name, mesh);
@@ -1137,7 +1142,7 @@ Console.WriteLine("ZProcessTaints for " + Name);
if (prm.m_assetFailed)
{
d.GeomSetCategoryBits(prm.prim_geom, 0);
- d.GeomSetCollideBits(prm.prim_geom, prm.BadAssetColideBits());
+ d.GeomSetCollideBits(prm.prim_geom, prm.BadMeshAssetCollideBits);
}
else
{
@@ -1191,7 +1196,7 @@ Console.WriteLine("ZProcessTaints for " + Name);
if (m_assetFailed)
{
d.GeomSetCategoryBits(prim_geom, 0);
- d.GeomSetCollideBits(prim_geom, BadAssetColideBits());
+ d.GeomSetCollideBits(prim_geom, BadMeshAssetCollideBits);
}
else
{
@@ -1393,7 +1398,7 @@ Console.WriteLine("ZProcessTaints for " + Name);
if (m_assetFailed)
{
d.GeomSetCategoryBits(prim_geom, 0);
- d.GeomSetCollideBits(prim_geom, BadAssetColideBits());
+ d.GeomSetCollideBits(prim_geom, BadMeshAssetCollideBits);
}
else
{
@@ -2137,7 +2142,7 @@ Console.WriteLine(" JointCreateFixed");
}
if (m_assetFailed)
- d.GeomSetCollideBits(prim_geom, BadAssetColideBits());
+ d.GeomSetCollideBits(prim_geom, BadMeshAssetCollideBits);
else
d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
--
cgit v1.1
From 5bc07a15f508f4860de4defd328f23c4300b33c0 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 20 Oct 2012 02:52:38 +0100
Subject: minor: remove unnecessary bit of method doc from
OdePrim.BadMeshAssetCollideBits that monodevelop inserted automatically
---
OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 3 ---
1 file changed, 3 deletions(-)
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index d11dff1..2548648 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -69,9 +69,6 @@ namespace OpenSim.Region.Physics.OdePlugin
///
/// Gets collide bits so that we can still perform land collisions if a mesh fails to load.
///
- ///
- /// The bad asset collide bits.
- ///
private int BadMeshAssetCollideBits
{
get { return m_isphysical ? (int)CollisionCategories.Land : 0; }
--
cgit v1.1
From 2aac113ac14f22509343ae82eb2eb4c3d7ad85b1 Mon Sep 17 00:00:00 2001
From: BlueWall
Date: Sat, 20 Oct 2012 04:28:58 -0400
Subject: Add CLICK_ACTION_ZOOM
Add support for V2/3 CLICK_ACTION_ZOOM to llSetClickAction
---
OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | 1 +
1 file changed, 1 insertion(+)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index 60a7e14..62bd6b8 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -612,6 +612,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const int CLICK_ACTION_OPEN = 4;
public const int CLICK_ACTION_PLAY = 5;
public const int CLICK_ACTION_OPEN_MEDIA = 6;
+ public const int CLICK_ACTION_ZOOM = 7;
// constants for the llDetectedTouch* functions
public const int TOUCH_INVALID_FACE = -1;
--
cgit v1.1
From d7fa4cacb3227cb432a13d4f27076e408e8c114f Mon Sep 17 00:00:00 2001
From: PixelTomsen
Date: Fri, 19 Oct 2012 21:02:54 +0200
Subject: 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
---
OpenSim/Framework/LandData.cs | 385 ++++++++++++++-------
.../CoreModules/World/Land/LandManagementModule.cs | 12 +
2 files changed, 272 insertions(+), 125 deletions(-)
diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs
index bf2ecf2..fc02f33 100644
--- a/OpenSim/Framework/LandData.cs
+++ b/OpenSim/Framework/LandData.cs
@@ -49,8 +49,8 @@ namespace OpenSim.Framework
// use only one serializer to give the runtime a chance to
// optimize it (it won't do that if you use a new instance
// 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 _AABBMin = new Vector3();
private int _area = 0;
@@ -65,11 +65,11 @@ namespace OpenSim.Framework
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.AllowTerraform |
- (uint) ParcelFlags.CreateObjects | (uint) ParcelFlags.AllowOtherScripts |
- (uint) ParcelFlags.SoundLocal | (uint) ParcelFlags.AllowVoiceChat;
+ private uint _flags = (uint)ParcelFlags.AllowFly | (uint)ParcelFlags.AllowLandmark |
+ (uint)ParcelFlags.AllowAPrimitiveEntry |
+ (uint)ParcelFlags.AllowDeedToGroup | (uint)ParcelFlags.AllowTerraform |
+ (uint)ParcelFlags.CreateObjects | (uint)ParcelFlags.AllowOtherScripts |
+ (uint)ParcelFlags.SoundLocal | (uint)ParcelFlags.AllowVoiceChat;
private byte _landingType = 0;
private string _name = "Your Parcel";
@@ -97,16 +97,36 @@ namespace OpenSim.Framework
private bool _mediaLoop = false;
private bool _obscureMusic = false;
private bool _obscureMedia = false;
+ private float _dwell = 0;
+
+ ///
+ /// Traffic count of parcel
+ ///
+ [XmlIgnore]
+ public float Dwell
+ {
+ get
+ {
+ return _dwell;
+ }
+ set
+ {
+ _dwell = value;
+ }
+ }
///
/// Whether to obscure parcel media URL
///
[XmlIgnore]
- public bool ObscureMedia {
- get {
+ public bool ObscureMedia
+ {
+ get
+ {
return _obscureMedia;
}
- set {
+ set
+ {
_obscureMedia = value;
}
}
@@ -115,11 +135,14 @@ namespace OpenSim.Framework
/// Whether to obscure parcel music URL
///
[XmlIgnore]
- public bool ObscureMusic {
- get {
+ public bool ObscureMusic
+ {
+ get
+ {
return _obscureMusic;
}
- set {
+ set
+ {
_obscureMusic = value;
}
}
@@ -128,11 +151,14 @@ namespace OpenSim.Framework
/// Whether to loop parcel media
///
[XmlIgnore]
- public bool MediaLoop {
- get {
+ public bool MediaLoop
+ {
+ get
+ {
return _mediaLoop;
}
- set {
+ set
+ {
_mediaLoop = value;
}
}
@@ -141,11 +167,14 @@ namespace OpenSim.Framework
/// Height of parcel media render
///
[XmlIgnore]
- public int MediaHeight {
- get {
+ public int MediaHeight
+ {
+ get
+ {
return _mediaHeight;
}
- set {
+ set
+ {
_mediaHeight = value;
}
}
@@ -154,11 +183,14 @@ namespace OpenSim.Framework
/// Width of parcel media render
///
[XmlIgnore]
- public int MediaWidth {
- get {
+ public int MediaWidth
+ {
+ get
+ {
return _mediaWidth;
}
- set {
+ set
+ {
_mediaWidth = value;
}
}
@@ -167,11 +199,14 @@ namespace OpenSim.Framework
/// Upper corner of the AABB for the parcel
///
[XmlIgnore]
- public Vector3 AABBMax {
- get {
+ public Vector3 AABBMax
+ {
+ get
+ {
return _AABBMax;
}
- set {
+ set
+ {
_AABBMax = value;
}
}
@@ -179,11 +214,14 @@ namespace OpenSim.Framework
/// Lower corner of the AABB for the parcel
///
[XmlIgnore]
- public Vector3 AABBMin {
- get {
+ public Vector3 AABBMin
+ {
+ get
+ {
return _AABBMin;
}
- set {
+ set
+ {
_AABBMin = value;
}
}
@@ -191,11 +229,14 @@ namespace OpenSim.Framework
///
/// Area in meters^2 the parcel contains
///
- public int Area {
- get {
+ public int Area
+ {
+ get
+ {
return _area;
}
- set {
+ set
+ {
_area = value;
}
}
@@ -203,11 +244,14 @@ namespace OpenSim.Framework
///
/// ID of auction (3rd Party Integration) when parcel is being auctioned
///
- public uint AuctionID {
- get {
+ public uint AuctionID
+ {
+ get
+ {
return _auctionID;
}
- set {
+ set
+ {
_auctionID = value;
}
}
@@ -215,11 +259,14 @@ namespace OpenSim.Framework
///
/// UUID of authorized buyer of parcel. This is UUID.Zero if anyone can buy it.
///
- public UUID AuthBuyerID {
- get {
+ public UUID AuthBuyerID
+ {
+ get
+ {
return _authBuyerID;
}
- set {
+ set
+ {
_authBuyerID = value;
}
}
@@ -227,11 +274,14 @@ namespace OpenSim.Framework
///
/// Category of parcel. Used for classifying the parcel in classified listings
///
- public ParcelCategory Category {
- get {
+ public ParcelCategory Category
+ {
+ get
+ {
return _category;
}
- set {
+ set
+ {
_category = value;
}
}
@@ -239,11 +289,14 @@ namespace OpenSim.Framework
///
/// Date that the current owner purchased or claimed the parcel
///
- public int ClaimDate {
- get {
+ public int ClaimDate
+ {
+ get
+ {
return _claimDate;
}
- set {
+ set
+ {
_claimDate = value;
}
}
@@ -251,11 +304,14 @@ namespace OpenSim.Framework
///
/// The last price that the parcel was sold at
///
- public int ClaimPrice {
- get {
+ public int ClaimPrice
+ {
+ get
+ {
return _claimPrice;
}
- set {
+ set
+ {
_claimPrice = value;
}
}
@@ -263,11 +319,14 @@ namespace OpenSim.Framework
///
/// Global ID for the parcel. (3rd Party Integration)
///
- public UUID GlobalID {
- get {
+ public UUID GlobalID
+ {
+ get
+ {
return _globalID;
}
- set {
+ set
+ {
_globalID = value;
}
}
@@ -275,11 +334,14 @@ namespace OpenSim.Framework
///
/// Unique ID of the Group that owns
///
- public UUID GroupID {
- get {
+ public UUID GroupID
+ {
+ get
+ {
return _groupID;
}
- set {
+ set
+ {
_groupID = value;
}
}
@@ -287,11 +349,14 @@ namespace OpenSim.Framework
///
/// Returns true if the Land Parcel is owned by a group
///
- public bool IsGroupOwned {
- get {
+ public bool IsGroupOwned
+ {
+ get
+ {
return _isGroupOwned;
}
- set {
+ set
+ {
_isGroupOwned = value;
}
}
@@ -299,11 +364,14 @@ namespace OpenSim.Framework
///
/// jp2 data for the image representative of the parcel in the parcel dialog
///
- public byte[] Bitmap {
- get {
+ public byte[] Bitmap
+ {
+ get
+ {
return _bitmap;
}
- set {
+ set
+ {
_bitmap = value;
}
}
@@ -311,11 +379,14 @@ namespace OpenSim.Framework
///
/// Parcel Description
///
- public string Description {
- get {
+ public string Description
+ {
+ get
+ {
return _description;
}
- set {
+ set
+ {
_description = value;
}
}
@@ -323,11 +394,14 @@ namespace OpenSim.Framework
///
/// Parcel settings. Access flags, Fly, NoPush, Voice, Scripts allowed, etc. ParcelFlags
///
- public uint Flags {
- get {
+ public uint Flags
+ {
+ get
+ {
return _flags;
}
- set {
+ set
+ {
_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
/// get constrainted to a specific point on teleport within the parcel
///
- public byte LandingType {
- get {
+ public byte LandingType
+ {
+ get
+ {
return _landingType;
}
- set {
+ set
+ {
_landingType = value;
}
}
@@ -348,11 +425,14 @@ namespace OpenSim.Framework
///
/// Parcel Name
///
- public string Name {
- get {
+ public string Name
+ {
+ get
+ {
return _name;
}
- set {
+ set
+ {
_name = value;
}
}
@@ -360,11 +440,14 @@ namespace OpenSim.Framework
///
/// Status of Parcel, Leased, Abandoned, For Sale
///
- public ParcelStatus Status {
- get {
+ public ParcelStatus Status
+ {
+ get
+ {
return _status;
}
- set {
+ set
+ {
_status = value;
}
}
@@ -372,11 +455,14 @@ namespace OpenSim.Framework
///
/// Internal ID of the parcel. Sometimes the client will try to use this value
///
- public int LocalID {
- get {
+ public int LocalID
+ {
+ get
+ {
return _localID;
}
- set {
+ set
+ {
_localID = value;
}
}
@@ -384,11 +470,14 @@ namespace OpenSim.Framework
///
/// Determines if we scale the media based on the surface it's on
///
- public byte MediaAutoScale {
- get {
+ public byte MediaAutoScale
+ {
+ get
+ {
return _mediaAutoScale;
}
- set {
+ set
+ {
_mediaAutoScale = value;
}
}
@@ -396,11 +485,14 @@ namespace OpenSim.Framework
///
/// Texture Guid to replace with the output of the media stream
///
- public UUID MediaID {
- get {
+ public UUID MediaID
+ {
+ get
+ {
return _mediaID;
}
- set {
+ set
+ {
_mediaID = value;
}
}
@@ -408,11 +500,14 @@ namespace OpenSim.Framework
///
/// URL to the media file to display
///
- public string MediaURL {
- get {
+ public string MediaURL
+ {
+ get
+ {
return _mediaURL;
}
- set {
+ set
+ {
_mediaURL = value;
}
}
@@ -432,11 +527,14 @@ namespace OpenSim.Framework
///
/// URL to the shoutcast music stream to play on the parcel
///
- public string MusicURL {
- get {
+ public string MusicURL
+ {
+ get
+ {
return _musicURL;
}
- set {
+ set
+ {
_musicURL = value;
}
}
@@ -445,11 +543,14 @@ namespace OpenSim.Framework
/// Owner Avatar or Group of the parcel. Naturally, all land masses must be
/// owned by someone
///
- public UUID OwnerID {
- get {
+ public UUID OwnerID
+ {
+ get
+ {
return _ownerID;
}
- set {
+ set
+ {
_ownerID = value;
}
}
@@ -457,11 +558,14 @@ namespace OpenSim.Framework
///
/// List of access data for the parcel. User data, some bitflags, and a time
///
- public List ParcelAccessList {
- get {
+ public List ParcelAccessList
+ {
+ get
+ {
return _parcelAccessList;
}
- set {
+ set
+ {
_parcelAccessList = value;
}
}
@@ -469,11 +573,14 @@ namespace OpenSim.Framework
///
/// How long in hours a Pass to the parcel is given
///
- public float PassHours {
- get {
+ public float PassHours
+ {
+ get
+ {
return _passHours;
}
- set {
+ set
+ {
_passHours = value;
}
}
@@ -481,11 +588,14 @@ namespace OpenSim.Framework
///
/// Price to purchase a Pass to a restricted parcel
///
- public int PassPrice {
- get {
+ public int PassPrice
+ {
+ get
+ {
return _passPrice;
}
- set {
+ set
+ {
_passPrice = value;
}
}
@@ -493,11 +603,14 @@ namespace OpenSim.Framework
///
/// When the parcel is being sold, this is the price to purchase the parcel
///
- public int SalePrice {
- get {
+ public int SalePrice
+ {
+ get
+ {
return _salePrice;
}
- set {
+ set
+ {
_salePrice = value;
}
}
@@ -506,11 +619,14 @@ namespace OpenSim.Framework
/// Number of meters^2 in the Simulator
///
[XmlIgnore]
- public int SimwideArea {
- get {
+ public int SimwideArea
+ {
+ get
+ {
return _simwideArea;
}
- set {
+ set
+ {
_simwideArea = value;
}
}
@@ -519,11 +635,14 @@ namespace OpenSim.Framework
/// Number of SceneObjectPart in the Simulator
///
[XmlIgnore]
- public int SimwidePrims {
- get {
+ public int SimwidePrims
+ {
+ get
+ {
return _simwidePrims;
}
- set {
+ set
+ {
_simwidePrims = value;
}
}
@@ -531,11 +650,14 @@ namespace OpenSim.Framework
///
/// ID of the snapshot used in the client parcel dialog of the parcel
///
- public UUID SnapshotID {
- get {
+ public UUID SnapshotID
+ {
+ get
+ {
return _snapshotID;
}
- set {
+ set
+ {
_snapshotID = value;
}
}
@@ -544,11 +666,14 @@ namespace OpenSim.Framework
/// When teleporting is restricted to a certain point, this is the location
/// that the user will be redirected to
///
- public Vector3 UserLocation {
- get {
+ public Vector3 UserLocation
+ {
+ get
+ {
return _userLocation;
}
- set {
+ set
+ {
_userLocation = value;
}
}
@@ -557,11 +682,14 @@ namespace OpenSim.Framework
/// When teleporting is restricted to a certain point, this is the rotation
/// that the user will be positioned
///
- public Vector3 UserLookAt {
- get {
+ public Vector3 UserLookAt
+ {
+ get
+ {
return _userLookAt;
}
- set {
+ set
+ {
_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
/// the parcel and isn't set to the same 'group' as the parcel.
///
- public int OtherCleanTime {
- get {
+ public int OtherCleanTime
+ {
+ get
+ {
return _otherCleanTime;
}
- set {
+ set
+ {
_otherCleanTime = value;
}
}
@@ -582,11 +713,14 @@ namespace OpenSim.Framework
///
/// parcel media description
///
- public string MediaDescription {
- get {
+ public string MediaDescription
+ {
+ get
+ {
return _mediaDescription;
}
- set {
+ set
+ {
_mediaDescription = value;
}
}
@@ -622,7 +756,7 @@ namespace OpenSim.Framework
landData._mediaURL = _mediaURL;
landData._musicURL = _musicURL;
landData._ownerID = _ownerID;
- landData._bitmap = (byte[]) _bitmap.Clone();
+ landData._bitmap = (byte[])_bitmap.Clone();
landData._description = _description;
landData._flags = _flags;
landData._name = _name;
@@ -643,6 +777,7 @@ namespace OpenSim.Framework
landData._obscureMedia = _obscureMedia;
landData._simwideArea = _simwideArea;
landData._simwidePrims = _simwidePrims;
+ landData._dwell = _dwell;
landData._parcelAccessList.Clear();
foreach (LandAccessEntry entry in _parcelAccessList)
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 8b7406d..95edf62 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -207,6 +207,7 @@ namespace OpenSim.Region.CoreModules.World.Land
client.OnParcelInfoRequest += ClientOnParcelInfoRequest;
client.OnParcelDeedToGroup += ClientOnParcelDeedToGroup;
client.OnPreAgentUpdate += ClientOnPreAgentUpdate;
+ client.OnParcelDwellRequest += ClientOnParcelDwellRequest;
EntityBase presenceEntity;
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
#region Parcel Modification
--
cgit v1.1
From 20eac8d6d07257031f529718dfb9a5863e977653 Mon Sep 17 00:00:00 2001
From: PixelTomsen
Date: Sun, 21 Oct 2012 14:59:22 +0200
Subject: SQLite DB: some values of land data will be not saved / loaded
http://opensimulator.org/mantis/view.php?id=6370
Signed-off-by: BlueWall
---
OpenSim/Data/SQLite/SQLiteSimulationData.cs | 25 +++++++++++++++++-----
.../CoreModules/World/Land/LandManagementModule.cs | 1 +
2 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
index 56df3cb..29cac3c 100644
--- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
@@ -1366,6 +1366,13 @@ namespace OpenSim.Data.SQLite
createCol(land, "UserLookAtZ", typeof(Double));
createCol(land, "AuthbuyerID", typeof(String));
createCol(land, "OtherCleanTime", typeof(Int32));
+ createCol(land, "Dwell", typeof(Int32));
+ createCol(land, "MediaType", typeof(String));
+ createCol(land, "MediaDescription", typeof(String));
+ createCol(land, "MediaSize", typeof(String));
+ createCol(land, "MediaLoop", typeof(Boolean));
+ createCol(land, "ObscureMedia", typeof(Boolean));
+ createCol(land, "ObscureMusic", typeof(Boolean));
land.PrimaryKey = new DataColumn[] { land.Columns["UUID"] };
@@ -1781,9 +1788,16 @@ namespace OpenSim.Data.SQLite
newData.PassHours = Convert.ToSingle(row["PassHours"]);
newData.PassPrice = Convert.ToInt32(row["PassPrice"]);
newData.SnapshotID = (UUID)(String)row["SnapshotUUID"];
+ newData.Dwell = Convert.ToInt32(row["Dwell"]);
+ newData.MediaType = (String)row["MediaType"];
+ newData.MediaDescription = (String)row["MediaDescription"];
+ newData.MediaWidth = Convert.ToInt32((((string)row["MediaSize"]).Split(','))[0]);
+ newData.MediaHeight = Convert.ToInt32((((string)row["MediaSize"]).Split(','))[1]);
+ newData.MediaLoop = Convert.ToBoolean(row["MediaLoop"]);
+ newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]);
+ newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]);
try
{
-
newData.UserLocation =
new Vector3(Convert.ToSingle(row["UserLocationX"]), Convert.ToSingle(row["UserLocationY"]),
Convert.ToSingle(row["UserLocationZ"]));
@@ -2195,12 +2209,13 @@ namespace OpenSim.Data.SQLite
row["UserLookAtZ"] = land.UserLookAt.Z;
row["AuthbuyerID"] = land.AuthBuyerID.ToString();
row["OtherCleanTime"] = land.OtherCleanTime;
+ row["Dwell"] = land.Dwell;
row["MediaType"] = land.MediaType;
row["MediaDescription"] = land.MediaDescription;
- row["MediaSize"] = land.MediaWidth.ToString() + "," + land.MediaHeight.ToString();
- row["MediaLoop"] = land.MediaLoop.ToString();
- row["ObscureMusic"] = land.ObscureMusic.ToString();
- row["ObscureMedia"] = land.ObscureMedia.ToString();
+ row["MediaSize"] = String.Format("{0},{1}", land.MediaWidth, land.MediaHeight);
+ row["MediaLoop"] = land.MediaLoop;
+ row["ObscureMusic"] = land.ObscureMusic;
+ row["ObscureMedia"] = land.ObscureMedia;
}
///
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 95edf62..1f8e823 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -962,6 +962,7 @@ namespace OpenSim.Region.CoreModules.World.Land
ILandObject newLand = startLandObject.Copy();
newLand.LandData.Name = newLand.LandData.Name;
newLand.LandData.GlobalID = UUID.Random();
+ newLand.LandData.Dwell = 0;
newLand.SetLandBitmap(newLand.GetSquareLandBitmap(start_x, start_y, end_x, end_y));
--
cgit v1.1
From efae7c6fc27cc43134c531df9cb9b42e210fad5e Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 21 Oct 2012 21:12:34 +0100
Subject: Refactor: Move Dwell reply to a module that can be disabled. The
prior, hardcoded approach disabled the use of non-core dwell tracking
modules.
---
.../Resources/CoreModulePlugin.addin.xml | 1 +
.../Region/CoreModules/World/Land/DwellModule.cs | 110 +++++++++++++++++++++
.../CoreModules/World/Land/LandManagementModule.cs | 12 ---
3 files changed, 111 insertions(+), 12 deletions(-)
create mode 100644 OpenSim/Region/CoreModules/World/Land/DwellModule.cs
diff --git a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml
index 424e0ab..6c73d91 100644
--- a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml
+++ b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml
@@ -15,6 +15,7 @@
+
diff --git a/OpenSim/Region/CoreModules/World/Land/DwellModule.cs b/OpenSim/Region/CoreModules/World/Land/DwellModule.cs
new file mode 100644
index 0000000..d1f05a7
--- /dev/null
+++ b/OpenSim/Region/CoreModules/World/Land/DwellModule.cs
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.org/
+ * See CONTRIBUTORS.TXT for a full list of copyright holders.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the OpenSimulator Project nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Reflection;
+using System.Text;
+using log4net;
+using Nini.Config;
+using OpenMetaverse;
+using OpenMetaverse.StructuredData;
+using OpenMetaverse.Messages.Linden;
+using OpenSim.Framework;
+using OpenSim.Framework.Capabilities;
+using OpenSim.Framework.Console;
+using OpenSim.Framework.Servers;
+using OpenSim.Framework.Servers.HttpServer;
+using OpenSim.Region.CoreModules.Framework.InterfaceCommander;
+using OpenSim.Region.Framework.Interfaces;
+using OpenSim.Region.Framework.Scenes;
+using OpenSim.Region.Physics.Manager;
+using OpenSim.Services.Interfaces;
+using Caps = OpenSim.Framework.Capabilities.Caps;
+using GridRegion = OpenSim.Services.Interfaces.GridRegion;
+
+namespace OpenSim.Region.CoreModules.World.Land
+{
+ public class DwellModule : IDwellModule, INonSharedRegionModule
+ {
+ private Scene m_scene;
+
+ public Type ReplaceableInterface
+ {
+ get { return typeof(IDwellModule); }
+ }
+
+ public string Name
+ {
+ get { return "DwellModule"; }
+ }
+
+ public void Initialise(IConfigSource source)
+ {
+ }
+
+ public void AddRegion(Scene scene)
+ {
+ m_scene = scene;
+
+ m_scene.EventManager.OnNewClient += OnNewClient;
+ }
+
+ public void RegionLoaded(Scene scene)
+ {
+ }
+
+ public void RemoveRegion(Scene scene)
+ {
+ }
+
+ public void Close()
+ {
+ }
+
+ public void OnNewClient(IClientAPI client)
+ {
+ client.OnParcelDwellRequest += ClientOnParcelDwellRequest;
+ }
+
+ private void ClientOnParcelDwellRequest(int localID, IClientAPI client)
+ {
+ ILandObject parcel = m_scene.LandChannel.GetLandObject(localID);
+ if (parcel == null)
+ return;
+
+ client.SendParcelDwellReply(localID, parcel.LandData.GlobalID, parcel.LandData.Dwell);
+ }
+
+ public int GetDwell(UUID parcelID)
+ {
+ return 0;
+ }
+ }
+}
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 1f8e823..e935462 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -207,7 +207,6 @@ namespace OpenSim.Region.CoreModules.World.Land
client.OnParcelInfoRequest += ClientOnParcelInfoRequest;
client.OnParcelDeedToGroup += ClientOnParcelDeedToGroup;
client.OnPreAgentUpdate += ClientOnPreAgentUpdate;
- client.OnParcelDwellRequest += ClientOnParcelDwellRequest;
EntityBase presenceEntity;
if (m_scene.Entities.TryGetValue(client.AgentId, out presenceEntity) && presenceEntity is ScenePresence)
@@ -799,17 +798,6 @@ 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
#region Parcel Modification
--
cgit v1.1