diff options
author | mingchen | 2007-07-14 15:57:20 +0000 |
---|---|---|
committer | mingchen | 2007-07-14 15:57:20 +0000 |
commit | a3f2c1276a4e86552aa2112600fe686763d7c5a3 (patch) | |
tree | 9846e4f3a771119ef7e4f31c0d389b8736f95978 /OpenSim/Region | |
parent | * Worked some more on SimpleApp (diff) | |
download | opensim-SC_OLD-a3f2c1276a4e86552aa2112600fe686763d7c5a3.zip opensim-SC_OLD-a3f2c1276a4e86552aa2112600fe686763d7c5a3.tar.gz opensim-SC_OLD-a3f2c1276a4e86552aa2112600fe686763d7c5a3.tar.bz2 opensim-SC_OLD-a3f2c1276a4e86552aa2112600fe686763d7c5a3.tar.xz |
*Added support for simwide area and simwide prim count for parcels
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Environment/ParcelManager.cs | 51 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 2 |
2 files changed, 50 insertions, 3 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 | ||
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 |