aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authormingchen2007-07-14 15:57:20 +0000
committermingchen2007-07-14 15:57:20 +0000
commita3f2c1276a4e86552aa2112600fe686763d7c5a3 (patch)
tree9846e4f3a771119ef7e4f31c0d389b8736f95978
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
-rw-r--r--OpenSim/Framework/General/Types/ParcelData.cs8
-rw-r--r--OpenSim/Region/Environment/ParcelManager.cs51
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs2
3 files changed, 55 insertions, 6 deletions
diff --git a/OpenSim/Framework/General/Types/ParcelData.cs b/OpenSim/Framework/General/Types/ParcelData.cs
index 2d332f5..80b9b64 100644
--- a/OpenSim/Framework/General/Types/ParcelData.cs
+++ b/OpenSim/Framework/General/Types/ParcelData.cs
@@ -46,9 +46,11 @@ namespace OpenSim.Framework.Types
46 public int claimDate = 0; //Unemplemented 46 public int claimDate = 0; //Unemplemented
47 public int claimPrice = 0; //Unemplemented 47 public int claimPrice = 0; //Unemplemented
48 public LLUUID groupID = new LLUUID(); //Unemplemented 48 public LLUUID groupID = new LLUUID(); //Unemplemented
49 public int groupPrims = 0; //Unemplemented 49 public int groupPrims = 0;
50 public int otherPrims = 0; //Unemplemented 50 public int otherPrims = 0;
51 public int ownerPrims = 0; //Unemplemented 51 public int ownerPrims = 0;
52 public int simwidePrims = 0;
53 public int simwideArea = 0;
52 public int salePrice = 0; //Unemeplemented. Parcels price. 54 public int salePrice = 0; //Unemeplemented. Parcels price.
53 public Parcel.ParcelStatus parcelStatus = Parcel.ParcelStatus.Leased; 55 public Parcel.ParcelStatus parcelStatus = Parcel.ParcelStatus.Leased;
54 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; 56 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;
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
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 13a8c89..9565c02 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -146,7 +146,6 @@ namespace OpenSim.Region.Environment.Scenes
146 146
147 ScenePresence.LoadAnims(); 147 ScenePresence.LoadAnims();
148 148
149 this.performParcelPrimCountUpdate();
150 this.httpListener = httpServer; 149 this.httpListener = httpServer;
151 } 150 }
152 #endregion 151 #endregion
@@ -827,6 +826,7 @@ namespace OpenSim.Region.Environment.Scenes
827 { 826 {
828 m_parcelManager.resetAllParcelPrimCounts(); 827 m_parcelManager.resetAllParcelPrimCounts();
829 m_eventManager.TriggerParcelPrimCountUpdate(); 828 m_eventManager.TriggerParcelPrimCountUpdate();
829 m_parcelManager.finalizeParcelPrimCountUpdate();
830 m_parcelManager.parcelPrimCountTainted = false; 830 m_parcelManager.parcelPrimCountTainted = false;
831 } 831 }
832 #endregion 832 #endregion