public void IncomingCapsRequest(UUID agentID, GridRegion region, ISimulationBase simbase, ref OSDMap capURLs) { m_agentID = agentID; m_region = region; m_userScopeIDs = simbase.ApplicationRegistry.RequestModuleInterface <IUserAccountService> ().GetUserAccount(null, m_agentID).AllScopeIDs; m_gridService = simbase.ApplicationRegistry.RequestModuleInterface <IGridService> (); IConfig config = simbase.ConfigSource.Configs ["MapCAPS"]; if (config != null) { m_allowCapsMessage = config.GetBoolean("AllowCapsMessage", m_allowCapsMessage); } HttpServerHandle method = (path, request, httpRequest, httpResponse) => MapLayerRequest(HttpServerHandlerHelpers.ReadString(request), httpRequest, httpResponse); m_uri = "/CAPS/MapLayer/" + UUID.Random() + "/"; capURLs ["MapLayer"] = MainServer.Instance.ServerURI + m_uri; capURLs ["MapLayerGod"] = MainServer.Instance.ServerURI + m_uri; MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", m_uri, method)); }
public void RegisterCaps(IRegionClientCapsService service) { m_service = service; m_assetService = service.Registry.RequestModuleInterface <IAssetService>(); m_inventoryService = service.Registry.RequestModuleInterface <IInventoryService>(); m_libraryService = service.Registry.RequestModuleInterface <ILibraryService>(); HttpServerHandle method = delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(HandleWebFetchInventoryDescendents(request, m_service.AgentID)); }; service.AddStreamHandler("WebFetchInventoryDescendents", new GenericStreamHandler("POST", service.CreateCAPS("WebFetchInventoryDescendents", ""), method)); service.AddStreamHandler("FetchInventoryDescendents", new GenericStreamHandler("POST", service.CreateCAPS("FetchInventoryDescendents", ""), method)); service.AddStreamHandler("FetchInventoryDescendents2", new GenericStreamHandler("POST", service.CreateCAPS("FetchInventoryDescendents2", ""), method)); method = delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(HandleFetchLibDescendents(request, m_service.AgentID)); }; service.AddStreamHandler("FetchLibDescendents", new GenericStreamHandler("POST", service.CreateCAPS("FetchLibDescendents", ""), method)); service.AddStreamHandler("FetchLibDescendents2", new GenericStreamHandler("POST", service.CreateCAPS("FetchLibDescendents2", ""), method)); method = delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(HandleFetchInventory(request, m_service.AgentID)); }; service.AddStreamHandler("FetchInventory", new GenericStreamHandler("POST", service.CreateCAPS("FetchInventory", ""), method)); service.AddStreamHandler("FetchInventory2", new GenericStreamHandler("POST", service.CreateCAPS("FetchInventory2", ""), method)); method = delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(HandleFetchLib(request, m_service.AgentID)); }; service.AddStreamHandler("FetchLib", new GenericStreamHandler("POST", service.CreateCAPS("FetchLib", ""), method)); service.AddStreamHandler("FetchLib2", new GenericStreamHandler("POST", service.CreateCAPS("FetchLib2", ""), method)); service.AddStreamHandler("NewFileAgentInventory", new GenericStreamHandler("POST", service.CreateCAPS("NewFileAgentInventory", ""), NewAgentInventoryRequest)); service.AddStreamHandler("NewFileAgentInventoryVariablePrice", new GenericStreamHandler("POST", service.CreateCAPS("NewFileAgentInventoryVariablePrice", ""), NewAgentInventoryRequestVariablePrice)); service.AddStreamHandler("CreateInventoryCategory", new GenericStreamHandler("POST", service.CreateCAPS("CreateInventoryCategory", ""), CreateInventoryCategory)); /*method = delegate(string request, string path, string param, * OSHttpRequest httpRequest, OSHttpResponse httpResponse) * { * return HandleInventoryItemCreate(request, m_service.AgentID); * }; * service.AddStreamHandler("InventoryItemCreate", * new RestBytesStreamHandler("POST", service.CreateCAPS("InventoryItemCreate", ""), * method));*/ }
public GenericStreamHandler(string httpMethod, string path, HttpServerHandle method) : base(httpMethod, path) { _method = method; }
public void IncomingCapsRequest(UUID agentID, Aurora.Framework.Services.GridRegion region, ISimulationBase simbase, ref OSDMap capURLs) { m_agentID = agentID; m_moneyModule = simbase.ApplicationRegistry.RequestModuleInterface <IMoneyModule>(); m_assetService = simbase.ApplicationRegistry.RequestModuleInterface <IAssetService>(); m_inventoryService = simbase.ApplicationRegistry.RequestModuleInterface <IInventoryService>(); m_libraryService = simbase.ApplicationRegistry.RequestModuleInterface <ILibraryService>(); m_inventoryData = Framework.Utilities.DataManager.RequestPlugin <IInventoryData>(); HttpServerHandle method = delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(HandleWebFetchInventoryDescendents(request, m_agentID)); }; string uri = "/CAPS/FetchInventoryDescendents/" + UUID.Random() + "/"; capURLs["WebFetchInventoryDescendents"] = MainServer.Instance.ServerURI + uri; capURLs["FetchInventoryDescendents"] = MainServer.Instance.ServerURI + uri; capURLs["FetchInventoryDescendents2"] = MainServer.Instance.ServerURI + uri; m_uris.Add(uri); MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", uri, method)); method = delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(HandleFetchLibDescendents(request, m_agentID)); }; uri = "/CAPS/FetchLibDescendents/" + UUID.Random() + "/"; capURLs["FetchLibDescendents"] = MainServer.Instance.ServerURI + uri; capURLs["FetchLibDescendents2"] = MainServer.Instance.ServerURI + uri; m_uris.Add(uri); MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", uri, method)); method = delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(HandleFetchInventory(request, m_agentID)); }; uri = "/CAPS/FetchInventory/" + UUID.Random() + "/"; capURLs["FetchInventory"] = MainServer.Instance.ServerURI + uri; capURLs["FetchInventory2"] = MainServer.Instance.ServerURI + uri; m_uris.Add(uri); MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", uri, method)); method = delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(HandleFetchLib(request, m_agentID)); }; uri = "/CAPS/FetchLib/" + UUID.Random() + "/"; capURLs["FetchLib"] = MainServer.Instance.ServerURI + uri; capURLs["FetchLib2"] = MainServer.Instance.ServerURI + uri; m_uris.Add(uri); MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", uri, method)); uri = "/CAPS/NewFileAgentInventory/" + UUID.Random() + "/"; capURLs["NewFileAgentInventory"] = MainServer.Instance.ServerURI + uri; m_uris.Add(uri); MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", uri, NewAgentInventoryRequest)); uri = "/CAPS/NewFileAgentInventoryVariablePrice/" + UUID.Random() + "/"; capURLs["NewFileAgentInventoryVariablePrice"] = MainServer.Instance.ServerURI + uri; m_uris.Add(uri); MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", uri, NewAgentInventoryRequestVariablePrice)); uri = "/CAPS/CreateInventoryCategory/" + UUID.Random() + "/"; capURLs["CreateInventoryCategory"] = MainServer.Instance.ServerURI + uri; m_uris.Add(uri); MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", uri, CreateInventoryCategory)); }