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); } } }
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); } } }
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); } } }
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 = "/CAPS/" + 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); } // m_log.DebugFormat( // "[FETCH INVENTORY DESCENDENTS2 MODULE]: Registered capability {0} at {1} in region {2} for {3}", // capName, capUrl, m_scene.RegionInfo.RegionName, agentID); }
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); } }
public void RegisterCaps(UUID agentID, Caps caps) { GetAssetsHandler assethandler = null; GetAssetsHandler reuse_assethandler = null; foreach (CapsData data in m_CapsData) { if (data.Url == "localhost") { if (string.IsNullOrEmpty(data.RedirectUrl)) { if (reuse_assethandler == null) { reuse_assethandler = new GetAssetsHandler("/CAPS/" + UUID.Random() + "/", m_assetService, "GetAsset", agentID.ToString(), null); } assethandler = reuse_assethandler; } else { assethandler = new GetAssetsHandler("/CAPS/" + UUID.Random() + "/", m_assetService, data.Name, agentID.ToString(), data.RedirectUrl); } caps.RegisterHandler( data.Name, assethandler); } else { IExternalCapsModule handler = m_scene.RequestModuleInterface <IExternalCapsModule>(); if (handler != null) { handler.RegisterExternalUserCapsHandler(agentID, caps, data.Name, data.Url); } else { caps.RegisterHandler(data.Name, data.Url); } } } }
public void RegisterCaps(UUID agentID, Caps caps) { 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"; } string hgassets = null; if (m_UserManagement != null) { hgassets = m_UserManagement.GetUserServerURL(agentID, "AssetServerURI"); } IExternalCapsModule handler = m_scene.RequestModuleInterface <IExternalCapsModule>(); string baseURL = String.Format("{0}://{1}:{2}", protocol, hostName, port); if (m_GetTextureURL == "localhost") { string capUrl = "/" + UUID.Random(); // Register this as a poll service PollServiceAssetEventArgs args = new PollServiceAssetEventArgs(capUrl, agentID, m_scene, hgassets); //args.Type = PollServiceEventArgs.EventType.Texture; MainServer.Instance.AddPollServiceHTTPHandler(args); if (handler != null) { handler.RegisterExternalUserCapsHandler(agentID, caps, "GetTexture", capUrl); } else { caps.RegisterHandler("GetTexture", baseURL + capUrl); } m_capsDictTexture[agentID] = capUrl; } else { caps.RegisterHandler("GetTexture", m_GetTextureURL); } //GetMesh if (m_GetMeshURL == "localhost") { string capUrl = "/" + UUID.Random(); PollServiceAssetEventArgs args = new PollServiceAssetEventArgs(capUrl, agentID, m_scene, hgassets); //args.Type = PollServiceEventArgs.EventType.Mesh; MainServer.Instance.AddPollServiceHTTPHandler(args); if (handler != null) { handler.RegisterExternalUserCapsHandler(agentID, caps, "GetMesh", capUrl); } else { caps.RegisterHandler("GetMesh", baseURL + capUrl); } m_capsDictGetMesh[agentID] = capUrl; } else if (m_GetMeshURL != string.Empty) { caps.RegisterHandler("GetMesh", m_GetMeshURL); } //GetMesh2 if (m_GetMesh2URL == "localhost") { string capUrl = "/" + UUID.Random(); PollServiceAssetEventArgs args = new PollServiceAssetEventArgs(capUrl, agentID, m_scene, hgassets); //args.Type = PollServiceEventArgs.EventType.Mesh2; MainServer.Instance.AddPollServiceHTTPHandler(args); if (handler != null) { handler.RegisterExternalUserCapsHandler(agentID, caps, "GetMesh2", capUrl); } else { caps.RegisterHandler("GetMesh2", baseURL + capUrl); } m_capsDictGetMesh2[agentID] = capUrl; } else if (m_GetMesh2URL != string.Empty) { caps.RegisterHandler("GetMesh2", m_GetMesh2URL); } //ViewerAsset if (m_GetAssetURL == "localhost") { string capUrl = "/" + UUID.Random(); PollServiceAssetEventArgs args = new PollServiceAssetEventArgs(capUrl, agentID, m_scene, hgassets); //args.Type = PollServiceEventArgs.EventType.Asset; MainServer.Instance.AddPollServiceHTTPHandler(args); if (handler != null) { handler.RegisterExternalUserCapsHandler(agentID, caps, "ViewerAsset", capUrl); } else { caps.RegisterHandler("ViewerAsset", baseURL + capUrl); } m_capsDictGetAsset[agentID] = capUrl; } else if (m_GetAssetURL != string.Empty) { caps.RegisterHandler("ViewerAsset", m_GetAssetURL); } }