From 61b67b2eade480c5fd75c6ba347e117f0e00f055 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 27 Jan 2011 03:49:32 +0100 Subject: [PATCH 1/3] Add TeleportFlags.ViaRegionID to the flags sent on login when the region was entered by hand to determine whether or not to honor the landing point --- .../Services/LLLoginService/LLLoginService.cs | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 75688706cb..1ab63f73db 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -320,7 +320,8 @@ namespace OpenSim.Services.LLLoginService Vector3 position = Vector3.Zero; Vector3 lookAt = Vector3.Zero; GridRegion gatekeeper = null; - GridRegion destination = FindDestination(account, scopeID, guinfo, session, startLocation, home, out gatekeeper, out where, out position, out lookAt); + TeleportFlags flags; + GridRegion destination = FindDestination(account, scopeID, guinfo, session, startLocation, home, out gatekeeper, out where, out position, out lookAt, out flags); if (destination == null) { m_PresenceService.LogoutAgent(session); @@ -343,7 +344,7 @@ namespace OpenSim.Services.LLLoginService string reason = string.Empty; GridRegion dest; AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, - clientVersion, channel, mac, id0, clientIP, out where, out reason, out dest); + clientVersion, channel, mac, id0, clientIP, flags, out where, out reason, out dest); destination = dest; if (aCircuit == null) { @@ -378,8 +379,10 @@ 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) + 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) { + flags = TeleportFlags.ViaLogin; + m_log.DebugFormat("[LLOGIN SERVICE]: FindDestination for start location {0}", startLocation); gatekeeper = null; @@ -473,6 +476,8 @@ namespace OpenSim.Services.LLLoginService } else { + flags |= TeleportFlags.ViaRegionID; + // free uri form // e.g. New Moon&135&46 New Moon@osgrid.org:8002&153&34 where = "url"; @@ -624,7 +629,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, out string where, out string reason, out GridRegion dest) + IPEndPoint clientIP, TeleportFlags flags, out string where, out string reason, out GridRegion dest) { where = currentWhere; ISimulationService simConnector = null; @@ -663,7 +668,7 @@ namespace OpenSim.Services.LLLoginService { circuitCode = (uint)Util.RandomClass.Next(); ; aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, clientIP.Address.ToString(), viewer, channel, mac, id0); - success = LaunchAgentDirectly(simConnector, destination, aCircuit, out reason); + success = LaunchAgentDirectly(simConnector, destination, aCircuit, flags, out reason); if (!success && m_GridService != null) { // Try the fallback regions @@ -672,7 +677,7 @@ namespace OpenSim.Services.LLLoginService { foreach (GridRegion r in fallbacks) { - success = LaunchAgentDirectly(simConnector, r, aCircuit, out reason); + success = LaunchAgentDirectly(simConnector, r, aCircuit, flags | TeleportFlags.ViaRegionID, out reason); if (success) { where = "safe"; @@ -795,9 +800,9 @@ namespace OpenSim.Services.LLLoginService } - private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, out string reason) + private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, TeleportFlags flags, out string reason) { - return simConnector.CreateAgent(region, aCircuit, (int)Constants.TeleportFlags.ViaLogin, out reason); + return simConnector.CreateAgent(region, aCircuit, (uint)flags, out reason); } private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, IPEndPoint clientIP, out string reason) From adb341e32fa60f71eab2876adfd47ea0736e13fb Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 27 Jan 2011 03:54:41 +0100 Subject: [PATCH 2/3] Also set Godlike flag. Might be useful --- OpenSim/Services/LLLoginService/LLLoginService.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 1ab63f73db..d364aa4b9f 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -329,6 +329,8 @@ namespace OpenSim.Services.LLLoginService return LLFailedLoginResponse.GridProblem; } + if (account.UserLevel >= 200) + flags |= TeleportFlags.Godlike; // // Get the avatar // From 17801bd78b339a2a85b318f87f8deae11adb8dc2 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 27 Jan 2011 04:14:41 +0100 Subject: [PATCH 3/3] Add a TeleportFlags member to SP so we can tell how we got there. --- OpenSim/Region/Framework/Scenes/Scene.cs | 4 ++++ OpenSim/Region/Framework/Scenes/ScenePresence.cs | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 71d0f09440..8edf3d3bb8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3279,6 +3279,10 @@ namespace OpenSim.Region.Framework.Scenes } + // Let the SP know how we got here. This has a lot of interesting + // uses down the line. + sp.TeleportFlags = (TeleportFlags)teleportFlags; + // In all cases, add or update the circuit data with the new agent circuit data and teleport flags agent.teleportFlags = teleportFlags; m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index fa2c7b5d37..1c276fa87f 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -130,6 +130,13 @@ namespace OpenSim.Region.Framework.Scenes private bool m_updateflag; private byte m_movementflag; private Vector3? m_forceToApply; + private TeleportFlags m_teleportFlags; + public TeleportFlags TeleportFlags + { + get { return m_teleportFlags; } + set { m_teleportFlags = value; } + } + private uint m_requestedSitTargetID; private UUID m_requestedSitTargetUUID; public bool SitGround = false; @@ -949,6 +956,10 @@ namespace OpenSim.Region.Framework.Scenes /// public void MakeChildAgent() { + // Reset these so that teleporting in and walking out isn't seen + // as teleporting back + m_teleportFlags = TeleportFlags.Default; + // It looks like m_animator is set to null somewhere, and MakeChild // is called after that. Probably in aborted teleports. if (m_animator == null)