diff options
Diffstat (limited to 'OpenSim/Region/Capabilities/Caps.cs')
-rw-r--r-- | OpenSim/Region/Capabilities/Caps.cs | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/OpenSim/Region/Capabilities/Caps.cs b/OpenSim/Region/Capabilities/Caps.cs index 1d07683..70d601f 100644 --- a/OpenSim/Region/Capabilities/Caps.cs +++ b/OpenSim/Region/Capabilities/Caps.cs | |||
@@ -71,20 +71,33 @@ namespace OpenSim.Region.Capabilities | |||
71 | public void RegisterHandlers() | 71 | public void RegisterHandlers() |
72 | { | 72 | { |
73 | Console.WriteLine("registering CAPS handlers"); | 73 | Console.WriteLine("registering CAPS handlers"); |
74 | string capsBase = "/CAPS/" + m_capsObjectPath; | ||
75 | |||
76 | AddLegacyCapsHandler( httpListener, m_mapLayerPath, MapLayer); | ||
77 | |||
78 | //httpListener.AddStreamHandler( | ||
79 | // new LLSDStreamhandler<LLSDMapRequest, LLSDMapLayerResponse>("POST", capsBase + m_mapLayerPath, this.GetMapLayer )); | ||
74 | 80 | ||
75 | AddCapsHandler( httpListener, m_requestPath, CapsRequest); | 81 | AddLegacyCapsHandler(httpListener, m_requestPath, CapsRequest); |
76 | AddCapsHandler( httpListener, m_mapLayerPath, MapLayer); | 82 | AddLegacyCapsHandler(httpListener, m_newInventory, NewAgentInventory); |
77 | AddCapsHandler( httpListener, m_newInventory, NewAgentInventory); | 83 | AddLegacyCapsHandler( httpListener, eventQueue, ProcessEventQueue); |
78 | AddCapsHandler( httpListener, eventQueue, ProcessEventQueue); | 84 | AddLegacyCapsHandler( httpListener, m_requestTexture, RequestTexture); |
79 | AddCapsHandler( httpListener, m_requestTexture, RequestTexture); | ||
80 | } | 85 | } |
81 | 86 | ||
82 | private void AddCapsHandler( BaseHttpServer httpListener, string path, RestMethod restMethod ) | 87 | public LLSDMapLayerResponse GetMapLayer(LLSDMapRequest mapReq) |
88 | { | ||
89 | LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse(); | ||
90 | mapResponse.LayerData.Array.Add(this.BuildLLSDMapLayerResponse()); | ||
91 | return mapResponse; | ||
92 | } | ||
93 | |||
94 | [Obsolete("Use BaseHttpServer.AddStreamHandler(new LLSDStreamHandler( LLSDMethod delegate )) instead.")] | ||
95 | private void AddLegacyCapsHandler(BaseHttpServer httpListener, string path, RestMethod restMethod) | ||
83 | { | 96 | { |
84 | string capsBase = "/CAPS/" + m_capsObjectPath; | 97 | string capsBase = "/CAPS/" + m_capsObjectPath; |
85 | httpListener.AddStreamHandler(new RestStreamHandler("POST", capsBase + path, restMethod)); | 98 | httpListener.AddStreamHandler(new RestStreamHandler("POST", capsBase + path, restMethod)); |
86 | } | 99 | } |
87 | 100 | ||
88 | /// <summary> | 101 | /// <summary> |
89 | /// | 102 | /// |
90 | /// </summary> | 103 | /// </summary> |
@@ -125,17 +138,18 @@ namespace OpenSim.Region.Capabilities | |||
125 | public string MapLayer(string request, string path, string param) | 138 | public string MapLayer(string request, string path, string param) |
126 | { | 139 | { |
127 | Encoding _enc = Encoding.UTF8; | 140 | Encoding _enc = Encoding.UTF8; |
128 | Hashtable hash =(Hashtable) LLSD.LLSDDeserialize(_enc.GetBytes(request)); | 141 | Hashtable hash = (Hashtable)LLSD.LLSDDeserialize(_enc.GetBytes(request)); |
129 | LLSDMapRequest mapReq = new LLSDMapRequest(); | 142 | LLSDMapRequest mapReq = new LLSDMapRequest(); |
130 | LLSDHelpers.DeserialiseLLSDMap(hash, mapReq ); | 143 | LLSDHelpers.DeserialiseLLSDMap(hash, mapReq); |
131 | 144 | ||
132 | LLSDMapLayerResponse mapResponse= new LLSDMapLayerResponse(); | 145 | LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse(); |
133 | mapResponse.LayerData.Array.Add(this.BuildLLSDMapLayerResponse()); | 146 | mapResponse.LayerData.Array.Add(this.BuildLLSDMapLayerResponse()); |
134 | string res = LLSDHelpers.SerialiseLLSDReply(mapResponse); | 147 | string res = LLSDHelpers.SerialiseLLSDReply(mapResponse); |
135 | 148 | ||
136 | return res; | 149 | return res; |
137 | } | 150 | } |
138 | 151 | ||
152 | |||
139 | /// <summary> | 153 | /// <summary> |
140 | /// | 154 | /// |
141 | /// </summary> | 155 | /// </summary> |
@@ -214,7 +228,7 @@ namespace OpenSim.Region.Capabilities | |||
214 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); | 228 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); |
215 | AssetUploader uploader = new AssetUploader(newAsset, newInvItem, uploaderPath, this.httpListener); | 229 | AssetUploader uploader = new AssetUploader(newAsset, newInvItem, uploaderPath, this.httpListener); |
216 | 230 | ||
217 | AddCapsHandler( httpListener, uploaderPath, uploader.uploaderCaps); | 231 | AddLegacyCapsHandler( httpListener, uploaderPath, uploader.uploaderCaps); |
218 | 232 | ||
219 | string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + uploaderPath; | 233 | string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + uploaderPath; |
220 | //Console.WriteLine("uploader url is " + uploaderURL); | 234 | //Console.WriteLine("uploader url is " + uploaderURL); |