aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Examples/SimpleApp/LlsdMethodEntry.cs
diff options
context:
space:
mode:
authorlbsa712007-07-03 07:06:08 +0000
committerlbsa712007-07-03 07:06:08 +0000
commit73a5ec391aa5600cb779044fbf335ce0537e9500 (patch)
tree9df98727f377806ab6e5afdabc3299cfa03a178b /OpenSim/Region/Examples/SimpleApp/LlsdMethodEntry.cs
parentYou can now substitute %name% in the filename argument for terrain save & loa... (diff)
downloadopensim-SC_OLD-73a5ec391aa5600cb779044fbf335ce0537e9500.zip
opensim-SC_OLD-73a5ec391aa5600cb779044fbf335ce0537e9500.tar.gz
opensim-SC_OLD-73a5ec391aa5600cb779044fbf335ce0537e9500.tar.bz2
opensim-SC_OLD-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.cs44
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 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.Framework.Servers;
5using OpenSim.Region.Capabilities;
6using libsecondlife;
7using System.Collections;
8
9namespace 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}