From 5b43f9cac47267a5400001445b05f137ae452ee7 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 6 Jan 2011 12:47:13 -0800 Subject: [PATCH] HG bug fix. Must wait for client's UDP contact before getting scene presence. --- OpenSim/Region/Framework/Scenes/Scene.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index e27b2ba7ab..12fd813e0c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2592,12 +2592,19 @@ namespace OpenSim.Region.Framework.Scenes // and the scene presence and the client, if they exist try { - ScenePresence sp = GetScenePresence(agentID); - PresenceService.LogoutAgent(sp.ControllingClient.SessionId); - + // We need to wait for the client to make UDP contact first. + // It's the UDP contact that creates the scene presence + ScenePresence sp = WaitGetScenePresence(agentID); if (sp != null) - sp.ControllingClient.Close(); + { + PresenceService.LogoutAgent(sp.ControllingClient.SessionId); + sp.ControllingClient.Close(); + } + else + { + m_log.WarnFormat("[SCENE]: Could not find scene presence for {0}", agentID); + } // BANG! SLASH! m_authenticateHandler.RemoveCircuit(agentID);