aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data/SimProfileData.cs
diff options
context:
space:
mode:
authormingchen2007-07-05 15:15:28 +0000
committermingchen2007-07-05 15:15:28 +0000
commit583f2a9de8e503773a427facd5f81a82b40bd585 (patch)
tree35d434db32056e7d0b231f56f2732c031c130a1d /OpenSim/Framework/Data/SimProfileData.cs
parent* Tweaks to Java engine (uses less threads). Added support for OnFrame and On... (diff)
downloadopensim-SC_OLD-583f2a9de8e503773a427facd5f81a82b40bd585.zip
opensim-SC_OLD-583f2a9de8e503773a427facd5f81a82b40bd585.tar.gz
opensim-SC_OLD-583f2a9de8e503773a427facd5f81a82b40bd585.tar.bz2
opensim-SC_OLD-583f2a9de8e503773a427facd5f81a82b40bd585.tar.xz
*Removed SimProfile.cs as it is no longer needed (in favor of SimProfileData)
*Added simulator_data_request XMLRPC method to request data from the grid server about a sim instead of faking its login *Login is progressing, now just getting an XML error (http://pastebin.com/942515) -- if you can fix this, throw MingChen in IRC a Private Message
Diffstat (limited to 'OpenSim/Framework/Data/SimProfileData.cs')
-rw-r--r--OpenSim/Framework/Data/SimProfileData.cs70
1 files changed, 70 insertions, 0 deletions
diff --git a/OpenSim/Framework/Data/SimProfileData.cs b/OpenSim/Framework/Data/SimProfileData.cs
index 3dddfb4..9db8574 100644
--- a/OpenSim/Framework/Data/SimProfileData.cs
+++ b/OpenSim/Framework/Data/SimProfileData.cs
@@ -26,6 +26,10 @@
26* 26*
27*/ 27*/
28using libsecondlife; 28using libsecondlife;
29using Nwc.XmlRpc;
30
31using System;
32using System.Collections;
29 33
30namespace OpenSim.Framework.Data 34namespace OpenSim.Framework.Data
31{ 35{
@@ -108,5 +112,71 @@ namespace OpenSim.Framework.Data
108 /// Region Map Texture Asset 112 /// Region Map Texture Asset
109 /// </summary> 113 /// </summary>
110 public LLUUID regionMapTextureID = new LLUUID("00000000-0000-0000-9999-000000000006"); 114 public LLUUID regionMapTextureID = new LLUUID("00000000-0000-0000-9999-000000000006");
115
116 /// <summary>
117 /// Get Sim profile data from grid server when in grid mode
118 /// </summary>
119 /// <param name="region_uuid"></param>
120 /// <param name="gridserver_url"></param>
121 /// <param name="?"></param>
122 /// <returns></returns>
123 public SimProfileData RequestSimProfileData(LLUUID region_uuid, string gridserver_url, string gridserver_sendkey, string gridserver_recvkey)
124 {
125 Hashtable requestData = new Hashtable();
126 requestData["region_uuid"] = region_uuid.UUID.ToString();
127 requestData["authkey"] = gridserver_sendkey;
128 ArrayList SendParams = new ArrayList();
129 SendParams.Add(requestData);
130 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams);
131 XmlRpcResponse GridResp = GridReq.Send(gridserver_url, 3000);
132
133 Hashtable responseData = (Hashtable)GridResp.Value;
134
135 if (responseData.ContainsKey("error"))
136 {
137 return null;
138 }
139
140 SimProfileData simData = new SimProfileData();
141 simData.regionLocX = Convert.ToUInt32((string)responseData["region_locx"]);
142 simData.regionLocY = Convert.ToUInt32((string)responseData["region_locy"]);
143 simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX * 256), (simData.regionLocY * 256));
144 simData.serverIP = (string)responseData["sim_ip"];
145 simData.serverPort = Convert.ToUInt32((string)responseData["sim_port"]);
146 simData.serverURI = "http://" + simData.serverIP + ":" + simData.serverPort.ToString() + "/";
147 simData.UUID = new LLUUID((string)responseData["region_UUID"]);
148 simData.regionName = (string)responseData["region_name"];
149
150 return simData;
151 }
152 public SimProfileData RequestSimProfileData(ulong region_handle, string gridserver_url, string gridserver_sendkey, string gridserver_recvkey)
153 {
154 Hashtable requestData = new Hashtable();
155 requestData["region_handle"] = region_handle.ToString();
156 requestData["authkey"] = gridserver_sendkey;
157 ArrayList SendParams = new ArrayList();
158 SendParams.Add(requestData);
159 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams);
160 XmlRpcResponse GridResp = GridReq.Send(gridserver_url, 3000);
161
162 Hashtable responseData = (Hashtable)GridResp.Value;
163
164 if (responseData.ContainsKey("error"))
165 {
166 return null;
167 }
168
169 SimProfileData simData = new SimProfileData();
170 simData.regionLocX = Convert.ToUInt32((string)responseData["region_locx"]);
171 simData.regionLocY = Convert.ToUInt32((string)responseData["region_locy"]);
172 simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX * 256), (simData.regionLocY * 256));
173 simData.serverIP = (string)responseData["sim_ip"];
174 simData.serverPort = Convert.ToUInt32((string)responseData["sim_port"]);
175 simData.serverURI = "http://" + simData.serverIP + ":" + simData.serverPort.ToString() + "/";
176 simData.UUID = new LLUUID((string)responseData["region_UUID"]);
177 simData.regionName = (string)responseData["region_name"];
178
179 return simData;
180 }
111 } 181 }
112} 182}