From d3a20a1e9257ecec417e219ebaf079370015f06d Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 21 Mar 2011 21:37:06 +0000
Subject: On initial region registration, if the user chooses the option to
make the region part of an existing estate, then list the existing region
names.
---
OpenSim/Region/Framework/Interfaces/IEstateDataService.cs | 14 ++++++++++++++
OpenSim/Region/Framework/Interfaces/IEstateDataStore.cs | 14 ++++++++++++++
2 files changed, 28 insertions(+)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs b/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs
index 95c9659..12ed9e3 100644
--- a/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs
@@ -36,8 +36,22 @@ namespace OpenSim.Region.Framework.Interfaces
{
EstateSettings LoadEstateSettings(UUID regionID, bool create);
EstateSettings LoadEstateSettings(int estateID);
+
+ ///
+ /// Load/Get all estate settings.
+ ///
+ /// An empty list if no estates were found.
+ List LoadEstateSettingsAll();
+
void StoreEstateSettings(EstateSettings es);
List GetEstates(string search);
+
+ ///
+ /// Get the IDs of all estates.
+ ///
+ /// An empty list if no estates were found.
+ List GetEstatesAll();
+
bool LinkRegion(UUID regionID, int estateID);
List GetRegions(int estateID);
bool DeleteEstate(int estateID);
diff --git a/OpenSim/Region/Framework/Interfaces/IEstateDataStore.cs b/OpenSim/Region/Framework/Interfaces/IEstateDataStore.cs
index 87c7a05..d78ad78 100644
--- a/OpenSim/Region/Framework/Interfaces/IEstateDataStore.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEstateDataStore.cs
@@ -37,8 +37,22 @@ namespace OpenSim.Region.Framework.Interfaces
EstateSettings LoadEstateSettings(UUID regionID, bool create);
EstateSettings LoadEstateSettings(int estateID);
+
+ ///
+ /// Load/Get all estate settings.
+ ///
+ /// An empty list if no estates were found.
+ List LoadEstateSettingsAll();
+
void StoreEstateSettings(EstateSettings es);
List GetEstates(string search);
+
+ ///
+ /// Get the IDs of all estates.
+ ///
+ /// An empty list if no estates were found.
+ List GetEstatesAll();
+
bool LinkRegion(UUID regionID, int estateID);
List GetRegions(int estateID);
bool DeleteEstate(int estateID);
--
cgit v1.1
From 793bfb5a663879296789efa8350df0e9cabb2148 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 21 Mar 2011 22:25:20 +0000
Subject: add method doc to IEstateDataService and IEstateDataStore interfaces
---
.../Framework/Interfaces/IEstateDataService.cs | 44 +++++++++++++++++++-
.../Framework/Interfaces/IEstateDataStore.cs | 48 +++++++++++++++++++++-
2 files changed, 90 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs b/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs
index 12ed9e3..55adef1 100644
--- a/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs
@@ -34,7 +34,19 @@ namespace OpenSim.Region.Framework.Interfaces
{
public interface IEstateDataService
{
+ ///
+ /// Load estate settings for a region.
+ ///
+ ///
+ /// If true, then an estate is created if one is not found. This is used in migration.
+ ///
EstateSettings LoadEstateSettings(UUID regionID, bool create);
+
+ ///
+ /// Load estate settings for an estate ID.
+ ///
+ ///
+ ///
EstateSettings LoadEstateSettings(int estateID);
///
@@ -43,7 +55,19 @@ namespace OpenSim.Region.Framework.Interfaces
/// An empty list if no estates were found.
List LoadEstateSettingsAll();
+ ///
+ /// Store estate settings.
+ ///
+ ///
+ /// This is also called by EstateSettings.Save()
+ ///
void StoreEstateSettings(EstateSettings es);
+
+ ///
+ /// Get estate IDs.
+ ///
+ /// Name of estate to search for. This is the exact name, no parttern matching is done.
+ ///
List GetEstates(string search);
///
@@ -52,8 +76,26 @@ namespace OpenSim.Region.Framework.Interfaces
/// An empty list if no estates were found.
List GetEstatesAll();
+ ///
+ /// Link a region to an estate.
+ ///
+ ///
+ ///
+ /// true if the link succeeded, false otherwise
bool LinkRegion(UUID regionID, int estateID);
+
+ ///
+ /// Get the UUIDs of all the regions in an estate.
+ ///
+ ///
+ ///
List GetRegions(int estateID);
+
+ ///
+ /// Delete an estate
+ ///
+ ///
+ /// true if the delete succeeded, false otherwise
bool DeleteEstate(int estateID);
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Framework/Interfaces/IEstateDataStore.cs b/OpenSim/Region/Framework/Interfaces/IEstateDataStore.cs
index d78ad78..4974d5d 100644
--- a/OpenSim/Region/Framework/Interfaces/IEstateDataStore.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEstateDataStore.cs
@@ -33,9 +33,25 @@ namespace OpenSim.Region.Framework.Interfaces
{
public interface IEstateDataStore
{
+ ///
+ /// Initialise the data store.
+ ///
+ ///
void Initialise(string connectstring);
+ ///
+ /// Load estate settings for a region.
+ ///
+ ///
+ /// If true, then an estate is created if one is not found. This is used in migration.
+ ///
EstateSettings LoadEstateSettings(UUID regionID, bool create);
+
+ ///
+ /// Load estate settings for an estate ID.
+ ///
+ ///
+ ///
EstateSettings LoadEstateSettings(int estateID);
///
@@ -44,7 +60,19 @@ namespace OpenSim.Region.Framework.Interfaces
/// An empty list if no estates were found.
List LoadEstateSettingsAll();
+ ///
+ /// Store estate settings.
+ ///
+ ///
+ /// This is also called by EstateSettings.Save()
+ ///
void StoreEstateSettings(EstateSettings es);
+
+ ///
+ /// Get estate IDs.
+ ///
+ /// Name of estate to search for. This is the exact name, no parttern matching is done.
+ ///
List GetEstates(string search);
///
@@ -53,8 +81,26 @@ namespace OpenSim.Region.Framework.Interfaces
/// An empty list if no estates were found.
List GetEstatesAll();
+ ///
+ /// Link a region to an estate.
+ ///
+ ///
+ ///
+ /// true if the link succeeded, false otherwise
bool LinkRegion(UUID regionID, int estateID);
+
+ ///
+ /// Get the UUIDs of all the regions in an estate.
+ ///
+ ///
+ ///
List GetRegions(int estateID);
+
+ ///
+ /// Delete an estate
+ ///
+ ///
+ /// true if the delete succeeded, false otherwise
bool DeleteEstate(int estateID);
}
-}
+}
\ No newline at end of file
--
cgit v1.1
From 2d1f0d224c355e92997643cf849b8e9774dddbad Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 21 Mar 2011 22:27:16 +0000
Subject: minor: slightly adjust previous method doc.
---
OpenSim/Region/Framework/Interfaces/IEstateDataService.cs | 2 +-
OpenSim/Region/Framework/Interfaces/IEstateDataStore.cs | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs b/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs
index 55adef1..38c10a6 100644
--- a/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs
@@ -38,7 +38,7 @@ namespace OpenSim.Region.Framework.Interfaces
/// Load estate settings for a region.
///
///
- /// If true, then an estate is created if one is not found. This is used in migration.
+ /// If true, then an estate is created if one is not found.
///
EstateSettings LoadEstateSettings(UUID regionID, bool create);
diff --git a/OpenSim/Region/Framework/Interfaces/IEstateDataStore.cs b/OpenSim/Region/Framework/Interfaces/IEstateDataStore.cs
index 4974d5d..c82661d 100644
--- a/OpenSim/Region/Framework/Interfaces/IEstateDataStore.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEstateDataStore.cs
@@ -43,7 +43,7 @@ namespace OpenSim.Region.Framework.Interfaces
/// Load estate settings for a region.
///
///
- /// If true, then an estate is created if one is not found. This is used in migration.
+ /// If true, then an estate is created if one is not found.
///
EstateSettings LoadEstateSettings(UUID regionID, bool create);
--
cgit v1.1
From 7acade00b9b34403e63656d5e2efc94322342653 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 21 Mar 2011 23:26:35 +0000
Subject: On initial setup, include estate and regions names in questions to
make it clearer what they relate to.
---
OpenSim/Region/Framework/Scenes/Scene.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 1a6a70b..4d2519d 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1109,7 +1109,7 @@ namespace OpenSim.Region.Framework.Scenes
//
while (m_regInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null)
{
- MainConsole.Instance.Output("The current estate has no owner set.");
+ MainConsole.Instance.OutputFormat("Estate {0} has no owner set.", m_regInfo.EstateSettings.EstateName);
List excluded = new List(new char[1]{' '});
string first = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded);
string last = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded);
--
cgit v1.1
From b34743e5fe6b0783caa62c014ff86e2ec76c8184 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 22 Mar 2011 23:47:36 +0000
Subject: Add an initial confidence-building TestAddObject() for prim counts.
---
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 734ba22..eca2786 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -627,7 +627,7 @@ namespace OpenSim.Region.Framework.Scenes
if (!Entities.Remove(agentID))
{
m_log.WarnFormat(
- "[SCENE]: Tried to remove non-existent scene presence with agent ID {0} from scene Entities list",
+ "[SCENEGRAPH]: Tried to remove non-existent scene presence with agent ID {0} from scene Entities list",
agentID);
}
@@ -650,7 +650,7 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
- m_log.WarnFormat("[SCENE]: Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID);
+ m_log.WarnFormat("[SCENEGRAPH]: Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID);
}
}
}
@@ -1079,7 +1079,8 @@ namespace OpenSim.Region.Framework.Scenes
catch (Exception e)
{
// Catch it and move on. This includes situations where splist has inconsistent info
- m_log.WarnFormat("[SCENE]: Problem processing action in ForEachSOG: ", e.ToString());
+ m_log.WarnFormat(
+ "[SCENEGRAPH]: Problem processing action in ForEachSOG: {0} {1}", e.Message, e.StackTrace);
}
}
}
@@ -1103,8 +1104,8 @@ namespace OpenSim.Region.Framework.Scenes
}
catch (Exception e)
{
- m_log.Info("[BUG] in " + m_parentScene.RegionInfo.RegionName + ": " + e.ToString());
- m_log.Info("[BUG] Stack Trace: " + e.StackTrace);
+ m_log.Info("[SCENEGRAPH]: Error in " + m_parentScene.RegionInfo.RegionName + ": " + e.ToString());
+ m_log.Info("[SCENEGRAPH]: Stack Trace: " + e.StackTrace);
}
});
Parallel.ForEach(GetScenePresences(), protectedAction);
@@ -1119,7 +1120,7 @@ namespace OpenSim.Region.Framework.Scenes
}
catch (Exception e)
{
- m_log.Info("[BUG] in " + m_parentScene.RegionInfo.RegionName + ": " + e.ToString());
+ m_log.Error("[SCENEGRAPH]: Error in " + m_parentScene.RegionInfo.RegionName + ": " + e.ToString());
}
}
}
--
cgit v1.1
From d011896341d09ce6c10a801264e663b6a19f0b48 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 23 Mar 2011 21:50:56 +0000
Subject: Add generic EventManager.OnObjectAddedToScene and get PrimCountModule
to listen for that rather than EventManager.OnParcelPrimCountAdd
OnParcelPrimCountAdd had the wrong semantics for the PrimCountModule - it was invoked for every entity in the scene, not just new ones, which would screw up the untainted count.
Extend automated test for this scenario.
---
OpenSim/Region/Framework/Scenes/EventManager.cs | 30 +++++++++++++++++++++++++
OpenSim/Region/Framework/Scenes/Scene.cs | 18 ++++++++++++---
2 files changed, 45 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index c321a15..fd62535 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -242,7 +242,15 @@ namespace OpenSim.Region.Framework.Scenes
public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID);
public event EstateToolsSunUpdate OnEstateToolsSunUpdate;
+
+ ///
+ /// Triggered when an object is added to the scene.
+ ///
+ public event Action OnObjectAddedToScene;
+ ///
+ /// Triggered when an object is removed from the scene.
+ ///
public delegate void ObjectBeingRemovedFromScene(SceneObjectGroup obj);
public event ObjectBeingRemovedFromScene OnObjectBeingRemovedFromScene;
@@ -345,6 +353,7 @@ namespace OpenSim.Region.Framework.Scenes
public delegate void Attach(uint localID, UUID itemID, UUID avatarID);
public event Attach OnAttach;
+
///
/// Called immediately after an object is loaded from storage.
///
@@ -800,6 +809,27 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+ public void TriggerObjectAddedToScene(SceneObjectGroup obj)
+ {
+ Action handler = OnObjectAddedToScene;
+ if (handler != null)
+ {
+ foreach (Action d in handler.GetInvocationList())
+ {
+ try
+ {
+ d(obj);
+ }
+ catch (Exception e)
+ {
+ m_log.ErrorFormat(
+ "[EVENT MANAGER]: Delegate for TriggerObjectAddedToScene failed - continuing. {0} {1}",
+ e.Message, e.StackTrace);
+ }
+ }
+ }
+ }
+
public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj)
{
ObjectBeingRemovedFromScene handlerObjectBeingRemovedFromScene = OnObjectBeingRemovedFromScene;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 4d2519d..d407a6f 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1956,8 +1956,14 @@ namespace OpenSim.Region.Framework.Scenes
/// If false, it is left to the caller to schedule the update
///
public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates)
- {
- return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, sendClientUpdates);
+ {
+ if (m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, sendClientUpdates))
+ {
+ EventManager.TriggerObjectAddedToScene(sceneObject);
+ return true;
+ }
+
+ return false;
}
///
@@ -1974,7 +1980,13 @@ namespace OpenSim.Region.Framework.Scenes
public bool AddNewSceneObject(
SceneObjectGroup sceneObject, bool attachToBackup, Vector3 pos, Quaternion rot, Vector3 vel)
{
- return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, pos, rot, vel);
+ if (m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, pos, rot, vel))
+ {
+ EventManager.TriggerObjectAddedToScene(sceneObject);
+ return true;
+ }
+
+ return false;
}
///
--
cgit v1.1
From 7f5019b0f23959ca049f87b596bc2bd47725eb0d Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 25 Mar 2011 21:47:54 +0000
Subject: Add ILandObject.IPrimCounts for the new prim count module.
Not functional yet, but tests now act against this object rather than interrogating the module directly
---
OpenSim/Region/Framework/Interfaces/ILandObject.cs | 5 +++++
1 file changed, 5 insertions(+)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Interfaces/ILandObject.cs b/OpenSim/Region/Framework/Interfaces/ILandObject.cs
index eeb9d3a..9c0abde 100644
--- a/OpenSim/Region/Framework/Interfaces/ILandObject.cs
+++ b/OpenSim/Region/Framework/Interfaces/ILandObject.cs
@@ -46,6 +46,11 @@ namespace OpenSim.Region.Framework.Interfaces
UUID RegionUUID { get; }
///
+ /// Prim counts for this land object.
+ ///
+ IPrimCounts PrimCounts { get; set; }
+
+ ///
/// The start point for the land object. This is the western-most point as one scans land working from
/// north to south.
///
--
cgit v1.1
From 6ae04448f73afdca791ea185fdc0e9c062dea87b Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 25 Mar 2011 23:05:51 +0000
Subject: Start using IPrimCounts populated by PrimCountModule instead of
LandData counts populated by LandManagementModule.
In order to pass ILandObject into IClientAPI.SendLandProperties(), had to push ILandObject and IPrimCounts into OpenSim.Framework from OpenSim.Region.Framework.Interfaces, in order to avoid ci
Counts are showing odd behaviour at the moment, this will be addressed shortly.
---
.../Region/Framework/Interfaces/ILandChannel.cs | 91 ----------------
OpenSim/Region/Framework/Interfaces/ILandObject.cs | 117 ---------------------
.../Framework/Interfaces/IPrimCountModule.cs | 16 +--
3 files changed, 1 insertion(+), 223 deletions(-)
delete mode 100644 OpenSim/Region/Framework/Interfaces/ILandChannel.cs
delete mode 100644 OpenSim/Region/Framework/Interfaces/ILandObject.cs
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Interfaces/ILandChannel.cs b/OpenSim/Region/Framework/Interfaces/ILandChannel.cs
deleted file mode 100644
index 30bae16..0000000
--- a/OpenSim/Region/Framework/Interfaces/ILandChannel.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * 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.Collections.Generic;
-using OpenMetaverse;
-using OpenSim.Framework;
-
-namespace OpenSim.Region.Framework.Interfaces
-{
- public interface ILandChannel
- {
- ///
- /// Get all parcels
- ///
- ///
- List AllParcels();
-
- ///
- /// Get the parcel at the specified point
- ///
- /// Value between 0 - 256 on the x axis of the point
- /// Value between 0 - 256 on the y axis of the point
- /// Land object at the point supplied
- ILandObject GetLandObject(int x, int y);
-
- ///
- /// Get the parcel at the specified point
- ///
- /// Value between 0 - 256 on the x axis of the point
- /// Value between 0 - 256 on the y axis of the point
- /// Land object at the point supplied
- ILandObject GetLandObject(float x, float y);
-
- ///
- /// Get the parcels near the specified point
- ///
- ///
- ///
- List ParcelsNearPoint(Vector3 position);
-
- ///
- /// Get the parcel given the land's local id.
- ///
- ///
- ///
- ILandObject GetLandObject(int localID);
-
- ///
- /// Clear the land channel of all parcels.
- ///
- ///
- /// If true, set up a default parcel covering the whole region owned by the estate owner.
- ///
- void Clear(bool setupDefaultParcel);
-
- bool IsLandPrimCountTainted();
- bool IsForcefulBansAllowed();
- void UpdateLandObject(int localID, LandData data);
- void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient);
- void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel);
- void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel);
- void SetParcelOtherCleanTime(IClientAPI remoteClient, int localID, int otherCleanTime);
-
- void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id);
- void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id);
- }
-}
diff --git a/OpenSim/Region/Framework/Interfaces/ILandObject.cs b/OpenSim/Region/Framework/Interfaces/ILandObject.cs
deleted file mode 100644
index 9c0abde..0000000
--- a/OpenSim/Region/Framework/Interfaces/ILandObject.cs
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * 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.Collections.Generic;
-using OpenMetaverse;
-using OpenSim.Framework;
-using OpenSim.Region.Framework.Scenes;
-
-namespace OpenSim.Region.Framework.Interfaces
-{
- public delegate int overrideParcelMaxPrimCountDelegate(ILandObject obj);
- public delegate int overrideSimulatorMaxPrimCountDelegate(ILandObject obj);
-
- public interface ILandObject
- {
- int GetParcelMaxPrimCount(ILandObject thisObject);
- int GetSimulatorMaxPrimCount(ILandObject thisObject);
- int GetPrimsFree();
-
- LandData LandData { get; set; }
- bool[,] LandBitmap { get; set; }
- UUID RegionUUID { get; }
-
- ///
- /// Prim counts for this land object.
- ///
- IPrimCounts PrimCounts { get; set; }
-
- ///
- /// The start point for the land object. This is the western-most point as one scans land working from
- /// north to south.
- ///
- Vector3 StartPoint { get; }
-
- ///
- /// The end point for the land object. This is the eastern-most point as one scans land working from
- /// south to north.
- ///
- Vector3 EndPoint { get; }
-
- bool ContainsPoint(int x, int y);
-
- ILandObject Copy();
-
- void SendLandUpdateToAvatarsOverMe();
-
- void SendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client);
- void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client);
- bool IsEitherBannedOrRestricted(UUID avatar);
- bool IsBannedFromLand(UUID avatar);
- bool IsRestrictedFromLand(UUID avatar);
- void SendLandUpdateToClient(IClientAPI remote_client);
- void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client);
- List CreateAccessListArrayByFlag(AccessList flag);
- void SendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, IClientAPI remote_client);
- void UpdateAccessList(uint flags, UUID transactionID, int sequenceID, int sections, List entries, IClientAPI remote_client);
- void UpdateLandBitmapByteArray();
- void SetLandBitmapFromByteArray();
- bool[,] GetLandBitmap();
- void ForceUpdateLandInfo();
- void SetLandBitmap(bool[,] bitmap);
-
- bool[,] BasicFullRegionLandBitmap();
- bool[,] GetSquareLandBitmap(int start_x, int start_y, int end_x, int end_y);
- bool[,] ModifyLandBitmapSquare(bool[,] land_bitmap, int start_x, int start_y, int end_x, int end_y, bool set_value);
- bool[,] MergeLandBitmaps(bool[,] bitmap_base, bool[,] bitmap_add);
- void SendForceObjectSelect(int local_id, int request_type, List returnIDs, IClientAPI remote_client);
- void SendLandObjectOwners(IClientAPI remote_client);
- void ReturnObject(SceneObjectGroup obj);
- void ReturnLandObjects(uint type, UUID[] owners, UUID[] tasks, IClientAPI remote_client);
- void ResetLandPrimCounts();
- void AddPrimToCount(SceneObjectGroup obj);
- void RemovePrimFromCount(SceneObjectGroup obj);
- void UpdateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area);
-
- void DeedToGroup(UUID groupID);
-
- void SetParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel);
- void SetSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel);
-
- ///
- /// Set the media url for this land parcel
- ///
- ///
- void SetMediaUrl(string url);
-
- ///
- /// Set the music url for this land parcel
- ///
- ///
- void SetMusicUrl(string url);
- }
-}
diff --git a/OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs b/OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs
index 65158e1..d63da2e 100644
--- a/OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs
@@ -38,18 +38,4 @@ namespace OpenSim.Region.Framework.Interfaces
IPrimCounts GetPrimCounts(UUID parcelID);
}
-
- public interface IPrimCounts
- {
- int Owner { get; }
- int Group { get; }
- int Others { get; }
- int Simulator { get; }
- IUserPrimCounts Users { get; }
- }
-
- public interface IUserPrimCounts
- {
- int this[UUID agentID] { get; }
- }
-}
+}
\ No newline at end of file
--
cgit v1.1
From f30bf429c274c9d6d0cfc99513820f759ca94d3e Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 26 Mar 2011 00:42:48 +0000
Subject: refactor: rename SOG collections in SceneGraph to make it clearer
that they are indexing each part's UUID, not just the root part.
---
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 60 +++++++++++++--------------
1 file changed, 30 insertions(+), 30 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index eca2786..345ed7a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -89,8 +89,8 @@ namespace OpenSim.Region.Framework.Scenes
protected internal PhysicsScene _PhyScene;
- protected internal Dictionary SceneObjectGroupsByLocalID = new Dictionary();
- protected internal Dictionary SceneObjectGroupsByFullID = new Dictionary();
+ protected internal Dictionary SceneObjectGroupsByLocalPartID = new Dictionary();
+ protected internal Dictionary SceneObjectGroupsByFullPartID = new Dictionary();
private Object m_updateLock = new Object();
@@ -131,10 +131,10 @@ namespace OpenSim.Region.Framework.Scenes
m_scenePresenceArray = newlist;
}
- lock (SceneObjectGroupsByFullID)
- SceneObjectGroupsByFullID.Clear();
- lock (SceneObjectGroupsByLocalID)
- SceneObjectGroupsByLocalID.Clear();
+ lock (SceneObjectGroupsByFullPartID)
+ SceneObjectGroupsByFullPartID.Clear();
+ lock (SceneObjectGroupsByLocalPartID)
+ SceneObjectGroupsByLocalPartID.Clear();
Entities.Clear();
}
@@ -384,18 +384,18 @@ namespace OpenSim.Region.Framework.Scenes
if (OnObjectCreate != null)
OnObjectCreate(sceneObject);
- lock (SceneObjectGroupsByFullID)
+ lock (SceneObjectGroupsByFullPartID)
{
- SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject;
+ SceneObjectGroupsByFullPartID[sceneObject.UUID] = sceneObject;
foreach (SceneObjectPart part in children)
- SceneObjectGroupsByFullID[part.UUID] = sceneObject;
+ SceneObjectGroupsByFullPartID[part.UUID] = sceneObject;
}
- lock (SceneObjectGroupsByLocalID)
+ lock (SceneObjectGroupsByLocalPartID)
{
- SceneObjectGroupsByLocalID[sceneObject.LocalId] = sceneObject;
+ SceneObjectGroupsByLocalPartID[sceneObject.LocalId] = sceneObject;
foreach (SceneObjectPart part in children)
- SceneObjectGroupsByLocalID[part.LocalId] = sceneObject;
+ SceneObjectGroupsByLocalPartID[part.LocalId] = sceneObject;
}
return true;
@@ -427,20 +427,20 @@ namespace OpenSim.Region.Framework.Scenes
if (OnObjectRemove != null)
OnObjectRemove(Entities[uuid]);
- lock (SceneObjectGroupsByFullID)
+ lock (SceneObjectGroupsByFullPartID)
{
SceneObjectPart[] parts = grp.Parts;
for (int i = 0; i < parts.Length; i++)
- SceneObjectGroupsByFullID.Remove(parts[i].UUID);
- SceneObjectGroupsByFullID.Remove(grp.RootPart.UUID);
+ SceneObjectGroupsByFullPartID.Remove(parts[i].UUID);
+ SceneObjectGroupsByFullPartID.Remove(grp.RootPart.UUID);
}
- lock (SceneObjectGroupsByLocalID)
+ lock (SceneObjectGroupsByLocalPartID)
{
SceneObjectPart[] parts = grp.Parts;
for (int i = 0; i < parts.Length; i++)
- SceneObjectGroupsByLocalID.Remove(parts[i].LocalId);
- SceneObjectGroupsByLocalID.Remove(grp.RootPart.LocalId);
+ SceneObjectGroupsByLocalPartID.Remove(parts[i].LocalId);
+ SceneObjectGroupsByLocalPartID.Remove(grp.RootPart.LocalId);
}
return Entities.Remove(uuid);
@@ -854,14 +854,14 @@ namespace OpenSim.Region.Framework.Scenes
//m_log.DebugFormat("Entered GetGroupByPrim with localID {0}", localID);
SceneObjectGroup sog;
- lock (SceneObjectGroupsByLocalID)
- SceneObjectGroupsByLocalID.TryGetValue(localID, out sog);
+ lock (SceneObjectGroupsByLocalPartID)
+ SceneObjectGroupsByLocalPartID.TryGetValue(localID, out sog);
if (sog != null)
{
if (sog.HasChildPrim(localID))
return sog;
- SceneObjectGroupsByLocalID.Remove(localID);
+ SceneObjectGroupsByLocalPartID.Remove(localID);
}
EntityBase[] entityList = GetEntities();
@@ -873,8 +873,8 @@ namespace OpenSim.Region.Framework.Scenes
sog = (SceneObjectGroup)ent;
if (sog.HasChildPrim(localID))
{
- lock (SceneObjectGroupsByLocalID)
- SceneObjectGroupsByLocalID[localID] = sog;
+ lock (SceneObjectGroupsByLocalPartID)
+ SceneObjectGroupsByLocalPartID[localID] = sog;
return sog;
}
}
@@ -891,16 +891,16 @@ namespace OpenSim.Region.Framework.Scenes
private SceneObjectGroup GetGroupByPrim(UUID fullID)
{
SceneObjectGroup sog;
- lock (SceneObjectGroupsByFullID)
- SceneObjectGroupsByFullID.TryGetValue(fullID, out sog);
+ lock (SceneObjectGroupsByFullPartID)
+ SceneObjectGroupsByFullPartID.TryGetValue(fullID, out sog);
if (sog != null)
{
if (sog.ContainsPart(fullID))
return sog;
- lock (SceneObjectGroupsByFullID)
- SceneObjectGroupsByFullID.Remove(fullID);
+ lock (SceneObjectGroupsByFullPartID)
+ SceneObjectGroupsByFullPartID.Remove(fullID);
}
EntityBase[] entityList = GetEntities();
@@ -911,8 +911,8 @@ namespace OpenSim.Region.Framework.Scenes
sog = (SceneObjectGroup)ent;
if (sog.HasChildPrim(fullID))
{
- lock (SceneObjectGroupsByFullID)
- SceneObjectGroupsByFullID[fullID] = sog;
+ lock (SceneObjectGroupsByFullPartID)
+ SceneObjectGroupsByFullPartID[fullID] = sog;
return sog;
}
}
@@ -1069,7 +1069,7 @@ namespace OpenSim.Region.Framework.Scenes
///
protected internal void ForEachSOG(Action action)
{
- List objlist = new List(SceneObjectGroupsByFullID.Values);
+ List objlist = new List(SceneObjectGroupsByFullPartID.Values);
foreach (SceneObjectGroup obj in objlist)
{
try
--
cgit v1.1
From 26d16567e1e2bf28a3eafce6d3acf8d9646aaf84 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 26 Mar 2011 00:53:19 +0000
Subject: Make SceneGraph.ForEachSOG() execute once for each SOG, not once for
each prim (e.g. a SOG with 3 prims would have the action executed three
times).
To do this, a new SceneObjectGroupsByFullID index in SceneGraph which just index's prims by their root part UUID, in order to avoid the inefficiency of filtering existing lists.
Existing callers to SceneGraph.ForEachSOG() did not fail due to the multiple per SOG action executions - they were probably just much less efficient.
Code suggests that no callers expected ForEachSOG() to execute actions on sog multiple times
---
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 30 ++++++++++++++++++++++-----
1 file changed, 25 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 345ed7a..1621398 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -88,9 +88,21 @@ namespace OpenSim.Region.Framework.Scenes
protected internal object m_syncRoot = new object();
protected internal PhysicsScene _PhyScene;
-
- protected internal Dictionary SceneObjectGroupsByLocalPartID = new Dictionary();
+
+ ///
+ /// Index the SceneObjectGroup for each part by the root part's UUID.
+ ///
+ protected internal Dictionary SceneObjectGroupsByFullID = new Dictionary();
+
+ ///
+ /// Index the SceneObjectGroup for each part by that part's UUID.
+ ///
protected internal Dictionary SceneObjectGroupsByFullPartID = new Dictionary();
+
+ ///
+ /// Index the SceneObjectGroup for each part by that part's local ID.
+ ///
+ protected internal Dictionary SceneObjectGroupsByLocalPartID = new Dictionary();
private Object m_updateLock = new Object();
@@ -131,6 +143,8 @@ namespace OpenSim.Region.Framework.Scenes
m_scenePresenceArray = newlist;
}
+ lock (SceneObjectGroupsByFullID)
+ SceneObjectGroupsByFullID.Clear();
lock (SceneObjectGroupsByFullPartID)
SceneObjectGroupsByFullPartID.Clear();
lock (SceneObjectGroupsByLocalPartID)
@@ -384,6 +398,9 @@ namespace OpenSim.Region.Framework.Scenes
if (OnObjectCreate != null)
OnObjectCreate(sceneObject);
+ lock (SceneObjectGroupsByFullID)
+ SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject;
+
lock (SceneObjectGroupsByFullPartID)
{
SceneObjectGroupsByFullPartID[sceneObject.UUID] = sceneObject;
@@ -426,6 +443,9 @@ namespace OpenSim.Region.Framework.Scenes
if (OnObjectRemove != null)
OnObjectRemove(Entities[uuid]);
+
+ lock (SceneObjectGroupsByFullID)
+ SceneObjectGroupsByFullID.Remove(grp.UUID);
lock (SceneObjectGroupsByFullPartID)
{
@@ -1064,12 +1084,13 @@ namespace OpenSim.Region.Framework.Scenes
}
///
- /// Performs action on all scene object groups.
+ /// Performs action once on all scene object groups.
///
///
protected internal void ForEachSOG(Action action)
{
- List objlist = new List(SceneObjectGroupsByFullPartID.Values);
+ // FIXME: Need to lock here, really.
+ List objlist = new List(SceneObjectGroupsByFullID.Values);
foreach (SceneObjectGroup obj in objlist)
{
try
@@ -1084,7 +1105,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
-
///
/// Performs action on all scene presences. This can ultimately run the actions in parallel but
--
cgit v1.1
From bfd9cc44b40e64af3c7504d43a15b7e1b44070a0 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 26 Mar 2011 02:05:53 +0000
Subject: When an object is duplicated, add the dupe to the uuid/local id
indexes as well as the basic entities list.
Added a prim counts test to reinforce this - shift-copy was no incrementing prim count. This will sometime become a basic scene test.
New code needs to be refactored so we just call SceneGraph.AddSceneObject(). This will happen in the near future.
With this, basic owner prim counts on a single parcel appear to be working fine (with the same previous existing taint calls as used by the land management module).
More work to do.
---
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 30 ++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 1621398..60855b2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -363,6 +363,10 @@ namespace OpenSim.Region.Framework.Scenes
if (Entities.ContainsKey(sceneObject.UUID))
return false;
+
+// m_log.DebugFormat(
+// "[SCENEGRAPH]: Adding scene object {0} {1}, with {2} parts on {3}",
+// sceneObject.Name, sceneObject.UUID, sceneObject.Parts.Length, m_parentScene.RegionInfo.RegionName);
SceneObjectPart[] children = sceneObject.Parts;
@@ -1798,7 +1802,10 @@ namespace OpenSim.Region.Framework.Scenes
///
public SceneObjectGroup DuplicateObject(uint originalPrimID, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot)
{
- //m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID);
+// m_log.DebugFormat(
+// "[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}",
+// originalPrimID, offset, AgentID);
+
SceneObjectGroup original = GetGroupByPrim(originalPrimID);
if (original != null)
{
@@ -1829,7 +1836,28 @@ namespace OpenSim.Region.Framework.Scenes
copy.RootPart.SalePrice = 10;
}
+ // FIXME: This section needs to be refactored so that it just calls AddSceneObject()
Entities.Add(copy);
+
+ lock (SceneObjectGroupsByFullID)
+ SceneObjectGroupsByFullID[copy.UUID] = copy;
+
+ SceneObjectPart[] children = copy.Parts;
+
+ lock (SceneObjectGroupsByFullPartID)
+ {
+ SceneObjectGroupsByFullPartID[copy.UUID] = copy;
+ foreach (SceneObjectPart part in children)
+ SceneObjectGroupsByFullPartID[part.UUID] = copy;
+ }
+
+ lock (SceneObjectGroupsByLocalPartID)
+ {
+ SceneObjectGroupsByLocalPartID[copy.LocalId] = copy;
+ foreach (SceneObjectPart part in children)
+ SceneObjectGroupsByLocalPartID[copy.LocalId] = copy;
+ }
+ // PROBABLE END OF FIXME
// Since we copy from a source group that is in selected
// state, but the copy is shown deselected in the viewer,
--
cgit v1.1
From 8022400bd4c852c3faf0db61006a2c60f5200342 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 31 Mar 2011 22:16:09 +0100
Subject: Remove unused Datastore parameter from RegionInfo (legacy from early
2008)
---
OpenSim/Region/Framework/Scenes/Scene.cs | 1 -
OpenSim/Region/Framework/Scenes/SceneBase.cs | 2 --
2 files changed, 3 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index d407a6f..353b7c2 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -563,7 +563,6 @@ namespace OpenSim.Region.Framework.Scenes
m_regInfo = regInfo;
m_regionHandle = m_regInfo.RegionHandle;
m_regionName = m_regInfo.RegionName;
- m_datastore = m_regInfo.DataStore;
m_lastUpdate = Util.EnvironmentTickCount();
m_physicalPrim = physicalPrim;
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs
index f343bc8..c4547f2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs
@@ -136,8 +136,6 @@ namespace OpenSim.Region.Framework.Scenes
get { return m_permissions; }
}
- protected string m_datastore;
-
/* Used by the loadbalancer plugin on GForge */
protected RegionStatus m_regStatus;
public RegionStatus RegionStatus
--
cgit v1.1
From 3a113f9902b859d11c200f9b0db06c2317eb53cc Mon Sep 17 00:00:00 2001
From: Melanie
Date: Fri, 1 Apr 2011 22:04:29 +0100
Subject: A stab at making CHANGED_OWNER work
---
OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index fa404c0..3281eab 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -175,12 +175,12 @@ namespace OpenSim.Region.Framework.Scenes
foreach (TaskInventoryItem item in items)
{
if (ownerId != item.OwnerID)
- {
item.LastOwnerID = item.OwnerID;
- item.OwnerID = ownerId;
- item.PermsMask = 0;
- item.PermsGranter = UUID.Zero;
- }
+
+ item.OwnerID = ownerId;
+ item.PermsMask = 0;
+ item.PermsGranter = UUID.Zero;
+ item.OwnerChanged = true;
}
}
--
cgit v1.1
From e8e940e33e458622ef3c1f6fbd206fcf13b2f700 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 3 Apr 2011 13:50:19 +0200
Subject: Make CHANGED_OWNER work for deeding and god-mode in-world change
---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index fcbcf59..73dd531 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2069,7 +2069,10 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart[] partList = sog.Parts;
foreach (SceneObjectPart child in partList)
+ {
child.Inventory.ChangeInventoryOwner(ownerID);
+ child.TriggerScriptChangedEvent(Changed.OWNER);
+ }
}
else
{
@@ -2085,6 +2088,7 @@ namespace OpenSim.Region.Framework.Scenes
{
child.LastOwnerID = child.OwnerID;
child.Inventory.ChangeInventoryOwner(groupID);
+ child.TriggerScriptChangedEvent(Changed.OWNER);
}
sog.SetOwnerId(groupID);
--
cgit v1.1
From b385d4aa036ad7bf58d033a9923452535c82ef69 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 7 Oct 2010 01:13:17 +0200
Subject: Implement taking of coalesced objects. WARNING!!!!! You can TAKE
them, but you can't REZ them again. Only the first of the contained objects
will rez, the rest is inaccessible until rezzing them is implemented. Also,
rotations are not explicitly stored. This MAY work. Or not.
---
OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs | 4 ++--
OpenSim/Region/Framework/Scenes/Scene.cs | 9 +++++++++
2 files changed, 11 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
index 64567db..8feb022 100644
--- a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
+++ b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
@@ -137,7 +137,7 @@ namespace OpenSim.Region.Framework.Scenes
x = m_inventoryDeletes.Dequeue();
m_log.DebugFormat(
- "[ASYNC DELETER]: Sending object to user's inventory, {0} item(s) remaining.", left);
+ "[ASYNC DELETER]: Sending object to user's inventory, action {1}, count {2}, {0} item(s) remaining.", left, x.action, x.objectGroups.Count);
try
{
@@ -177,4 +177,4 @@ namespace OpenSim.Region.Framework.Scenes
return false;
}
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 353b7c2..35a798e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -4865,8 +4865,17 @@ namespace OpenSim.Region.Framework.Scenes
{
float ominX, ominY, ominZ, omaxX, omaxY, omaxZ;
+ Vector3 vec = g.AbsolutePosition;
+
g.GetAxisAlignedBoundingBoxRaw(out ominX, out omaxX, out ominY, out omaxY, out ominZ, out omaxZ);
+ ominX += vec.X;
+ omaxX += vec.X;
+ ominY += vec.Y;
+ omaxY += vec.Y;
+ ominZ += vec.Z;
+ omaxZ += vec.Z;
+
if (minX > ominX)
minX = ominX;
if (minY > ominY)
--
cgit v1.1
From f58941e89f122c2e1fd54a2f817fb8114e6c80ed Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 5 Apr 2011 01:30:13 +0100
Subject: Make the "All Estates" option work from the client (this makes chosen
changes to all the estates that the user owns).
This applies to adding/removing estate users, groups, managers and bans.
This is the application of the AllEstates_0.5.patch from http://opensimulator.org/mantis/view.php?id=5420
Thanks very much, Snoopy!
---
OpenSim/Region/Framework/Interfaces/IEstateDataService.cs | 6 ++++++
OpenSim/Region/Framework/Interfaces/IEstateDataStore.cs | 6 ++++++
2 files changed, 12 insertions(+)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs b/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs
index 38c10a6..7066cf2 100644
--- a/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs
@@ -71,6 +71,12 @@ namespace OpenSim.Region.Framework.Interfaces
List GetEstates(string search);
///
+ /// Get the IDs of all estates owned by the given user.
+ ///
+ /// An empty list if no estates were found.
+ List GetEstatesByOwner(UUID ownerID);
+
+ ///
/// Get the IDs of all estates.
///
/// An empty list if no estates were found.
diff --git a/OpenSim/Region/Framework/Interfaces/IEstateDataStore.cs b/OpenSim/Region/Framework/Interfaces/IEstateDataStore.cs
index c82661d..d790a30 100644
--- a/OpenSim/Region/Framework/Interfaces/IEstateDataStore.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEstateDataStore.cs
@@ -74,6 +74,12 @@ namespace OpenSim.Region.Framework.Interfaces
/// Name of estate to search for. This is the exact name, no parttern matching is done.
///
List GetEstates(string search);
+
+ ///
+ /// Get the IDs of all estates owned by the given user.
+ ///
+ /// An empty list if no estates were found.
+ List GetEstatesByOwner(UUID ownerID);
///
/// Get the IDs of all estates.
--
cgit v1.1
From 0e465da187c93e7ff21f91742f75ee9f3b76b04e Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 5 Apr 2011 21:25:54 +0100
Subject: remove now unused individual LandData prim counts.
However, the calls to the land management module to record prims need to remain, since they were also being used to return owner object lists, etc.
This is probably why prim counts were being done there in the first place.
---
OpenSim/Region/Framework/Scenes/Scene.cs | 14 --------------
1 file changed, 14 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 35a798e..a62d6d7 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1428,20 +1428,6 @@ namespace OpenSim.Region.Framework.Scenes
}
///
- /// Recount SceneObjectPart in parcel aabb
- ///
- private void UpdateLand()
- {
- if (LandChannel != null)
- {
- if (LandChannel.IsLandPrimCountTainted())
- {
- EventManager.TriggerParcelPrimCountUpdate();
- }
- }
- }
-
- ///
/// Update the terrain if it needs to be updated.
///
private void UpdateTerrain()
--
cgit v1.1
From 2497962360258eb6cb1a78c7b4d5227d88eabb87 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 5 Apr 2011 22:25:00 +0100
Subject: Change some text to make the autoreturn mechanism more obvious, and
align with the fact that it's one word rather than two.
---
OpenSim/Region/Framework/Scenes/Scene.cs | 5 ++++-
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 6 ++++--
2 files changed, 8 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index a62d6d7..f0acc38 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1521,8 +1521,11 @@ namespace OpenSim.Region.Framework.Scenes
}
///
- /// Return object to avatar Message
+ /// Tell an agent that their object has been returned.
///
+ ///
+ /// The actual return is handled by the caller.
+ ///
/// Avatar Unique Id
/// Name of object returned
/// Location of object returned
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index f17fb28..a7107f0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1313,8 +1313,10 @@ namespace OpenSim.Region.Framework.Scenes
parcel.LandData.OtherCleanTime)
{
DetachFromBackup();
- m_log.InfoFormat("[SCENE]: Returning object {0} due to parcel auto return", RootPart.UUID.ToString());
- m_scene.AddReturn(OwnerID, Name, AbsolutePosition, "parcel auto return");
+ m_log.DebugFormat(
+ "[SCENE OBJECT GROUP]: Returning object {0} due to parcel autoreturn",
+ RootPart.UUID);
+ m_scene.AddReturn(OwnerID, Name, AbsolutePosition, "parcel autoreturn");
m_scene.DeRezObjects(null, new List() { RootPart.LocalId }, UUID.Zero,
DeRezAction.Return, UUID.Zero);
--
cgit v1.1
From 8318915d7ec7ed3bd25ff1027a9a8dfb695f2609 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 6 Apr 2011 20:45:59 +0100
Subject: Signal prim count taint if the AbsolutePosition of a scene object
changes.
This updates prim counts correctly if an object is moved by something other than an avatar (e.g. scripts, region modules)
Create TestMoveOwnerObject() regression test for this case.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 ++
1 file changed, 2 insertions(+)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index a7107f0..ca7d9d9 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -325,6 +325,8 @@ namespace OpenSim.Region.Framework.Scenes
//m_rootPart.GroupPosition.Z);
//m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
//}
+
+ m_scene.EventManager.TriggerParcelPrimCountTainted();
}
}
--
cgit v1.1
From 9bc2705f37bfc057cdb74a4479d1c72fda4e0aa9 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 6 Apr 2011 20:52:36 +0100
Subject: Fix bug where on duplication, the root part local id was continually
used in populating the local id scene object index instead of each part's
local id
---
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 60855b2..97af0a0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1855,7 +1855,7 @@ namespace OpenSim.Region.Framework.Scenes
{
SceneObjectGroupsByLocalPartID[copy.LocalId] = copy;
foreach (SceneObjectPart part in children)
- SceneObjectGroupsByLocalPartID[copy.LocalId] = copy;
+ SceneObjectGroupsByLocalPartID[part.LocalId] = copy;
}
// PROBABLE END OF FIXME
--
cgit v1.1
From 77cf9405de10f016d85d67b6016ed27d28ed898f Mon Sep 17 00:00:00 2001
From: Mic Bowman
Date: Mon, 28 Mar 2011 10:00:53 -0700
Subject: Implements adaptive queue management and fair queueing for improved
networking performance.
Reprioritization algorithms need to be ported still. One is
in place.
---
OpenSim/Region/Framework/Scenes/Prioritizer.cs | 71 +++++++++++++++++++++++++-
1 file changed, 69 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
index f9599f5..2764b05 100644
--- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs
+++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Region.Framework.Scenes
public class Prioritizer
{
-// private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+ private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
///
/// This is added to the priority of all child prims, to make sure that the root prim update is sent to the
@@ -76,7 +76,74 @@ namespace OpenSim.Region.Framework.Scenes
m_scene = scene;
}
- public double GetUpdatePriority(IClientAPI client, ISceneEntity entity)
+//
+ public uint GetUpdatePriority(IClientAPI client, ISceneEntity entity)
+ {
+ if (entity == null)
+ {
+ m_log.WarnFormat("[PRIORITIZER] attempt to prioritize null entity");
+ throw new InvalidOperationException("Prioritization entity not defined");
+ }
+
+ // If this is an update for our own avatar give it the highest priority
+ if (client.AgentId == entity.UUID)
+ return 0;
+
+ // Get this agent's position
+ ScenePresence presence = m_scene.GetScenePresence(client.AgentId);
+ if (presence == null)
+ {
+ m_log.WarnFormat("[PRIORITIZER] attempt to prioritize agent no longer in the scene");
+ throw new InvalidOperationException("Prioritization agent not defined");
+ }
+
+ // Use group position for child prims
+ Vector3 entityPos = entity.AbsolutePosition;
+ if (entity is SceneObjectPart)
+ {
+ SceneObjectGroup group = (entity as SceneObjectPart).ParentGroup;
+ if (group != null)
+ entityPos = group.AbsolutePosition;
+ }
+
+ // Use the camera position for local agents and avatar position for remote agents
+ Vector3 presencePos = (presence.IsChildAgent) ?
+ presence.AbsolutePosition :
+ presence.CameraPosition;
+
+ // Compute the distance...
+ double distance = Vector3.Distance(presencePos, entityPos);
+
+ // And convert the distance to a priority queue, this computation gives queues
+ // at 10, 20, 40, 80, 160, 320, 640, and 1280m
+ uint pqueue = 1;
+ for (int i = 0; i < 8; i++)
+ {
+ if (distance < 10 * Math.Pow(2.0,i))
+ break;
+ pqueue++;
+ }
+
+ // If this is a root agent, then determine front & back
+ // Bump up the priority queue for any objects behind the avatar
+ if (! presence.IsChildAgent)
+ {
+ // Root agent, decrease priority for objects behind us
+ Vector3 camPosition = presence.CameraPosition;
+ Vector3 camAtAxis = presence.CameraAtAxis;
+
+ // Plane equation
+ float d = -Vector3.Dot(camPosition, camAtAxis);
+ float p = Vector3.Dot(camAtAxis, entityPos) + d;
+ if (p < 0.0f)
+ pqueue++;
+ }
+
+ return pqueue;
+ }
+//
+
+ public double bGetUpdatePriority(IClientAPI client, ISceneEntity entity)
{
double priority = 0;
--
cgit v1.1
From 0bd06d8ba85595a1707d2093a08a901b950ca120 Mon Sep 17 00:00:00 2001
From: Mic Bowman
Date: Mon, 4 Apr 2011 13:19:45 -0700
Subject: Fixed the prioritizer functions for the new priority queues
---
OpenSim/Region/Framework/Scenes/Prioritizer.cs | 292 +++++++------------------
1 file changed, 82 insertions(+), 210 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
index 2764b05..a14bb70 100644
--- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs
+++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
@@ -60,15 +60,6 @@ namespace OpenSim.Region.Framework.Scenes
{
private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
- ///
- /// This is added to the priority of all child prims, to make sure that the root prim update is sent to the
- /// viewer before child prim updates.
- /// The adjustment is added to child prims and subtracted from root prims, so the gap ends up
- /// being double. We do it both ways so that there is a still a priority delta even if the priority is already
- /// double.MinValue or double.MaxValue.
- ///
- private double m_childPrimAdjustmentFactor = 0.05;
-
private Scene m_scene;
public Prioritizer(Scene scene)
@@ -76,9 +67,19 @@ namespace OpenSim.Region.Framework.Scenes
m_scene = scene;
}
-//
+ ///
+ /// Returns the priority queue into which the update should be placed. Updates within a
+ /// queue will be processed in arrival order. There are currently 12 priority queues
+ /// implemented in PriorityQueue class in LLClientView. Queue 0 is generally retained
+ /// for avatar updates. The fair queuing discipline for processing the priority queues
+ /// assumes that the number of entities in each priority queues increases exponentially.
+ /// So for example... if queue 1 contains all updates within 10m of the avatar or camera
+ /// then queue 2 at 20m is about 3X bigger in space & about 3X bigger in total number
+ /// of updates.
+ ///
public uint GetUpdatePriority(IClientAPI client, ISceneEntity entity)
{
+ // If entity is null we have a serious problem
if (entity == null)
{
m_log.WarnFormat("[PRIORITIZER] attempt to prioritize null entity");
@@ -89,71 +90,12 @@ namespace OpenSim.Region.Framework.Scenes
if (client.AgentId == entity.UUID)
return 0;
- // Get this agent's position
- ScenePresence presence = m_scene.GetScenePresence(client.AgentId);
- if (presence == null)
- {
- m_log.WarnFormat("[PRIORITIZER] attempt to prioritize agent no longer in the scene");
- throw new InvalidOperationException("Prioritization agent not defined");
- }
-
- // Use group position for child prims
- Vector3 entityPos = entity.AbsolutePosition;
- if (entity is SceneObjectPart)
- {
- SceneObjectGroup group = (entity as SceneObjectPart).ParentGroup;
- if (group != null)
- entityPos = group.AbsolutePosition;
- }
-
- // Use the camera position for local agents and avatar position for remote agents
- Vector3 presencePos = (presence.IsChildAgent) ?
- presence.AbsolutePosition :
- presence.CameraPosition;
-
- // Compute the distance...
- double distance = Vector3.Distance(presencePos, entityPos);
-
- // And convert the distance to a priority queue, this computation gives queues
- // at 10, 20, 40, 80, 160, 320, 640, and 1280m
- uint pqueue = 1;
- for (int i = 0; i < 8; i++)
- {
- if (distance < 10 * Math.Pow(2.0,i))
- break;
- pqueue++;
- }
-
- // If this is a root agent, then determine front & back
- // Bump up the priority queue for any objects behind the avatar
- if (! presence.IsChildAgent)
- {
- // Root agent, decrease priority for objects behind us
- Vector3 camPosition = presence.CameraPosition;
- Vector3 camAtAxis = presence.CameraAtAxis;
-
- // Plane equation
- float d = -Vector3.Dot(camPosition, camAtAxis);
- float p = Vector3.Dot(camAtAxis, entityPos) + d;
- if (p < 0.0f)
- pqueue++;
- }
-
- return pqueue;
- }
-//
-
- public double bGetUpdatePriority(IClientAPI client, ISceneEntity entity)
- {
- double priority = 0;
-
- if (entity == null)
- return 100000;
+ uint priority;
switch (m_scene.UpdatePrioritizationScheme)
{
case UpdatePrioritizationSchemes.Time:
- priority = GetPriorityByTime();
+ priority = GetPriorityByTime(client, entity);
break;
case UpdatePrioritizationSchemes.Distance:
priority = GetPriorityByDistance(client, entity);
@@ -171,180 +113,110 @@ namespace OpenSim.Region.Framework.Scenes
throw new InvalidOperationException("UpdatePrioritizationScheme not defined.");
}
- // Adjust priority so that root prims are sent to the viewer first. This is especially important for
- // attachments acting as huds, since current viewers fail to display hud child prims if their updates
- // arrive before the root one.
- if (entity is SceneObjectPart)
- {
- SceneObjectPart sop = ((SceneObjectPart)entity);
-
- if (sop.IsRoot)
- {
- if (priority >= double.MinValue + m_childPrimAdjustmentFactor)
- priority -= m_childPrimAdjustmentFactor;
- }
- else
- {
- if (priority <= double.MaxValue - m_childPrimAdjustmentFactor)
- priority += m_childPrimAdjustmentFactor;
- }
- }
-
return priority;
}
- private double GetPriorityByTime()
+
+ private uint GetPriorityByTime(IClientAPI client, ISceneEntity entity)
{
- return DateTime.UtcNow.ToOADate();
+ return 1;
}
- private double GetPriorityByDistance(IClientAPI client, ISceneEntity entity)
+ private uint GetPriorityByDistance(IClientAPI client, ISceneEntity entity)
{
- ScenePresence presence = m_scene.GetScenePresence(client.AgentId);
- if (presence != null)
- {
- // If this is an update for our own avatar give it the highest priority
- if (presence == entity)
- return 0.0;
-
- // Use the camera position for local agents and avatar position for remote agents
- Vector3 presencePos = (presence.IsChildAgent) ?
- presence.AbsolutePosition :
- presence.CameraPosition;
-
- // Use group position for child prims
- Vector3 entityPos;
- if (entity is SceneObjectPart)
- {
- // Can't use Scene.GetGroupByPrim() here, since the entity may have been delete from the scene
- // before its scheduled update was triggered
- //entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition;
- entityPos = ((SceneObjectPart)entity).ParentGroup.AbsolutePosition;
- }
- else
- {
- entityPos = entity.AbsolutePosition;
- }
-
- return Vector3.DistanceSquared(presencePos, entityPos);
- }
-
- return double.NaN;
+ return ComputeDistancePriority(client,entity,false);
+ }
+
+ private uint GetPriorityByFrontBack(IClientAPI client, ISceneEntity entity)
+ {
+ return ComputeDistancePriority(client,entity,true);
}
- private double GetPriorityByFrontBack(IClientAPI client, ISceneEntity entity)
+ private uint GetPriorityByBestAvatarResponsiveness(IClientAPI client, ISceneEntity entity)
{
+ uint pqueue = ComputeDistancePriority(client,entity,true);
+
ScenePresence presence = m_scene.GetScenePresence(client.AgentId);
if (presence != null)
{
- // If this is an update for our own avatar give it the highest priority
- if (presence == entity)
- return 0.0;
-
- // Use group position for child prims
- Vector3 entityPos = entity.AbsolutePosition;
- if (entity is SceneObjectPart)
- {
- // Can't use Scene.GetGroupByPrim() here, since the entity may have been delete from the scene
- // before its scheduled update was triggered
- //entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition;
- entityPos = ((SceneObjectPart)entity).ParentGroup.AbsolutePosition;
- }
- else
- {
- entityPos = entity.AbsolutePosition;
- }
-
if (!presence.IsChildAgent)
{
- // Root agent. Use distance from camera and a priority decrease for objects behind us
- Vector3 camPosition = presence.CameraPosition;
- Vector3 camAtAxis = presence.CameraAtAxis;
-
- // Distance
- double priority = Vector3.DistanceSquared(camPosition, entityPos);
-
- // Plane equation
- float d = -Vector3.Dot(camPosition, camAtAxis);
- float p = Vector3.Dot(camAtAxis, entityPos) + d;
- if (p < 0.0f) priority *= 2.0;
-
- return priority;
- }
- else
- {
- // Child agent. Use the normal distance method
- Vector3 presencePos = presence.AbsolutePosition;
+ if (entity is SceneObjectPart)
+ {
+ // Non physical prims are lower priority than physical prims
+ PhysicsActor physActor = ((SceneObjectPart)entity).ParentGroup.RootPart.PhysActor;
+ if (physActor == null || !physActor.IsPhysical)
+ pqueue++;
- return Vector3.DistanceSquared(presencePos, entityPos);
+ // Attachments are high priority,
+ // MIC: shouldn't these already be in the highest priority queue already
+ // since their root position is same as the avatars?
+ if (((SceneObjectPart)entity).ParentGroup.RootPart.IsAttachment)
+ pqueue = 1;
+ }
}
}
- return double.NaN;
+ return pqueue;
}
- private double GetPriorityByBestAvatarResponsiveness(IClientAPI client, ISceneEntity entity)
+ private uint ComputeDistancePriority(IClientAPI client, ISceneEntity entity, bool useFrontBack)
{
- // If this is an update for our own avatar give it the highest priority
- if (client.AgentId == entity.UUID)
- return 0.0;
- if (entity == null)
- return double.NaN;
-
- // Use group position for child prims
+ // Get this agent's position
+ ScenePresence presence = m_scene.GetScenePresence(client.AgentId);
+ if (presence == null)
+ {
+ m_log.WarnFormat("[PRIORITIZER] attempt to prioritize agent no longer in the scene");
+ throw new InvalidOperationException("Prioritization agent not defined");
+ }
+
+ // Use group position for child prims, since we are putting child prims in
+ // the same queue with the root of the group, the root prim (which goes into
+ // the queue first) should always be sent first, no need to adjust child prim
+ // priorities
Vector3 entityPos = entity.AbsolutePosition;
if (entity is SceneObjectPart)
{
SceneObjectGroup group = (entity as SceneObjectPart).ParentGroup;
if (group != null)
entityPos = group.AbsolutePosition;
- else
- entityPos = entity.AbsolutePosition;
}
- else
- entityPos = entity.AbsolutePosition;
-
- ScenePresence presence = m_scene.GetScenePresence(client.AgentId);
- if (presence != null)
- {
- if (!presence.IsChildAgent)
- {
- if (entity is ScenePresence)
- return 1.0;
- // Root agent. Use distance from camera and a priority decrease for objects behind us
- Vector3 camPosition = presence.CameraPosition;
- Vector3 camAtAxis = presence.CameraAtAxis;
-
- // Distance
- double priority = Vector3.DistanceSquared(camPosition, entityPos);
-
- // Plane equation
- float d = -Vector3.Dot(camPosition, camAtAxis);
- float p = Vector3.Dot(camAtAxis, entityPos) + d;
- if (p < 0.0f) priority *= 2.0;
+ // Use the camera position for local agents and avatar position for remote agents
+ Vector3 presencePos = (presence.IsChildAgent) ?
+ presence.AbsolutePosition :
+ presence.CameraPosition;
- if (entity is SceneObjectPart)
- {
- PhysicsActor physActor = ((SceneObjectPart)entity).ParentGroup.RootPart.PhysActor;
- if (physActor == null || !physActor.IsPhysical)
- priority += 100;
+ // Compute the distance...
+ double distance = Vector3.Distance(presencePos, entityPos);
- if (((SceneObjectPart)entity).ParentGroup.RootPart.IsAttachment)
- priority = 1.0;
- }
- return priority;
- }
- else
- {
- // Child agent. Use the normal distance method
- Vector3 presencePos = presence.AbsolutePosition;
+ // And convert the distance to a priority queue, this computation gives queues
+ // at 10, 20, 40, 80, 160, 320, 640, and 1280m
+ uint pqueue = 1;
+ for (int i = 0; i < 8; i++)
+ {
+ if (distance < 10 * Math.Pow(2.0,i))
+ break;
+ pqueue++;
+ }
+
+ // If this is a root agent, then determine front & back
+ // Bump up the priority queue (drop the priority) for any objects behind the avatar
+ if (useFrontBack && ! presence.IsChildAgent)
+ {
+ // Root agent, decrease priority for objects behind us
+ Vector3 camPosition = presence.CameraPosition;
+ Vector3 camAtAxis = presence.CameraAtAxis;
- return Vector3.DistanceSquared(presencePos, entityPos);
- }
+ // Plane equation
+ float d = -Vector3.Dot(camPosition, camAtAxis);
+ float p = Vector3.Dot(camAtAxis, entityPos) + d;
+ if (p < 0.0f)
+ pqueue++;
}
- return double.NaN;
+ return pqueue;
}
+
}
}
--
cgit v1.1
From ebc249e3bef57aee656936f5e63842d83ee29fff Mon Sep 17 00:00:00 2001
From: Mic Bowman
Date: Sun, 10 Apr 2011 17:02:40 -0700
Subject: Changed the "not in scene" check in the prioritizier to just a
warning. There appears to be a race condition on slow logins that attempts to
prioritize before the scene presence is fully initialized.
---
OpenSim/Region/Framework/Scenes/Prioritizer.cs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
index a14bb70..4694e2b 100644
--- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs
+++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
@@ -166,8 +166,9 @@ namespace OpenSim.Region.Framework.Scenes
ScenePresence presence = m_scene.GetScenePresence(client.AgentId);
if (presence == null)
{
- m_log.WarnFormat("[PRIORITIZER] attempt to prioritize agent no longer in the scene");
- throw new InvalidOperationException("Prioritization agent not defined");
+ m_log.WarnFormat("[PRIORITIZER] attempt to use agent {0} not in the scene",client.AgentId);
+ // throw new InvalidOperationException("Prioritization agent not defined");
+ return Int32.MaxValue;
}
// Use group position for child prims, since we are putting child prims in
--
cgit v1.1
From d6948b15c47fd067be6d7cef31caf8e49e9c9afa Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 11 Apr 2011 21:51:17 +0100
Subject: Make it more obvious when it happens that DLL plugin loading fails.
Improve exception output on Windows.
---
OpenSim/Region/Framework/ModuleLoader.cs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/ModuleLoader.cs b/OpenSim/Region/Framework/ModuleLoader.cs
index 23be9c2..14ecd44 100644
--- a/OpenSim/Region/Framework/ModuleLoader.cs
+++ b/OpenSim/Region/Framework/ModuleLoader.cs
@@ -223,7 +223,8 @@ namespace OpenSim.Region.Framework
catch (Exception e)
{
m_log.ErrorFormat(
- "[MODULES]: Could not load types for [{0}]. Exception {1}", pluginAssembly.FullName, e);
+ "[MODULES]: Could not load types for plugin DLL {0}. Exception {1} {2}",
+ pluginAssembly.FullName, e.Message, e.StackTrace);
// justincc: Right now this is fatal to really get the user's attention
throw e;
--
cgit v1.1
From 98d7de22dc44ca1e5971301c02a6a1fe49620889 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 12 Apr 2011 18:31:41 +0100
Subject: Fix (add) ability to rez objects by dragging them out of another
prim's inventory.
This should happen if the client supplies a task ID with the RezObject call.
The rez goes through the same code as llRezObject(), so the same perms are applied.
Rotation isn't yet preserved, this should be fixed shortly.
---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 59 ++++++++++++++++++++--
1 file changed, 54 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 73dd531..4370850 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1955,11 +1955,60 @@ namespace OpenSim.Region.Framework.Scenes
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
bool RezSelected, bool RemoveItem, UUID fromTaskID)
{
- IInventoryAccessModule invAccess = RequestModuleInterface();
- if (invAccess != null)
- invAccess.RezObject(
- remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection,
- RezSelected, RemoveItem, fromTaskID, false);
+// m_log.DebugFormat(
+// "[PRIM INVENTORY]: RezObject from {0} for item {1} from task id {2}",
+// remoteClient.Name, itemID, fromTaskID);
+
+ if (fromTaskID == UUID.Zero)
+ {
+ IInventoryAccessModule invAccess = RequestModuleInterface();
+ if (invAccess != null)
+ invAccess.RezObject(
+ remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection,
+ RezSelected, RemoveItem, fromTaskID, false);
+ }
+ else
+ {
+ SceneObjectPart part = GetSceneObjectPart(fromTaskID);
+ if (part == null)
+ {
+ m_log.ErrorFormat(
+ "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such scene object",
+ remoteClient.Name, itemID, fromTaskID);
+
+ return;
+ }
+
+ TaskInventoryItem item = part.Inventory.GetInventoryItem(itemID);
+ if (item == null)
+ {
+ m_log.ErrorFormat(
+ "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such item",
+ remoteClient.Name, itemID, fromTaskID);
+
+ return;
+ }
+
+ // Work out position details
+ byte bRayEndIsIntersection = (byte)0;
+
+ if (RayEndIsIntersection)
+ {
+ bRayEndIsIntersection = (byte)1;
+ }
+ else
+ {
+ bRayEndIsIntersection = (byte)0;
+ }
+
+ Vector3 scale = new Vector3(0.5f, 0.5f, 0.5f);
+ Vector3 pos
+ = GetNewRezLocation(
+ RayStart, RayEnd, RayTargetID, Quaternion.Identity,
+ BypassRayCast, bRayEndIsIntersection, true, scale, false);
+
+ RezObject(part, item, pos, Quaternion.Identity, Vector3.Zero, 0);
+ }
}
///
--
cgit v1.1
From 3ba5eeb6c3b7c6381ca1e0ed87bce44049f96e37 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 12 Apr 2011 22:15:40 +0100
Subject: Allow a null rotation to be passed in to RezObject so that we can
control whether to use the serialized rotation or not. Not used yet.
---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 4370850..87b4cb8 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2016,14 +2016,14 @@ namespace OpenSim.Region.Framework.Scenes
///
///
///
- ///
- ///
- ///
+ /// The position of the rezzed object.
+ /// The rotation of the rezzed object. If null, then the rotation stored with the object
+ /// will be used if it exists.
+ /// The velocity of the rezzed object.
///
/// The SceneObjectGroup rezzed or null if rez was unsuccessful
public virtual SceneObjectGroup RezObject(
- SceneObjectPart sourcePart, TaskInventoryItem item,
- Vector3 pos, Quaternion rot, Vector3 vel, int param)
+ SceneObjectPart sourcePart, TaskInventoryItem item, Vector3 pos, Quaternion? rot, Vector3 vel, int param)
{
if (null == item)
return null;
@@ -2041,8 +2041,14 @@ namespace OpenSim.Region.Framework.Scenes
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
sourcePart.Inventory.RemoveInventoryItem(item.ItemID);
}
-
- AddNewSceneObject(group, true, pos, rot, vel);
+
+ AddNewSceneObject(group, true);
+
+ group.AbsolutePosition = pos;
+ group.Velocity = vel;
+
+ if (rot != null)
+ group.UpdateGroupRotationR((Quaternion)rot);
// We can only call this after adding the scene object, since the scene object references the scene
// to find out if scripts should be activated at all.
--
cgit v1.1
From 8e0d2cc43b63046b0dd6b9a3a7dafd70a70362d0 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 12 Apr 2011 22:21:46 +0100
Subject: If an object is rezzed directly from a prim inventory then give it
the rotation it was stored with.
---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 87b4cb8..254879b 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2007,7 +2007,7 @@ namespace OpenSim.Region.Framework.Scenes
RayStart, RayEnd, RayTargetID, Quaternion.Identity,
BypassRayCast, bRayEndIsIntersection, true, scale, false);
- RezObject(part, item, pos, Quaternion.Identity, Vector3.Zero, 0);
+ RezObject(part, item, pos, null, Vector3.Zero, 0);
}
}
--
cgit v1.1
From b0889ed92a3c7d152f9b05aec1ce00dfc010e34e Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 12 Apr 2011 22:30:43 +0100
Subject: refactor: simplify bRayEndIsIntersection boolean set from
RayEndIsIntersection byte
---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 254879b..0f85925 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1989,18 +1989,7 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
- // Work out position details
- byte bRayEndIsIntersection = (byte)0;
-
- if (RayEndIsIntersection)
- {
- bRayEndIsIntersection = (byte)1;
- }
- else
- {
- bRayEndIsIntersection = (byte)0;
- }
-
+ byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0);
Vector3 scale = new Vector3(0.5f, 0.5f, 0.5f);
Vector3 pos
= GetNewRezLocation(
--
cgit v1.1