diff options
author | gareth | 2007-03-22 10:11:15 +0000 |
---|---|---|
committer | gareth | 2007-03-22 10:11:15 +0000 |
commit | 7daa3955bc3a1918e40962851f9e8d38597a245e (patch) | |
tree | bee3e1372a7eed0c1b220a8a49f7bee7d29a6b91 /OpenSim.Framework/SimProfile.cs | |
parent | Load XML for neighbourinfo from grid (diff) | |
download | opensim-SC_OLD-7daa3955bc3a1918e40962851f9e8d38597a245e.zip opensim-SC_OLD-7daa3955bc3a1918e40962851f9e8d38597a245e.tar.gz opensim-SC_OLD-7daa3955bc3a1918e40962851f9e8d38597a245e.tar.bz2 opensim-SC_OLD-7daa3955bc3a1918e40962851f9e8d38597a245e.tar.xz |
brought zircon branch into trunk
Diffstat (limited to 'OpenSim.Framework/SimProfile.cs')
-rw-r--r-- | OpenSim.Framework/SimProfile.cs | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/OpenSim.Framework/SimProfile.cs b/OpenSim.Framework/SimProfile.cs new file mode 100644 index 0000000..ac4cf9e --- /dev/null +++ b/OpenSim.Framework/SimProfile.cs | |||
@@ -0,0 +1,51 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Collections; | ||
4 | using System.Xml; | ||
5 | using System.Text; | ||
6 | using libsecondlife; | ||
7 | using Nwc.XmlRpc; | ||
8 | |||
9 | namespace OpenSim.Framework.Sims | ||
10 | { | ||
11 | public class SimProfile : SimProfileBase | ||
12 | { | ||
13 | public SimProfile LoadFromGrid(ulong region_handle, string GridURL, string SendKey, string RecvKey) | ||
14 | { | ||
15 | try | ||
16 | { | ||
17 | Hashtable GridReqParams = new Hashtable(); | ||
18 | GridReqParams["region_handle"] = region_handle.ToString(); | ||
19 | GridReqParams["caller"] = "userserver"; | ||
20 | GridReqParams["authkey"] = SendKey; | ||
21 | ArrayList SendParams = new ArrayList(); | ||
22 | SendParams.Add(GridReqParams); | ||
23 | XmlRpcRequest GridReq = new XmlRpcRequest("get_sim_info", SendParams); | ||
24 | |||
25 | XmlRpcResponse GridResp = GridReq.Send(GridURL, 3000); | ||
26 | |||
27 | Hashtable RespData = (Hashtable)GridResp.Value; | ||
28 | this.UUID = new LLUUID((string)RespData["UUID"]); | ||
29 | this.regionhandle = (ulong)Convert.ToUInt64(RespData["regionhandle"]); | ||
30 | this.regionname = (string)RespData["regionname"]; | ||
31 | this.sim_ip = (string)RespData["sim_ip"]; | ||
32 | this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]); | ||
33 | this.caps_url = (string)RespData["caps_url"]; | ||
34 | this.RegionLocX = (uint)Convert.ToUInt32(RespData["RegionLocX"]); | ||
35 | this.RegionLocY = (uint)Convert.ToUInt32(RespData["RegionLocY"]); | ||
36 | this.sendkey = (string)RespData["sendkey"]; | ||
37 | this.recvkey = (string)RespData["recvkey"]; | ||
38 | } | ||
39 | catch (Exception e) | ||
40 | { | ||
41 | Console.WriteLine(e.ToString()); | ||
42 | } | ||
43 | return this; | ||
44 | } | ||
45 | |||
46 | public SimProfile() | ||
47 | { | ||
48 | } | ||
49 | } | ||
50 | |||
51 | } | ||