*Added support for simwide area and simwide prim count for parcels

afrisby
mingchen 2007-07-14 15:57:20 +00:00
parent 811d2b69c9
commit a3f2c1276a
3 changed files with 55 additions and 6 deletions

View File

@ -46,9 +46,11 @@ namespace OpenSim.Framework.Types
public int claimDate = 0; //Unemplemented public int claimDate = 0; //Unemplemented
public int claimPrice = 0; //Unemplemented public int claimPrice = 0; //Unemplemented
public LLUUID groupID = new LLUUID(); //Unemplemented public LLUUID groupID = new LLUUID(); //Unemplemented
public int groupPrims = 0; //Unemplemented public int groupPrims = 0;
public int otherPrims = 0; //Unemplemented public int otherPrims = 0;
public int ownerPrims = 0; //Unemplemented public int ownerPrims = 0;
public int simwidePrims = 0;
public int simwideArea = 0;
public int salePrice = 0; //Unemeplemented. Parcels price. public int salePrice = 0; //Unemeplemented. Parcels price.
public Parcel.ParcelStatus parcelStatus = Parcel.ParcelStatus.Leased; public Parcel.ParcelStatus parcelStatus = Parcel.ParcelStatus.Leased;
public uint parcelFlags = (uint)Parcel.ParcelFlags.AllowFly | (uint)Parcel.ParcelFlags.AllowLandmark | (uint)Parcel.ParcelFlags.AllowAllObjectEntry | (uint)Parcel.ParcelFlags.AllowDeedToGroup | (uint)Parcel.ParcelFlags.AllowTerraform | (uint)Parcel.ParcelFlags.CreateObjects | (uint)Parcel.ParcelFlags.AllowOtherScripts; public uint parcelFlags = (uint)Parcel.ParcelFlags.AllowFly | (uint)Parcel.ParcelFlags.AllowLandmark | (uint)Parcel.ParcelFlags.AllowAllObjectEntry | (uint)Parcel.ParcelFlags.AllowDeedToGroup | (uint)Parcel.ParcelFlags.AllowTerraform | (uint)Parcel.ParcelFlags.CreateObjects | (uint)Parcel.ParcelFlags.AllowOtherScripts;

View File

@ -548,6 +548,45 @@ namespace OpenSim.Region.Environment
{ {
this.parcelPrimCountTainted = true; this.parcelPrimCountTainted = true;
} }
public void finalizeParcelPrimCountUpdate()
{
//Get Simwide prim count for owner
Dictionary<LLUUID, List<Parcel>> parcelOwnersAndParcels = new Dictionary<LLUUID,List<Parcel>>();
foreach (Parcel p in parcelList.Values)
{
if(!parcelOwnersAndParcels.ContainsKey(p.parcelData.ownerID))
{
List<Parcel> tempList = new List<Parcel>();
tempList.Add(p);
parcelOwnersAndParcels.Add(p.parcelData.ownerID,tempList);
}
else
{
parcelOwnersAndParcels[p.parcelData.ownerID].Add(p);
}
}
foreach (LLUUID owner in parcelOwnersAndParcels.Keys)
{
int simArea = 0;
int simPrims = 0;
foreach (Parcel p in parcelOwnersAndParcels[owner])
{
simArea += p.parcelData.area;
simPrims += p.parcelData.ownerPrims + p.parcelData.otherPrims + p.parcelData.groupPrims;
}
foreach (Parcel p in parcelOwnersAndParcels[owner])
{
p.parcelData.simwideArea = simArea;
p.parcelData.simwidePrims = simPrims;
}
}
}
#endregion #endregion
} }
#endregion #endregion
@ -670,8 +709,15 @@ namespace OpenSim.Region.Environment
updatePacket.ParcelData.SelectedPrims = 0; //unemeplemented updatePacket.ParcelData.SelectedPrims = 0; //unemeplemented
updatePacket.ParcelData.SelfCount = 0;//unemplemented updatePacket.ParcelData.SelfCount = 0;//unemplemented
updatePacket.ParcelData.SequenceID = sequence_id; updatePacket.ParcelData.SequenceID = sequence_id;
updatePacket.ParcelData.SimWideMaxPrims = 15000; //unemplemented if (parcelData.simwideArea > 0)
updatePacket.ParcelData.SimWideTotalPrims = 0; //unemplemented {
updatePacket.ParcelData.SimWideMaxPrims = Convert.ToInt32(Math.Floor((Convert.ToDecimal(65536) / Convert.ToDecimal(parcelData.simwideArea)) * 15000));
}
else
{
updatePacket.ParcelData.SimWideMaxPrims = 0;
}
updatePacket.ParcelData.SimWideTotalPrims = parcelData.simwidePrims;
updatePacket.ParcelData.SnapSelection = snap_selection; updatePacket.ParcelData.SnapSelection = snap_selection;
updatePacket.ParcelData.SnapshotID = parcelData.snapshotID; updatePacket.ParcelData.SnapshotID = parcelData.snapshotID;
updatePacket.ParcelData.Status = (byte)parcelData.parcelStatus; updatePacket.ParcelData.Status = (byte)parcelData.parcelStatus;
@ -1003,6 +1049,7 @@ namespace OpenSim.Region.Environment
} }
} }
#endregion #endregion

View File

@ -146,7 +146,6 @@ namespace OpenSim.Region.Environment.Scenes
ScenePresence.LoadAnims(); ScenePresence.LoadAnims();
this.performParcelPrimCountUpdate();
this.httpListener = httpServer; this.httpListener = httpServer;
} }
#endregion #endregion
@ -827,6 +826,7 @@ namespace OpenSim.Region.Environment.Scenes
{ {
m_parcelManager.resetAllParcelPrimCounts(); m_parcelManager.resetAllParcelPrimCounts();
m_eventManager.TriggerParcelPrimCountUpdate(); m_eventManager.TriggerParcelPrimCountUpdate();
m_parcelManager.finalizeParcelPrimCountUpdate();
m_parcelManager.parcelPrimCountTainted = false; m_parcelManager.parcelPrimCountTainted = false;
} }
#endregion #endregion