aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/ParcelManager.cs
diff options
context:
space:
mode:
authormingchen2007-07-14 15:57:20 +0000
committermingchen2007-07-14 15:57:20 +0000
commita3f2c1276a4e86552aa2112600fe686763d7c5a3 (patch)
tree9846e4f3a771119ef7e4f31c0d389b8736f95978 /OpenSim/Region/Environment/ParcelManager.cs
parent* Worked some more on SimpleApp (diff)
downloadopensim-SC-a3f2c1276a4e86552aa2112600fe686763d7c5a3.zip
opensim-SC-a3f2c1276a4e86552aa2112600fe686763d7c5a3.tar.gz
opensim-SC-a3f2c1276a4e86552aa2112600fe686763d7c5a3.tar.bz2
opensim-SC-a3f2c1276a4e86552aa2112600fe686763d7c5a3.tar.xz
*Added support for simwide area and simwide prim count for parcels
Diffstat (limited to 'OpenSim/Region/Environment/ParcelManager.cs')
-rw-r--r--OpenSim/Region/Environment/ParcelManager.cs51
1 files changed, 49 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/ParcelManager.cs b/OpenSim/Region/Environment/ParcelManager.cs
index 981898f..28bfd4c 100644
--- a/OpenSim/Region/Environment/ParcelManager.cs
+++ b/OpenSim/Region/Environment/ParcelManager.cs
@@ -548,6 +548,45 @@ namespace OpenSim.Region.Environment
548 { 548 {
549 this.parcelPrimCountTainted = true; 549 this.parcelPrimCountTainted = true;
550 } 550 }
551
552
553
554 public void finalizeParcelPrimCountUpdate()
555 {
556 //Get Simwide prim count for owner
557 Dictionary<LLUUID, List<Parcel>> parcelOwnersAndParcels = new Dictionary<LLUUID,List<Parcel>>();
558 foreach (Parcel p in parcelList.Values)
559 {
560 if(!parcelOwnersAndParcels.ContainsKey(p.parcelData.ownerID))
561 {
562 List<Parcel> tempList = new List<Parcel>();
563 tempList.Add(p);
564 parcelOwnersAndParcels.Add(p.parcelData.ownerID,tempList);
565 }
566 else
567 {
568 parcelOwnersAndParcels[p.parcelData.ownerID].Add(p);
569 }
570 }
571
572 foreach (LLUUID owner in parcelOwnersAndParcels.Keys)
573 {
574 int simArea = 0;
575 int simPrims = 0;
576 foreach (Parcel p in parcelOwnersAndParcels[owner])
577 {
578 simArea += p.parcelData.area;
579 simPrims += p.parcelData.ownerPrims + p.parcelData.otherPrims + p.parcelData.groupPrims;
580 }
581
582 foreach (Parcel p in parcelOwnersAndParcels[owner])
583 {
584 p.parcelData.simwideArea = simArea;
585 p.parcelData.simwidePrims = simPrims;
586 }
587 }
588
589 }
551 #endregion 590 #endregion
552 } 591 }
553 #endregion 592 #endregion
@@ -670,8 +709,15 @@ namespace OpenSim.Region.Environment
670 updatePacket.ParcelData.SelectedPrims = 0; //unemeplemented 709 updatePacket.ParcelData.SelectedPrims = 0; //unemeplemented
671 updatePacket.ParcelData.SelfCount = 0;//unemplemented 710 updatePacket.ParcelData.SelfCount = 0;//unemplemented
672 updatePacket.ParcelData.SequenceID = sequence_id; 711 updatePacket.ParcelData.SequenceID = sequence_id;
673 updatePacket.ParcelData.SimWideMaxPrims = 15000; //unemplemented 712 if (parcelData.simwideArea > 0)
674 updatePacket.ParcelData.SimWideTotalPrims = 0; //unemplemented 713 {
714 updatePacket.ParcelData.SimWideMaxPrims = Convert.ToInt32(Math.Floor((Convert.ToDecimal(65536) / Convert.ToDecimal(parcelData.simwideArea)) * 15000));
715 }
716 else
717 {
718 updatePacket.ParcelData.SimWideMaxPrims = 0;
719 }
720 updatePacket.ParcelData.SimWideTotalPrims = parcelData.simwidePrims;
675 updatePacket.ParcelData.SnapSelection = snap_selection; 721 updatePacket.ParcelData.SnapSelection = snap_selection;
676 updatePacket.ParcelData.SnapshotID = parcelData.snapshotID; 722 updatePacket.ParcelData.SnapshotID = parcelData.snapshotID;
677 updatePacket.ParcelData.Status = (byte)parcelData.parcelStatus; 723 updatePacket.ParcelData.Status = (byte)parcelData.parcelStatus;
@@ -1003,6 +1049,7 @@ namespace OpenSim.Region.Environment
1003 } 1049 }
1004 } 1050 }
1005 1051
1052
1006 #endregion 1053 #endregion
1007 1054
1008 1055