diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 39 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandObject.cs | 26 |
2 files changed, 32 insertions, 33 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 1279ac1..5750aa4 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -191,9 +191,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
191 | forcedPosition = null; | 191 | forcedPosition = null; |
192 | } | 192 | } |
193 | //if we are far away, teleport | 193 | //if we are far away, teleport |
194 | else if (Vector3.Distance(clientAvatar.AbsolutePosition,forcedPosition.Value) > 3) | 194 | else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition.Value) > 3) |
195 | { | 195 | { |
196 | Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}",forcedPosition.Value,clientAvatar.AbsolutePosition)); | 196 | Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}", forcedPosition.Value, clientAvatar.AbsolutePosition)); |
197 | clientAvatar.Teleport(forcedPosition.Value); | 197 | clientAvatar.Teleport(forcedPosition.Value); |
198 | forcedPosition = null; | 198 | forcedPosition = null; |
199 | } | 199 | } |
@@ -374,30 +374,27 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
374 | } | 374 | } |
375 | } | 375 | } |
376 | 376 | ||
377 | public void SendOutNearestBanLine(IClientAPI avatar) | 377 | public void SendOutNearestBanLine(IClientAPI client) |
378 | { | 378 | { |
379 | List<ScenePresence> avatars = m_scene.GetAvatars(); | 379 | ScenePresence sp = m_scene.GetScenePresence(client.AgentId); |
380 | foreach (ScenePresence presence in avatars) | 380 | if (sp == null || sp.IsChildAgent) |
381 | return; | ||
382 | |||
383 | List<ILandObject> checkLandParcels = ParcelsNearPoint(sp.AbsolutePosition); | ||
384 | foreach (ILandObject checkBan in checkLandParcels) | ||
381 | { | 385 | { |
382 | if (presence.UUID == avatar.AgentId) | 386 | if (checkBan.IsBannedFromLand(client.AgentId)) |
383 | { | 387 | { |
384 | List<ILandObject> checkLandParcels = ParcelsNearPoint(presence.AbsolutePosition); | 388 | checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, false, (int)ParcelResult.Single, client); |
385 | foreach (ILandObject checkBan in checkLandParcels) | 389 | return; //Only send one |
386 | { | 390 | } |
387 | if (checkBan.IsBannedFromLand(avatar.AgentId)) | 391 | if (checkBan.IsRestrictedFromLand(client.AgentId)) |
388 | { | 392 | { |
389 | checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, false, (int)ParcelResult.Single, avatar); | 393 | checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, false, (int)ParcelResult.Single, client); |
390 | return; //Only send one | 394 | return; //Only send one |
391 | } | ||
392 | if (checkBan.IsRestrictedFromLand(avatar.AgentId)) | ||
393 | { | ||
394 | checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, false, (int)ParcelResult.Single, avatar); | ||
395 | return; //Only send one | ||
396 | } | ||
397 | } | ||
398 | return; | ||
399 | } | 395 | } |
400 | } | 396 | } |
397 | return; | ||
401 | } | 398 | } |
402 | 399 | ||
403 | public void SendLandUpdate(ScenePresence avatar, bool force) | 400 | public void SendLandUpdate(ScenePresence avatar, bool force) |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index e85136a..b2d9b66 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -332,36 +332,38 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
332 | 332 | ||
333 | public void SendLandUpdateToAvatarsOverMe(bool snap_selection) | 333 | public void SendLandUpdateToAvatarsOverMe(bool snap_selection) |
334 | { | 334 | { |
335 | List<ScenePresence> avatars = m_scene.GetAvatars(); | 335 | m_scene.ForEachScenePresence(delegate(ScenePresence avatar) |
336 | ILandObject over = null; | ||
337 | for (int i = 0; i < avatars.Count; i++) | ||
338 | { | 336 | { |
337 | if (avatar.IsChildAgent) | ||
338 | return; | ||
339 | |||
340 | ILandObject over = null; | ||
339 | try | 341 | try |
340 | { | 342 | { |
341 | over = | 343 | over = |
342 | m_scene.LandChannel.GetLandObject(Util.Clamp<int>((int)Math.Round(avatars[i].AbsolutePosition.X), 0, ((int)Constants.RegionSize - 1)), | 344 | m_scene.LandChannel.GetLandObject(Util.Clamp<int>((int)Math.Round(avatar.AbsolutePosition.X), 0, ((int)Constants.RegionSize - 1)), |
343 | Util.Clamp<int>((int)Math.Round(avatars[i].AbsolutePosition.Y), 0, ((int)Constants.RegionSize - 1))); | 345 | Util.Clamp<int>((int)Math.Round(avatar.AbsolutePosition.Y), 0, ((int)Constants.RegionSize - 1))); |
344 | } | 346 | } |
345 | catch (Exception) | 347 | catch (Exception) |
346 | { | 348 | { |
347 | m_log.Warn("[LAND]: " + "unable to get land at x: " + Math.Round(avatars[i].AbsolutePosition.X) + " y: " + | 349 | m_log.Warn("[LAND]: " + "unable to get land at x: " + Math.Round(avatar.AbsolutePosition.X) + " y: " + |
348 | Math.Round(avatars[i].AbsolutePosition.Y)); | 350 | Math.Round(avatar.AbsolutePosition.Y)); |
349 | } | 351 | } |
350 | 352 | ||
351 | if (over != null) | 353 | if (over != null) |
352 | { | 354 | { |
353 | if (over.LandData.LocalID == LandData.LocalID) | 355 | if (over.LandData.LocalID == LandData.LocalID) |
354 | { | 356 | { |
355 | if (((over.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0) && | 357 | if (((over.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0) && |
356 | m_scene.RegionInfo.RegionSettings.AllowDamage) | 358 | m_scene.RegionInfo.RegionSettings.AllowDamage) |
357 | avatars[i].Invulnerable = false; | 359 | avatar.Invulnerable = false; |
358 | else | 360 | else |
359 | avatars[i].Invulnerable = true; | 361 | avatar.Invulnerable = true; |
360 | 362 | ||
361 | SendLandUpdateToClient(snap_selection, avatars[i].ControllingClient); | 363 | SendLandUpdateToClient(snap_selection, avatar.ControllingClient); |
362 | } | 364 | } |
363 | } | 365 | } |
364 | } | 366 | }); |
365 | } | 367 | } |
366 | 368 | ||
367 | #endregion | 369 | #endregion |