aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Capabilities
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Capabilities/Caps.cs (renamed from OpenSim/Framework/Capabilities/Caps.cs)0
-rw-r--r--OpenSim/Capabilities/CapsHandlers.cs (renamed from OpenSim/Framework/Capabilities/CapsHandlers.cs)0
-rw-r--r--OpenSim/Capabilities/Handlers/CapsServerConnector.cs73
-rw-r--r--OpenSim/Capabilities/Handlers/GetTextureHandler.cs (renamed from OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs)58
-rw-r--r--OpenSim/Capabilities/LLSD.cs (renamed from OpenSim/Framework/Capabilities/LLSD.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDArray.cs (renamed from OpenSim/Framework/Capabilities/LLSDArray.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDAssetUploadComplete.cs (renamed from OpenSim/Framework/Capabilities/LLSDAssetUploadComplete.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDAssetUploadRequest.cs (renamed from OpenSim/Framework/Capabilities/LLSDAssetUploadRequest.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDAssetUploadResponse.cs (renamed from OpenSim/Framework/Capabilities/LLSDAssetUploadResponse.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDCapEvent.cs (renamed from OpenSim/Framework/Capabilities/LLSDCapEvent.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDEmpty.cs (renamed from OpenSim/Framework/Capabilities/LLSDEmpty.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDHelpers.cs (renamed from OpenSim/Framework/Capabilities/LLSDHelpers.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDInventoryFolder.cs (renamed from OpenSim/Framework/Capabilities/LLSDInventoryFolder.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDInventoryItem.cs (renamed from OpenSim/Framework/Capabilities/LLSDInventoryItem.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDItemUpdate.cs (renamed from OpenSim/Framework/Capabilities/LLSDItemUpdate.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDMapLayer.cs (renamed from OpenSim/Framework/Capabilities/LLSDMapLayer.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDMapLayerResponse.cs (renamed from OpenSim/Framework/Capabilities/LLSDMapLayerResponse.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDMapRequest.cs (renamed from OpenSim/Framework/Capabilities/LLSDMapRequest.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDMethod.cs (renamed from OpenSim/Framework/Capabilities/LLSDMethod.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDMethodString.cs (renamed from OpenSim/Framework/Capabilities/LLSDMethodString.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDParcelVoiceInfoResponse.cs (renamed from OpenSim/Framework/Capabilities/LLSDParcelVoiceInfoResponse.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDRemoteParcelResponse.cs (renamed from OpenSim/Framework/Capabilities/LLSDRemoteParcelResponse.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDStreamHandler.cs (renamed from OpenSim/Framework/Capabilities/LLSDStreamHandler.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDTaskInventoryUploadComplete.cs (renamed from OpenSim/Framework/Capabilities/LLSDTaskInventoryUploadComplete.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDTaskScriptUpdate.cs (renamed from OpenSim/Framework/Capabilities/LLSDTaskScriptUpdate.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDTaskScriptUploadComplete.cs (renamed from OpenSim/Framework/Capabilities/LLSDTaskScriptUploadComplete.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDTest.cs (renamed from OpenSim/Framework/Capabilities/LLSDTest.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDType.cs (renamed from OpenSim/Framework/Capabilities/LLSDType.cs)0
-rw-r--r--OpenSim/Capabilities/LLSDVoiceAccountResponse.cs (renamed from OpenSim/Framework/Capabilities/LLSDVoiceAccountResponse.cs)0
29 files changed, 79 insertions, 52 deletions
diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Capabilities/Caps.cs
index 3be97b5..3be97b5 100644
--- a/OpenSim/Framework/Capabilities/Caps.cs
+++ b/OpenSim/Capabilities/Caps.cs
diff --git a/OpenSim/Framework/Capabilities/CapsHandlers.cs b/OpenSim/Capabilities/CapsHandlers.cs
index e1c800e..e1c800e 100644
--- a/OpenSim/Framework/Capabilities/CapsHandlers.cs
+++ b/OpenSim/Capabilities/CapsHandlers.cs
diff --git a/OpenSim/Capabilities/Handlers/CapsServerConnector.cs b/OpenSim/Capabilities/Handlers/CapsServerConnector.cs
new file mode 100644
index 0000000..561d767
--- /dev/null
+++ b/OpenSim/Capabilities/Handlers/CapsServerConnector.cs
@@ -0,0 +1,73 @@
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
28using System;
29using Nini.Config;
30using OpenSim.Server.Base;
31using OpenSim.Services.Interfaces;
32using OpenSim.Framework.Servers.HttpServer;
33using OpenSim.Server.Handlers.Base;
34using OpenMetaverse;
35using Caps = OpenSim.Framework.Capabilities.Caps;
36
37namespace OpenSim.Capabilities.Handlers
38{
39 public class CapsServerConnector : ServiceConnector
40 {
41 private IAssetService m_AssetService;
42 private string m_ConfigName = "CapsService";
43
44 public CapsServerConnector(IConfigSource config, IHttpServer server, string configName) :
45 base(config, server, configName)
46 {
47 if (configName != String.Empty)
48 m_ConfigName = configName;
49
50 IConfig serverConfig = config.Configs[m_ConfigName];
51 if (serverConfig == null)
52 throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
53
54 string assetService = serverConfig.GetString("LocalServiceModule",
55 String.Empty);
56
57 if (assetService == String.Empty)
58 throw new Exception("No LocalServiceModule in config file");
59
60 Object[] args = new Object[] { config };
61 m_AssetService =
62 ServerUtils.LoadPlugin<IAssetService>(assetService, args);
63
64 if (m_AssetService == null)
65 throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName));
66
67 bool allowDelete = serverConfig.GetBoolean("AllowRemoteDelete", false);
68
69 server.AddStreamHandler(new GetTextureHandler("/CAPS/" + UUID.Random() + "/", m_AssetService));
70 }
71
72 }
73}
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Capabilities/Handlers/GetTextureHandler.cs
index df4d561..00186ee 100644
--- a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs
+++ b/OpenSim/Capabilities/Handlers/GetTextureHandler.cs
@@ -42,39 +42,16 @@ using OpenSim.Framework;
42using OpenSim.Framework.Servers; 42using OpenSim.Framework.Servers;
43using OpenSim.Framework.Servers.HttpServer; 43using OpenSim.Framework.Servers.HttpServer;
44using OpenSim.Region.Framework.Interfaces; 44using OpenSim.Region.Framework.Interfaces;
45using OpenSim.Region.Framework.Scenes;
46using OpenSim.Services.Interfaces; 45using OpenSim.Services.Interfaces;
47using Caps = OpenSim.Framework.Capabilities.Caps; 46using Caps = OpenSim.Framework.Capabilities.Caps;
48 47
49namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps 48namespace OpenSim.Capabilities.Handlers
50{ 49{
51 #region Stream Handler
52 50
53 public delegate byte[] StreamHandlerCallback(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse); 51 public class GetTextureHandler : BaseStreamHandler
54
55 public class StreamHandler : BaseStreamHandler
56 {
57 StreamHandlerCallback m_callback;
58
59 public StreamHandler(string httpMethod, string path, StreamHandlerCallback callback)
60 : base(httpMethod, path)
61 {
62 m_callback = callback;
63 }
64
65 public override byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
66 {
67 return m_callback(path, request, httpRequest, httpResponse);
68 }
69 }
70
71 #endregion Stream Handler
72
73 public class GetTextureModule : IRegionModule
74 { 52 {
75 private static readonly ILog m_log = 53 private static readonly ILog m_log =
76 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 54 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
77 private Scene m_scene;
78 private IAssetService m_assetService; 55 private IAssetService m_assetService;
79 56
80 public const string DefaultFormat = "x-j2c"; 57 public const string DefaultFormat = "x-j2c";
@@ -82,36 +59,13 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
82 // TODO: Change this to a config option 59 // TODO: Change this to a config option
83 const string REDIRECT_URL = null; 60 const string REDIRECT_URL = null;
84 61
85 62 public GetTextureHandler(string path, IAssetService assService) :
86 #region IRegionModule Members 63 base("GET", path)
87
88 public void Initialise(Scene pScene, IConfigSource pSource)
89 {
90 m_scene = pScene;
91 }
92
93 public void PostInitialise()
94 {
95 m_assetService = m_scene.RequestModuleInterface<IAssetService>();
96 m_scene.EventManager.OnRegisterCaps += RegisterCaps;
97 }
98
99 public void Close() { }
100
101 public string Name { get { return "GetTextureModule"; } }
102 public bool IsSharedModule { get { return false; } }
103
104 public void RegisterCaps(UUID agentID, Caps caps)
105 { 64 {
106 UUID capID = UUID.Random(); 65 m_assetService = assService;
107
108// m_log.InfoFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
109 caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
110 } 66 }
111 67
112 #endregion 68 public override byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
113
114 private byte[] ProcessGetTexture(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
115 { 69 {
116 //m_log.DebugFormat("[GETTEXTURE]: called in {0}", m_scene.RegionInfo.RegionName); 70 //m_log.DebugFormat("[GETTEXTURE]: called in {0}", m_scene.RegionInfo.RegionName);
117 71
diff --git a/OpenSim/Framework/Capabilities/LLSD.cs b/OpenSim/Capabilities/LLSD.cs
index eec9e61..eec9e61 100644
--- a/OpenSim/Framework/Capabilities/LLSD.cs
+++ b/OpenSim/Capabilities/LLSD.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDArray.cs b/OpenSim/Capabilities/LLSDArray.cs
index 3459e49..3459e49 100644
--- a/OpenSim/Framework/Capabilities/LLSDArray.cs
+++ b/OpenSim/Capabilities/LLSDArray.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDAssetUploadComplete.cs b/OpenSim/Capabilities/LLSDAssetUploadComplete.cs
index ab6cee5..ab6cee5 100644
--- a/OpenSim/Framework/Capabilities/LLSDAssetUploadComplete.cs
+++ b/OpenSim/Capabilities/LLSDAssetUploadComplete.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDAssetUploadRequest.cs b/OpenSim/Capabilities/LLSDAssetUploadRequest.cs
index 6e66f0a..6e66f0a 100644
--- a/OpenSim/Framework/Capabilities/LLSDAssetUploadRequest.cs
+++ b/OpenSim/Capabilities/LLSDAssetUploadRequest.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDAssetUploadResponse.cs b/OpenSim/Capabilities/LLSDAssetUploadResponse.cs
index 0d6f7f9..0d6f7f9 100644
--- a/OpenSim/Framework/Capabilities/LLSDAssetUploadResponse.cs
+++ b/OpenSim/Capabilities/LLSDAssetUploadResponse.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDCapEvent.cs b/OpenSim/Capabilities/LLSDCapEvent.cs
index 63abd62..63abd62 100644
--- a/OpenSim/Framework/Capabilities/LLSDCapEvent.cs
+++ b/OpenSim/Capabilities/LLSDCapEvent.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDEmpty.cs b/OpenSim/Capabilities/LLSDEmpty.cs
index f94fcba..f94fcba 100644
--- a/OpenSim/Framework/Capabilities/LLSDEmpty.cs
+++ b/OpenSim/Capabilities/LLSDEmpty.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDHelpers.cs b/OpenSim/Capabilities/LLSDHelpers.cs
index 8f1a40e..8f1a40e 100644
--- a/OpenSim/Framework/Capabilities/LLSDHelpers.cs
+++ b/OpenSim/Capabilities/LLSDHelpers.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDInventoryFolder.cs b/OpenSim/Capabilities/LLSDInventoryFolder.cs
index 3c216e9..3c216e9 100644
--- a/OpenSim/Framework/Capabilities/LLSDInventoryFolder.cs
+++ b/OpenSim/Capabilities/LLSDInventoryFolder.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDInventoryItem.cs b/OpenSim/Capabilities/LLSDInventoryItem.cs
index cce18d7..cce18d7 100644
--- a/OpenSim/Framework/Capabilities/LLSDInventoryItem.cs
+++ b/OpenSim/Capabilities/LLSDInventoryItem.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDItemUpdate.cs b/OpenSim/Capabilities/LLSDItemUpdate.cs
index 96e2b61..96e2b61 100644
--- a/OpenSim/Framework/Capabilities/LLSDItemUpdate.cs
+++ b/OpenSim/Capabilities/LLSDItemUpdate.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDMapLayer.cs b/OpenSim/Capabilities/LLSDMapLayer.cs
index 4aeb1ff..4aeb1ff 100644
--- a/OpenSim/Framework/Capabilities/LLSDMapLayer.cs
+++ b/OpenSim/Capabilities/LLSDMapLayer.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDMapLayerResponse.cs b/OpenSim/Capabilities/LLSDMapLayerResponse.cs
index 839e34c..839e34c 100644
--- a/OpenSim/Framework/Capabilities/LLSDMapLayerResponse.cs
+++ b/OpenSim/Capabilities/LLSDMapLayerResponse.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDMapRequest.cs b/OpenSim/Capabilities/LLSDMapRequest.cs
index debf387..debf387 100644
--- a/OpenSim/Framework/Capabilities/LLSDMapRequest.cs
+++ b/OpenSim/Capabilities/LLSDMapRequest.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDMethod.cs b/OpenSim/Capabilities/LLSDMethod.cs
index cd2574d..cd2574d 100644
--- a/OpenSim/Framework/Capabilities/LLSDMethod.cs
+++ b/OpenSim/Capabilities/LLSDMethod.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDMethodString.cs b/OpenSim/Capabilities/LLSDMethodString.cs
index 38700d5..38700d5 100644
--- a/OpenSim/Framework/Capabilities/LLSDMethodString.cs
+++ b/OpenSim/Capabilities/LLSDMethodString.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDParcelVoiceInfoResponse.cs b/OpenSim/Capabilities/LLSDParcelVoiceInfoResponse.cs
index b34a668..b34a668 100644
--- a/OpenSim/Framework/Capabilities/LLSDParcelVoiceInfoResponse.cs
+++ b/OpenSim/Capabilities/LLSDParcelVoiceInfoResponse.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDRemoteParcelResponse.cs b/OpenSim/Capabilities/LLSDRemoteParcelResponse.cs
index 13d69d3..13d69d3 100644
--- a/OpenSim/Framework/Capabilities/LLSDRemoteParcelResponse.cs
+++ b/OpenSim/Capabilities/LLSDRemoteParcelResponse.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDStreamHandler.cs b/OpenSim/Capabilities/LLSDStreamHandler.cs
index 7aaa994..7aaa994 100644
--- a/OpenSim/Framework/Capabilities/LLSDStreamHandler.cs
+++ b/OpenSim/Capabilities/LLSDStreamHandler.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDTaskInventoryUploadComplete.cs b/OpenSim/Capabilities/LLSDTaskInventoryUploadComplete.cs
index 47fdaca..47fdaca 100644
--- a/OpenSim/Framework/Capabilities/LLSDTaskInventoryUploadComplete.cs
+++ b/OpenSim/Capabilities/LLSDTaskInventoryUploadComplete.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDTaskScriptUpdate.cs b/OpenSim/Capabilities/LLSDTaskScriptUpdate.cs
index 9d7c17f..9d7c17f 100644
--- a/OpenSim/Framework/Capabilities/LLSDTaskScriptUpdate.cs
+++ b/OpenSim/Capabilities/LLSDTaskScriptUpdate.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDTaskScriptUploadComplete.cs b/OpenSim/Capabilities/LLSDTaskScriptUploadComplete.cs
index d308831..d308831 100644
--- a/OpenSim/Framework/Capabilities/LLSDTaskScriptUploadComplete.cs
+++ b/OpenSim/Capabilities/LLSDTaskScriptUploadComplete.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDTest.cs b/OpenSim/Capabilities/LLSDTest.cs
index 5f77c3d..5f77c3d 100644
--- a/OpenSim/Framework/Capabilities/LLSDTest.cs
+++ b/OpenSim/Capabilities/LLSDTest.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDType.cs b/OpenSim/Capabilities/LLSDType.cs
index d5ca1ab..d5ca1ab 100644
--- a/OpenSim/Framework/Capabilities/LLSDType.cs
+++ b/OpenSim/Capabilities/LLSDType.cs
diff --git a/OpenSim/Framework/Capabilities/LLSDVoiceAccountResponse.cs b/OpenSim/Capabilities/LLSDVoiceAccountResponse.cs
index 53c11e7..53c11e7 100644
--- a/OpenSim/Framework/Capabilities/LLSDVoiceAccountResponse.cs
+++ b/OpenSim/Capabilities/LLSDVoiceAccountResponse.cs