aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authormingchen2008-06-11 17:31:43 +0000
committermingchen2008-06-11 17:31:43 +0000
commit0896cb53d4bb9ffb4492a1a5dfdc2749d9117abb (patch)
tree644718e985b16ae25ea9b1779444ebf80c64ceb9 /OpenSim
parentMantis#1514. Thank you kindly, Boscata for an InventoryServer patch (diff)
downloadopensim-SC-0896cb53d4bb9ffb4492a1a5dfdc2749d9117abb.zip
opensim-SC-0896cb53d4bb9ffb4492a1a5dfdc2749d9117abb.tar.gz
opensim-SC-0896cb53d4bb9ffb4492a1a5dfdc2749d9117abb.tar.bz2
opensim-SC-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 '')
-rw-r--r--OpenSim/Framework/IClientAPI.cs2
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs12
-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
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs2
10 files changed, 87 insertions, 16 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 0ece1a3..11cc166 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -972,7 +972,7 @@ namespace OpenSim.Framework
972 void sendEstateCovenantInformation(); 972 void sendEstateCovenantInformation();
973 void sendDetailedEstateData(LLUUID invoice,string estateName, uint estateID); 973 void sendDetailedEstateData(LLUUID invoice,string estateName, uint estateID);
974 974
975 void sendLandProperties(IClientAPI remote_client, int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int simObjectCapacity, uint regionFlags); 975 void sendLandProperties(IClientAPI remote_client, int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags);
976 void sendLandAccessListData(List<LLUUID> avatars, uint accessFlag, int localLandID); 976 void sendLandAccessListData(List<LLUUID> avatars, uint accessFlag, int localLandID);
977 void sendForceClientSelectObjects(List<uint> objectIDs); 977 void sendForceClientSelectObjects(List<uint> objectIDs);
978 void sendLandObjectOwners(Dictionary<LLUUID, int> ownersAndCount); 978 void sendLandObjectOwners(Dictionary<LLUUID, int> ownersAndCount);
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 6839896..47a9f53 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -2630,7 +2630,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2630 this.OutPacket(packet, ThrottleOutPacketType.Task); 2630 this.OutPacket(packet, ThrottleOutPacketType.Task);
2631 } 2631 }
2632 2632
2633 public void sendLandProperties(IClientAPI remote_client,int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int simObjectCapacity, uint regionFlags) 2633 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)
2634 { 2634 {
2635 ParcelPropertiesPacket updatePacket = (ParcelPropertiesPacket) PacketPool.Instance.GetPacket(PacketType.ParcelProperties); 2635 ParcelPropertiesPacket updatePacket = (ParcelPropertiesPacket) PacketPool.Instance.GetPacket(PacketType.ParcelProperties);
2636 // TODO: don't create new blocks if recycling an old packet 2636 // TODO: don't create new blocks if recycling an old packet
@@ -2654,10 +2654,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2654 updatePacket.ParcelData.LocalID = landData.localID; 2654 updatePacket.ParcelData.LocalID = landData.localID;
2655 if (landData.area > 0) 2655 if (landData.area > 0)
2656 { 2656 {
2657 updatePacket.ParcelData.MaxPrims = 2657 updatePacket.ParcelData.MaxPrims = parcelObjectCapacity;
2658 Convert.ToInt32(
2659 Math.Round((Convert.ToDecimal(landData.area) / Convert.ToDecimal(65536)) * simObjectCapacity *
2660 Convert.ToDecimal(simObjectBonusFactor)));
2661 } 2658 }
2662 else 2659 else
2663 { 2660 {
@@ -2696,10 +2693,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2696 updatePacket.ParcelData.SequenceID = sequence_id; 2693 updatePacket.ParcelData.SequenceID = sequence_id;
2697 if (landData.simwideArea > 0) 2694 if (landData.simwideArea > 0)
2698 { 2695 {
2699 updatePacket.ParcelData.SimWideMaxPrims = 2696 updatePacket.ParcelData.SimWideMaxPrims = parcelObjectCapacity;
2700 Convert.ToInt32(
2701 Math.Round((Convert.ToDecimal(landData.simwideArea) / Convert.ToDecimal(65536)) * simObjectCapacity *
2702 Convert.ToDecimal(simObjectBonusFactor)));
2703 } 2697 }
2704 else 2698 else
2705 { 2699 {
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)
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index dcbbc68..99372fe 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -745,7 +745,7 @@ namespace OpenSim.Region.Examples.SimpleModule
745 { 745 {
746 } 746 }
747 747
748 public void sendLandProperties(IClientAPI remote_client, int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int simObjectCapacity, uint regionFlags) 748 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)
749 { 749 {
750 } 750 }
751 public void sendLandAccessListData(List<LLUUID> avatars, uint accessFlag, int localLandID) 751 public void sendLandAccessListData(List<LLUUID> avatars, uint accessFlag, int localLandID)
diff --git a/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs b/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs
index 04cb0b2..b18c867 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs
@@ -5576,7 +5576,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
5576 { 5576 {
5577 m_host.AddScriptLPS(1); 5577 m_host.AddScriptLPS(1);
5578 NotImplemented("llSetInventoryPermMask"); 5578 NotImplemented("llSetInventoryPermMask");
5579 } 5579 }
5580 5580
5581 public string llGetInventoryCreator(string item) 5581 public string llGetInventoryCreator(string item)
5582 { 5582 {