diff options
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 130 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandObject.cs | 48 |
2 files changed, 58 insertions, 120 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 33d16d5..8c3d17d 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -269,57 +269,20 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
269 | return parcelsNear; | 269 | return parcelsNear; |
270 | } | 270 | } |
271 | 271 | ||
272 | public void KickUserOffOfParcel(ScenePresence avatar) | 272 | public void SendYouAreBannedNotice(ScenePresence avatar) |
273 | { | 273 | { |
274 | if (avatar.GodLevel == 0) | 274 | if (AllowedForcefulBans) |
275 | { | 275 | { |
276 | List<ILandObject> parcelsNear = ParcelsNearPoint(avatar.AbsolutePosition); | 276 | avatar.ControllingClient.SendAlertMessage( |
277 | foreach (ILandObject check in parcelsNear) | 277 | "You are not allowed on this parcel because you are banned. Please go away."); |
278 | { | 278 | |
279 | if (check.IsEitherBannedOrRestricted(avatar.UUID) != true) | 279 | avatar.PhysicsActor.Position = avatar.lastKnownAllowedPosition; |
280 | { | 280 | avatar.PhysicsActor.Velocity = Vector3.Zero; |
281 | Vector3 target = check.LandData.UserLocation; | ||
282 | avatar.TeleportWithMomentum(target); | ||
283 | return; | ||
284 | } | ||
285 | } | ||
286 | } | 281 | } |
287 | } | 282 | else |
288 | public void MoveUserOutOfParcel(ScenePresence avatar) | ||
289 | { | ||
290 | if (avatar.GodLevel == 0) | ||
291 | { | 283 | { |
292 | ILandObject land = m_scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); | 284 | avatar.ControllingClient.SendAlertMessage( |
293 | List<ILandObject> parcelsNear = new List<ILandObject>(); | 285 | "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!"); |
294 | |||
295 | for (int x = -2; x <= 2; x += 2) | ||
296 | { | ||
297 | ILandObject check = GetLandObject(avatar.AbsolutePosition.X + x, avatar.AbsolutePosition.Y); | ||
298 | if (check != null) | ||
299 | { | ||
300 | if (check.IsEitherBannedOrRestricted(avatar.UUID) != true) | ||
301 | { | ||
302 | Vector3 target = new Vector3(avatar.AbsolutePosition.X + x, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z); | ||
303 | avatar.TeleportWithMomentum(target); | ||
304 | avatar.Velocity = new Vector3(-avatar.Velocity.X - 5, avatar.Velocity.Y, avatar.Velocity.Z); | ||
305 | return; | ||
306 | } | ||
307 | } | ||
308 | } | ||
309 | for (int y = -2; y <= 2; y += 2) | ||
310 | { | ||
311 | ILandObject check = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y + y); | ||
312 | if (check != null) | ||
313 | { | ||
314 | if (check.IsEitherBannedOrRestricted(avatar.UUID) != true) | ||
315 | { | ||
316 | Vector3 target = new Vector3(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y + y, avatar.AbsolutePosition.Z); | ||
317 | avatar.TeleportWithMomentum(target); | ||
318 | avatar.Velocity = new Vector3(avatar.Velocity.X, -avatar.Velocity.Y - 5, avatar.Velocity.Z); | ||
319 | return; | ||
320 | } | ||
321 | } | ||
322 | } | ||
323 | } | 286 | } |
324 | } | 287 | } |
325 | 288 | ||
@@ -339,7 +302,16 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
339 | { | 302 | { |
340 | if (parcelAvatarIsEntering.IsBannedFromLand(avatar.UUID)) | 303 | if (parcelAvatarIsEntering.IsBannedFromLand(avatar.UUID)) |
341 | { | 304 | { |
342 | MoveUserOutOfParcel(avatar); | 305 | SendYouAreBannedNotice(avatar); |
306 | } | ||
307 | else if (parcelAvatarIsEntering.IsRestrictedFromLand(avatar.UUID)) | ||
308 | { | ||
309 | avatar.ControllingClient.SendAlertMessage( | ||
310 | "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!)."); | ||
311 | } | ||
312 | else | ||
313 | { | ||
314 | avatar.sentMessageAboutRestrictedParcelFlyingDown = true; | ||
343 | } | 315 | } |
344 | } | 316 | } |
345 | else | 317 | else |
@@ -350,47 +322,28 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
350 | } | 322 | } |
351 | } | 323 | } |
352 | 324 | ||
353 | public void SendOutNearestBanLine(ScenePresence avatar) | 325 | public void SendOutNearestBanLine(IClientAPI avatar) |
354 | { | 326 | { |
355 | ILandObject checkBan = null; | 327 | List<ScenePresence> avatars = m_scene.GetAvatars(); |
356 | for (int x = -2; x <= 2; x += 2) | 328 | foreach (ScenePresence presence in avatars) |
357 | { | ||
358 | checkBan = GetLandObject(avatar.AbsolutePosition.X + x, avatar.AbsolutePosition.Y); | ||
359 | if (checkBan != null) | ||
360 | { | ||
361 | if (avatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT) | ||
362 | { | ||
363 | if (checkBan.IsRestrictedFromLand(avatar.ControllingClient.AgentId)) | ||
364 | { | ||
365 | checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, false, (int)ParcelResult.Single, avatar.ControllingClient); | ||
366 | return; | ||
367 | } | ||
368 | if (checkBan.IsBannedFromLand(avatar.ControllingClient.AgentId)) | ||
369 | { | ||
370 | checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, false, (int)ParcelResult.Single, avatar.ControllingClient); | ||
371 | return; | ||
372 | } | ||
373 | } | ||
374 | } | ||
375 | } | ||
376 | for (int y = -2; y <= 2; y += 2) | ||
377 | { | 329 | { |
378 | checkBan = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y + y); | 330 | if (presence.UUID == avatar.AgentId) |
379 | if (checkBan != null) | ||
380 | { | 331 | { |
381 | if (avatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT) | 332 | List<ILandObject> checkLandParcels = ParcelsNearPoint(presence.AbsolutePosition); |
333 | foreach (ILandObject checkBan in checkLandParcels) | ||
382 | { | 334 | { |
383 | if (checkBan.IsRestrictedFromLand(avatar.ControllingClient.AgentId)) | 335 | if (checkBan.IsBannedFromLand(avatar.AgentId)) |
384 | { | 336 | { |
385 | checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, false, (int)ParcelResult.Single, avatar.ControllingClient); | 337 | checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, false, (int)ParcelResult.Single, avatar); |
386 | return; | 338 | return; //Only send one |
387 | } | 339 | } |
388 | if (checkBan.IsBannedFromLand(avatar.ControllingClient.AgentId)) | 340 | if (checkBan.IsRestrictedFromLand(avatar.AgentId)) |
389 | { | 341 | { |
390 | checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, false, (int)ParcelResult.Single, avatar.ControllingClient); | 342 | checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, false, (int)ParcelResult.Single, avatar); |
391 | return; | 343 | return; //Only send one |
392 | } | 344 | } |
393 | } | 345 | } |
346 | return; | ||
394 | } | 347 | } |
395 | } | 348 | } |
396 | } | 349 | } |
@@ -437,14 +390,25 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
437 | if (clientAvatar != null) | 390 | if (clientAvatar != null) |
438 | { | 391 | { |
439 | SendLandUpdate(clientAvatar); | 392 | SendLandUpdate(clientAvatar); |
440 | SendOutNearestBanLine(clientAvatar); | 393 | SendOutNearestBanLine(remote_client); |
441 | ILandObject parcel = GetLandObject(clientAvatar.AbsolutePosition.X, clientAvatar.AbsolutePosition.Y); | 394 | ILandObject parcel = GetLandObject(clientAvatar.AbsolutePosition.X, clientAvatar.AbsolutePosition.Y); |
442 | if (parcel != null) | 395 | if (parcel != null) |
443 | { | 396 | { |
444 | if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && | 397 | if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && |
398 | clientAvatar.sentMessageAboutRestrictedParcelFlyingDown) | ||
399 | { | ||
400 | EventManagerOnAvatarEnteringNewParcel(clientAvatar, parcel.LandData.LocalID, | ||
401 | m_scene.RegionInfo.RegionID); | ||
402 | //They are going under the safety line! | ||
403 | if (!parcel.IsBannedFromLand(clientAvatar.UUID)) | ||
404 | { | ||
405 | clientAvatar.sentMessageAboutRestrictedParcelFlyingDown = false; | ||
406 | } | ||
407 | } | ||
408 | else if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && | ||
445 | parcel.IsBannedFromLand(clientAvatar.UUID)) | 409 | parcel.IsBannedFromLand(clientAvatar.UUID)) |
446 | { | 410 | { |
447 | MoveUserOutOfParcel(clientAvatar); | 411 | SendYouAreBannedNotice(clientAvatar); |
448 | } | 412 | } |
449 | } | 413 | } |
450 | } | 414 | } |
@@ -492,7 +456,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
492 | 456 | ||
493 | if (land != null) | 457 | if (land != null) |
494 | { | 458 | { |
495 | if (m_scene.Permissions.CanEditParcel(agentID, land)) | 459 | if (agentID == land.LandData.OwnerID) |
496 | { | 460 | { |
497 | land.UpdateAccessList(flags, entries, remote_client); | 461 | land.UpdateAccessList(flags, entries, remote_client); |
498 | } | 462 | } |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 1c65965..1fa8630 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -267,7 +267,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
267 | 267 | ||
268 | public bool IsEitherBannedOrRestricted(UUID avatar) | 268 | public bool IsEitherBannedOrRestricted(UUID avatar) |
269 | { | 269 | { |
270 | if (IsRestrictedFromLand(avatar) || IsBannedFromLand(avatar)) | 270 | if (IsBannedFromLand(avatar)) |
271 | { | ||
272 | return true; | ||
273 | } | ||
274 | else if (IsRestrictedFromLand(avatar)) | ||
271 | { | 275 | { |
272 | return true; | 276 | return true; |
273 | } | 277 | } |
@@ -276,8 +280,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
276 | 280 | ||
277 | public bool IsBannedFromLand(UUID avatar) | 281 | public bool IsBannedFromLand(UUID avatar) |
278 | { | 282 | { |
279 | ScenePresence SP = m_scene.GetScenePresence(avatar); | 283 | if ((LandData.Flags & (uint) ParcelFlags.UseBanList) > 0) |
280 | if ((LandData.Flags & (uint)ParcelFlags.UseBanList) > 0) | ||
281 | { | 284 | { |
282 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | 285 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); |
283 | entry.AgentID = avatar; | 286 | entry.AgentID = avatar; |
@@ -285,22 +288,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
285 | entry.Time = new DateTime(); | 288 | entry.Time = new DateTime(); |
286 | if (LandData.ParcelAccessList.Contains(entry)) | 289 | if (LandData.ParcelAccessList.Contains(entry)) |
287 | { | 290 | { |
288 | if ((LandData.Flags & (uint)ParcelFlags.UseAccessGroup) > 0) | 291 | //They are banned, so lets send them a notice about this parcel |
289 | { | 292 | return true; |
290 | if (LandData.GroupID == SP.ControllingClient.ActiveGroupId) | ||
291 | { | ||
292 | return false; | ||
293 | } | ||
294 | else | ||
295 | { | ||
296 | //They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel | ||
297 | return true; | ||
298 | } | ||
299 | } | ||
300 | else | ||
301 | { | ||
302 | return true; | ||
303 | } | ||
304 | } | 293 | } |
305 | } | 294 | } |
306 | return false; | 295 | return false; |
@@ -308,8 +297,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
308 | 297 | ||
309 | public bool IsRestrictedFromLand(UUID avatar) | 298 | public bool IsRestrictedFromLand(UUID avatar) |
310 | { | 299 | { |
311 | ScenePresence SP = m_scene.GetScenePresence(avatar); | 300 | if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0) |
312 | if ((LandData.Flags & (uint)ParcelFlags.UseAccessList) > 0) | ||
313 | { | 301 | { |
314 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | 302 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); |
315 | entry.AgentID = avatar; | 303 | entry.AgentID = avatar; |
@@ -317,22 +305,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
317 | entry.Time = new DateTime(); | 305 | entry.Time = new DateTime(); |
318 | if (!LandData.ParcelAccessList.Contains(entry)) | 306 | if (!LandData.ParcelAccessList.Contains(entry)) |
319 | { | 307 | { |
320 | if ((LandData.Flags & (uint)ParcelFlags.UseAccessGroup) > 0) | 308 | //They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel |
321 | { | 309 | return true; |
322 | if (LandData.GroupID == SP.ControllingClient.ActiveGroupId) | ||
323 | { | ||
324 | return false; | ||
325 | } | ||
326 | else | ||
327 | { | ||
328 | //They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel | ||
329 | return true; | ||
330 | } | ||
331 | } | ||
332 | else | ||
333 | { | ||
334 | return true; | ||
335 | } | ||
336 | } | 310 | } |
337 | } | 311 | } |
338 | return false; | 312 | return false; |