Example #1
0
        /// <summary>
        /// Return an LLSD-serializable Hashtable describing the
        /// capabilities and their handler details.
        /// </summary>
        /// <param name="excludeSeed">If true, then exclude the seed cap.</param>
        public Hashtable GetCapsDetails(bool excludeSeed, List <string> requestedCaps)
        {
            Hashtable caps = CapsHandlers.GetCapsDetails(excludeSeed, requestedCaps);

            lock (m_pollServiceHandlers)
            {
                foreach (KeyValuePair <string, PollServiceEventArgs> kvp in m_pollServiceHandlers)
                {
                    if (!requestedCaps.Contains(kvp.Key))
                    {
                        continue;
                    }

                    string hostName = m_httpListenerHostName;
                    uint   port     = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port;
                    string protocol = "http";

                    if (MainServer.Instance.UseSSL)
                    {
                        hostName = MainServer.Instance.SSLCommonName;
                        port     = MainServer.Instance.SSLPort;
                        protocol = "https";
                    }
                    //
                    //            caps.RegisterHandler("FetchInventoryDescendents2", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl));

                    caps[kvp.Key] = string.Format("{0}://{1}:{2}{3}", protocol, hostName, port, kvp.Value.Url);
                }
            }

            // Add the external too
            foreach (KeyValuePair <string, string> kvp in ExternalCapsHandlers)
            {
                if (!requestedCaps.Contains(kvp.Key))
                {
                    continue;
                }

                caps[kvp.Key] = kvp.Value;
            }

            Flags |= CapsFlags.SentSeeds;
            return(caps);
        }
Example #2
0
        /// <summary>
        /// Return an LLSD-serializable Hashtable describing the
        /// capabilities and their handler details.
        /// </summary>
        /// <param name="excludeSeed">If true, then exclude the seed cap.</param>
        public Hashtable GetCapsDetails(bool excludeSeed, List <string> requestedCaps)
        {
            Hashtable caps = CapsHandlers.GetCapsDetails(excludeSeed, requestedCaps);

            m_pollServiceHandlers.ForEach(delegate(KeyValuePair <string, PollServiceEventArgs> kvp)
            {
                if (!requestedCaps.Contains(kvp.Key))
                {
                    return;
                }

                string hostName = m_httpListenerHostName;
                uint port       = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port;
                string protocol = "http";

                if (MainServer.Instance.UseSSL)
                {
                    hostName = MainServer.Instance.SSLCommonName;
                    port     = MainServer.Instance.SSLPort;
                    protocol = "https";
                }

                caps[kvp.Key] = string.Format("{0}://{1}:{2}{3}", protocol, hostName, port, kvp.Value.Url);
            });

            // Add the external too
            m_externalCapsHandlers.ForEach(delegate(KeyValuePair <string, string> kvp)
            {
                if (!requestedCaps.Contains(kvp.Key))
                {
                    return;
                }

                caps[kvp.Key] = kvp.Value;
            });

            return(caps);
        }