minor: add doc to a few parcel methods

0.6.8-post-fixes
Justin Clark-Casey (justincc) 2009-11-25 17:49:38 +00:00
parent 40464f6cc6
commit 59caa68e08
5 changed files with 44 additions and 7 deletions

View File

@ -93,6 +93,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver
List<EntityBase> entities = m_scene.GetEntities(); List<EntityBase> entities = m_scene.GetEntities();
List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>();
/*
foreach (ILandObject lo in m_scene.LandChannel.AllParcels())
{
if (name == lo.LandData.Name)
{
// This is the parcel we want
}
}
*/
// Filter entities so that we only have scene objects. // Filter entities so that we only have scene objects.
// FIXME: Would be nicer to have this as a proper list in SceneGraph, since lots of methods // FIXME: Would be nicer to have this as a proper list in SceneGraph, since lots of methods
// end up having to do this // end up having to do this

View File

@ -105,7 +105,7 @@ namespace OpenSim.Region.CoreModules.World.Land
ILandObject obj = new LandObject(UUID.Zero, false, m_scene); ILandObject obj = new LandObject(UUID.Zero, false, m_scene);
obj.LandData.Name = "NO LAND"; obj.LandData.Name = "NO LAND";
return obj; return obj;
} }
public List<ILandObject> AllParcels() public List<ILandObject> AllParcels()
{ {
@ -154,6 +154,7 @@ namespace OpenSim.Region.CoreModules.World.Land
m_landManagementModule.UpdateLandObject(localID, data); m_landManagementModule.UpdateLandObject(localID, data);
} }
} }
public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient)
{ {
if (m_landManagementModule != null) if (m_landManagementModule != null)

View File

@ -67,7 +67,14 @@ namespace OpenSim.Region.CoreModules.World.Land
private const int landArrayMax = ((int)((int)Constants.RegionSize / 4) >= 64) ? (int)((int)Constants.RegionSize / 4) : 64; private const int landArrayMax = ((int)((int)Constants.RegionSize / 4) >= 64) ? (int)((int)Constants.RegionSize / 4) : 64;
#pragma warning restore 0429 #pragma warning restore 0429
/// <value>
/// Local land ids at specified region co-ordinates (region size / 4)
/// </value>
private readonly int[,] m_landIDList = new int[landArrayMax, landArrayMax]; private readonly int[,] m_landIDList = new int[landArrayMax, landArrayMax];
/// <value>
/// Land objects keyed by local id
/// </value>
private readonly Dictionary<int, ILandObject> m_landList = new Dictionary<int, ILandObject>(); private readonly Dictionary<int, ILandObject> m_landList = new Dictionary<int, ILandObject>();
private bool m_landPrimCountTainted; private bool m_landPrimCountTainted;
@ -570,6 +577,7 @@ namespace OpenSim.Region.CoreModules.World.Land
if (x_float > Constants.RegionSize || x_float <= 0 || y_float > Constants.RegionSize || y_float <= 0) if (x_float > Constants.RegionSize || x_float <= 0 || y_float > Constants.RegionSize || y_float <= 0)
return null; return null;
try try
{ {
x = Convert.ToInt32(Math.Floor(Convert.ToDouble(x_float) / 4.0)); x = Convert.ToInt32(Math.Floor(Convert.ToDouble(x_float) / 4.0));
@ -584,6 +592,7 @@ namespace OpenSim.Region.CoreModules.World.Land
{ {
return null; return null;
} }
lock (m_landList) lock (m_landList)
{ {
// Corner case. If an autoreturn happens during sim startup // Corner case. If an autoreturn happens during sim startup
@ -603,6 +612,7 @@ namespace OpenSim.Region.CoreModules.World.Land
// they happen every time at border crossings // they happen every time at border crossings
throw new Exception("Error: Parcel not found at point " + x + ", " + y); throw new Exception("Error: Parcel not found at point " + x + ", " + y);
} }
lock (m_landIDList) lock (m_landIDList)
{ {
try try
@ -617,7 +627,7 @@ namespace OpenSim.Region.CoreModules.World.Land
return null; return null;
} }
} }
} }
#endregion #endregion

View File

@ -33,26 +33,41 @@ namespace OpenSim.Region.Framework.Interfaces
{ {
public interface ILandChannel public interface ILandChannel
{ {
List<ILandObject> ParcelsNearPoint(Vector3 position); /// <summary>
/// Get all parcels
/// </summary>
/// <returns></returns>
List<ILandObject> AllParcels(); List<ILandObject> AllParcels();
/// <summary> /// <summary>
/// Get the land object at the specified point /// Get the parcel at the specified point
/// </summary> /// </summary>
/// <param name="x">Value between 0 - 256 on the x axis of the point</param> /// <param name="x">Value between 0 - 256 on the x axis of the point</param>
/// <param name="y">Value between 0 - 256 on the y axis of the point</param> /// <param name="y">Value between 0 - 256 on the y axis of the point</param>
/// <returns>Land object at the point supplied</returns> /// <returns>Land object at the point supplied</returns>
ILandObject GetLandObject(int x, int y); ILandObject GetLandObject(int x, int y);
ILandObject GetLandObject(int localID);
/// <summary> /// <summary>
/// Get the land object at the specified point /// Get the parcel at the specified point
/// </summary> /// </summary>
/// <param name="x">Value between 0 - 256 on the x axis of the point</param> /// <param name="x">Value between 0 - 256 on the x axis of the point</param>
/// <param name="y">Value between 0 - 256 on the y axis of the point</param> /// <param name="y">Value between 0 - 256 on the y axis of the point</param>
/// <returns>Land object at the point supplied</returns> /// <returns>Land object at the point supplied</returns>
ILandObject GetLandObject(float x, float y); ILandObject GetLandObject(float x, float y);
/// <summary>
/// Get the parcels near the specified point
/// </summary>
/// <param name="position"></param>
/// <returns></returns>
List<ILandObject> ParcelsNearPoint(Vector3 position);
/// <summary>
/// Get the parcel given the land's local id.
/// </summary>
/// <param name="localID"></param>
/// <returns></returns>
ILandObject GetLandObject(int localID);
bool IsLandPrimCountTainted(); bool IsLandPrimCountTainted();
bool IsForcefulBansAllowed(); bool IsForcefulBansAllowed();

View File

@ -118,6 +118,7 @@ public class RegionCombinerLargeLandChannel : ILandChannel
return regionData.RegionScene.LandChannel.GetLandObject(x - offsetX, y - offsetY); return regionData.RegionScene.LandChannel.GetLandObject(x - offsetX, y - offsetY);
} }
} }
ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene); ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene);
obj.LandData.Name = "NO LAND"; obj.LandData.Name = "NO LAND";
return obj; return obj;