aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2011-02-16 05:23:30 +0100
committerMelanie2011-02-16 05:23:30 +0100
commit3f93db83711956dbef8870d5b997e3bc12d16c46 (patch)
tree1d7c482b31a4ff0d8feb357c5d00a2d257bf6033 /OpenSim/Region
parentChange the QUERYACCESS method to eliminate spurious access denied messages (diff)
downloadopensim-SC_OLD-3f93db83711956dbef8870d5b997e3bc12d16c46.zip
opensim-SC_OLD-3f93db83711956dbef8870d5b997e3bc12d16c46.tar.gz
opensim-SC_OLD-3f93db83711956dbef8870d5b997e3bc12d16c46.tar.bz2
opensim-SC_OLD-3f93db83711956dbef8870d5b997e3bc12d16c46.tar.xz
Streamline ban line processing. Remove remnants of old advisory messages.
Centralize ban checking and prepare for adding a "ban and eject" function.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs82
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs1
2 files changed, 24 insertions, 59 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index b671aec..ad75ea5 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -163,13 +163,6 @@ namespace OpenSim.Region.CoreModules.World.Land
163 m_scene.UnregisterModuleCommander(m_commander.Name); 163 m_scene.UnregisterModuleCommander(m_commander.Name);
164 } 164 }
165 165
166// private bool OnVerifyUserConnection(ScenePresence scenePresence, out string reason)
167// {
168// ILandObject nearestParcel = m_scene.GetNearestAllowedParcel(scenePresence.UUID, scenePresence.AbsolutePosition.X, scenePresence.AbsolutePosition.Y);
169// reason = "You are not allowed to enter this sim.";
170// return nearestParcel != null;
171// }
172
173 /// <summary> 166 /// <summary>
174 /// Processes commandline input. Do not call directly. 167 /// Processes commandline input. Do not call directly.
175 /// </summary> 168 /// </summary>
@@ -364,31 +357,7 @@ namespace OpenSim.Region.CoreModules.World.Land
364 } 357 }
365 358
366 if (parcelAvatarIsEntering != null) 359 if (parcelAvatarIsEntering != null)
367 { 360 EnforceBans(parcelAvatarIsEntering, avatar);
368 if (avatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT)
369 {
370 if (parcelAvatarIsEntering.IsEitherBannedOrRestricted(avatar.UUID))
371 {
372 SendYouAreBannedNotice(avatar);
373 ForceAvatarToPosition(avatar, avatar.lastKnownAllowedPosition);
374 //ForceAvatarToPosition(avatar, m_scene.GetNearestAllowedPosition(avatar));
375 }
376 else if (parcelAvatarIsEntering.IsRestrictedFromLand(avatar.UUID))
377 {
378 SendYouAreRestrictedNotice(avatar);
379 ForceAvatarToPosition(avatar, avatar.lastKnownAllowedPosition);
380 //ForceAvatarToPosition(avatar, m_scene.GetNearestAllowedPosition(avatar));
381 }
382 else
383 {
384 avatar.sentMessageAboutRestrictedParcelFlyingDown = true;
385 }
386 }
387 else
388 {
389 avatar.sentMessageAboutRestrictedParcelFlyingDown = true;
390 }
391 }
392 } 361 }
393 } 362 }
394 363
@@ -460,32 +429,7 @@ namespace OpenSim.Region.CoreModules.World.Land
460 SendOutNearestBanLine(remote_client); 429 SendOutNearestBanLine(remote_client);
461 ILandObject parcel = GetLandObject(clientAvatar.AbsolutePosition.X, clientAvatar.AbsolutePosition.Y); 430 ILandObject parcel = GetLandObject(clientAvatar.AbsolutePosition.X, clientAvatar.AbsolutePosition.Y);
462 if (parcel != null) 431 if (parcel != null)
463 { 432 EnforceBans(parcel, clientAvatar);
464 if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT &&
465 clientAvatar.sentMessageAboutRestrictedParcelFlyingDown)
466 {
467 EventManagerOnAvatarEnteringNewParcel(clientAvatar, parcel.LandData.LocalID,
468 m_scene.RegionInfo.RegionID);
469 //They are going under the safety line!
470 if (!parcel.IsBannedFromLand(clientAvatar.UUID))
471 {
472 clientAvatar.sentMessageAboutRestrictedParcelFlyingDown = false;
473 }
474 }
475 else if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT &&
476 parcel.IsBannedFromLand(clientAvatar.UUID))
477 {
478 // SendYouAreBannedNotice(clientAvatar);
479 //ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar));
480 ForceAvatarToPosition(clientAvatar, clientAvatar.lastKnownAllowedPosition);
481 }
482 else if (parcel.IsRestrictedFromLand(clientAvatar.UUID))
483 {
484 // SendYouAreRestrictedNotice(clientAvatar);
485 //ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar));
486 ForceAvatarToPosition(clientAvatar, clientAvatar.lastKnownAllowedPosition);
487 }
488 }
489 } 433 }
490 } 434 }
491 435
@@ -2005,5 +1949,27 @@ namespace OpenSim.Region.CoreModules.World.Land
2005 1949
2006 MainConsole.Instance.Output(report.ToString()); 1950 MainConsole.Instance.Output(report.ToString());
2007 } 1951 }
1952
1953 public void EnforceBans(ILandObject land, ScenePresence avatar)
1954 {
1955 if (avatar.AbsolutePosition.Z > LandChannel.BAN_LINE_SAFETY_HIEGHT)
1956 return;
1957
1958 if (land.IsEitherBannedOrRestricted(avatar.UUID))
1959 {
1960 if (land.ContainsPoint(Convert.ToInt32(avatar.lastKnownAllowedPosition.X), Convert.ToInt32(avatar.lastKnownAllowedPosition.Y)))
1961 {
1962 Vector3? pos = m_scene.GetNearestAllowedPosition(avatar);
1963 if (pos == null)
1964 m_scene.TeleportClientHome(avatar.UUID, avatar.ControllingClient);
1965 else
1966 ForceAvatarToPosition(avatar, (Vector3)pos);
1967 }
1968 else
1969 {
1970 ForceAvatarToPosition(avatar, avatar.lastKnownAllowedPosition);
1971 }
1972 }
1973 }
2008 } 1974 }
2009} 1975}
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index b54d1b8..af24ed3 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -123,7 +123,6 @@ namespace OpenSim.Region.Framework.Scenes
123 private SceneObjectGroup proxyObjectGroup; 123 private SceneObjectGroup proxyObjectGroup;
124 //private SceneObjectPart proxyObjectPart = null; 124 //private SceneObjectPart proxyObjectPart = null;
125 public Vector3 lastKnownAllowedPosition; 125 public Vector3 lastKnownAllowedPosition;
126 public bool sentMessageAboutRestrictedParcelFlyingDown;
127 public Vector4 CollisionPlane = Vector4.UnitW; 126 public Vector4 CollisionPlane = Vector4.UnitW;
128 127
129 private Vector3 m_avInitialPos; // used to calculate unscripted sit rotation 128 private Vector3 m_avInitialPos; // used to calculate unscripted sit rotation