Пример #1
0
        public void OnRegisterCaps(UUID agentID, Caps caps)
        {
//            m_log.DebugFormat(
//                "[MOAP]: Registering ObjectMedia and ObjectMediaNavigate capabilities for agent {0}", agentID);

            string omCapUrl = "/CAPS/" + UUID.Random();

            m_omCap.Remove(agentID);
            m_omCap.Remove(omCapUrl);
            m_omCap.Add(omCapUrl, agentID);

            // Even though we're registering for POST we're going to get GETS and UPDATES too
            caps.RegisterHandler(
                "ObjectMedia",
                new RestStreamHandler(
                    "POST", omCapUrl, HandleObjectMediaMessage, "ObjectMedia", agentID.ToString()));

            string omuCapUrl = "/CAPS/" + UUID.Random();

            m_omuCap.Remove(agentID);
            m_omuCap.Remove(omuCapUrl);
            m_omuCap.Add(omuCapUrl, agentID);

            // Even though we're registering for POST we're going to get GETS and UPDATES too
            caps.RegisterHandler(
                "ObjectMediaNavigate",
                new RestStreamHandler(
                    "POST", omuCapUrl, HandleObjectMediaNavigateMessage, "ObjectMediaNavigate", agentID.ToString()));
        }
Пример #2
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capID = UUID.Random();

            //caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
            if (m_URL == "localhost")
            {
                //                m_log.DebugFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
                caps.RegisterHandler(
                    "GetTexture",
                    new GetTextureHandler("/CAPS/" + capID + "/", m_assetService, "GetTexture", agentID.ToString()));
            }
            else
            {
                //                m_log.DebugFormat("[GETTEXTURE]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
                IExternalCapsModule handler = m_scene.RequestModuleInterface <IExternalCapsModule>();
                if (handler != null)
                {
                    handler.RegisterExternalUserCapsHandler(agentID, caps, "GetTexture", m_URL);
                }
                else
                {
                    caps.RegisterHandler("GetTexture", m_URL);
                }
            }
        }
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            //            UUID capID = UUID.Random();

            //caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
            if (m_URL == "localhost")
            {
                //                m_log.DebugFormat("[GETMESH]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
                GetMeshHandler  gmeshHandler = new GetMeshHandler(m_AssetService);
                IRequestHandler reqHandler
                    = new RestHTTPHandler(
                          "GET",
                          "/CAPS/" + UUID.Random(),
                          httpMethod => gmeshHandler.ProcessGetMesh(httpMethod, UUID.Zero, null),
                          "GetMesh",
                          agentID.ToString());

                caps.RegisterHandler("GetMesh", reqHandler);
            }
            else
            {
                //                m_log.DebugFormat("[GETMESH]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
                caps.RegisterHandler("GetMesh", m_URL);
            }
        }
Пример #4
0
        public void RegisterCaps(UUID agent, Caps caps)
        {
            UUID capId = UUID.Random();

            caps.RegisterHandler("AgentPreferences",
                                 new RestStreamHandler("POST", "/CAPS/" + capId,
                                                       delegate(string request, string path, string param,
                                                                IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
            {
                return(UpdateAgentPreferences(request, path, param, agent));
            }));
            caps.RegisterHandler("UpdateAgentLanguage",
                                 new RestStreamHandler("POST", "/CAPS/" + capId,
                                                       delegate(string request, string path, string param,
                                                                IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
            {
                return(UpdateAgentPreferences(request, path, param, agent));
            }));
            caps.RegisterHandler("UpdateAgentInformation",
                                 new RestStreamHandler("POST", "/CAPS/" + capId,
                                                       delegate(string request, string path, string param,
                                                                IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
            {
                return(UpdateAgentPreferences(request, path, param, agent));
            }));
        }
Пример #5
0
        private void RegisterFetchCap(UUID agentID, Caps caps, string capName, string url)
        {
            string capUrl;

            if (url == "localhost")
            {
                capUrl = "/CAPS/" + UUID.Random();

                IRequestHandler reqHandler
                    = new RestStreamHandler(
                          "POST",
                          capUrl,
                          m_webFetchHandler.FetchInventoryDescendentsRequest,
                          "FetchInventoryDescendents2",
                          agentID.ToString());

                caps.RegisterHandler(capName, reqHandler);
            }
            else
            {
                capUrl = url;

                caps.RegisterHandler(capName, capUrl);
            }

//            m_log.DebugFormat(
//                "[WEB FETCH INV DESC MODULE]: Registered capability {0} at {1} in region {2} for {3}",
//                capName, capUrl, m_scene.RegionInfo.RegionName, agentID);
        }
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capID = UUID.Random();

            if (m_URL == "localhost")
            {
                m_log.DebugFormat("[GET_DISPLAY_NAMES]: /CAPS/agents/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
                caps.RegisterHandler(
                    "GetDisplayNames",
                    new GetDisplayNamesHandler("/CAPS/agents" + capID + "/", m_UserManager, "GetDisplayNames", agentID.ToString()));
            }
            else
            {
//                m_log.DebugFormat("[GETTEXTURE]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
                IExternalCapsModule handler = m_scene.RequestModuleInterface <IExternalCapsModule>();
                if (handler != null)
                {
                    handler.RegisterExternalUserCapsHandler(agentID, caps, "GetDisplayNames", m_URL);
                }
                else
                {
                    caps.RegisterHandler("GetDisplayNames", m_URL);
                }
            }
        }
Пример #7
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
//            UUID capID = UUID.Random();
            if (m_URL == "localhost")
            {
                string capUrl = "/CAPS/" + UUID.Random() + "/";

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

                args.Type = PollServiceEventArgs.EventType.Mesh;
                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";
                }
                caps.RegisterHandler("GetMesh", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl));
                m_pollservices[agentID] = args;
                m_capsDict[agentID]     = capUrl;
            }
            else
            {
                caps.RegisterHandler("GetMesh", m_URL);
            }
        }
Пример #8
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            IRequestHandler SendUserReportHandler = new RestStreamHandler(
                "POST", "/CAPS/" + UUID.Random(), (v, w, x, y, z) => SendUserReport(v, w, x, y, z, caps), "SendUserReportHandler", null);

            caps.RegisterHandler("SendUserReport", SendUserReportHandler);

            IRequestHandler SendUserReportWithScreenshotHandler = new RestStreamHandler(
                "POST", "/CAPS/" + UUID.Random(), (v, w, x, y, z) => SendUserReportWithScreenshot(v, w, x, y, z, caps), "SendUserReportWithScreenshot", null);

            caps.RegisterHandler("SendUserReportWithScreenshot", SendUserReportWithScreenshotHandler);
        }
Пример #9
0
 public void RegisterCaps(UUID agentID, Caps caps)
 {
     if (m_Url == "localhost")
     {
         IRequestHandler LSLSyntaxHandler = new RestStreamHandler(
             "GET", "/CAPS/" + UUID.Random(), LSLSyntax, "LSLSyntax", null);
         caps.RegisterHandler("LSLSyntax", LSLSyntaxHandler);
     }
     else
     {
         caps.RegisterHandler("LSLSyntax", m_Url + m_SyntaxID);
     }
 }
Пример #10
0
        private void RegisterFetchDescendentsCap(UUID agentID, Caps caps, string capName, string url)
        {
            string capUrl;

            // disable the cap clause
            if (url == "")
            {
                return;
            }
            // handled by the simulator
            else if (url == "localhost")
            {
                capUrl = "/" + UUID.Random();

                // Register this as a poll service
                PollServiceInventoryEventArgs args = new PollServiceInventoryEventArgs(this, capUrl, agentID);
                //args.Type = PollServiceEventArgs.EventType.Inventory;

                caps.RegisterPollHandler(capName, args);
            }
            // external handler
            else
            {
                capUrl = url;
                IExternalCapsModule handler = Scene.RequestModuleInterface <IExternalCapsModule>();
                if (handler != null)
                {
                    handler.RegisterExternalUserCapsHandler(agentID, caps, capName, capUrl);
                }
                else
                {
                    caps.RegisterHandler(capName, capUrl);
                }
            }
        }
Пример #11
0
        private void OnRegisterCaps(OpenMetaverse.UUID agentID, OpenSim.Framework.Capabilities.Caps caps)
        {
            string capsBase = "/CAPS/" + caps.CapsObjectPath;

            IRequestHandler renderMaterialsPostHandler
                = new RestStreamHandler("POST", capsBase + "/",
                                        (request, path, param, httpRequest, httpResponse)
                                        => RenderMaterialsPostCap(request, agentID),
                                        "RenderMaterials", null);

            caps.RegisterHandler("RenderMaterials", renderMaterialsPostHandler);

            // OpenSimulator CAPs infrastructure seems to be somewhat hostile towards any CAP that requires both GET
            // and POST handlers, (at least at the time this was originally written), so we first set up a POST
            // handler normally and then add a GET handler via MainServer

            IRequestHandler renderMaterialsGetHandler
                = new RestStreamHandler("GET", capsBase + "/",
                                        (request, path, param, httpRequest, httpResponse)
                                        => RenderMaterialsGetCap(request),
                                        "RenderMaterials", null);

            MainServer.Instance.AddStreamHandler(renderMaterialsGetHandler);

            // materials viewer seems to use either POST or PUT, so assign POST handler for PUT as well
            IRequestHandler renderMaterialsPutHandler
                = new RestStreamHandler("PUT", capsBase + "/",
                                        (request, path, param, httpRequest, httpResponse)
                                        => RenderMaterialsPostCap(request, agentID),
                                        "RenderMaterials", null);

            MainServer.Instance.AddStreamHandler(renderMaterialsPutHandler);
        }
Пример #12
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capID = UUID.Random();

            //caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
            if (m_URL == "localhost")
            {
//                m_log.DebugFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
                caps.RegisterHandler("GetTexture", new GetTextureHandler("/CAPS/" + capID + "/", m_assetService));
            }
            else
            {
//                m_log.DebugFormat("[GETTEXTURE]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
                caps.RegisterHandler("GetTexture", m_URL);
            }
        }
Пример #13
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            IRequestHandler reqHandler = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(), MeshUploadFlag);

            caps.RegisterHandler("MeshUploadFlag", reqHandler);
            m_agentID = agentID;
        }
Пример #14
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capID = UUID.Random();

            m_log.Info("[GETTEXTURE]: /CAPS/" + capID);
            caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
        }
Пример #15
0
        private void OnRegisterCaps(UUID agentID, Caps caps)
        {
            string capUrl = "/CAPS/" + UUID.Random() + "/";

            capUrl = "/CAPS/" + UUID.Random() + "/";
            caps.RegisterHandler("CustomMenuAction", new MenuActionHandler(capUrl, "CustomMenuAction", agentID, this, m_scene));
        }
Пример #16
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capID = UUID.Random();

//            m_log.InfoFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
            caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
        }
Пример #17
0
        // Eg http://grid.sciencesim.com/GridPublic/%CAP%/%OP%/"
        public bool RegisterExternalUserCapsHandler(UUID agentID, Caps caps, String capName, String urlSkel)
        {
            UUID cap = UUID.Random();

            // Call to simian to register the cap we generated
            // NameValueCollection requestArgs = new NameValueCollection
            // {
            //     { "RequestMethod", "AddCapability" },
            //     { "Resource", "user" },
            //     { "Expiration", 0 },
            //     { "OwnerID", agentID.ToString() },
            //     { "CapabilityID", cap.ToString() }
            // };

            // OSDMap response = SimianGrid.PostToService(m_simianURL, requestArgs);

            Dictionary <String, String> subs = new Dictionary <String, String>();

            subs["%OP%"]  = capName;
            subs["%USR%"] = agentID.ToString();
            subs["%CAP%"] = cap.ToString();
            subs["%SIM%"] = m_scene.RegionInfo.RegionID.ToString();

            caps.RegisterHandler(capName, ExpandSkeletonURL(urlSkel, subs));
            return(true);
        }
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capID = UUID.Random();

            //            m_log.Debug("[UPLOAD OBJECT ASSET MODULE]: /CAPS/" + capID);
            caps.RegisterHandler(
                "UploadObjectAsset",
                new RestHTTPHandler(
                    "POST",
                    "/CAPS/OA/" + capID + "/",
                    httpMethod => ProcessAdd(httpMethod, agentID, caps),
                    "UploadObjectAsset",
                    agentID.ToString()));

            /*
             *     caps.RegisterHandler("NewFileAgentInventoryVariablePrice",
             *
             *             new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDNewFileAngentInventoryVariablePriceReplyResponse>("POST",
             *                                                                                    "/CAPS/" + capID.ToString(),
             *                                                                                    delegate(LLSDAssetUploadRequest req)
             *                                                {
             *                                                    return NewAgentInventoryRequest(req,agentID);
             *                                                }));
             */
        }
Пример #19
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            IRequestHandler reqHandler
                = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(), HandleSimulatorFeaturesRequest);

            caps.RegisterHandler("SimulatorFeatures", reqHandler);
        }
Пример #20
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            IRequestHandler reqHandler
                = new RestHTTPHandler(
                      "GET", "/CAPS/" + UUID.Random(), ht => MeshUploadFlag(ht, agentID), "MeshUploadFlag", agentID.ToString());

            caps.RegisterHandler("MeshUploadFlag", reqHandler);
        }
Пример #21
0
        private void OnRegisterCaps(UUID agentID, Caps caps)
        {
            string uri = "/CAPS/" + UUID.Random();

            caps.RegisterHandler(
                "UntrustedSimulatorMessage",
                new RestStreamHandler("POST", uri, HandleUntrustedSimulatorMessage, "UntrustedSimulatorMessage", null));
        }
Пример #22
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capID = UUID.Random();

            if (m_URL == "localhost")
            {
//                m_log.DebugFormat("[AVATAR PICKER SEARCH]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
                caps.RegisterHandler(
                    "AvatarPickerSearch",
                    new AvatarPickerSearchHandler("/CAPS/" + capID + "/", m_People, "AvatarPickerSearch", "Search for avatars by name"));
            }
            else
            {
                //                m_log.DebugFormat("[AVATAR PICKER SEARCH]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
                caps.RegisterHandler("AvatarPickerSearch", m_URL);
            }
        }
Пример #23
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capuuid = UUID.Random();

            caps.RegisterHandler("ServerReleaseNotes",
                                new RestHTTPHandler("POST", "/CAPS/ServerReleaseNotes/" + capuuid + "/",
                                                      delegate(Hashtable m_dhttpMethod)
                                                      {
                                                          return ProcessServerReleaseNotes(m_dhttpMethod, agentID, capuuid);
                                                      }));

            caps.RegisterHandler("CopyInventoryFromNotecard",
                                new RestHTTPHandler("POST", "/CAPS/" + capuuid + "/",
                                                      delegate(Hashtable m_dhttpMethod)
                                                      {
                                                          return CopyInventoryFromNotecard(m_dhttpMethod, capuuid, agentID);
                                                      }));
        }
Пример #24
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            IRequestHandler reqHandler
                = new RestHTTPHandler(
                      "GET", "/CAPS/" + UUID.Random(),
                      x => { return(HandleSimulatorFeaturesRequest(x, agentID)); }, "SimulatorFeatures", agentID.ToString());

            caps.RegisterHandler("SimulatorFeatures", reqHandler);
        }
Пример #25
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            IRequestHandler reqHandler = new RestHTTPHandler(
                "GET", "/CAPS/" + UUID.Random(),
                x => { return(HandleSimulatorFeaturesRequest(x, agentID)); },
                "SimulatorFeatures", agentID.ToString());

            caps.RegisterHandler("SimulatorFeatures", reqHandler);

            if (m_doScriptSyntax && m_scriptSyntaxID != UUID.Zero && !String.IsNullOrEmpty(m_scriptSyntaxXML))
            {
                IRequestHandler sreqHandler = new RestHTTPHandler(
                    "GET", "/CAPS/" + UUID.Random(),
                    x => { return(HandleSyntaxRequest(x, agentID)); },
                    "LSLSyntax", agentID.ToString());
                caps.RegisterHandler("LSLSyntax", sreqHandler);
            }
        }
Пример #26
0
 public void RegisterCaps(UUID agentID, Caps caps)
 {
     caps.RegisterHandler(
         "UploadBakedTexture",
         new RestStreamHandler(
             "POST",
             "/CAPS/" + caps.CapsObjectPath + m_uploadBakedTexturePath,
             new UploadBakedTextureHandler(
                 caps, m_scene.AssetService, m_persistBakedTextures).UploadBakedTexture));
 }
Пример #27
0
 public void RegisterCaps(UUID agentID, Caps caps)
 {
     if (m_LSLSyntaxURL == "localhost")
     {
         caps.RegisterSimpleHandler("LSLSyntax", new SimpleStreamHandler("/" + UUID.Random(), HandleLSLSyntaxRequest));
     }
     else if (m_LSLSyntaxURL != string.Empty)
     {
         caps.RegisterHandler("LSLSyntax", m_LSLSyntaxURL);
     }
 }
Пример #28
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
//            if (!m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(agentID) && !m_scene.Permissions.IsGod(agentID))
//                return;

            UUID capID = UUID.Random();

//            m_log.DebugFormat("[REGION CONSOLE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
            caps.RegisterHandler(
                "SimConsoleAsync",
                new ConsoleHandler("/CAPS/" + capID + "/", "SimConsoleAsync", agentID, this, m_scene));
        }
Пример #29
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            string capUrl = "/CAPS/" + UUID.Random() + "/";

            IRequestHandler ServerReleaseNote = new RestHTTPHandler("GET", capUrl,
                                                                    delegate(Hashtable request)
            {
                return(ProcessServerReleaseNotes(request, agentID));
            });

            caps.RegisterHandler("ServerReleaseNotes", ServerReleaseNote);
        }
Пример #30
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capID = UUID.Random();

            m_log.Info("[GETMESH]: /CAPS/" + capID);
            caps.RegisterHandler("GetMesh",
                                 new RestHTTPHandler("GET", "/CAPS/" + capID,
                                                     delegate(Hashtable m_dhttpMethod)
            {
                return(ProcessGetMesh(m_dhttpMethod, agentID, caps));
            }));
        }
Пример #31
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capuuid = UUID.Random();
            
//            m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/");

            caps.RegisterHandler("ObjectAdd",
                                 new RestHTTPHandler("POST", "/CAPS/OA/" + capuuid + "/",
                                                       delegate(Hashtable m_dhttpMethod)
                                                       {
                                                           return ProcessAdd(m_dhttpMethod, agentID, caps);
                                                       }));
        }
Пример #32
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            string capUrl = "/CAPS/" + UUID.Random() + "/";

            caps.RegisterHandler(
                "EstateAccess",
                new RestHTTPHandler(
                    "GET",
                    capUrl,
                    httpMethod => ProcessRequest(httpMethod, agentID, caps),
                    "EstateAccess",
                    agentID.ToString()));;
        }
Пример #33
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capuuid = UUID.Random();
            
//            m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/");

            caps.RegisterHandler(
                "ObjectAdd",
                new RestHTTPHandler(
                    "POST",
                    "/CAPS/OA/" + capuuid + "/",
                    httpMethod => ProcessAdd(httpMethod, agentID, caps),
                    "ObjectAdd",
                    agentID.ToString()));;
        }
Пример #34
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capuuid = UUID.Random();

            caps.RegisterHandler("SetDisplayName",
                                new RestHTTPHandler("POST", "/CAPS" + capuuid + "/",
                                                      delegate(Hashtable m_dhttpMethod)
                                                      {
                                                          return ProcessSetDisplayName(m_dhttpMethod, agentID);
                                                      }));

            capuuid = UUID.Random();

            caps.RegisterHandler("GetDisplayNames",
                                new RestHTTPHandler("POST", "/CAPS" + capuuid + "/",
                                                      delegate(Hashtable m_dhttpMethod)
                                                      {
                                                          return ProcessGetDisplayName(m_dhttpMethod, agentID);
                                                      }));
        }
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capID = UUID.Random();

//            m_log.InfoFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
            caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
        }
Пример #36
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {

            //caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
            if (m_URL == "localhost")
            {
                //                m_log.DebugFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);

                UUID capID = UUID.Random();

                caps.RegisterHandler(
                    "GetMesh",
                    new GetMeshHandler("/CAPS/" + capID + "/", m_AssetService, "GetMesh", agentID.ToString()));
            }
            else
            {
                //                m_log.DebugFormat("[GETTEXTURE]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
                IExternalCapsModule handler = m_scene.RequestModuleInterface<IExternalCapsModule>();
                if (handler != null)
                    handler.RegisterExternalUserCapsHandler(agentID, caps, "GetMesh", m_URL);
                else
                    caps.RegisterHandler("GetMesh", m_URL);
            }
        }                             
        public virtual void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capID = UUID.Random();

            if (m_URL == "localhost")
            {
                m_log.DebugFormat("[GET_DISPLAY_NAMES]: /CAPS/agents/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
                caps.RegisterHandler(
                    "GetDisplayNames",
                    new GetDisplayNamesHandler("/CAPS/agents" + capID + "/", m_UserManager, "GetDisplayNames", agentID.ToString()));
            }
            else
            {
//                m_log.DebugFormat("[GETTEXTURE]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
                IExternalCapsModule handler = m_scene.RequestModuleInterface<IExternalCapsModule>();
                if (handler != null)
                    handler.RegisterExternalUserCapsHandler(agentID,caps,"GetDisplayNames", m_URL);
                else
                    caps.RegisterHandler("GetDisplayNames", m_URL);
            }
        }
Пример #38
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capID = UUID.Random();

            if (m_URL == "localhost")
            {
//                m_log.DebugFormat("[AVATAR PICKER SEARCH]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
                caps.RegisterHandler(
                    "AvatarPickerSearch",
                    new AvatarPickerSearchHandler("/CAPS/" + capID + "/", m_People, "AvatarPickerSearch", "Search for avatars by name"));
            }
            else
            {
                //                m_log.DebugFormat("[AVATAR PICKER SEARCH]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
                caps.RegisterHandler("AvatarPickerSearch", m_URL);
            }
        }
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            IRequestHandler reqHandler
                = new RestHTTPHandler(
                    "GET", "/CAPS/" + UUID.Random(), ht => MeshUploadFlag(ht, agentID), "MeshUploadFlag", agentID.ToString());

            caps.RegisterHandler("MeshUploadFlag", reqHandler);

        }
Пример #40
0
        /// <summary>
        /// Set up the CAPS for friend conferencing
        /// </summary>
        /// <param name="agentID"></param>
        /// <param name="caps"></param>
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            string capsBase = "/CAPS/" + caps.CapsObjectPath;

            caps.RegisterHandler("ChatSessionRequest",
                                new RestHTTPHandler("POST", capsBase,
                                                      delegate(Hashtable m_dhttpMethod)
                                                      {
                                                          return ProcessChatSessionRequest(m_dhttpMethod, agentID);
                                                      }));
        }
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capID = UUID.Random();

            //caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
            if (m_URL == "localhost")
            {
                m_log.InfoFormat("[WEBFETCHINVENTORYDESCENDANTS]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
                WebFetchInvDescHandler webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService);
                IRequestHandler reqHandler = new RestStreamHandler("POST", "/CAPS/" + UUID.Random(), webFetchHandler.FetchInventoryDescendentsRequest);
                caps.RegisterHandler("WebFetchInventoryDescendents", reqHandler);
            }
            else
            {
                m_log.InfoFormat("[WEBFETCHINVENTORYDESCENDANTS]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
                caps.RegisterHandler("WebFetchInventoryDescendents", m_URL);
            }
        }
Пример #42
0
 void HandleM_sceneEventManagerOnRegisterCaps (UUID agentID, Caps caps)
 {
     string capsBase = "/CAPS/VOX/";
 	caps.RegisterHandler("MatTable",new RestStreamHandler("POST",capsBase+"/GetMats/",HandleMatTableReq));
     caps.RegisterHandler("VoxelChunk", new RestStreamHandler("POST", capsBase + "/GetChunk/", HandleMatTableReq));
 	caps.RegisterHandler("SetMaterial",new RestStreamHandler("POST",capsBase+"/SetMat/",HandleSetMatTableReq));
 }
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            IRequestHandler reqHandler
                = new RestHTTPHandler(
                    "GET", "/CAPS/" + UUID.Random(),
                    x => { return HandleSimulatorFeaturesRequest(x, agentID); }, "SimulatorFeatures", agentID.ToString());

            caps.RegisterHandler("SimulatorFeatures", reqHandler);
        }
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            //caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
            if (m_URL == "localhost")
            {
                UploadBakedTextureHandler avatarhandler = new UploadBakedTextureHandler(
                    caps, m_scene.AssetService, m_persistBakedTextures);

                caps.RegisterHandler(
                    "UploadBakedTexture",
                    new RestStreamHandler(
                        "POST",
                        "/CAPS/" + caps.CapsObjectPath + m_uploadBakedTexturePath,
                        avatarhandler.UploadBakedTexture,
                        "UploadBakedTexture",
                        agentID.ToString()));
                
            }
            else
            {
                caps.RegisterHandler("UploadBakedTexture", m_URL);
            }
        }
Пример #45
0
 public void RegisterCaps(UUID agent, Caps caps)
 {
     UUID capId = UUID.Random();
     caps.RegisterHandler("AgentPreferences",
         new RestStreamHandler("POST", "/CAPS/" + capId,
             delegate(string request, string path, string param,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
             {
                 return UpdateAgentPreferences(request, path, param, agent);
             }));
     caps.RegisterHandler("UpdateAgentLanguage",
         new RestStreamHandler("POST", "/CAPS/" + capId,
             delegate(string request, string path, string param,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
             {
                 return UpdateAgentPreferences(request, path, param, agent);
             }));
     caps.RegisterHandler("UpdateAgentInformation",
         new RestStreamHandler("POST", "/CAPS/" + capId,
             delegate(string request, string path, string param,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
             {
                 return UpdateAgentPreferences(request, path, param, agent);
             }));
 }
Пример #46
0
 public void OnRegisterCaps(UUID agentID, Caps caps)
 {
     m_log.DebugFormat("[VC]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps);
     string capsPath = "/CAPS/VS/" + UUID.Random();
     caps.RegisterHandler("ViewerStats",
                          new RestStreamHandler("POST", capsPath,
                                                delegate(string request, string path, string param,
                                                         OSHttpRequest httpRequest, OSHttpResponse httpResponse)
                                                {
                                                    return ViewerStatsReport(request, path, param,
                                                                           agentID, caps);
                                                }));
 }
Пример #47
0
        private void RegisterFetchCap(UUID agentID, Caps caps, string capName, string url)
        {
            string capUrl;

            if (url == "localhost")
            {
                capUrl = "/CAPS/" + UUID.Random();

                IRequestHandler reqHandler
                    = new RestStreamHandler("POST", capUrl, m_fetchHandler.FetchInventoryRequest);

                caps.RegisterHandler(capName, reqHandler);
            }
            else
            {
                capUrl = url;

                caps.RegisterHandler(capName, capUrl);
            }

//            m_log.DebugFormat(
//                "[FETCH INVENTORY2 MODULE]: Registered capability {0} at {1} in region {2} for {3}",
//                capName, capUrl, m_scene.RegionInfo.RegionName, agentID);
        }
Пример #48
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capID = UUID.Random();

            //m_log.Info("[GETTEXTURE]: /CAPS/" + capID);
            caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
        }
Пример #49
0
        private void OnRegisterCaps(UUID agentID, Caps caps)
        {
            string capUrl = "/CAPS/" + UUID.Random() + "/";

            capUrl = "/CAPS/" + UUID.Random() + "/";
            caps.RegisterHandler("CustomMenuAction", new MenuActionHandler(capUrl, "CustomMenuAction", agentID, this, m_scene));
        }
Пример #50
0
        private void OnRegisterCaps(UUID agentID, Caps caps)
        {
            string uri = "/CAPS/" + UUID.Random();

            caps.RegisterHandler(
                "UntrustedSimulatorMessage", 
                new RestStreamHandler("POST", uri, HandleUntrustedSimulatorMessage, "UntrustedSimulatorMessage", null));
        }
Пример #51
0
 private void EventManagerOnRegisterCaps(UUID agentID, Caps caps)
 {
     string capsBase = "/CAPS/" + caps.CapsObjectPath;
     caps.RegisterHandler("RemoteParcelRequest",
                          new RestStreamHandler("POST", capsBase + remoteParcelRequestPath,
                                                delegate(string request, string path, string param,
                                                         OSHttpRequest httpRequest, OSHttpResponse httpResponse)
                                                    {
                                                        return RemoteParcelRequest(request, path, param, agentID, caps);
                                                    }));
     UUID parcelCapID = UUID.Random();
     caps.RegisterHandler("ParcelPropertiesUpdate",
                          new RestStreamHandler("POST", "/CAPS/" + parcelCapID,
                                                delegate(string request, string path, string param,
                                                         OSHttpRequest httpRequest, OSHttpResponse httpResponse)
                                                    {
                                                        return ProcessPropertiesUpdate(request, path, param, agentID, caps);
                                                    }));
 }
Пример #52
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capID = UUID.Random();

            m_log.Info("[GETMESH]: /CAPS/" + capID);
            caps.RegisterHandler("GetMesh",
                                 new RestHTTPHandler("GET", "/CAPS/" + capID,
                                                       delegate(Hashtable m_dhttpMethod)
                                                       {
                                                           return ProcessGetMesh(m_dhttpMethod, agentID, caps);
                                                       }));
         
        }
        public void OnRegisterCaps(UUID agentID, Caps caps)
        {
            // Register an event queue for the client
            
            //m_log.DebugFormat(
            //    "[EVENTQUEUE]: OnRegisterCaps: agentID {0} caps {1} region {2}", 
            //    agentID, caps, m_scene.RegionInfo.RegionName);

            // Let's instantiate a Queue for this agent right now
            TryGetQueue(agentID);

            string capsBase = "/CAPS/EQG/";
            UUID EventQueueGetUUID = UUID.Zero;

            lock (m_AvatarQueueUUIDMapping)
            {
                // Reuse open queues.  The client does!
                if (m_AvatarQueueUUIDMapping.ContainsKey(agentID))
                {
                    //m_log.DebugFormat("[EVENTQUEUE]: Found Existing UUID!");
                    EventQueueGetUUID = m_AvatarQueueUUIDMapping[agentID];
                }
                else
                {
                    EventQueueGetUUID = UUID.Random();
                    //m_log.DebugFormat("[EVENTQUEUE]: Using random UUID!");
                }
            }

            lock (m_QueueUUIDAvatarMapping)
            {
                if (!m_QueueUUIDAvatarMapping.ContainsKey(EventQueueGetUUID))
                    m_QueueUUIDAvatarMapping.Add(EventQueueGetUUID, agentID);
            }

            lock (m_AvatarQueueUUIDMapping)
            {
                if (!m_AvatarQueueUUIDMapping.ContainsKey(agentID))
                    m_AvatarQueueUUIDMapping.Add(agentID, EventQueueGetUUID);
            }

            // Register this as a caps handler
            caps.RegisterHandler("EventQueueGet",
                                 new RestHTTPHandler("POST", capsBase + EventQueueGetUUID.ToString() + "/",
                                                       delegate(Hashtable m_dhttpMethod)
                                                       {
                                                           return ProcessQueue(m_dhttpMethod, agentID, caps);
                                                       }));
            
            // This will persist this beyond the expiry of the caps handlers
            MainServer.Instance.AddPollServiceHTTPHandler(
                capsBase + EventQueueGetUUID.ToString() + "/", EventQueuePoll, new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID));

            Random rnd = new Random(Environment.TickCount);
            lock (m_ids)
            {
                if (!m_ids.ContainsKey(agentID))
                    m_ids.Add(agentID, rnd.Next(30000000));
            }
        }
Пример #54
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            if (!m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(agentID))
                return;

            UUID capID = UUID.Random();

//            m_log.DebugFormat("[REGION CONSOLE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
            caps.RegisterHandler(
                    "SimConsoleAsync",
                    new ConsoleHandler("/CAPS/" + capID + "/", "SimConsoleAsync", agentID, this, m_scene));
        }
        private void OnRegisterCaps(UUID agentID, Caps caps)
        {
            //            m_log.DebugFormat("[WEB STATS MODULE]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps);

            string capsPath = "/CAPS/VS/" + UUID.Random();
            caps.RegisterHandler(
                "ViewerStats",
                new RestStreamHandler(
                    "POST",
                    capsPath,
                    (request, path, param, httpRequest, httpResponse)
                        => ViewerStatsReport(request, path, param, agentID, caps),
                    "ViewerStats",
                    agentID.ToString()));
        }
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capID = UUID.Random();

//            m_log.Debug("[UPLOAD OBJECT ASSET MODULE]: /CAPS/" + capID);
            caps.RegisterHandler(
                "UploadObjectAsset",
                new RestHTTPHandler(
                    "POST",
                    "/CAPS/OA/" + capID + "/",
                    httpMethod => ProcessAdd(httpMethod, agentID, caps),
                    "UploadObjectAsset",
                    agentID.ToString()));

            /*
                   caps.RegisterHandler("NewFileAgentInventoryVariablePrice",

                           new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDNewFileAngentInventoryVariablePriceReplyResponse>("POST",
                                                                                                  "/CAPS/" + capID.ToString(),
                                                                                                  delegate(LLSDAssetUploadRequest req)
                                                              {
                                                                  return NewAgentInventoryRequest(req,agentID);
                                                              }));
             */

        }
Пример #57
0
        public void OnRegisterCaps(UUID agentID, Caps caps)
        {
            // Register an event queue for the client

            //m_log.DebugFormat(
            //    "[EVENTQUEUE]: OnRegisterCaps: agentID {0} caps {1} region {2}",
            //    agentID, caps, m_scene.RegionInfo.RegionName);

            // Let's instantiate a Queue for this agent right now
            TryGetQueue(agentID);

            UUID eventQueueGetUUID;

            lock (m_AvatarQueueUUIDMapping)
            {
                // Reuse open queues.  The client does!
                if (m_AvatarQueueUUIDMapping.ContainsKey(agentID))
                {
                    //m_log.DebugFormat("[EVENTQUEUE]: Found Existing UUID!");
                    eventQueueGetUUID = m_AvatarQueueUUIDMapping[agentID];
                }
                else
                {
                    eventQueueGetUUID = UUID.Random();
                    //m_log.DebugFormat("[EVENTQUEUE]: Using random UUID!");
                }
            }

            lock (m_QueueUUIDAvatarMapping)
            {
                if (!m_QueueUUIDAvatarMapping.ContainsKey(eventQueueGetUUID))
                    m_QueueUUIDAvatarMapping.Add(eventQueueGetUUID, agentID);
            }

            lock (m_AvatarQueueUUIDMapping)
            {
                if (!m_AvatarQueueUUIDMapping.ContainsKey(agentID))
                    m_AvatarQueueUUIDMapping.Add(agentID, eventQueueGetUUID);
            }

            string eventQueueGetPath = GenerateEqgCapPath(eventQueueGetUUID);

            // Register this as a caps handler
            // FIXME: Confusingly, we need to register separate as a capability so that the client is told about
            // EventQueueGet when it receive capability information, but then we replace the rest handler immediately
            // afterwards with the poll service.  So for now, we'll pass a null instead to simplify code reading, but
            // really it should be possible to directly register the poll handler as a capability.
            caps.RegisterHandler("EventQueueGet", new RestHTTPHandler("POST", eventQueueGetPath, null));
//                                                       delegate(Hashtable m_dhttpMethod)
//                                                       {
//                                                           return ProcessQueue(m_dhttpMethod, agentID, caps);
//                                                       }));

            // This will persist this beyond the expiry of the caps handlers
            // TODO: Add EventQueueGet name/description for diagnostics
            MainServer.Instance.AddPollServiceHTTPHandler(
                eventQueueGetPath,
                new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID));

//            m_log.DebugFormat(
//                "[EVENT QUEUE GET MODULE]: Registered EQG handler {0} for {1} in {2}",
//                eventQueueGetPath, agentID, m_scene.RegionInfo.RegionName);

            Random rnd = new Random(Environment.TickCount);
            lock (m_ids)
            {
                if (!m_ids.ContainsKey(agentID))
                    m_ids.Add(agentID, rnd.Next(30000000));
            }
        }
Пример #58
0
        void EventManager_OnRegisterCaps(UUID agentID, Caps caps)
        {
            CAPSPrivateSeedHandler handler = new CAPSPrivateSeedHandler(null,//the server IS null for a reason, so that we don't add the handlers at the wrong time
                m_scene.InventoryService, 
                m_scene.LibraryService, m_scene.GridUserService,
                m_scene.PresenceService, "", agentID, ""); //URL and Hostname are all "" as well so that we don't add the hostname by accident

            List<IRequestHandler> handlers = handler.GetServerCAPS();

            foreach (IRequestHandler handle in handlers)
            {
                if (handler.registeredCAPSPath.ContainsKey(handle.Path))
                {
                    caps.RegisterHandler(handler.registeredCAPSPath[handle.Path].ToString(), handle);
                }
            }
        }
Пример #59
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
//            UUID capID = UUID.Random();
            if (m_URL == "localhost")
            {
                string capUrl = "/CAPS/" + UUID.Random() + "/";

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

                args.Type = PollServiceEventArgs.EventType.Mesh;
                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";
                }
                caps.RegisterHandler("GetMesh", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl));
                m_pollservices[agentID] = args;
                m_capsDict[agentID] = capUrl;
            }
            else
            {
                caps.RegisterHandler("GetMesh", m_URL);
            }
        }
Пример #60
0
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capID = UUID.Random();

            //caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
            if (m_URL == "localhost")
            {
//                m_log.DebugFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
                caps.RegisterHandler("GetTexture", new GetTextureHandler("/CAPS/" + capID + "/", m_assetService));
            }
            else
            {
//                m_log.DebugFormat("[GETTEXTURE]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
                caps.RegisterHandler("GetTexture", m_URL);
            }
        }