Ejemplo n.º 1
0
        private void RegisterCaps(UUID agentID, Caps caps)
        {
            if (m_Url == "localhost")
            {
                string capUrl = "/CAPS/" + UUID.Random() + "/";

                // Register this as a poll service
                PollServiceTextureEventArgs args = new PollServiceTextureEventArgs(agentID, m_scene);

                args.Type = PollServiceEventArgs.EventType.Texture;
                MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args);

                string hostName = m_scene.RegionInfo.ExternalHostName;
                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";
                }
                IExternalCapsModule handler = m_scene.RequestModuleInterface <IExternalCapsModule>();
                if (handler != null)
                {
                    handler.RegisterExternalUserCapsHandler(agentID, caps, "GetTexture", capUrl);
                }
                else
                {
                    caps.RegisterHandler("GetTexture", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl));
                }
                m_pollservices[agentID] = args;
                m_capsDict[agentID]     = capUrl;
            }
            else
            {
                caps.RegisterHandler("GetTexture", m_Url);
            }
        }
Ejemplo n.º 2
0
        private void RegisterCaps(UUID agentID, Caps caps)
        {
            if (m_Url == "localhost")
            {
                string capUrl = "/CAPS/" + UUID.Random() + "/";

                // Register this as a poll service           
                PollServiceTextureEventArgs args = new PollServiceTextureEventArgs(agentID, m_scene);
                
                args.Type = PollServiceEventArgs.EventType.Texture;
                MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args);

                string hostName = m_scene.RegionInfo.ExternalHostName;
                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";
                }
                IExternalCapsModule handler = m_scene.RequestModuleInterface<IExternalCapsModule>();
                if (handler != null)
                    handler.RegisterExternalUserCapsHandler(agentID, caps, "GetTexture", capUrl);
                else
                    caps.RegisterHandler("GetTexture", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl));
                m_pollservices[agentID] = args;
                m_capsDict[agentID] = capUrl;
            }
            else
            {
                caps.RegisterHandler("GetTexture", m_Url);
            }
        }