*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.

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

View File

@ -972,7 +972,7 @@ namespace OpenSim.Framework
void sendEstateCovenantInformation(); void sendEstateCovenantInformation();
void sendDetailedEstateData(LLUUID invoice,string estateName, uint estateID); void sendDetailedEstateData(LLUUID invoice,string estateName, uint estateID);
void sendLandProperties(IClientAPI remote_client, int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int simObjectCapacity, uint regionFlags); void sendLandProperties(IClientAPI remote_client, int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags);
void sendLandAccessListData(List<LLUUID> avatars, uint accessFlag, int localLandID); void sendLandAccessListData(List<LLUUID> avatars, uint accessFlag, int localLandID);
void sendForceClientSelectObjects(List<uint> objectIDs); void sendForceClientSelectObjects(List<uint> objectIDs);
void sendLandObjectOwners(Dictionary<LLUUID, int> ownersAndCount); void sendLandObjectOwners(Dictionary<LLUUID, int> ownersAndCount);

View File

@ -2630,7 +2630,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
this.OutPacket(packet, ThrottleOutPacketType.Task); this.OutPacket(packet, ThrottleOutPacketType.Task);
} }
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)
{ {
ParcelPropertiesPacket updatePacket = (ParcelPropertiesPacket) PacketPool.Instance.GetPacket(PacketType.ParcelProperties); ParcelPropertiesPacket updatePacket = (ParcelPropertiesPacket) PacketPool.Instance.GetPacket(PacketType.ParcelProperties);
// TODO: don't create new blocks if recycling an old packet // TODO: don't create new blocks if recycling an old packet
@ -2654,10 +2654,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
updatePacket.ParcelData.LocalID = landData.localID; updatePacket.ParcelData.LocalID = landData.localID;
if (landData.area > 0) if (landData.area > 0)
{ {
updatePacket.ParcelData.MaxPrims = updatePacket.ParcelData.MaxPrims = parcelObjectCapacity;
Convert.ToInt32(
Math.Round((Convert.ToDecimal(landData.area) / Convert.ToDecimal(65536)) * simObjectCapacity *
Convert.ToDecimal(simObjectBonusFactor)));
} }
else else
{ {
@ -2696,10 +2693,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
updatePacket.ParcelData.SequenceID = sequence_id; updatePacket.ParcelData.SequenceID = sequence_id;
if (landData.simwideArea > 0) if (landData.simwideArea > 0)
{ {
updatePacket.ParcelData.SimWideMaxPrims = updatePacket.ParcelData.SimWideMaxPrims = parcelObjectCapacity;
Convert.ToInt32(
Math.Round((Convert.ToDecimal(landData.simwideArea) / Convert.ToDecimal(65536)) * simObjectCapacity *
Convert.ToDecimal(simObjectBonusFactor)));
} }
else else
{ {

View File

@ -42,5 +42,7 @@ namespace OpenSim.Region.Environment.Interfaces
bool IsForcefulBansAllowed(); bool IsForcefulBansAllowed();
void UpdateLandObject(int localID, LandData data); void UpdateLandObject(int localID, LandData data);
void ReturnObjectsInParcel(int localID, uint returnType, LLUUID[] agentIDs, LLUUID[] taskIDs, IClientAPI remoteClient); void ReturnObjectsInParcel(int localID, uint returnType, LLUUID[] agentIDs, LLUUID[] taskIDs, IClientAPI remoteClient);
void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel);
void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel);
} }
} }

View File

@ -32,8 +32,14 @@ using OpenSim.Region.Environment.Scenes;
namespace OpenSim.Region.Environment.Interfaces namespace OpenSim.Region.Environment.Interfaces
{ {
public delegate int overrideParcelMaxPrimCountDelegate(ILandObject obj);
public delegate int overrideSimulatorMaxPrimCountDelegate(ILandObject obj);
public interface ILandObject public interface ILandObject
{ {
int getParcelMaxPrimCount(ILandObject thisObject);
int getSimulatorMaxPrimCount(ILandObject thisObject);
LandData landData { get; set; } LandData landData { get; set; }
bool[,] landBitmap { get; set; } bool[,] landBitmap { get; set; }
LLUUID regionUUID { get; } LLUUID regionUUID { get; }
@ -57,6 +63,7 @@ namespace OpenSim.Region.Environment.Interfaces
void forceUpdateLandInfo(); void forceUpdateLandInfo();
void setLandBitmap(bool[,] bitmap); void setLandBitmap(bool[,] bitmap);
bool[,] basicFullRegionLandBitmap(); bool[,] basicFullRegionLandBitmap();
bool[,] getSquareLandBitmap(int start_x, int start_y, int end_x, int end_y); 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[,] modifyLandBitmapSquare(bool[,] land_bitmap, int start_x, int start_y, int end_x, int end_y, bool set_value);
@ -69,5 +76,8 @@ namespace OpenSim.Region.Environment.Interfaces
void addPrimToCount(SceneObjectGroup obj); void addPrimToCount(SceneObjectGroup obj);
void removePrimFromCount(SceneObjectGroup obj); void removePrimFromCount(SceneObjectGroup obj);
void updateLandSold(LLUUID avatarID, LLUUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area); void updateLandSold(LLUUID avatarID, LLUUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area);
void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel);
void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel);
} }
} }

View File

@ -149,6 +149,22 @@ namespace OpenSim.Region.Environment.Modules.World.Land
m_landManagementModule.ReturnObjectsInParcel(localID, returnType, agentIDs, taskIDs, remoteClient); 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 #endregion
} }

View File

@ -1048,6 +1048,16 @@ namespace OpenSim.Region.Environment.Modules.World.Land
#endregion #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; return newLand;
} }
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 #endregion
#region Packet Request Handling #region Packet Request Handling
public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) 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) 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) public void sendLandAccessListData(List<LLUUID> avatars, uint accessFlag, int localLandID)

View File

@ -745,7 +745,7 @@ namespace OpenSim.Region.Examples.SimpleModule
{ {
} }
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) public void sendLandAccessListData(List<LLUUID> avatars, uint accessFlag, int localLandID)