From aaef497afbedef9382c9afdcb9f8d0d5b0a0e0bc Mon Sep 17 00:00:00 2001 From: onefang Date: Wed, 9 Sep 2020 22:59:24 +1000 Subject: Various teleport fixes. TPs from scripts avoid all that silly raycasting nonsense, just go where we ask. For the "teleport from above" case, do the right thing. Which includes looking for designated floor prims, which have ^ as the first character of their description. Don't do "teleport from above" when we have proper coords. Teleport home from off grid shouldn't land on roofs either. --- OpenSim/Services/LLLoginService/LLLoginService.cs | 28 ++++++++++++----------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'OpenSim/Services/LLLoginService/LLLoginService.cs') diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 7aa18b1..06e3d8d 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -534,7 +534,7 @@ namespace OpenSim.Services.LLLoginService Vector3 position = Vector3.Zero; Vector3 lookAt = Vector3.Zero; GridRegion gatekeeper = null; - TeleportFlags flags; + Constants.TeleportFlags flags; GridRegion destination = FindDestination(account, scopeID, guinfo, session, startLocation, home, out gatekeeper, out where, out position, out lookAt, out flags); if (destination == null) { @@ -553,7 +553,7 @@ namespace OpenSim.Services.LLLoginService } if (account.UserLevel >= 200) - flags |= TeleportFlags.Godlike; + flags |= Constants.TeleportFlags.Godlike; // // Get the avatar // @@ -627,9 +627,9 @@ namespace OpenSim.Services.LLLoginService protected GridRegion FindDestination( UserAccount account, UUID scopeID, GridUserInfo pinfo, UUID sessionID, string startLocation, GridRegion home, out GridRegion gatekeeper, - out string where, out Vector3 position, out Vector3 lookAt, out TeleportFlags flags) + out string where, out Vector3 position, out Vector3 lookAt, out Constants.TeleportFlags flags) { - flags = TeleportFlags.ViaLogin; + flags = Constants.TeleportFlags.ViaLogin; m_log.DebugFormat( "[LLOGIN SERVICE]: Finding destination matching start location {0} for {1}", @@ -663,7 +663,7 @@ namespace OpenSim.Services.LLLoginService position = pinfo.HomePosition; lookAt = pinfo.HomeLookAt; - flags |= TeleportFlags.ViaHome; + flags |= Constants.TeleportFlags.ViaHome; } if (tryDefaults) @@ -671,7 +671,7 @@ namespace OpenSim.Services.LLLoginService List defaults = m_GridService.GetDefaultRegions(scopeID); if (defaults != null && defaults.Count > 0) { - flags |= TeleportFlags.ViaRegionID; + flags |= Constants.TeleportFlags.ViaRegionID; region = defaults[0]; where = "safe"; } @@ -682,7 +682,7 @@ namespace OpenSim.Services.LLLoginService region = FindAlternativeRegion(scopeID); if (region != null) { - flags |= TeleportFlags.ViaRegionID; + flags |= Constants.TeleportFlags.ViaRegionID; where = "safe"; } } @@ -705,7 +705,7 @@ namespace OpenSim.Services.LLLoginService List defaults = m_GridService.GetDefaultRegions(scopeID); if (defaults != null && defaults.Count > 0) { - flags |= TeleportFlags.ViaRegionID; + flags |= Constants.TeleportFlags.ViaRegionID; region = defaults[0]; where = "safe"; } @@ -715,7 +715,7 @@ namespace OpenSim.Services.LLLoginService region = FindAlternativeRegion(scopeID); if (region != null) { - flags |= TeleportFlags.ViaRegionID; + flags |= Constants.TeleportFlags.ViaRegionID; where = "safe"; } } @@ -730,7 +730,7 @@ namespace OpenSim.Services.LLLoginService } else { - flags |= TeleportFlags.ViaRegionID; + flags |= Constants.TeleportFlags.ViaRegionID; // free uri form // e.g. New Moon&135&46 New Moon@osgrid.org:8002&153&34 @@ -748,6 +748,8 @@ namespace OpenSim.Services.LLLoginService position = new Vector3(float.Parse(uriMatch.Groups["x"].Value, Culture.NumberFormatInfo), float.Parse(uriMatch.Groups["y"].Value, Culture.NumberFormatInfo), float.Parse(uriMatch.Groups["z"].Value, Culture.NumberFormatInfo)); + if (0 == position.Z) + flags |= Constants.TeleportFlags.ViaMap; string regionName = uriMatch.Groups["region"].ToString(); if (regionName != null) @@ -900,7 +902,7 @@ namespace OpenSim.Services.LLLoginService protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarAppearance avatar, UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, string channel, string mac, string id0, - IPEndPoint clientIP, TeleportFlags flags, out string where, out string reason, out GridRegion dest) + IPEndPoint clientIP, Constants.TeleportFlags flags, out string where, out string reason, out GridRegion dest) { where = currentWhere; ISimulationService simConnector = null; @@ -937,7 +939,7 @@ namespace OpenSim.Services.LLLoginService { foreach (GridRegion r in fallbacks) { - success = LaunchAgentDirectly(simConnector, r, aCircuit, flags | TeleportFlags.ViaRegionID, out reason); + success = LaunchAgentDirectly(simConnector, r, aCircuit, flags | Constants.TeleportFlags.ViaRegionID | Constants.TeleportFlags.ViaMap, out reason); if (success) { where = "safe"; @@ -1083,7 +1085,7 @@ namespace OpenSim.Services.LLLoginService } - private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, TeleportFlags flags, out string reason) + private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, Constants.TeleportFlags flags, out string reason) { EntityTransferContext ctx = new EntityTransferContext(); -- cgit v1.1