diff options
Diffstat (limited to 'OpenSim/Region/Examples/SimpleApp/LlsdMethodEntry.cs')
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/LlsdMethodEntry.cs | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/OpenSim/Region/Examples/SimpleApp/LlsdMethodEntry.cs b/OpenSim/Region/Examples/SimpleApp/LlsdMethodEntry.cs index f946482..d0ef2af 100644 --- a/OpenSim/Region/Examples/SimpleApp/LlsdMethodEntry.cs +++ b/OpenSim/Region/Examples/SimpleApp/LlsdMethodEntry.cs | |||
@@ -2,40 +2,9 @@ using System.Collections; | |||
2 | using System.Text; | 2 | using System.Text; |
3 | using libsecondlife; | 3 | using libsecondlife; |
4 | using OpenSim.Region.Capabilities; | 4 | using OpenSim.Region.Capabilities; |
5 | using System.IO; | ||
5 | 6 | ||
6 | namespace OpenSim.Framework.Servers | 7 | namespace OpenSim.Framework.Servers |
7 | { | 8 | { |
8 | public class LlsdMethodEntry<TResponse, TRequest> : ILlsdMethodHandler | 9 | |
9 | where TRequest : new() | ||
10 | { | ||
11 | private LlsdMethod<TResponse, TRequest> m_method; | ||
12 | |||
13 | |||
14 | public LlsdMethodEntry( ) | ||
15 | { | ||
16 | |||
17 | } | ||
18 | |||
19 | public LlsdMethodEntry(LlsdMethod<TResponse, TRequest> method) | ||
20 | { | ||
21 | m_method = method; | ||
22 | } | ||
23 | |||
24 | #region ILlsdMethodHandler Members | ||
25 | |||
26 | public string Handle(string body, string path) | ||
27 | { | ||
28 | Encoding _enc = Encoding.UTF8; | ||
29 | Hashtable hash = (Hashtable)LLSD.LLSDDeserialize(_enc.GetBytes( body )); | ||
30 | TRequest request = new TRequest(); | ||
31 | |||
32 | LLSDHelpers.DeserialiseLLSDMap(hash, request ); | ||
33 | |||
34 | TResponse response = m_method(request); | ||
35 | |||
36 | return LLSDHelpers.SerialiseLLSDReply( response ); | ||
37 | } | ||
38 | |||
39 | #endregion | ||
40 | } | ||
41 | } | 10 | } |