diff options
* Started renaming world to Scene
* Update and UpdateMovement now first stores array to avoid collection update exceptions
* Ignored some bins
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/LandManagement/Land.cs | 33 | ||||
-rw-r--r-- | OpenSim/Region/Environment/LandManagement/LandManager.cs | 14 |
2 files changed, 25 insertions, 22 deletions
diff --git a/OpenSim/Region/Environment/LandManagement/Land.cs b/OpenSim/Region/Environment/LandManagement/Land.cs index bae3b0e..625b176 100644 --- a/OpenSim/Region/Environment/LandManagement/Land.cs +++ b/OpenSim/Region/Environment/LandManagement/Land.cs | |||
@@ -18,7 +18,7 @@ namespace OpenSim.Region.Environment.LandManagement | |||
18 | public LandData landData = new LandData(); | 18 | public LandData landData = new LandData(); |
19 | public List<SceneObject> primsOverMe = new List<SceneObject>(); | 19 | public List<SceneObject> primsOverMe = new List<SceneObject>(); |
20 | 20 | ||
21 | public Scene m_world; | 21 | public Scene m_scene; |
22 | 22 | ||
23 | private bool[,] landBitmap = new bool[64, 64]; | 23 | private bool[,] landBitmap = new bool[64, 64]; |
24 | 24 | ||
@@ -26,9 +26,9 @@ namespace OpenSim.Region.Environment.LandManagement | |||
26 | 26 | ||
27 | 27 | ||
28 | #region Constructors | 28 | #region Constructors |
29 | public Land(LLUUID owner_id, bool is_group_owned, Scene world) | 29 | public Land(LLUUID owner_id, bool is_group_owned, Scene scene) |
30 | { | 30 | { |
31 | m_world = world; | 31 | m_scene = scene; |
32 | landData.ownerID = owner_id; | 32 | landData.ownerID = owner_id; |
33 | landData.isGroupOwned = is_group_owned; | 33 | landData.isGroupOwned = is_group_owned; |
34 | 34 | ||
@@ -59,7 +59,7 @@ namespace OpenSim.Region.Environment.LandManagement | |||
59 | 59 | ||
60 | public Land Copy() | 60 | public Land Copy() |
61 | { | 61 | { |
62 | Land newLand = new Land(this.landData.ownerID, this.landData.isGroupOwned, m_world); | 62 | Land newLand = new Land(this.landData.ownerID, this.landData.isGroupOwned, m_scene); |
63 | 63 | ||
64 | //Place all new variables here! | 64 | //Place all new variables here! |
65 | newLand.landBitmap = (bool[,])(this.landBitmap.Clone()); | 65 | newLand.landBitmap = (bool[,])(this.landBitmap.Clone()); |
@@ -101,7 +101,7 @@ namespace OpenSim.Region.Environment.LandManagement | |||
101 | updatePacket.ParcelData.LocalID = landData.localID; | 101 | updatePacket.ParcelData.LocalID = landData.localID; |
102 | if (landData.area > 0) | 102 | if (landData.area > 0) |
103 | { | 103 | { |
104 | updatePacket.ParcelData.MaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(landData.area) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_world.RegionInfo.estateSettings.objectBonusFactor))); | 104 | updatePacket.ParcelData.MaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(landData.area) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_scene.RegionInfo.estateSettings.objectBonusFactor))); |
105 | } | 105 | } |
106 | else | 106 | else |
107 | { | 107 | { |
@@ -118,14 +118,17 @@ namespace OpenSim.Region.Environment.LandManagement | |||
118 | updatePacket.ParcelData.OwnerID = landData.ownerID; | 118 | updatePacket.ParcelData.OwnerID = landData.ownerID; |
119 | updatePacket.ParcelData.OwnerPrims = landData.ownerPrims; | 119 | updatePacket.ParcelData.OwnerPrims = landData.ownerPrims; |
120 | updatePacket.ParcelData.ParcelFlags = landData.landFlags; | 120 | updatePacket.ParcelData.ParcelFlags = landData.landFlags; |
121 | updatePacket.ParcelData.ParcelPrimBonus = m_world.RegionInfo.estateSettings.objectBonusFactor; | 121 | updatePacket.ParcelData.ParcelPrimBonus = m_scene.RegionInfo.estateSettings.objectBonusFactor; |
122 | updatePacket.ParcelData.PassHours = landData.passHours; | 122 | updatePacket.ParcelData.PassHours = landData.passHours; |
123 | updatePacket.ParcelData.PassPrice = landData.passPrice; | 123 | updatePacket.ParcelData.PassPrice = landData.passPrice; |
124 | updatePacket.ParcelData.PublicCount = 0; //unemplemented | 124 | updatePacket.ParcelData.PublicCount = 0; //unemplemented |
125 | updatePacket.ParcelData.RegionDenyAnonymous = (((uint)m_world.RegionInfo.estateSettings.regionFlags & (uint)Simulator.RegionFlags.DenyAnonymous) > 0); | 125 | |
126 | updatePacket.ParcelData.RegionDenyIdentified = (((uint)m_world.RegionInfo.estateSettings.regionFlags & (uint)Simulator.RegionFlags.DenyIdentified) > 0); | 126 | uint regionFlags = (uint)m_scene.RegionInfo.estateSettings.regionFlags; |
127 | updatePacket.ParcelData.RegionDenyTransacted = (((uint)m_world.RegionInfo.estateSettings.regionFlags & (uint)Simulator.RegionFlags.DenyTransacted) > 0); | 127 | updatePacket.ParcelData.RegionDenyAnonymous = ((regionFlags & (uint)Simulator.RegionFlags.DenyAnonymous) > 0); |
128 | updatePacket.ParcelData.RegionPushOverride = (((uint)m_world.RegionInfo.estateSettings.regionFlags & (uint)Simulator.RegionFlags.RestrictPushObject) > 0); | 128 | updatePacket.ParcelData.RegionDenyIdentified = ((regionFlags & (uint)Simulator.RegionFlags.DenyIdentified) > 0); |
129 | updatePacket.ParcelData.RegionDenyTransacted = ((regionFlags & (uint)Simulator.RegionFlags.DenyTransacted) > 0); | ||
130 | updatePacket.ParcelData.RegionPushOverride = ((regionFlags & (uint)Simulator.RegionFlags.RestrictPushObject) > 0); | ||
131 | |||
129 | updatePacket.ParcelData.RentPrice = 0; | 132 | updatePacket.ParcelData.RentPrice = 0; |
130 | updatePacket.ParcelData.RequestResult = request_result; | 133 | updatePacket.ParcelData.RequestResult = request_result; |
131 | updatePacket.ParcelData.SalePrice = landData.salePrice; | 134 | updatePacket.ParcelData.SalePrice = landData.salePrice; |
@@ -134,7 +137,7 @@ namespace OpenSim.Region.Environment.LandManagement | |||
134 | updatePacket.ParcelData.SequenceID = sequence_id; | 137 | updatePacket.ParcelData.SequenceID = sequence_id; |
135 | if (landData.simwideArea > 0) | 138 | if (landData.simwideArea > 0) |
136 | { | 139 | { |
137 | updatePacket.ParcelData.SimWideMaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(landData.simwideArea) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_world.RegionInfo.estateSettings.objectBonusFactor))); | 140 | updatePacket.ParcelData.SimWideMaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(landData.simwideArea) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_scene.RegionInfo.estateSettings.objectBonusFactor))); |
138 | } | 141 | } |
139 | else | 142 | else |
140 | { | 143 | { |
@@ -180,10 +183,10 @@ namespace OpenSim.Region.Environment.LandManagement | |||
180 | 183 | ||
181 | public void sendLandUpdateToAvatarsOverMe() | 184 | public void sendLandUpdateToAvatarsOverMe() |
182 | { | 185 | { |
183 | List<ScenePresence> avatars = m_world.RequestAvatarList(); | 186 | List<ScenePresence> avatars = m_scene.RequestAvatarList(); |
184 | for (int i = 0; i < avatars.Count; i++) | 187 | for (int i = 0; i < avatars.Count; i++) |
185 | { | 188 | { |
186 | Land over = m_world.LandManager.getLandObject((int)Math.Round(avatars[i].Pos.X), (int)Math.Round(avatars[i].Pos.Y)); | 189 | Land over = m_scene.LandManager.getLandObject((int)Math.Round(avatars[i].Pos.X), (int)Math.Round(avatars[i].Pos.Y)); |
187 | if (over.landData.localID == this.landData.localID) | 190 | if (over.landData.localID == this.landData.localID) |
188 | { | 191 | { |
189 | sendLandProperties(0, false, 0, avatars[i].ControllingClient); | 192 | sendLandProperties(0, false, 0, avatars[i].ControllingClient); |
@@ -219,8 +222,8 @@ namespace OpenSim.Region.Environment.LandManagement | |||
219 | } | 222 | } |
220 | } | 223 | } |
221 | } | 224 | } |
222 | landData.AABBMin = new LLVector3((float)(min_x * 4), (float)(min_y * 4), (float)m_world.Terrain.GetHeight((min_x * 4), (min_y * 4))); | 225 | landData.AABBMin = new LLVector3((float)(min_x * 4), (float)(min_y * 4), (float)m_scene.Terrain.GetHeight((min_x * 4), (min_y * 4))); |
223 | landData.AABBMax = new LLVector3((float)(max_x * 4), (float)(max_y * 4), (float)m_world.Terrain.GetHeight((max_x * 4), (max_y * 4))); | 226 | landData.AABBMax = new LLVector3((float)(max_x * 4), (float)(max_y * 4), (float)m_scene.Terrain.GetHeight((max_x * 4), (max_y * 4))); |
224 | landData.area = tempArea; | 227 | landData.area = tempArea; |
225 | } | 228 | } |
226 | 229 | ||
diff --git a/OpenSim/Region/Environment/LandManagement/LandManager.cs b/OpenSim/Region/Environment/LandManagement/LandManager.cs index be2913b..8c359fc 100644 --- a/OpenSim/Region/Environment/LandManagement/LandManager.cs +++ b/OpenSim/Region/Environment/LandManagement/LandManager.cs | |||
@@ -85,16 +85,16 @@ namespace OpenSim.Region.Environment.LandManagement | |||
85 | /// </summary> | 85 | /// </summary> |
86 | public bool landPrimCountTainted = false; | 86 | public bool landPrimCountTainted = false; |
87 | 87 | ||
88 | private Scene m_world; | 88 | private Scene m_scene; |
89 | private RegionInfo m_regInfo; | 89 | private RegionInfo m_regInfo; |
90 | 90 | ||
91 | #endregion | 91 | #endregion |
92 | 92 | ||
93 | #region Constructors | 93 | #region Constructors |
94 | public LandManager(Scene world, RegionInfo reginfo) | 94 | public LandManager(Scene scene, RegionInfo reginfo) |
95 | { | 95 | { |
96 | 96 | ||
97 | m_world = world; | 97 | m_scene = scene; |
98 | m_regInfo = reginfo; | 98 | m_regInfo = reginfo; |
99 | landIDList.Initialize(); | 99 | landIDList.Initialize(); |
100 | 100 | ||
@@ -106,7 +106,7 @@ namespace OpenSim.Region.Environment.LandManagement | |||
106 | #region Parcel From Storage Functions | 106 | #region Parcel From Storage Functions |
107 | public void LandFromStorage(LandData data) | 107 | public void LandFromStorage(LandData data) |
108 | { | 108 | { |
109 | Land new_land = new Land(data.ownerID, data.isGroupOwned, m_world); | 109 | Land new_land = new Land(data.ownerID, data.isGroupOwned, m_scene); |
110 | new_land.landData = data.Copy(); | 110 | new_land.landData = data.Copy(); |
111 | new_land.setLandBitmapFromByteArray(); | 111 | new_land.setLandBitmapFromByteArray(); |
112 | addLandObject(new_land); | 112 | addLandObject(new_land); |
@@ -126,7 +126,7 @@ namespace OpenSim.Region.Environment.LandManagement | |||
126 | /// <returns></returns> | 126 | /// <returns></returns> |
127 | public Land createBaseLand() | 127 | public Land createBaseLand() |
128 | { | 128 | { |
129 | return new Land(new LLUUID(), false, m_world); | 129 | return new Land(new LLUUID(), false, m_scene); |
130 | } | 130 | } |
131 | 131 | ||
132 | /// <summary> | 132 | /// <summary> |
@@ -517,7 +517,7 @@ namespace OpenSim.Region.Environment.LandManagement | |||
517 | lastLandLocalID = START_LAND_LOCAL_ID - 1; | 517 | lastLandLocalID = START_LAND_LOCAL_ID - 1; |
518 | landIDList.Initialize(); | 518 | landIDList.Initialize(); |
519 | 519 | ||
520 | Land fullSimParcel = new Land(LLUUID.Zero, false, m_world); | 520 | Land fullSimParcel = new Land(LLUUID.Zero, false, m_scene); |
521 | 521 | ||
522 | fullSimParcel.setLandBitmap(Land.getSquareLandBitmap(0, 0, 256, 256)); | 522 | fullSimParcel.setLandBitmap(Land.getSquareLandBitmap(0, 0, 256, 256)); |
523 | fullSimParcel.landData.ownerID = m_regInfo.MasterAvatarAssignedUUID; | 523 | fullSimParcel.landData.ownerID = m_regInfo.MasterAvatarAssignedUUID; |
@@ -529,7 +529,7 @@ namespace OpenSim.Region.Environment.LandManagement | |||
529 | 529 | ||
530 | public void handleSignificantClientMovement(IClientAPI remote_client) | 530 | public void handleSignificantClientMovement(IClientAPI remote_client) |
531 | { | 531 | { |
532 | ScenePresence clientAvatar = m_world.RequestAvatar(remote_client.AgentId); | 532 | ScenePresence clientAvatar = m_scene.RequestAvatar(remote_client.AgentId); |
533 | if (clientAvatar != null) | 533 | if (clientAvatar != null) |
534 | { | 534 | { |
535 | Land over = getLandObject(clientAvatar.Pos.X,clientAvatar.Pos.Y); | 535 | Land over = getLandObject(clientAvatar.Pos.X,clientAvatar.Pos.Y); |