*Parcel Prim Count Maximums moved to their own functions so modules can override the default method of calculating how many prims a parcel can have.

This commit is contained in:
mingchen
2008-06-11 17:31:43 +00:00
parent 7821cca2f5
commit 0896cb53d4
10 changed files with 87 additions and 16 deletions

View File

@@ -149,6 +149,22 @@ namespace OpenSim.Region.Environment.Modules.World.Land
m_landManagementModule.ReturnObjectsInParcel(localID, returnType, agentIDs, taskIDs, remoteClient);
}
}
public void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel)
{
if (m_landManagementModule != null)
{
m_landManagementModule.setParcelObjectMaxOverride(overrideDel);
}
}
public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel)
{
if (m_landManagementModule != null)
{
m_landManagementModule.setSimulatorObjectMaxOverride(overrideDel);
}
}
#endregion
}

View File

@@ -585,7 +585,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
ResetAllLandPrimCounts();
lock (m_scene.Entities)
{
foreach (EntityBase obj in m_scene.Entities.Values)
foreach (EntityBase obj in m_scene.Entities.Values)
{
if (obj != null)
{
@@ -1048,6 +1048,16 @@ namespace OpenSim.Region.Environment.Modules.World.Land
#endregion
public void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel)
{
foreach (LandObject obj in landList.Values)
{
obj.setParcelObjectMaxOverride(overrideDel);
}
}
public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel)
{
}
}
}

View File

@@ -116,13 +116,52 @@ namespace OpenSim.Region.Environment.Modules.World.Land
return newLand;
}
#endregion
static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount;
static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount;
public void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel)
{
overrideParcelMaxPrimCount = overrideDel;
}
public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel)
{
overrideSimulatorMaxPrimCount = overrideDel;
}
public int getParcelMaxPrimCount(ILandObject thisObject)
{
if (overrideParcelMaxPrimCount != null)
{
return overrideParcelMaxPrimCount(thisObject);
}
else
{
//Normal Calculations
return Convert.ToInt32(
Math.Round((Convert.ToDecimal(landData.area) / Convert.ToDecimal(65536)) * m_scene.objectCapacity *
Convert.ToDecimal(m_scene.RegionInfo.EstateSettings.objectBonusFactor))); ;
}
}
public int getSimulatorMaxPrimCount(ILandObject thisObject)
{
if (overrideSimulatorMaxPrimCount != null)
{
return overrideSimulatorMaxPrimCount(thisObject);
}
else
{
//Normal Calculations
return m_scene.objectCapacity;
}
}
#endregion
#region Packet Request Handling
public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client)
{
remote_client.sendLandProperties(remote_client, sequence_id, snap_selection, request_result, landData, m_scene.RegionInfo.EstateSettings.objectBonusFactor, m_scene.objectCapacity,(uint) m_scene.RegionInfo.EstateSettings.regionFlags);
remote_client.sendLandProperties(remote_client, sequence_id, snap_selection, request_result, landData, m_scene.RegionInfo.EstateSettings.objectBonusFactor, getParcelMaxPrimCount(this), getSimulatorMaxPrimCount(this), (uint)m_scene.RegionInfo.EstateSettings.regionFlags);
}
public void updateLandProperties(LandUpdateArgs args, IClientAPI remote_client)

View File

@@ -748,7 +748,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
{
}
public void sendLandProperties(IClientAPI remote_client, int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int simObjectCapacity, uint regionFlags)
public void sendLandProperties(IClientAPI remote_client, int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor,int parcelObjectCapacity, int simObjectCapacity, uint regionFlags)
{
}
public void sendLandAccessListData(List<LLUUID> avatars, uint accessFlag, int localLandID)