diff options
author | lbsa71 | 2007-07-03 07:06:08 +0000 |
---|---|---|
committer | lbsa71 | 2007-07-03 07:06:08 +0000 |
commit | 73a5ec391aa5600cb779044fbf335ce0537e9500 (patch) | |
tree | 9df98727f377806ab6e5afdabc3299cfa03a178b /OpenSim/Region/Examples/SimpleApp/LlsdMethodEntry.cs | |
parent | You can now substitute %name% in the filename argument for terrain save & loa... (diff) | |
download | opensim-SC-73a5ec391aa5600cb779044fbf335ce0537e9500.zip opensim-SC-73a5ec391aa5600cb779044fbf335ce0537e9500.tar.gz opensim-SC-73a5ec391aa5600cb779044fbf335ce0537e9500.tar.bz2 opensim-SC-73a5ec391aa5600cb779044fbf335ce0537e9500.tar.xz |
* Completed conceptual LlsdMethod - everything resides in SimpleApp pending guru approval.
Diffstat (limited to 'OpenSim/Region/Examples/SimpleApp/LlsdMethodEntry.cs')
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/LlsdMethodEntry.cs | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/OpenSim/Region/Examples/SimpleApp/LlsdMethodEntry.cs b/OpenSim/Region/Examples/SimpleApp/LlsdMethodEntry.cs new file mode 100644 index 0000000..c3d3d33 --- /dev/null +++ b/OpenSim/Region/Examples/SimpleApp/LlsdMethodEntry.cs | |||
@@ -0,0 +1,44 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using OpenSim.Framework.Servers; | ||
5 | using OpenSim.Region.Capabilities; | ||
6 | using libsecondlife; | ||
7 | using System.Collections; | ||
8 | |||
9 | namespace OpenSim.Framework.Servers | ||
10 | { | ||
11 | public class LlsdMethodEntry<TResponse, TRequest> : ILlsdMethodHandler | ||
12 | where TRequest : new() | ||
13 | { | ||
14 | private LlsdMethod<TResponse, TRequest> m_method; | ||
15 | |||
16 | |||
17 | public LlsdMethodEntry( ) | ||
18 | { | ||
19 | |||
20 | } | ||
21 | |||
22 | public LlsdMethodEntry(LlsdMethod<TResponse, TRequest> method) | ||
23 | { | ||
24 | m_method = method; | ||
25 | } | ||
26 | |||
27 | #region ILlsdMethodHandler Members | ||
28 | |||
29 | public string Handle(string body, string path) | ||
30 | { | ||
31 | Encoding _enc = System.Text.Encoding.UTF8; | ||
32 | Hashtable hash = (Hashtable)LLSD.LLSDDeserialize(_enc.GetBytes( body )); | ||
33 | TRequest request = new TRequest(); | ||
34 | |||
35 | LLSDHelpers.DeserialiseLLSDMap(hash, request ); | ||
36 | |||
37 | TResponse response = m_method(request); | ||
38 | |||
39 | return LLSDHelpers.SerialiseLLSDReply( response ); | ||
40 | } | ||
41 | |||
42 | #endregion | ||
43 | } | ||
44 | } | ||