aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Common/OpenSim.Framework/SimProfile.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Common/OpenSim.Framework/SimProfile.cs')
-rw-r--r--Common/OpenSim.Framework/SimProfile.cs110
1 files changed, 0 insertions, 110 deletions
diff --git a/Common/OpenSim.Framework/SimProfile.cs b/Common/OpenSim.Framework/SimProfile.cs
deleted file mode 100644
index 0d79ee9..0000000
--- a/Common/OpenSim.Framework/SimProfile.cs
+++ /dev/null
@@ -1,110 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28using System;
29using System.Collections.Generic;
30using System.Collections;
31using System.Xml;
32using System.Text;
33using libsecondlife;
34using Nwc.XmlRpc;
35
36namespace OpenSim.Framework.Sims
37{
38 public class SimProfile : SimProfileBase
39 {
40 public SimProfile LoadFromGrid(ulong region_handle, string GridURL, string SendKey, string RecvKey)
41 {
42 try
43 {
44 Hashtable GridReqParams = new Hashtable();
45 GridReqParams["region_handle"] = region_handle.ToString();
46 GridReqParams["authkey"] = SendKey;
47 ArrayList SendParams = new ArrayList();
48 SendParams.Add(GridReqParams);
49 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
50
51 XmlRpcResponse GridResp = GridReq.Send(GridURL, 3000);
52
53 Hashtable RespData = (Hashtable)GridResp.Value;
54 this.UUID = new LLUUID((string)RespData["UUID"]);
55 this.regionhandle = Helpers.UIntsToLong(((uint)Convert.ToUInt32(RespData["region_locx"]) * 256), ((uint)Convert.ToUInt32(RespData["region_locy"]) * 256));
56 this.regionname = (string)RespData["regionname"];
57 this.sim_ip = (string)RespData["sim_ip"];
58 this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]);
59 this.caps_url = "http://" + ((string)RespData["sim_ip"]) + ":" + (string)RespData["sim_port"] + "/";
60 this.RegionLocX = (uint)Convert.ToUInt32(RespData["region_locx"]);
61 this.RegionLocY = (uint)Convert.ToUInt32(RespData["region_locy"]);
62 this.sendkey = SendKey;
63 this.recvkey = RecvKey;
64 }
65 catch (Exception e)
66 {
67 Console.WriteLine(e.ToString());
68 }
69 return this;
70 }
71
72 public SimProfile LoadFromGrid(LLUUID UUID, string GridURL, string SendKey, string RecvKey)
73 {
74 try
75 {
76 Hashtable GridReqParams = new Hashtable();
77 GridReqParams["UUID"] = UUID.ToString();
78 GridReqParams["authkey"] = SendKey;
79 ArrayList SendParams = new ArrayList();
80 SendParams.Add(GridReqParams);
81 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
82
83 XmlRpcResponse GridResp = GridReq.Send(GridURL, 3000);
84
85 Hashtable RespData = (Hashtable)GridResp.Value;
86 this.UUID = new LLUUID((string)RespData["UUID"]);
87 this.regionhandle = Helpers.UIntsToLong(((uint)Convert.ToUInt32(RespData["region_locx"]) * 256), ((uint)Convert.ToUInt32(RespData["region_locy"]) * 256));
88 this.regionname = (string)RespData["regionname"];
89 this.sim_ip = (string)RespData["sim_ip"];
90 this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]);
91 this.caps_url = "http://" + ((string)RespData["sim_ip"]) + ":" + (string)RespData["sim_port"] + "/";
92 this.RegionLocX = (uint)Convert.ToUInt32(RespData["region_locx"]);
93 this.RegionLocY = (uint)Convert.ToUInt32(RespData["region_locy"]);
94 this.sendkey = SendKey;
95 this.recvkey = RecvKey;
96 }
97 catch (Exception e)
98 {
99 Console.WriteLine(e.ToString());
100 }
101 return this;
102 }
103
104
105 public SimProfile()
106 {
107 }
108 }
109
110}