From 74524cb3be8ffcc4a0debf2091ab71517a7a4791 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 24 Aug 2017 01:30:57 +0100 Subject: (un)eject flag is only lowest bit, only protect active gods from freeze; do not check landing point (telehubs) on eject. --- OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index f422708..95b1af9 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -2204,12 +2204,12 @@ namespace OpenSim.Region.CoreModules.World.Land ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager); System.Threading.Timer Timer; - if (targetAvatar.GodController.UserLevel == 0) + if (targetAvatar.GodController.UserLevel < 200) { ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y); if (!((Scene)client.Scene).Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze, true)) return; - if (flags == 0) + if ((flags & 1) == 0) // only lowest bit has meaning for now { targetAvatar.AllowMovement = false; targetAvatar.ControllingClient.SendAlertMessage(parcelManager.Firstname + " " + parcelManager.Lastname + " has frozen you for 30 seconds. You cannot move or interact with the world."); @@ -2261,7 +2261,7 @@ namespace OpenSim.Region.CoreModules.World.Land Vector3 pos = m_scene.GetNearestAllowedPosition(targetAvatar, land); - targetAvatar.TeleportWithMomentum(pos, null); + targetAvatar.TeleportOnEject(pos); targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname); parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected."); -- cgit v1.1 From 1a7c8893ee47da7d872c06b9da0181bb4c473c14 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 24 Aug 2017 01:38:04 +0100 Subject: add missing file. Also in last commit comment the flag was relative to (un)freeze no t(un)eject --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index ba3aaae..22860b1 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1619,8 +1619,8 @@ namespace OpenSim.Region.Framework.Scenes public void TeleportWithMomentum(Vector3 pos, Vector3? v) { - if(!CheckLocalTPLandingPoint(ref pos)) - return; + if(!CheckLocalTPLandingPoint(ref pos)) + return; if (ParentID != (uint)0) StandUp(); @@ -1642,6 +1642,20 @@ namespace OpenSim.Region.Framework.Scenes SendTerseUpdateToAllClients(); } + public void TeleportOnEject(Vector3 pos) + { + if (ParentID != (uint)0) + StandUp(); + + bool isFlying = Flying; + RemoveFromPhysicalScene(); + + AbsolutePosition = pos; + + AddToPhysicalScene(isFlying); + SendTerseUpdateToAllClients(); + } + public void avnLocalTeleport(Vector3 newpos, Vector3? newvel, bool rotateToVelXY) { if(!CheckLocalTPLandingPoint(ref newpos)) -- cgit v1.1 From c5802c94608f7dbd39bb8dd03ecd409fbae83f22 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 24 Aug 2017 01:47:01 +0100 Subject: change a few more parcel eject code paths --- OpenSim/Region/CoreModules/World/Land/LandObject.cs | 2 +- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 07d11f9..4471432 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -1886,7 +1886,7 @@ namespace OpenSim.Region.CoreModules.World.Land if (land.LandData.LocalID == LandData.LocalID) { Vector3 pos = m_scene.GetNearestAllowedPosition(presence, land); - presence.TeleportWithMomentum(pos, null); + presence.TeleportOnEject(pos); presence.ControllingClient.SendAlertMessage("You have been ejected from this land"); } } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 22860b1..f9c7031 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1619,7 +1619,7 @@ namespace OpenSim.Region.Framework.Scenes public void TeleportWithMomentum(Vector3 pos, Vector3? v) { - if(!CheckLocalTPLandingPoint(ref pos)) + if(!CheckLocalTPLandingPoint(ref pos)) return; if (ParentID != (uint)0) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index b810ffb..fa32986 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -6827,7 +6827,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (m_host.OwnerID == land.LandData.OwnerID) { Vector3 p = World.GetNearestAllowedPosition(presence, land); - presence.TeleportWithMomentum(p, null); + presence.TeleportOnEject(p); presence.ControllingClient.SendAlertMessage("You have been ejected from this land"); } } -- cgit v1.1 From 05b8ead8b236c041b9128ae07ce8160c12a44f35 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 24 Aug 2017 02:11:40 +0100 Subject: frozen avatars should not do local teleports. Possible none should not be allowed, but that may be abusive --- .../Framework/EntityTransfer/EntityTransferModule.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index c93c54d..9b094f7 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -371,7 +371,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer teleportFlags |= (uint)TeleportFlags.Godlike; } - if (!sp.Scene.Permissions.CanTeleport(sp.UUID)) + else if (!sp.Scene.Permissions.CanTeleport(sp.UUID)) return; string destinationRegionName = "(not found)"; @@ -391,17 +391,27 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer try { - // Reset animations; the viewer does that in teleports. - sp.Animator.ResetAnimations(); if (regionHandle == sp.Scene.RegionInfo.RegionHandle) { + if(!sp.AllowMovement) + { + sp.ControllingClient.SendTeleportFailed("You are frozen"); + m_entityTransferStateMachine.ResetFromTransit(sp.UUID); + return; + } + + // Reset animations; the viewer does that in teleports. + sp.Animator.ResetAnimations(); destinationRegionName = sp.Scene.RegionInfo.RegionName; TeleportAgentWithinRegion(sp, position, lookAt, teleportFlags); } else // Another region possibly in another simulator { + // Reset animations; the viewer does that in teleports. + sp.Animator.ResetAnimations(); + GridRegion finalDestination = null; try { -- cgit v1.1