aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/LandManagement/Land.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/LandManagement/Land.cs')
-rw-r--r--OpenSim/Region/Environment/LandManagement/Land.cs69
1 files changed, 36 insertions, 33 deletions
diff --git a/OpenSim/Region/Environment/LandManagement/Land.cs b/OpenSim/Region/Environment/LandManagement/Land.cs
index 45e8aac..3f60b1b 100644
--- a/OpenSim/Region/Environment/LandManagement/Land.cs
+++ b/OpenSim/Region/Environment/LandManagement/Land.cs
@@ -32,6 +32,7 @@ using libsecondlife;
32using libsecondlife.Packets; 32using libsecondlife.Packets;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Region.Environment.Scenes; 34using OpenSim.Region.Environment.Scenes;
35using OpenSim.Region.Environment.Interfaces;
35 36
36namespace OpenSim.Region.Environment.LandManagement 37namespace OpenSim.Region.Environment.LandManagement
37{ 38{
@@ -47,7 +48,6 @@ namespace OpenSim.Region.Environment.LandManagement
47 48
48 public LandData landData = new LandData(); 49 public LandData landData = new LandData();
49 public List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>(); 50 public List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>();
50 public List<libsecondlife.ParcelManager.ParcelAccessEntry> parcelAccessList = new List<ParcelManager.ParcelAccessEntry>();
51 public Scene m_scene; 51 public Scene m_scene;
52 52
53 private bool[,] landBitmap = new bool[64,64]; 53 private bool[,] landBitmap = new bool[64,64];
@@ -93,21 +93,12 @@ namespace OpenSim.Region.Environment.LandManagement
93 93
94 //Place all new variables here! 94 //Place all new variables here!
95 newLand.landBitmap = (bool[,]) (landBitmap.Clone()); 95 newLand.landBitmap = (bool[,]) (landBitmap.Clone());
96 newLand.parcelAccessList.Clear();
97 foreach (ParcelManager.ParcelAccessEntry entry in parcelAccessList)
98 {
99 ParcelManager.ParcelAccessEntry newEntry = new ParcelManager.ParcelAccessEntry();
100 newEntry.AgentID = entry.AgentID;
101 newEntry.Flags = entry.Flags;
102 newEntry.Time = entry.Time;
103
104 newLand.parcelAccessList.Add(newEntry);
105 }
106 newLand.landData = landData.Copy(); 96 newLand.landData = landData.Copy();
107 97
108 return newLand; 98 return newLand;
109 } 99 }
110 100
101
111 #endregion 102 #endregion
112 103
113 #region Packet Request Handling 104 #region Packet Request Handling
@@ -209,24 +200,30 @@ namespace OpenSim.Region.Environment.LandManagement
209 if (remote_client.AgentId == landData.ownerID) 200 if (remote_client.AgentId == landData.ownerID)
210 { 201 {
211 //Needs later group support 202 //Needs later group support
212 landData.authBuyerID = packet.ParcelData.AuthBuyerID; 203 LandData newData = landData.Copy();
213 landData.category = (Parcel.ParcelCategory) packet.ParcelData.Category; 204 newData.authBuyerID = packet.ParcelData.AuthBuyerID;
214 landData.landDesc = Helpers.FieldToUTF8String(packet.ParcelData.Desc); 205 newData.category = (Parcel.ParcelCategory)packet.ParcelData.Category;
215 landData.groupID = packet.ParcelData.GroupID; 206 newData.landDesc = Helpers.FieldToUTF8String(packet.ParcelData.Desc);
216 landData.landingType = packet.ParcelData.LandingType; 207 newData.groupID = packet.ParcelData.GroupID;
217 landData.mediaAutoScale = packet.ParcelData.MediaAutoScale; 208 newData.landingType = packet.ParcelData.LandingType;
218 landData.mediaID = packet.ParcelData.MediaID; 209 newData.mediaAutoScale = packet.ParcelData.MediaAutoScale;
219 landData.mediaURL = Helpers.FieldToUTF8String(packet.ParcelData.MediaURL); 210 newData.mediaID = packet.ParcelData.MediaID;
220 landData.musicURL = Helpers.FieldToUTF8String(packet.ParcelData.MusicURL); 211 newData.mediaURL = Helpers.FieldToUTF8String(packet.ParcelData.MediaURL);
221 landData.landName = Helpers.FieldToUTF8String(packet.ParcelData.Name); 212 newData.musicURL = Helpers.FieldToUTF8String(packet.ParcelData.MusicURL);
222 landData.landFlags = packet.ParcelData.ParcelFlags; 213 newData.landName = Helpers.FieldToUTF8String(packet.ParcelData.Name);
223 landData.passHours = packet.ParcelData.PassHours; 214 newData.landFlags = packet.ParcelData.ParcelFlags;
224 landData.passPrice = packet.ParcelData.PassPrice; 215 newData.passHours = packet.ParcelData.PassHours;
225 landData.salePrice = packet.ParcelData.SalePrice; 216 newData.passPrice = packet.ParcelData.PassPrice;
226 landData.snapshotID = packet.ParcelData.SnapshotID; 217 newData.salePrice = packet.ParcelData.SalePrice;
227 landData.userLocation = packet.ParcelData.UserLocation; 218 newData.snapshotID = packet.ParcelData.SnapshotID;
228 landData.userLookAt = packet.ParcelData.UserLookAt; 219 newData.userLocation = packet.ParcelData.UserLocation;
220 newData.userLookAt = packet.ParcelData.UserLookAt;
221
222 m_scene.LandManager.updateLandObject(landData.localID, newData);
223
229 sendLandUpdateToAvatarsOverMe(); 224 sendLandUpdateToAvatarsOverMe();
225
226
230 } 227 }
231 } 228 }
232 229
@@ -257,7 +254,7 @@ namespace OpenSim.Region.Environment.LandManagement
257 public ParcelAccessListReplyPacket.ListBlock[] createAccessListArrayByFlag(ParcelManager.AccessList flag) 254 public ParcelAccessListReplyPacket.ListBlock[] createAccessListArrayByFlag(ParcelManager.AccessList flag)
258 { 255 {
259 List<ParcelAccessListReplyPacket.ListBlock> list = new List<ParcelAccessListReplyPacket.ListBlock>(); 256 List<ParcelAccessListReplyPacket.ListBlock> list = new List<ParcelAccessListReplyPacket.ListBlock>();
260 foreach (ParcelManager.ParcelAccessEntry entry in parcelAccessList) 257 foreach (ParcelManager.ParcelAccessEntry entry in landData.parcelAccessList)
261 { 258 {
262 if (entry.Flags == flag) 259 if (entry.Flags == flag)
263 { 260 {
@@ -317,13 +314,15 @@ namespace OpenSim.Region.Environment.LandManagement
317 314
318 public void updateAccessList(uint flags, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client) 315 public void updateAccessList(uint flags, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client)
319 { 316 {
317 LandData newData = landData.Copy();
318
320 if (entries.Count == 1 && entries[0].AgentID == LLUUID.Zero) 319 if (entries.Count == 1 && entries[0].AgentID == LLUUID.Zero)
321 { 320 {
322 entries.Clear(); 321 entries.Clear();
323 } 322 }
324 323
325 List<ParcelManager.ParcelAccessEntry> toRemove = new List<ParcelManager.ParcelAccessEntry>(); 324 List<ParcelManager.ParcelAccessEntry> toRemove = new List<ParcelManager.ParcelAccessEntry>();
326 foreach (ParcelManager.ParcelAccessEntry entry in parcelAccessList) 325 foreach (ParcelManager.ParcelAccessEntry entry in newData.parcelAccessList)
327 { 326 {
328 if (entry.Flags == (ParcelManager.AccessList)flags) 327 if (entry.Flags == (ParcelManager.AccessList)flags)
329 { 328 {
@@ -333,7 +332,7 @@ namespace OpenSim.Region.Environment.LandManagement
333 332
334 foreach (ParcelManager.ParcelAccessEntry entry in toRemove) 333 foreach (ParcelManager.ParcelAccessEntry entry in toRemove)
335 { 334 {
336 parcelAccessList.Remove(entry); 335 newData.parcelAccessList.Remove(entry);
337 } 336 }
338 foreach (ParcelManager.ParcelAccessEntry entry in entries) 337 foreach (ParcelManager.ParcelAccessEntry entry in entries)
339 { 338 {
@@ -342,11 +341,14 @@ namespace OpenSim.Region.Environment.LandManagement
342 temp.Time = new DateTime() ; //Pointless? Yes. 341 temp.Time = new DateTime() ; //Pointless? Yes.
343 temp.Flags = (ParcelManager.AccessList)flags; 342 temp.Flags = (ParcelManager.AccessList)flags;
344 343
345 if (!this.parcelAccessList.Contains(temp)) 344 if (!newData.parcelAccessList.Contains(temp))
346 { 345 {
347 this.parcelAccessList.Add(temp); 346 newData.parcelAccessList.Add(temp);
348 } 347 }
349 } 348 }
349
350 m_scene.LandManager.updateLandObject(landData.localID, newData);
351
350 } 352 }
351 353
352 #endregion 354 #endregion
@@ -385,6 +387,7 @@ namespace OpenSim.Region.Environment.LandManagement
385 new LLVector3((float) (max_x*4), (float) (max_y*4), 387 new LLVector3((float) (max_x*4), (float) (max_y*4),
386 (float) m_scene.Terrain.GetHeight((max_x*4), (max_y*4))); 388 (float) m_scene.Terrain.GetHeight((max_x*4), (max_y*4)));
387 landData.area = tempArea; 389 landData.area = tempArea;
390
388 } 391 }
389 392
390 public void updateLandBitmapByteArray() 393 public void updateLandBitmapByteArray()