aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/LandManagement/Land.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/LandManagement/Land.cs61
1 files changed, 26 insertions, 35 deletions
diff --git a/OpenSim/Region/Environment/LandManagement/Land.cs b/OpenSim/Region/Environment/LandManagement/Land.cs
index 7977c78..ff16319 100644
--- a/OpenSim/Region/Environment/LandManagement/Land.cs
+++ b/OpenSim/Region/Environment/LandManagement/Land.cs
@@ -32,7 +32,6 @@ 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;
36 35
37namespace OpenSim.Region.Environment.LandManagement 36namespace OpenSim.Region.Environment.LandManagement
38{ 37{
@@ -98,7 +97,6 @@ namespace OpenSim.Region.Environment.LandManagement
98 return newLand; 97 return newLand;
99 } 98 }
100 99
101
102 #endregion 100 #endregion
103 101
104 #region Packet Request Handling 102 #region Packet Request Handling
@@ -202,7 +200,7 @@ namespace OpenSim.Region.Environment.LandManagement
202 //Needs later group support 200 //Needs later group support
203 LandData newData = landData.Copy(); 201 LandData newData = landData.Copy();
204 newData.authBuyerID = packet.ParcelData.AuthBuyerID; 202 newData.authBuyerID = packet.ParcelData.AuthBuyerID;
205 newData.category = (Parcel.ParcelCategory)packet.ParcelData.Category; 203 newData.category = (Parcel.ParcelCategory) packet.ParcelData.Category;
206 newData.landDesc = Helpers.FieldToUTF8String(packet.ParcelData.Desc); 204 newData.landDesc = Helpers.FieldToUTF8String(packet.ParcelData.Desc);
207 newData.groupID = packet.ParcelData.GroupID; 205 newData.groupID = packet.ParcelData.GroupID;
208 newData.landingType = packet.ParcelData.LandingType; 206 newData.landingType = packet.ParcelData.LandingType;
@@ -222,8 +220,6 @@ namespace OpenSim.Region.Environment.LandManagement
222 m_scene.LandManager.updateLandObject(landData.localID, newData); 220 m_scene.LandManager.updateLandObject(landData.localID, newData);
223 221
224 sendLandUpdateToAvatarsOverMe(); 222 sendLandUpdateToAvatarsOverMe();
225
226
227 } 223 }
228 } 224 }
229 225
@@ -242,13 +238,13 @@ namespace OpenSim.Region.Environment.LandManagement
242 238
243 public bool isBannedFromLand(LLUUID avatar) 239 public bool isBannedFromLand(LLUUID avatar)
244 { 240 {
245 if ((this.landData.landFlags & (uint)Parcel.ParcelFlags.UseBanList) > 0) 241 if ((landData.landFlags & (uint) Parcel.ParcelFlags.UseBanList) > 0)
246 { 242 {
247 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); 243 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
248 entry.AgentID = avatar; 244 entry.AgentID = avatar;
249 entry.Flags = ParcelManager.AccessList.Ban; 245 entry.Flags = ParcelManager.AccessList.Ban;
250 entry.Time = new DateTime(); 246 entry.Time = new DateTime();
251 if (this.landData.parcelAccessList.Contains(entry)) 247 if (landData.parcelAccessList.Contains(entry))
252 { 248 {
253 //They are banned, so lets send them a notice about this parcel 249 //They are banned, so lets send them a notice about this parcel
254 return true; 250 return true;
@@ -259,13 +255,13 @@ namespace OpenSim.Region.Environment.LandManagement
259 255
260 public bool isRestrictedFromLand(LLUUID avatar) 256 public bool isRestrictedFromLand(LLUUID avatar)
261 { 257 {
262 if ((this.landData.landFlags & (uint)Parcel.ParcelFlags.UseAccessList) > 0) 258 if ((landData.landFlags & (uint) Parcel.ParcelFlags.UseAccessList) > 0)
263 { 259 {
264 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); 260 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
265 entry.AgentID = avatar; 261 entry.AgentID = avatar;
266 entry.Flags = ParcelManager.AccessList.Access; 262 entry.Flags = ParcelManager.AccessList.Access;
267 entry.Time = new DateTime(); 263 entry.Time = new DateTime();
268 if (!this.landData.parcelAccessList.Contains(entry)) 264 if (!landData.parcelAccessList.Contains(entry))
269 { 265 {
270 //They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel 266 //They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel
271 return true; 267 return true;
@@ -310,7 +306,7 @@ namespace OpenSim.Region.Environment.LandManagement
310 { 306 {
311 ParcelAccessListReplyPacket.ListBlock listBlock = new ParcelAccessListReplyPacket.ListBlock(); 307 ParcelAccessListReplyPacket.ListBlock listBlock = new ParcelAccessListReplyPacket.ListBlock();
312 308
313 listBlock.Flags = (uint)0; 309 listBlock.Flags = (uint) 0;
314 listBlock.ID = entry.AgentID; 310 listBlock.ID = entry.AgentID;
315 listBlock.Time = 0; 311 listBlock.Time = 0;
316 312
@@ -322,7 +318,7 @@ namespace OpenSim.Region.Environment.LandManagement
322 { 318 {
323 ParcelAccessListReplyPacket.ListBlock listBlock = new ParcelAccessListReplyPacket.ListBlock(); 319 ParcelAccessListReplyPacket.ListBlock listBlock = new ParcelAccessListReplyPacket.ListBlock();
324 320
325 listBlock.Flags = (uint)0; 321 listBlock.Flags = (uint) 0;
326 listBlock.ID = LLUUID.Zero; 322 listBlock.ID = LLUUID.Zero;
327 listBlock.Time = 0; 323 listBlock.Time = 0;
328 324
@@ -331,38 +327,37 @@ namespace OpenSim.Region.Environment.LandManagement
331 return list.ToArray(); 327 return list.ToArray();
332 } 328 }
333 329
334 public void sendAccessList(LLUUID agentID, LLUUID sessionID, uint flags, int sequenceID, IClientAPI remote_client) 330 public void sendAccessList(LLUUID agentID, LLUUID sessionID, uint flags, int sequenceID,
331 IClientAPI remote_client)
335 { 332 {
336
337 ParcelAccessListReplyPacket replyPacket; 333 ParcelAccessListReplyPacket replyPacket;
338 334
339 if (flags == (uint)ParcelManager.AccessList.Access || flags == (uint)ParcelManager.AccessList.Both) 335 if (flags == (uint) ParcelManager.AccessList.Access || flags == (uint) ParcelManager.AccessList.Both)
340 { 336 {
341 replyPacket = new ParcelAccessListReplyPacket(); 337 replyPacket = new ParcelAccessListReplyPacket();
342 replyPacket.Data.AgentID = agentID; 338 replyPacket.Data.AgentID = agentID;
343 replyPacket.Data.Flags = (uint)ParcelManager.AccessList.Access; 339 replyPacket.Data.Flags = (uint) ParcelManager.AccessList.Access;
344 replyPacket.Data.LocalID = this.landData.localID; 340 replyPacket.Data.LocalID = landData.localID;
345 replyPacket.Data.SequenceID = 0; 341 replyPacket.Data.SequenceID = 0;
346 342
347 replyPacket.List = createAccessListArrayByFlag(ParcelManager.AccessList.Access); 343 replyPacket.List = createAccessListArrayByFlag(ParcelManager.AccessList.Access);
348 remote_client.OutPacket((Packet)replyPacket, ThrottleOutPacketType.Task); 344 remote_client.OutPacket((Packet) replyPacket, ThrottleOutPacketType.Task);
349 } 345 }
350 346
351 if (flags == (uint)ParcelManager.AccessList.Ban || flags == (uint)ParcelManager.AccessList.Both) 347 if (flags == (uint) ParcelManager.AccessList.Ban || flags == (uint) ParcelManager.AccessList.Both)
352 { 348 {
353 replyPacket = new ParcelAccessListReplyPacket(); 349 replyPacket = new ParcelAccessListReplyPacket();
354 replyPacket.Data.AgentID = agentID; 350 replyPacket.Data.AgentID = agentID;
355 replyPacket.Data.Flags = (uint)ParcelManager.AccessList.Ban; 351 replyPacket.Data.Flags = (uint) ParcelManager.AccessList.Ban;
356 replyPacket.Data.LocalID = this.landData.localID; 352 replyPacket.Data.LocalID = landData.localID;
357 replyPacket.Data.SequenceID = 0; 353 replyPacket.Data.SequenceID = 0;
358 354
359 replyPacket.List = createAccessListArrayByFlag(ParcelManager.AccessList.Ban); 355 replyPacket.List = createAccessListArrayByFlag(ParcelManager.AccessList.Ban);
360 remote_client.OutPacket((Packet)replyPacket, ThrottleOutPacketType.Task); 356 remote_client.OutPacket((Packet) replyPacket, ThrottleOutPacketType.Task);
361 } 357 }
362
363 } 358 }
364 359
365 public void updateAccessList(uint flags, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client) 360 public void updateAccessList(uint flags, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client)
366 { 361 {
367 LandData newData = landData.Copy(); 362 LandData newData = landData.Copy();
368 363
@@ -370,11 +365,11 @@ namespace OpenSim.Region.Environment.LandManagement
370 { 365 {
371 entries.Clear(); 366 entries.Clear();
372 } 367 }
373 368
374 List<ParcelManager.ParcelAccessEntry> toRemove = new List<ParcelManager.ParcelAccessEntry>(); 369 List<ParcelManager.ParcelAccessEntry> toRemove = new List<ParcelManager.ParcelAccessEntry>();
375 foreach (ParcelManager.ParcelAccessEntry entry in newData.parcelAccessList) 370 foreach (ParcelManager.ParcelAccessEntry entry in newData.parcelAccessList)
376 { 371 {
377 if (entry.Flags == (ParcelManager.AccessList)flags) 372 if (entry.Flags == (ParcelManager.AccessList) flags)
378 { 373 {
379 toRemove.Add(entry); 374 toRemove.Add(entry);
380 } 375 }
@@ -388,8 +383,8 @@ namespace OpenSim.Region.Environment.LandManagement
388 { 383 {
389 ParcelManager.ParcelAccessEntry temp = new ParcelManager.ParcelAccessEntry(); 384 ParcelManager.ParcelAccessEntry temp = new ParcelManager.ParcelAccessEntry();
390 temp.AgentID = entry.AgentID; 385 temp.AgentID = entry.AgentID;
391 temp.Time = new DateTime() ; //Pointless? Yes. 386 temp.Time = new DateTime(); //Pointless? Yes.
392 temp.Flags = (ParcelManager.AccessList)flags; 387 temp.Flags = (ParcelManager.AccessList) flags;
393 388
394 if (!newData.parcelAccessList.Contains(temp)) 389 if (!newData.parcelAccessList.Contains(temp))
395 { 390 {
@@ -398,7 +393,6 @@ namespace OpenSim.Region.Environment.LandManagement
398 } 393 }
399 394
400 m_scene.LandManager.updateLandObject(landData.localID, newData); 395 m_scene.LandManager.updateLandObject(landData.localID, newData);
401
402 } 396 }
403 397
404 #endregion 398 #endregion
@@ -437,7 +431,6 @@ namespace OpenSim.Region.Environment.LandManagement
437 new LLVector3((float) (max_x*4), (float) (max_y*4), 431 new LLVector3((float) (max_x*4), (float) (max_y*4),
438 (float) m_scene.Terrain.GetHeight((max_x*4), (max_y*4))); 432 (float) m_scene.Terrain.GetHeight((max_x*4), (max_y*4)));
439 landData.area = tempArea; 433 landData.area = tempArea;
440
441 } 434 }
442 435
443 public void updateLandBitmapByteArray() 436 public void updateLandBitmapByteArray()
@@ -650,9 +643,9 @@ namespace OpenSim.Region.Environment.LandManagement
650 { 643 {
651 resultLocalIDs.Add(obj.LocalId); 644 resultLocalIDs.Add(obj.LocalId);
652 } 645 }
653 // else if (request_type == LandManager.LAND_SELECT_OBJECTS_GROUP && ...) // TODO: group support 646 // else if (request_type == LandManager.LAND_SELECT_OBJECTS_GROUP && ...) // TODO: group support
654 // { 647 // {
655 // } 648 // }
656 else if (request_type == LandManager.LAND_SELECT_OBJECTS_OTHER && 649 else if (request_type == LandManager.LAND_SELECT_OBJECTS_OTHER &&
657 obj.OwnerID != remote_client.AgentId) 650 obj.OwnerID != remote_client.AgentId)
658 { 651 {
@@ -732,10 +725,8 @@ namespace OpenSim.Region.Environment.LandManagement
732 725
733 num++; 726 num++;
734 } 727 }
735 728
736 pack.Data = dataBlock; 729 pack.Data = dataBlock;
737
738
739 } 730 }
740 remote_client.OutPacket(pack, ThrottleOutPacketType.Task); 731 remote_client.OutPacket(pack, ThrottleOutPacketType.Task);
741 } 732 }