aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authormingchen2008-06-11 17:31:43 +0000
committermingchen2008-06-11 17:31:43 +0000
commit0896cb53d4bb9ffb4492a1a5dfdc2749d9117abb (patch)
tree644718e985b16ae25ea9b1779444ebf80c64ceb9 /OpenSim/Region/Environment
parentMantis#1514. Thank you kindly, Boscata for an InventoryServer patch (diff)
downloadopensim-SC_OLD-0896cb53d4bb9ffb4492a1a5dfdc2749d9117abb.zip
opensim-SC_OLD-0896cb53d4bb9ffb4492a1a5dfdc2749d9117abb.tar.gz
opensim-SC_OLD-0896cb53d4bb9ffb4492a1a5dfdc2749d9117abb.tar.bz2
opensim-SC_OLD-0896cb53d4bb9ffb4492a1a5dfdc2749d9117abb.tar.xz
*Parcel Prim Count Maximums moved to their own functions so modules can override the default method of calculating how many prims a parcel can have.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Interfaces/ILandChannel.cs2
-rw-r--r--OpenSim/Region/Environment/Interfaces/ILandObject.cs10
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs16
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs12
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandObject.cs43
-rw-r--r--OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs2
6 files changed, 81 insertions, 4 deletions
diff --git a/OpenSim/Region/Environment/Interfaces/ILandChannel.cs b/OpenSim/Region/Environment/Interfaces/ILandChannel.cs
index 6c53177..c1f6f45 100644
--- a/OpenSim/Region/Environment/Interfaces/ILandChannel.cs
+++ b/OpenSim/Region/Environment/Interfaces/ILandChannel.cs
@@ -42,5 +42,7 @@ namespace OpenSim.Region.Environment.Interfaces
42 bool IsForcefulBansAllowed(); 42 bool IsForcefulBansAllowed();
43 void UpdateLandObject(int localID, LandData data); 43 void UpdateLandObject(int localID, LandData data);
44 void ReturnObjectsInParcel(int localID, uint returnType, LLUUID[] agentIDs, LLUUID[] taskIDs, IClientAPI remoteClient); 44 void ReturnObjectsInParcel(int localID, uint returnType, LLUUID[] agentIDs, LLUUID[] taskIDs, IClientAPI remoteClient);
45 void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel);
46 void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel);
45 } 47 }
46} 48}
diff --git a/OpenSim/Region/Environment/Interfaces/ILandObject.cs b/OpenSim/Region/Environment/Interfaces/ILandObject.cs
index 4368493..750b387 100644
--- a/OpenSim/Region/Environment/Interfaces/ILandObject.cs
+++ b/OpenSim/Region/Environment/Interfaces/ILandObject.cs
@@ -32,8 +32,14 @@ using OpenSim.Region.Environment.Scenes;
32 32
33namespace OpenSim.Region.Environment.Interfaces 33namespace OpenSim.Region.Environment.Interfaces
34{ 34{
35 public delegate int overrideParcelMaxPrimCountDelegate(ILandObject obj);
36 public delegate int overrideSimulatorMaxPrimCountDelegate(ILandObject obj);
37
35 public interface ILandObject 38 public interface ILandObject
36 { 39 {
40 int getParcelMaxPrimCount(ILandObject thisObject);
41 int getSimulatorMaxPrimCount(ILandObject thisObject);
42
37 LandData landData { get; set; } 43 LandData landData { get; set; }
38 bool[,] landBitmap { get; set; } 44 bool[,] landBitmap { get; set; }
39 LLUUID regionUUID { get; } 45 LLUUID regionUUID { get; }
@@ -57,6 +63,7 @@ namespace OpenSim.Region.Environment.Interfaces
57 void forceUpdateLandInfo(); 63 void forceUpdateLandInfo();
58 void setLandBitmap(bool[,] bitmap); 64 void setLandBitmap(bool[,] bitmap);
59 65
66
60 bool[,] basicFullRegionLandBitmap(); 67 bool[,] basicFullRegionLandBitmap();
61 bool[,] getSquareLandBitmap(int start_x, int start_y, int end_x, int end_y); 68 bool[,] getSquareLandBitmap(int start_x, int start_y, int end_x, int end_y);
62 bool[,] modifyLandBitmapSquare(bool[,] land_bitmap, int start_x, int start_y, int end_x, int end_y, bool set_value); 69 bool[,] modifyLandBitmapSquare(bool[,] land_bitmap, int start_x, int start_y, int end_x, int end_y, bool set_value);
@@ -69,5 +76,8 @@ namespace OpenSim.Region.Environment.Interfaces
69 void addPrimToCount(SceneObjectGroup obj); 76 void addPrimToCount(SceneObjectGroup obj);
70 void removePrimFromCount(SceneObjectGroup obj); 77 void removePrimFromCount(SceneObjectGroup obj);
71 void updateLandSold(LLUUID avatarID, LLUUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area); 78 void updateLandSold(LLUUID avatarID, LLUUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area);
79
80 void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel);
81 void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel);
72 } 82 }
73} 83}
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs b/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs
index 0b77b23..b83de23 100644
--- a/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs
+++ b/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs
@@ -149,6 +149,22 @@ namespace OpenSim.Region.Environment.Modules.World.Land
149 m_landManagementModule.ReturnObjectsInParcel(localID, returnType, agentIDs, taskIDs, remoteClient); 149 m_landManagementModule.ReturnObjectsInParcel(localID, returnType, agentIDs, taskIDs, remoteClient);
150 } 150 }
151 } 151 }
152
153 public void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel)
154 {
155 if (m_landManagementModule != null)
156 {
157 m_landManagementModule.setParcelObjectMaxOverride(overrideDel);
158 }
159 }
160
161 public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel)
162 {
163 if (m_landManagementModule != null)
164 {
165 m_landManagementModule.setSimulatorObjectMaxOverride(overrideDel);
166 }
167 }
152 #endregion 168 #endregion
153 169
154 } 170 }
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs
index 1c04796..984bc4e 100644
--- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs
@@ -585,7 +585,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
585 ResetAllLandPrimCounts(); 585 ResetAllLandPrimCounts();
586 lock (m_scene.Entities) 586 lock (m_scene.Entities)
587 { 587 {
588 foreach (EntityBase obj in m_scene.Entities.Values) 588 foreach (EntityBase obj in m_scene.Entities.Values)
589 { 589 {
590 if (obj != null) 590 if (obj != null)
591 { 591 {
@@ -1048,6 +1048,16 @@ namespace OpenSim.Region.Environment.Modules.World.Land
1048 1048
1049 #endregion 1049 #endregion
1050 1050
1051 public void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel)
1052 {
1053 foreach (LandObject obj in landList.Values)
1054 {
1055 obj.setParcelObjectMaxOverride(overrideDel);
1056 }
1057 }
1058 public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel)
1059 {
1060 }
1051 } 1061 }
1052 1062
1053} \ No newline at end of file 1063} \ No newline at end of file
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
index f5b1a1d..2ff48cc 100644
--- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
+++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
@@ -116,13 +116,52 @@ namespace OpenSim.Region.Environment.Modules.World.Land
116 return newLand; 116 return newLand;
117 } 117 }
118 118
119 #endregion 119
120 static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount;
121 static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount;
122
123 public void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel)
124 {
125 overrideParcelMaxPrimCount = overrideDel;
126 }
127 public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel)
128 {
129 overrideSimulatorMaxPrimCount = overrideDel;
130 }
120 131
132 public int getParcelMaxPrimCount(ILandObject thisObject)
133 {
134 if (overrideParcelMaxPrimCount != null)
135 {
136 return overrideParcelMaxPrimCount(thisObject);
137 }
138 else
139 {
140 //Normal Calculations
141 return Convert.ToInt32(
142 Math.Round((Convert.ToDecimal(landData.area) / Convert.ToDecimal(65536)) * m_scene.objectCapacity *
143 Convert.ToDecimal(m_scene.RegionInfo.EstateSettings.objectBonusFactor))); ;
144 }
145 }
146 public int getSimulatorMaxPrimCount(ILandObject thisObject)
147 {
148 if (overrideSimulatorMaxPrimCount != null)
149 {
150 return overrideSimulatorMaxPrimCount(thisObject);
151 }
152 else
153 {
154 //Normal Calculations
155 return m_scene.objectCapacity;
156 }
157 }
158 #endregion
159
121 #region Packet Request Handling 160 #region Packet Request Handling
122 161
123 public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) 162 public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client)
124 { 163 {
125 remote_client.sendLandProperties(remote_client, sequence_id, snap_selection, request_result, landData, m_scene.RegionInfo.EstateSettings.objectBonusFactor, m_scene.objectCapacity,(uint) m_scene.RegionInfo.EstateSettings.regionFlags); 164 remote_client.sendLandProperties(remote_client, sequence_id, snap_selection, request_result, landData, m_scene.RegionInfo.EstateSettings.objectBonusFactor, getParcelMaxPrimCount(this), getSimulatorMaxPrimCount(this), (uint)m_scene.RegionInfo.EstateSettings.regionFlags);
126 } 165 }
127 166
128 public void updateLandProperties(LandUpdateArgs args, IClientAPI remote_client) 167 public void updateLandProperties(LandUpdateArgs args, IClientAPI remote_client)
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
index b8ca482..a64d857 100644
--- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
@@ -748,7 +748,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
748 { 748 {
749 } 749 }
750 750
751 public void sendLandProperties(IClientAPI remote_client, int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int simObjectCapacity, uint regionFlags) 751 public void sendLandProperties(IClientAPI remote_client, int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor,int parcelObjectCapacity, int simObjectCapacity, uint regionFlags)
752 { 752 {
753 } 753 }
754 public void sendLandAccessListData(List<LLUUID> avatars, uint accessFlag, int localLandID) 754 public void sendLandAccessListData(List<LLUUID> avatars, uint accessFlag, int localLandID)