public void CreateCaps(UUID agentId, uint circuitCode) { int ts = Util.EnvironmentTickCount(); /* this as no business here... * must be done elsewhere ( and is ) * int flags = m_scene.GetUserFlags(agentId); * * m_log.ErrorFormat("[CreateCaps]: banCheck {0} ", Util.EnvironmentTickCountSubtract(ts)); * * if (m_scene.RegionInfo.EstateSettings.IsBanned(agentId, flags)) * return; */ Caps caps; String capsObjectPath = GetCapsPath(agentId); lock (m_capsObjects) { if (m_capsObjects.ContainsKey(circuitCode)) { Caps oldCaps = m_capsObjects[circuitCode]; if (capsObjectPath == oldCaps.CapsObjectPath) { // m_log.WarnFormat( // "[CAPS]: Reusing caps for agent {0} in region {1}. Old caps path {2}, new caps path {3}. ", // agentId, m_scene.RegionInfo.RegionName, oldCaps.CapsObjectPath, capsObjectPath); return; } else { // not reusing add extra melanie cleanup // Remove tge handlers. They may conflict with the // new object created below oldCaps.DeregisterHandlers(); // Better safe ... should not be needed but also // no big deal m_capsObjects.Remove(circuitCode); } } // m_log.DebugFormat( // "[CAPS]: Adding capabilities for agent {0} in {1} with path {2}", // agentId, m_scene.RegionInfo.RegionName, capsObjectPath); caps = new Caps(MainServer.Instance, m_scene.RegionInfo.ExternalHostName, (MainServer.Instance == null) ? 0: MainServer.Instance.Port, capsObjectPath, agentId, m_scene.RegionInfo.RegionName); m_log.DebugFormat("[CreateCaps]: new caps agent {0}, circuit {1}, path {2}, time {3} ", agentId, circuitCode, caps.CapsObjectPath, Util.EnvironmentTickCountSubtract(ts)); m_capsObjects[circuitCode] = caps; } m_scene.EventManager.TriggerOnRegisterCaps(agentId, caps); // m_log.ErrorFormat("[CreateCaps]: end {0} ", Util.EnvironmentTickCountSubtract(ts)); }