Thank you, Goetz, for a patch to fix prim count display in cut regions.
parent
be3685b1a2
commit
5a0cb7d37e
OpenSim
Framework
Region
ClientStack/LindenUDP
CoreModules/World/Land
Framework/Interfaces
|
@ -697,6 +697,8 @@ namespace OpenSim.Framework
|
||||||
landData._mediaLoop = _mediaLoop;
|
landData._mediaLoop = _mediaLoop;
|
||||||
landData._obscureMusic = _obscureMusic;
|
landData._obscureMusic = _obscureMusic;
|
||||||
landData._obscureMedia = _obscureMedia;
|
landData._obscureMedia = _obscureMedia;
|
||||||
|
landData._simwideArea = _simwideArea;
|
||||||
|
landData._simwidePrims = _simwidePrims;
|
||||||
|
|
||||||
landData._parcelAccessList.Clear();
|
landData._parcelAccessList.Clear();
|
||||||
foreach (ParcelManager.ParcelAccessEntry entry in _parcelAccessList)
|
foreach (ParcelManager.ParcelAccessEntry entry in _parcelAccessList)
|
||||||
|
|
|
@ -4333,7 +4333,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
updateMessage.SequenceID = sequence_id;
|
updateMessage.SequenceID = sequence_id;
|
||||||
if (landData.SimwideArea > 0)
|
if (landData.SimwideArea > 0)
|
||||||
{
|
{
|
||||||
updateMessage.SimWideMaxPrims = parcelObjectCapacity;
|
int simulatorCapacity = (int)(((float)landData.SimwideArea / 65536.0f) * (float)m_scene.RegionInfo.ObjectCapacity * (float)m_scene.RegionInfo.RegionSettings.ObjectBonus);
|
||||||
|
updateMessage.SimWideMaxPrims = simulatorCapacity;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -709,7 +709,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
|
|
||||||
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
|
||||||
|
@ -751,10 +751,10 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (m_landList.ContainsKey(m_landIDList[x / 4, y / 4]))
|
//if (m_landList.ContainsKey(m_landIDList[x / 4, y / 4]))
|
||||||
return m_landList[m_landIDList[x / 4, y / 4]];
|
return m_landList[m_landIDList[x / 4, y / 4]];
|
||||||
else
|
//else
|
||||||
return null;
|
// return null;
|
||||||
}
|
}
|
||||||
catch (IndexOutOfRangeException)
|
catch (IndexOutOfRangeException)
|
||||||
{
|
{
|
||||||
|
|
|
@ -66,6 +66,13 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
|
|
||||||
#region ILandObject Members
|
#region ILandObject Members
|
||||||
|
|
||||||
|
public int GetPrimsFree()
|
||||||
|
{
|
||||||
|
m_scene.EventManager.TriggerParcelPrimCountUpdate();
|
||||||
|
int free = GetSimulatorMaxPrimCount(this) - m_landData.SimwidePrims;
|
||||||
|
return free;
|
||||||
|
}
|
||||||
|
|
||||||
public LandData LandData
|
public LandData LandData
|
||||||
{
|
{
|
||||||
get { return m_landData; }
|
get { return m_landData; }
|
||||||
|
@ -141,7 +148,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
/// <returns>Returns true if the piece of land contains the specified point</returns>
|
/// <returns>Returns true if the piece of land contains the specified point</returns>
|
||||||
public bool ContainsPoint(int x, int y)
|
public bool ContainsPoint(int x, int y)
|
||||||
{
|
{
|
||||||
if (x >= 0 && y >= 0 && x <= Constants.RegionSize && y <= Constants.RegionSize)
|
if (x >= 0 && y >= 0 && x < Constants.RegionSize && y < Constants.RegionSize)
|
||||||
{
|
{
|
||||||
return (LandBitmap[x / 4, y / 4] == true);
|
return (LandBitmap[x / 4, y / 4] == true);
|
||||||
}
|
}
|
||||||
|
@ -183,7 +190,11 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Normal Calculations
|
// Normal Calculations
|
||||||
return (int)Math.Round(((float)LandData.Area / 65536.0f) * (float)m_scene.RegionInfo.ObjectCapacity * (float)m_scene.RegionInfo.RegionSettings.ObjectBonus);
|
int parcelMax = (int)(((float)LandData.Area / 65536.0f)
|
||||||
|
* (float)m_scene.RegionInfo.ObjectCapacity
|
||||||
|
* (float)m_scene.RegionInfo.RegionSettings.ObjectBonus);
|
||||||
|
// TODO: The calculation of ObjectBonus should be refactored. It does still not work in the same manner as SL!
|
||||||
|
return parcelMax;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public int GetSimulatorMaxPrimCount(ILandObject thisObject)
|
public int GetSimulatorMaxPrimCount(ILandObject thisObject)
|
||||||
|
@ -195,7 +206,9 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Normal Calculations
|
//Normal Calculations
|
||||||
return m_scene.RegionInfo.ObjectCapacity;
|
int simMax = (int)(((float)LandData.SimwideArea / 65536.0f)
|
||||||
|
* (float)m_scene.RegionInfo.ObjectCapacity);
|
||||||
|
return simMax;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -369,7 +382,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
newData.AuthBuyerID = UUID.Zero;
|
newData.AuthBuyerID = UUID.Zero;
|
||||||
newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory);
|
newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory);
|
||||||
m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
|
m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
|
||||||
|
m_scene.EventManager.TriggerParcelPrimCountUpdate();
|
||||||
SendLandUpdateToAvatarsOverMe(true);
|
SendLandUpdateToAvatarsOverMe(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,7 +397,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory);
|
newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory);
|
||||||
|
|
||||||
m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
|
m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
|
||||||
|
m_scene.EventManager.TriggerParcelPrimCountUpdate();
|
||||||
SendLandUpdateToAvatarsOverMe(true);
|
SendLandUpdateToAvatarsOverMe(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -450,6 +463,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
|
|
||||||
public void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client)
|
public void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client)
|
||||||
{
|
{
|
||||||
|
m_scene.EventManager.TriggerParcelPrimCountUpdate();
|
||||||
SendLandProperties(0, snap_selection, 0, remote_client);
|
SendLandProperties(0, snap_selection, 0, remote_client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
{
|
{
|
||||||
int GetParcelMaxPrimCount(ILandObject thisObject);
|
int GetParcelMaxPrimCount(ILandObject thisObject);
|
||||||
int GetSimulatorMaxPrimCount(ILandObject thisObject);
|
int GetSimulatorMaxPrimCount(ILandObject thisObject);
|
||||||
|
int GetPrimsFree();
|
||||||
|
|
||||||
LandData LandData { get; set; }
|
LandData LandData { get; set; }
|
||||||
bool[,] LandBitmap { get; set; }
|
bool[,] LandBitmap { get; set; }
|
||||||
|
|
Loading…
Reference in New Issue