From 7bdcf9eb26842af57e31f3cecd4f403a39a27bc0 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Sat, 18 Feb 2012 00:32:09 -0500 Subject: Propagate our teleport flags on logins --- OpenSim/Services/HypergridService/GatekeeperService.cs | 8 ++++++-- OpenSim/Services/LLLoginService/LLLoginService.cs | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index 5d99c79..0a59f86 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs @@ -188,9 +188,9 @@ namespace OpenSim.Services.HypergridService string authURL = string.Empty; if (aCircuit.ServiceURLs.ContainsKey("HomeURI")) authURL = aCircuit.ServiceURLs["HomeURI"].ToString(); - m_log.InfoFormat("[GATEKEEPER SERVICE]: Login request for {0} {1} @ {2} ({3}) at {4} using viewer {5}, channel {6}, IP {7}, Mac {8}, Id0 {9}", + m_log.InfoFormat("[GATEKEEPER SERVICE]: Login request for {0} {1} @ {2} ({3}) at {4} using viewer {5}, channel {6}, IP {7}, Mac {8}, Id0 {9} Teleport Flags {10}", aCircuit.firstname, aCircuit.lastname, authURL, aCircuit.AgentID, destination.RegionName, - aCircuit.Viewer, aCircuit.Channel, aCircuit.IPAddress, aCircuit.Mac, aCircuit.Id0); + aCircuit.Viewer, aCircuit.Channel, aCircuit.IPAddress, aCircuit.Mac, aCircuit.Id0, aCircuit.teleportFlags.ToString()); // // Check client @@ -315,6 +315,10 @@ namespace OpenSim.Services.HypergridService // Finally launch the agent at the destination // Constants.TeleportFlags loginFlag = isFirstLogin ? Constants.TeleportFlags.ViaLogin : Constants.TeleportFlags.ViaHGLogin; + + // Preserve our TeleportFlags we have gathered so-far + loginFlag |= (Constants.TeleportFlags) aCircuit.teleportFlags; + m_log.DebugFormat("[GATEKEEPER SERVICE]: launching agent {0}", loginFlag); return m_SimulationService.CreateAgent(destination, aCircuit, (uint)loginFlag, out reason); } diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 02b5cc1..5dff512 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -465,6 +465,7 @@ namespace OpenSim.Services.LLLoginService position = pinfo.HomePosition; lookAt = pinfo.HomeLookAt; + flags |= TeleportFlags.ViaHome; } if (tryDefaults) @@ -753,6 +754,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); + aCircuit.teleportFlags |= (uint)flags; success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, clientIP, out reason); if (!success && m_GridService != null) { -- cgit v1.1 From 99b9c1a9d5d4d9b76609ab8f91dd8d9ebe248ff5 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 20 Feb 2012 10:58:07 -0800 Subject: More improvements on agent position updates: if the target sims fail, blacklist them for 2 min, so that we don't keep doing remote calls that fail. --- .../Simulation/SimulationServiceConnector.cs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index c45f456..c45e312 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -153,6 +153,7 @@ namespace OpenSim.Services.Connectors.Simulation return UpdateAgent(destination, (IAgentData)data, 200000); // yes, 200 seconds } + private ExpiringCache _failedSims = new ExpiringCache(); /// /// Send updated position information about an agent in this region to a neighbor /// This operation may be called very frequently if an avatar is moving about in @@ -160,6 +161,10 @@ namespace OpenSim.Services.Connectors.Simulation /// public bool UpdateAgent(GridRegion destination, AgentPosition data) { + bool v = true; + if (_failedSims.TryGetValue(destination.ServerURI, out v)) + return false; + // The basic idea of this code is that the first thread that needs to // send an update for a specific avatar becomes the worker for any subsequent // requests until there are no more outstanding requests. Further, only send the most @@ -183,9 +188,10 @@ namespace OpenSim.Services.Connectors.Simulation // Otherwise update the reference and start processing m_updateAgentQueue[uri] = data; } - + AgentPosition pos = null; - while (true) + bool success = true; + while (success) { lock (m_updateAgentQueue) { @@ -205,11 +211,13 @@ namespace OpenSim.Services.Connectors.Simulation } } - UpdateAgent(destination, (IAgentData)pos, 10000); + success = UpdateAgent(destination, (IAgentData)pos, 10000); } - - // unreachable -// return true; + // we get here iff success == false + // blacklist sim for 2 minutes + _failedSims.AddOrUpdate(destination.ServerURI, true, 120); + m_updateAgentQueue.Clear(); + return false; } /// -- cgit v1.1 From 4a329098e8eba012cbf9f66627443968cbf9d726 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 20 Feb 2012 11:12:02 -0800 Subject: Amend to last commit: synchronize access to queues. --- .../Services/Connectors/Simulation/SimulationServiceConnector.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index c45e312..65f01b3 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -215,8 +215,11 @@ namespace OpenSim.Services.Connectors.Simulation } // we get here iff success == false // blacklist sim for 2 minutes - _failedSims.AddOrUpdate(destination.ServerURI, true, 120); - m_updateAgentQueue.Clear(); + lock (m_updateAgentQueue) + { + _failedSims.AddOrUpdate(destination.ServerURI, true, 120); + m_updateAgentQueue.Remove(uri); + } return false; } -- cgit v1.1 From 1dfc9902649bfb4f02340644a0589fe139a3322a Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 23 Feb 2012 01:40:30 +0000 Subject: Add a position parameter to region crossing of objects. This avoids the potential bad update that places an object at the opposite side of the origin sim for a moment before actually crossing it. Especially important in grids like OSG where lag between sims is high. --- OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | 3 ++- OpenSim/Services/Interfaces/ISimulationService.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 65f01b3..cb003d1 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -408,7 +408,7 @@ namespace OpenSim.Services.Connectors.Simulation /// /// /// - public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall) + public bool CreateObject(GridRegion destination, Vector3 newPosition, ISceneObject sog, bool isLocalCall) { // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: CreateObject start"); @@ -421,6 +421,7 @@ namespace OpenSim.Services.Connectors.Simulation args["sog"] = OSD.FromString(sog.ToXml2()); args["extra"] = OSD.FromString(sog.ExtraToXmlString()); args["modified"] = OSD.FromBoolean(sog.HasGroupChanged); + args["new_position"] = newPosition.ToString(); string state = sog.GetStateSnapshot(); if (state.Length > 0) diff --git a/OpenSim/Services/Interfaces/ISimulationService.cs b/OpenSim/Services/Interfaces/ISimulationService.cs index 5f9ce6d..36fd6fc 100644 --- a/OpenSim/Services/Interfaces/ISimulationService.cs +++ b/OpenSim/Services/Interfaces/ISimulationService.cs @@ -98,7 +98,7 @@ namespace OpenSim.Services.Interfaces /// /// /// - bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall); + bool CreateObject(GridRegion destination, Vector3 newPosition, ISceneObject sog, bool isLocalCall); /// /// Create an object from the user's inventory in the destination region. -- cgit v1.1