diff options
Diffstat (limited to 'OpenSim/Capabilities')
9 files changed, 99 insertions, 19 deletions
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory2/FetchInventory2ServerConnector.cs b/OpenSim/Capabilities/Handlers/FetchInventory2/FetchInventory2ServerConnector.cs index 0ba8931..5bab52f 100644 --- a/OpenSim/Capabilities/Handlers/FetchInventory2/FetchInventory2ServerConnector.cs +++ b/OpenSim/Capabilities/Handlers/FetchInventory2/FetchInventory2ServerConnector.cs | |||
@@ -63,7 +63,8 @@ namespace OpenSim.Capabilities.Handlers | |||
63 | 63 | ||
64 | FetchInventory2Handler fiHandler = new FetchInventory2Handler(m_InventoryService); | 64 | FetchInventory2Handler fiHandler = new FetchInventory2Handler(m_InventoryService); |
65 | IRequestHandler reqHandler | 65 | IRequestHandler reqHandler |
66 | = new RestStreamHandler("POST", "/CAPS/FetchInventory/", fiHandler.FetchInventoryRequest); | 66 | = new RestStreamHandler( |
67 | "POST", "/CAPS/FetchInventory/", fiHandler.FetchInventoryRequest, "FetchInventory", null); | ||
67 | server.AddStreamHandler(reqHandler); | 68 | server.AddStreamHandler(reqHandler); |
68 | } | 69 | } |
69 | } | 70 | } |
diff --git a/OpenSim/Capabilities/Handlers/GetMesh/GetMeshServerConnector.cs b/OpenSim/Capabilities/Handlers/GetMesh/GetMeshServerConnector.cs index 2ecfa3c..8a275f3 100644 --- a/OpenSim/Capabilities/Handlers/GetMesh/GetMeshServerConnector.cs +++ b/OpenSim/Capabilities/Handlers/GetMesh/GetMeshServerConnector.cs | |||
@@ -66,13 +66,14 @@ namespace OpenSim.Capabilities.Handlers | |||
66 | throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName)); | 66 | throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName)); |
67 | 67 | ||
68 | GetMeshHandler gmeshHandler = new GetMeshHandler(m_AssetService); | 68 | GetMeshHandler gmeshHandler = new GetMeshHandler(m_AssetService); |
69 | IRequestHandler reqHandler = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(), | 69 | IRequestHandler reqHandler |
70 | delegate(Hashtable m_dhttpMethod) | 70 | = new RestHTTPHandler( |
71 | { | 71 | "GET", |
72 | return gmeshHandler.ProcessGetMesh(m_dhttpMethod, UUID.Zero, null); | 72 | "/CAPS/" + UUID.Random(), |
73 | }); | 73 | httpMethod => gmeshHandler.ProcessGetMesh(httpMethod, UUID.Zero, null), |
74 | "GetMesh", | ||
75 | null); | ||
74 | server.AddStreamHandler(reqHandler); | 76 | server.AddStreamHandler(reqHandler); |
75 | } | 77 | } |
76 | |||
77 | } | 78 | } |
78 | } | 79 | } \ No newline at end of file |
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs index 217217e..abdbc72 100644 --- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs +++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs | |||
@@ -58,8 +58,8 @@ namespace OpenSim.Capabilities.Handlers | |||
58 | // TODO: Change this to a config option | 58 | // TODO: Change this to a config option |
59 | const string REDIRECT_URL = null; | 59 | const string REDIRECT_URL = null; |
60 | 60 | ||
61 | public GetTextureHandler(string path, IAssetService assService) : | 61 | public GetTextureHandler(string path, IAssetService assService, string name, string description) |
62 | base("GET", path) | 62 | : base("GET", path, name, description) |
63 | { | 63 | { |
64 | m_assetService = assService; | 64 | m_assetService = assService; |
65 | } | 65 | } |
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureServerConnector.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureServerConnector.cs index 0d072f7..71cf033 100644 --- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureServerConnector.cs +++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureServerConnector.cs | |||
@@ -62,8 +62,8 @@ namespace OpenSim.Capabilities.Handlers | |||
62 | if (m_AssetService == null) | 62 | if (m_AssetService == null) |
63 | throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName)); | 63 | throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName)); |
64 | 64 | ||
65 | server.AddStreamHandler(new GetTextureHandler("/CAPS/GetTexture/" /*+ UUID.Random() */, m_AssetService)); | 65 | server.AddStreamHandler( |
66 | new GetTextureHandler("/CAPS/GetTexture/" /*+ UUID.Random() */, m_AssetService, "GetTexture", null)); | ||
66 | } | 67 | } |
67 | |||
68 | } | 68 | } |
69 | } | 69 | } \ No newline at end of file |
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs b/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs index fd152c3..761e4e7 100644 --- a/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs +++ b/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs | |||
@@ -50,9 +50,9 @@ namespace OpenSim.Capabilities.Handlers.GetTexture.Tests | |||
50 | TestHelpers.InMethod(); | 50 | TestHelpers.InMethod(); |
51 | 51 | ||
52 | // Overkill - we only really need the asset service, not a whole scene. | 52 | // Overkill - we only really need the asset service, not a whole scene. |
53 | Scene scene = SceneHelpers.SetupScene(); | 53 | Scene scene = new SceneHelpers().SetupScene(); |
54 | 54 | ||
55 | GetTextureHandler handler = new GetTextureHandler(null, scene.AssetService); | 55 | GetTextureHandler handler = new GetTextureHandler(null, scene.AssetService, "TestGetTexture", null); |
56 | TestOSHttpRequest req = new TestOSHttpRequest(); | 56 | TestOSHttpRequest req = new TestOSHttpRequest(); |
57 | TestOSHttpResponse resp = new TestOSHttpResponse(); | 57 | TestOSHttpResponse resp = new TestOSHttpResponse(); |
58 | req.Url = new Uri("http://localhost/?texture_id=00000000-0000-1111-9999-000000000012"); | 58 | req.Url = new Uri("http://localhost/?texture_id=00000000-0000-1111-9999-000000000012"); |
diff --git a/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs b/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs index 594ce9d..8849a59 100644 --- a/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs +++ b/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs | |||
@@ -85,8 +85,8 @@ namespace OpenSim.Capabilities.Handlers | |||
85 | uploader.OnUpLoad += BakedTextureUploaded; | 85 | uploader.OnUpLoad += BakedTextureUploaded; |
86 | 86 | ||
87 | m_HostCapsObj.HttpListener.AddStreamHandler( | 87 | m_HostCapsObj.HttpListener.AddStreamHandler( |
88 | new BinaryStreamHandler("POST", capsBase + uploaderPath, | 88 | new BinaryStreamHandler( |
89 | uploader.uploaderCaps)); | 89 | "POST", capsBase + uploaderPath, uploader.uploaderCaps, "UploadBakedTexture", null)); |
90 | 90 | ||
91 | string protocol = "http://"; | 91 | string protocol = "http://"; |
92 | 92 | ||
diff --git a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescServerConnector.cs b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescServerConnector.cs index 92eeb14..5d86557 100644 --- a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescServerConnector.cs +++ b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescServerConnector.cs | |||
@@ -68,7 +68,13 @@ namespace OpenSim.Capabilities.Handlers | |||
68 | ServerUtils.LoadPlugin<ILibraryService>(libService, args); | 68 | ServerUtils.LoadPlugin<ILibraryService>(libService, args); |
69 | 69 | ||
70 | WebFetchInvDescHandler webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService); | 70 | WebFetchInvDescHandler webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService); |
71 | IRequestHandler reqHandler = new RestStreamHandler("POST", "/CAPS/WebFetchInvDesc/" /*+ UUID.Random()*/, webFetchHandler.FetchInventoryDescendentsRequest); | 71 | IRequestHandler reqHandler |
72 | = new RestStreamHandler( | ||
73 | "POST", | ||
74 | "/CAPS/WebFetchInvDesc/" /*+ UUID.Random()*/, | ||
75 | webFetchHandler.FetchInventoryDescendentsRequest, | ||
76 | "WebFetchInvDesc", | ||
77 | null); | ||
72 | server.AddStreamHandler(reqHandler); | 78 | server.AddStreamHandler(reqHandler); |
73 | } | 79 | } |
74 | 80 | ||
diff --git a/OpenSim/Capabilities/LLSDEnvironmentSettings.cs b/OpenSim/Capabilities/LLSDEnvironmentSettings.cs new file mode 100644 index 0000000..39019af --- /dev/null +++ b/OpenSim/Capabilities/LLSDEnvironmentSettings.cs | |||
@@ -0,0 +1,68 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using OpenMetaverse; | ||
31 | |||
32 | namespace OpenSim.Framework.Capabilities | ||
33 | { | ||
34 | [OSDMap] | ||
35 | public class LLSDEnvironmentRequest | ||
36 | { | ||
37 | public UUID messageID; | ||
38 | public UUID regionID; | ||
39 | } | ||
40 | |||
41 | [OSDMap] | ||
42 | public class LLSDEnvironmentSetResponse | ||
43 | { | ||
44 | public UUID regionID; | ||
45 | public UUID messageID; | ||
46 | public Boolean success; | ||
47 | public String fail_reason; | ||
48 | } | ||
49 | |||
50 | public class EnvironmentSettings | ||
51 | { | ||
52 | /// <summary> | ||
53 | /// generates a empty llsd settings response for viewer | ||
54 | /// </summary> | ||
55 | /// <param name="messageID">the message UUID</param> | ||
56 | /// <param name="regionID">the region UUID</param> | ||
57 | public static string EmptySettings(UUID messageID, UUID regionID) | ||
58 | { | ||
59 | OSDArray arr = new OSDArray(); | ||
60 | LLSDEnvironmentRequest msg = new LLSDEnvironmentRequest(); | ||
61 | msg.messageID = messageID; | ||
62 | msg.regionID = regionID; | ||
63 | arr.Array.Add(msg); | ||
64 | return LLSDHelpers.SerialiseLLSDReply(arr); | ||
65 | } | ||
66 | } | ||
67 | |||
68 | } | ||
diff --git a/OpenSim/Capabilities/LLSDStreamHandler.cs b/OpenSim/Capabilities/LLSDStreamHandler.cs index c7c1fc9..f5c728c 100644 --- a/OpenSim/Capabilities/LLSDStreamHandler.cs +++ b/OpenSim/Capabilities/LLSDStreamHandler.cs | |||
@@ -39,7 +39,11 @@ namespace OpenSim.Framework.Capabilities | |||
39 | private LLSDMethod<TRequest, TResponse> m_method; | 39 | private LLSDMethod<TRequest, TResponse> m_method; |
40 | 40 | ||
41 | public LLSDStreamhandler(string httpMethod, string path, LLSDMethod<TRequest, TResponse> method) | 41 | public LLSDStreamhandler(string httpMethod, string path, LLSDMethod<TRequest, TResponse> method) |
42 | : base(httpMethod, path) | 42 | : this(httpMethod, path, method, null, null) {} |
43 | |||
44 | public LLSDStreamhandler( | ||
45 | string httpMethod, string path, LLSDMethod<TRequest, TResponse> method, string name, string description) | ||
46 | : base(httpMethod, path, name, description) | ||
43 | { | 47 | { |
44 | m_method = method; | 48 | m_method = method; |
45 | } | 49 | } |