diff options
author | lbsa71 | 2007-12-27 21:41:48 +0000 |
---|---|---|
committer | lbsa71 | 2007-12-27 21:41:48 +0000 |
commit | efd90b56b761219af6425b1c7a2cdd3b6ffb4de2 (patch) | |
tree | bf5b897e1e3c13211e3e2fc61d30508b94c928c0 /OpenSim/Region/Environment/LandManagement | |
parent | * removed always true if (diff) | |
download | opensim-SC_OLD-efd90b56b761219af6425b1c7a2cdd3b6ffb4de2.zip opensim-SC_OLD-efd90b56b761219af6425b1c7a2cdd3b6ffb4de2.tar.gz opensim-SC_OLD-efd90b56b761219af6425b1c7a2cdd3b6ffb4de2.tar.bz2 opensim-SC_OLD-efd90b56b761219af6425b1c7a2cdd3b6ffb4de2.tar.xz |
* Optimized usings
* shortened references
* Removed redundant 'this'
* Normalized EOF
Diffstat (limited to 'OpenSim/Region/Environment/LandManagement')
-rw-r--r-- | OpenSim/Region/Environment/LandManagement/Land.cs | 61 | ||||
-rw-r--r-- | OpenSim/Region/Environment/LandManagement/LandManager.cs | 95 |
2 files changed, 77 insertions, 79 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; | |||
32 | using libsecondlife.Packets; | 32 | using libsecondlife.Packets; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Region.Environment.Scenes; | 34 | using OpenSim.Region.Environment.Scenes; |
35 | using OpenSim.Region.Environment.Interfaces; | ||
36 | 35 | ||
37 | namespace OpenSim.Region.Environment.LandManagement | 36 | namespace 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 | } |
diff --git a/OpenSim/Region/Environment/LandManagement/LandManager.cs b/OpenSim/Region/Environment/LandManagement/LandManager.cs index ecd458d..772fe2e 100644 --- a/OpenSim/Region/Environment/LandManagement/LandManager.cs +++ b/OpenSim/Region/Environment/LandManagement/LandManager.cs | |||
@@ -27,11 +27,13 @@ | |||
27 | */ | 27 | */ |
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using Axiom.Math; | ||
30 | using libsecondlife; | 31 | using libsecondlife; |
31 | using libsecondlife.Packets; | 32 | using libsecondlife.Packets; |
32 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Console; | ||
33 | using OpenSim.Region.Environment.Scenes; | 35 | using OpenSim.Region.Environment.Scenes; |
34 | using OpenSim.Region.Environment.Interfaces; | 36 | using OpenSim.Region.Physics.Manager; |
35 | 37 | ||
36 | namespace OpenSim.Region.Environment.LandManagement | 38 | namespace OpenSim.Region.Environment.LandManagement |
37 | { | 39 | { |
@@ -93,7 +95,7 @@ namespace OpenSim.Region.Environment.LandManagement | |||
93 | private readonly RegionInfo m_regInfo; | 95 | private readonly RegionInfo m_regInfo; |
94 | 96 | ||
95 | public bool allowedForcefulBans = true; | 97 | public bool allowedForcefulBans = true; |
96 | 98 | ||
97 | #endregion | 99 | #endregion |
98 | 100 | ||
99 | #region Constructors | 101 | #region Constructors |
@@ -103,14 +105,13 @@ namespace OpenSim.Region.Environment.LandManagement | |||
103 | m_scene = scene; | 105 | m_scene = scene; |
104 | m_regInfo = reginfo; | 106 | m_regInfo = reginfo; |
105 | landIDList.Initialize(); | 107 | landIDList.Initialize(); |
106 | scene.EventManager.OnAvatarEnteringNewParcel += new EventManager.AvatarEnteringNewParcel(handleAvatarChangingParcel); | 108 | scene.EventManager.OnAvatarEnteringNewParcel += |
107 | scene.EventManager.OnClientMovement += new EventManager.ClientMovement(this.handleAnyClientMovement); | 109 | new EventManager.AvatarEnteringNewParcel(handleAvatarChangingParcel); |
110 | scene.EventManager.OnClientMovement += new EventManager.ClientMovement(handleAnyClientMovement); | ||
108 | } | 111 | } |
109 | 112 | ||
110 | |||
111 | |||
112 | #endregion | 113 | #endregion |
113 | 114 | ||
114 | #region Member Functions | 115 | #region Member Functions |
115 | 116 | ||
116 | #region Land Object From Storage Functions | 117 | #region Land Object From Storage Functions |
@@ -147,7 +148,6 @@ namespace OpenSim.Region.Environment.LandManagement | |||
147 | /// <returns></returns> | 148 | /// <returns></returns> |
148 | public Land createBaseLand() | 149 | public Land createBaseLand() |
149 | { | 150 | { |
150 | |||
151 | return new Land(LLUUID.Zero, false, m_scene); | 151 | return new Land(LLUUID.Zero, false, m_scene); |
152 | } | 152 | } |
153 | 153 | ||
@@ -175,7 +175,7 @@ namespace OpenSim.Region.Environment.LandManagement | |||
175 | } | 175 | } |
176 | } | 176 | } |
177 | landList[lastLandLocalID].forceUpdateLandInfo(); | 177 | landList[lastLandLocalID].forceUpdateLandInfo(); |
178 | m_scene.EventManager.TriggerLandObjectAdded(new_land,m_scene.RegionInfo.RegionID); | 178 | m_scene.EventManager.TriggerLandObjectAdded(new_land, m_scene.RegionInfo.RegionID); |
179 | return new_land; | 179 | return new_land; |
180 | } | 180 | } |
181 | 181 | ||
@@ -207,7 +207,7 @@ namespace OpenSim.Region.Environment.LandManagement | |||
207 | if (landList.ContainsKey(local_id)) | 207 | if (landList.ContainsKey(local_id)) |
208 | { | 208 | { |
209 | landList[local_id].landData = newData.Copy(); | 209 | landList[local_id].landData = newData.Copy(); |
210 | m_scene.EventManager.TriggerLandObjectUpdated((uint)local_id, landList[local_id]); | 210 | m_scene.EventManager.TriggerLandObjectUpdated((uint) local_id, landList[local_id]); |
211 | } | 211 | } |
212 | else | 212 | else |
213 | { | 213 | { |
@@ -335,7 +335,7 @@ namespace OpenSim.Region.Environment.LandManagement | |||
335 | 335 | ||
336 | //Now add the new land object | 336 | //Now add the new land object |
337 | Land result = addLandObject(newLand); | 337 | Land result = addLandObject(newLand); |
338 | updateLandObject(startLandObject.landData.localID,startLandObject.landData); | 338 | updateLandObject(startLandObject.landData.localID, startLandObject.landData); |
339 | result.sendLandUpdateToAvatarsOverMe(); | 339 | result.sendLandUpdateToAvatarsOverMe(); |
340 | 340 | ||
341 | 341 | ||
@@ -463,11 +463,11 @@ namespace OpenSim.Region.Environment.LandManagement | |||
463 | Land southParcel = null; | 463 | Land southParcel = null; |
464 | if (x > 0) | 464 | if (x > 0) |
465 | { | 465 | { |
466 | westParcel = getLandObject((x - 1) * 4, y * 4); | 466 | westParcel = getLandObject((x - 1)*4, y*4); |
467 | } | 467 | } |
468 | if (y > 0) | 468 | if (y > 0) |
469 | { | 469 | { |
470 | southParcel = getLandObject(x * 4, (y - 1) * 4); | 470 | southParcel = getLandObject(x*4, (y - 1)*4); |
471 | } | 471 | } |
472 | 472 | ||
473 | if (x == 0) | 473 | if (x == 0) |
@@ -496,14 +496,15 @@ namespace OpenSim.Region.Environment.LandManagement | |||
496 | packet = new ParcelOverlayPacket(); | 496 | packet = new ParcelOverlayPacket(); |
497 | packet.ParcelData.Data = byteArray; | 497 | packet.ParcelData.Data = byteArray; |
498 | packet.ParcelData.SequenceID = sequenceID; | 498 | packet.ParcelData.SequenceID = sequenceID; |
499 | remote_client.OutPacket((Packet)packet, ThrottleOutPacketType.Task); | 499 | remote_client.OutPacket((Packet) packet, ThrottleOutPacketType.Task); |
500 | sequenceID++; | 500 | sequenceID++; |
501 | byteArray = new byte[LAND_BLOCKS_PER_PACKET]; | 501 | byteArray = new byte[LAND_BLOCKS_PER_PACKET]; |
502 | } | 502 | } |
503 | } | 503 | } |
504 | catch (System.Exception e) | 504 | catch (Exception e) |
505 | { | 505 | { |
506 | OpenSim.Framework.Console.MainLog.Instance.Debug("LAND", "Skipped Land checks because avatar is out of bounds: " + e.Message); | 506 | MainLog.Instance.Debug("LAND", |
507 | "Skipped Land checks because avatar is out of bounds: " + e.Message); | ||
507 | } | 508 | } |
508 | } | 509 | } |
509 | } | 510 | } |
@@ -599,7 +600,6 @@ namespace OpenSim.Region.Environment.LandManagement | |||
599 | 600 | ||
600 | public List<Land> parcelsNearPoint(LLVector3 position) | 601 | public List<Land> parcelsNearPoint(LLVector3 position) |
601 | { | 602 | { |
602 | |||
603 | List<Land> parcelsNear = new List<Land>(); | 603 | List<Land> parcelsNear = new List<Land>(); |
604 | int x, y; | 604 | int x, y; |
605 | for (x = -4; x <= 4; x += 4) | 605 | for (x = -4; x <= 4; x += 4) |
@@ -617,22 +617,25 @@ namespace OpenSim.Region.Environment.LandManagement | |||
617 | } | 617 | } |
618 | } | 618 | } |
619 | 619 | ||
620 | return parcelsNear; | 620 | return parcelsNear; |
621 | |||
622 | } | 621 | } |
623 | 622 | ||
624 | public void sendYouAreBannedNotice(ScenePresence avatar) | 623 | public void sendYouAreBannedNotice(ScenePresence avatar) |
625 | { | 624 | { |
626 | if (allowedForcefulBans) | 625 | if (allowedForcefulBans) |
627 | { | 626 | { |
628 | avatar.ControllingClient.SendAlertMessage("You are not allowed on this parcel because you are banned. Please go away. <3 OpenSim Developers"); | 627 | avatar.ControllingClient.SendAlertMessage( |
628 | "You are not allowed on this parcel because you are banned. Please go away. <3 OpenSim Developers"); | ||
629 | 629 | ||
630 | avatar.PhysicsActor.Position = new OpenSim.Region.Physics.Manager.PhysicsVector(avatar.lastKnownAllowedPosition.x, avatar.lastKnownAllowedPosition.y, avatar.lastKnownAllowedPosition.z); | 630 | avatar.PhysicsActor.Position = |
631 | avatar.PhysicsActor.Velocity = new OpenSim.Region.Physics.Manager.PhysicsVector(0, 0, 0); | 631 | new PhysicsVector(avatar.lastKnownAllowedPosition.x, avatar.lastKnownAllowedPosition.y, |
632 | avatar.lastKnownAllowedPosition.z); | ||
633 | avatar.PhysicsActor.Velocity = new PhysicsVector(0, 0, 0); | ||
632 | } | 634 | } |
633 | else | 635 | else |
634 | { | 636 | { |
635 | avatar.ControllingClient.SendAlertMessage("You are not allowed on this parcel because you are banned; however, the grid administrator has disabled ban lines globally. Please obey the land owner's requests or you can be banned from the entire sim! <3 OpenSim Developers"); | 637 | avatar.ControllingClient.SendAlertMessage( |
638 | "You are not allowed on this parcel because you are banned; however, the grid administrator has disabled ban lines globally. Please obey the land owner's requests or you can be banned from the entire sim! <3 OpenSim Developers"); | ||
636 | } | 639 | } |
637 | } | 640 | } |
638 | 641 | ||
@@ -651,7 +654,8 @@ namespace OpenSim.Region.Environment.LandManagement | |||
651 | } | 654 | } |
652 | else if (parcelAvatarIsEntering.isRestrictedFromLand(avatar.UUID)) | 655 | else if (parcelAvatarIsEntering.isRestrictedFromLand(avatar.UUID)) |
653 | { | 656 | { |
654 | avatar.ControllingClient.SendAlertMessage("You are not allowed on this parcel because the land owner has restricted access. For now, you can enter, but please respect the land owner's decisions (or he can ban you!). <3 OpenSim Developers"); | 657 | avatar.ControllingClient.SendAlertMessage( |
658 | "You are not allowed on this parcel because the land owner has restricted access. For now, you can enter, but please respect the land owner's decisions (or he can ban you!). <3 OpenSim Developers"); | ||
655 | } | 659 | } |
656 | else | 660 | else |
657 | { | 661 | { |
@@ -668,7 +672,6 @@ namespace OpenSim.Region.Environment.LandManagement | |||
668 | 672 | ||
669 | public void sendOutNearestBanLine(IClientAPI avatar) | 673 | public void sendOutNearestBanLine(IClientAPI avatar) |
670 | { | 674 | { |
671 | |||
672 | List<ScenePresence> avatars = m_scene.GetAvatars(); | 675 | List<ScenePresence> avatars = m_scene.GetAvatars(); |
673 | foreach (ScenePresence presence in avatars) | 676 | foreach (ScenePresence presence in avatars) |
674 | { | 677 | { |
@@ -679,15 +682,14 @@ namespace OpenSim.Region.Environment.LandManagement | |||
679 | { | 682 | { |
680 | if (checkBan.isBannedFromLand(avatar.AgentId)) | 683 | if (checkBan.isBannedFromLand(avatar.AgentId)) |
681 | { | 684 | { |
682 | checkBan.sendLandProperties(-30000, false, (int)ParcelManager.ParcelResult.Single, avatar); | 685 | checkBan.sendLandProperties(-30000, false, (int) ParcelManager.ParcelResult.Single, avatar); |
683 | return; //Only send one | 686 | return; //Only send one |
684 | } | 687 | } |
685 | else if (checkBan.isRestrictedFromLand(avatar.AgentId)) | 688 | else if (checkBan.isRestrictedFromLand(avatar.AgentId)) |
686 | { | 689 | { |
687 | checkBan.sendLandProperties(-40000, false, (int)ParcelManager.ParcelResult.Single, avatar); | 690 | checkBan.sendLandProperties(-40000, false, (int) ParcelManager.ParcelResult.Single, avatar); |
688 | return; //Only send one | 691 | return; //Only send one |
689 | } | 692 | } |
690 | |||
691 | } | 693 | } |
692 | return; | 694 | return; |
693 | } | 695 | } |
@@ -696,8 +698,8 @@ namespace OpenSim.Region.Environment.LandManagement | |||
696 | 698 | ||
697 | public void sendLandUpdate(ScenePresence avatar) | 699 | public void sendLandUpdate(ScenePresence avatar) |
698 | { | 700 | { |
699 | Land over = getLandObject((int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), | 701 | Land over = getLandObject((int) Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), |
700 | (int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); | 702 | (int) Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); |
701 | 703 | ||
702 | if (over != null) | 704 | if (over != null) |
703 | { | 705 | { |
@@ -705,10 +707,10 @@ namespace OpenSim.Region.Environment.LandManagement | |||
705 | if (avatar.currentParcelUUID != over.landData.globalID) | 707 | if (avatar.currentParcelUUID != over.landData.globalID) |
706 | { | 708 | { |
707 | avatar.currentParcelUUID = over.landData.globalID; | 709 | avatar.currentParcelUUID = over.landData.globalID; |
708 | m_scene.EventManager.TriggerAvatarEnteringNewParcel(avatar, over.landData.localID, this.m_scene.RegionInfo.RegionID); | 710 | m_scene.EventManager.TriggerAvatarEnteringNewParcel(avatar, over.landData.localID, |
711 | m_scene.RegionInfo.RegionID); | ||
709 | } | 712 | } |
710 | } | 713 | } |
711 | |||
712 | } | 714 | } |
713 | 715 | ||
714 | public void handleSignificantClientMovement(IClientAPI remote_client) | 716 | public void handleSignificantClientMovement(IClientAPI remote_client) |
@@ -722,16 +724,18 @@ namespace OpenSim.Region.Environment.LandManagement | |||
722 | Land parcel = getLandObject(clientAvatar.AbsolutePosition.X, clientAvatar.AbsolutePosition.Y); | 724 | Land parcel = getLandObject(clientAvatar.AbsolutePosition.X, clientAvatar.AbsolutePosition.Y); |
723 | if (parcel != null) | 725 | if (parcel != null) |
724 | { | 726 | { |
725 | if (clientAvatar.AbsolutePosition.Z < BAN_LINE_SAFETY_HIEGHT && clientAvatar.sentMessageAboutRestrictedParcelFlyingDown) | 727 | if (clientAvatar.AbsolutePosition.Z < BAN_LINE_SAFETY_HIEGHT && |
728 | clientAvatar.sentMessageAboutRestrictedParcelFlyingDown) | ||
726 | { | 729 | { |
727 | 730 | handleAvatarChangingParcel(clientAvatar, parcel.landData.localID, m_scene.RegionInfo.RegionID); | |
728 | handleAvatarChangingParcel(clientAvatar, parcel.landData.localID, m_scene.RegionInfo.RegionID); //They are going below the safety line! | 731 | //They are going below the safety line! |
729 | if (!parcel.isBannedFromLand(clientAvatar.UUID)) | 732 | if (!parcel.isBannedFromLand(clientAvatar.UUID)) |
730 | { | 733 | { |
731 | clientAvatar.sentMessageAboutRestrictedParcelFlyingDown = false; | 734 | clientAvatar.sentMessageAboutRestrictedParcelFlyingDown = false; |
732 | } | 735 | } |
733 | } | 736 | } |
734 | else if (clientAvatar.AbsolutePosition.Z < BAN_LINE_SAFETY_HIEGHT && parcel.isBannedFromLand(clientAvatar.UUID)) | 737 | else if (clientAvatar.AbsolutePosition.Z < BAN_LINE_SAFETY_HIEGHT && |
738 | parcel.isBannedFromLand(clientAvatar.UUID)) | ||
735 | { | 739 | { |
736 | sendYouAreBannedNotice(clientAvatar); | 740 | sendYouAreBannedNotice(clientAvatar); |
737 | } | 741 | } |
@@ -739,30 +743,33 @@ namespace OpenSim.Region.Environment.LandManagement | |||
739 | } | 743 | } |
740 | } | 744 | } |
741 | 745 | ||
742 | public void handleAnyClientMovement(ScenePresence avatar) //Like handleSignificantClientMovement, but called with an AgentUpdate regardless of distance. | 746 | public void handleAnyClientMovement(ScenePresence avatar) |
747 | //Like handleSignificantClientMovement, but called with an AgentUpdate regardless of distance. | ||
743 | { | 748 | { |
744 | Land over = getLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); | 749 | Land over = getLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); |
745 | if (over != null) | 750 | if (over != null) |
746 | { | 751 | { |
747 | if (!over.isBannedFromLand(avatar.UUID) || avatar.AbsolutePosition.Z >= BAN_LINE_SAFETY_HIEGHT) | 752 | if (!over.isBannedFromLand(avatar.UUID) || avatar.AbsolutePosition.Z >= BAN_LINE_SAFETY_HIEGHT) |
748 | { | 753 | { |
749 | avatar.lastKnownAllowedPosition = new Axiom.Math.Vector3(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z); | 754 | avatar.lastKnownAllowedPosition = |
750 | 755 | new Vector3(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z); | |
751 | |||
752 | } | 756 | } |
753 | } | 757 | } |
754 | } | 758 | } |
755 | 759 | ||
756 | 760 | ||
757 | public void handleParcelAccessRequest(LLUUID agentID, LLUUID sessionID, uint flags, int sequenceID, int landLocalID, IClientAPI remote_client) | 761 | public void handleParcelAccessRequest(LLUUID agentID, LLUUID sessionID, uint flags, int sequenceID, |
762 | int landLocalID, IClientAPI remote_client) | ||
758 | { | 763 | { |
759 | if (landList.ContainsKey(landLocalID)) | 764 | if (landList.ContainsKey(landLocalID)) |
760 | { | 765 | { |
761 | landList[landLocalID].sendAccessList(agentID, sessionID, flags, sequenceID,remote_client); | 766 | landList[landLocalID].sendAccessList(agentID, sessionID, flags, sequenceID, remote_client); |
762 | } | 767 | } |
763 | } | 768 | } |
764 | 769 | ||
765 | public void handleParcelAccessUpdateRequest(LLUUID agentID, LLUUID sessionID,uint flags, int landLocalID, List<libsecondlife.ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client) | 770 | public void handleParcelAccessUpdateRequest(LLUUID agentID, LLUUID sessionID, uint flags, int landLocalID, |
771 | List<ParcelManager.ParcelAccessEntry> entries, | ||
772 | IClientAPI remote_client) | ||
766 | { | 773 | { |
767 | if (landList.ContainsKey(landLocalID)) | 774 | if (landList.ContainsKey(landLocalID)) |
768 | { | 775 | { |
@@ -849,4 +856,4 @@ namespace OpenSim.Region.Environment.LandManagement | |||
849 | } | 856 | } |
850 | 857 | ||
851 | #endregion | 858 | #endregion |
852 | } | 859 | } \ No newline at end of file |