From df773ee8c37d3d6c9de32d76cc0632298b30e93b Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 24 Sep 2014 20:57:23 +0100 Subject: [PATCH] make CreateAgent sync for logins, async for other cases --- .../Handlers/Simulation/AgentHandlers.cs | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 1087a71755..466b6f8ebb 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -387,20 +387,25 @@ namespace OpenSim.Server.Handlers.Simulation protected virtual bool CreateAgent(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, out string reason) { reason = String.Empty; -/* - Util.FireAndForget(x => + if ((teleportFlags & (uint)TeleportFlags.ViaLogin) == 0) { - string r; - m_SimulationService.CreateAgent(destination, aCircuit, teleportFlags, out r); + Util.FireAndForget(x => + { + string r; + m_SimulationService.CreateAgent(destination, aCircuit, teleportFlags, out r); + m_log.DebugFormat("[AGENT HANDLER]: ASYNC CreateAgent {0} {1}", r); + }); + + return true; + } + else + { + + bool ret = m_SimulationService.CreateAgent(destination, aCircuit, teleportFlags, out reason); + m_log.DebugFormat("[AGENT HANDLER]: SYNC CreateAgent {0} {1}", ret.ToString(), reason); + return ret; + } - }); - - return true; -*/ - bool ret = m_SimulationService.CreateAgent(destination, aCircuit, teleportFlags, out reason); - m_log.DebugFormat("[AGENT HANDLER]: CreateAgent {0} {1}", ret.ToString(),reason); - return ret; - } }