aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data/RegionProfileData.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-03-18 05:44:25 +0000
committerTeravus Ovares2008-03-18 05:44:25 +0000
commit42857fe4e9e898c8e350da2f9acb3b252b31694a (patch)
treede55ab7f5d6d6e1bb127a39f6e97f67e4e442cf4 /OpenSim/Framework/Data/RegionProfileData.cs
parentFormatting cleanup. (diff)
downloadopensim-SC_OLD-42857fe4e9e898c8e350da2f9acb3b252b31694a.zip
opensim-SC_OLD-42857fe4e9e898c8e350da2f9acb3b252b31694a.tar.gz
opensim-SC_OLD-42857fe4e9e898c8e350da2f9acb3b252b31694a.tar.bz2
opensim-SC_OLD-42857fe4e9e898c8e350da2f9acb3b252b31694a.tar.xz
* Added the ability to type the partial name of a region in the start location box and go to that region if it's there. If no close match was found, it sends you home. This is tested on mySQL. There's untested code on grids that are based on sqlite and MSSQL. The SQL statements *should* be right, but your results may very.
* Ex, if you want to go to Wright Plaza, you simply need to type Wright Plaza in the start location in the client when you log-in.
Diffstat (limited to 'OpenSim/Framework/Data/RegionProfileData.cs')
-rw-r--r--OpenSim/Framework/Data/RegionProfileData.cs42
1 files changed, 42 insertions, 0 deletions
diff --git a/OpenSim/Framework/Data/RegionProfileData.cs b/OpenSim/Framework/Data/RegionProfileData.cs
index b541116..f736571 100644
--- a/OpenSim/Framework/Data/RegionProfileData.cs
+++ b/OpenSim/Framework/Data/RegionProfileData.cs
@@ -216,5 +216,47 @@ namespace OpenSim.Framework.Data
216 216
217 return simData; 217 return simData;
218 } 218 }
219
220 /// <summary>
221 /// Request sim profile information from a grid server
222 /// </summary>
223 /// <param name="region_handle"></param>
224 /// <param name="gridserver_url"></param>
225 /// <param name="gridserver_sendkey"></param>
226 /// <param name="gridserver_recvkey"></param>
227 /// <returns>The sim profile. Null if there was a request failure</returns>
228 public static RegionProfileData RequestSimProfileData(string regionName, string gridserver_url,
229 string gridserver_sendkey, string gridserver_recvkey)
230 {
231 Hashtable requestData = new Hashtable();
232 requestData["region_name_search"] = regionName;
233 requestData["authkey"] = gridserver_sendkey;
234 ArrayList SendParams = new ArrayList();
235 SendParams.Add(requestData);
236 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams);
237 XmlRpcResponse GridResp = GridReq.Send(gridserver_url, 3000);
238
239 Hashtable responseData = (Hashtable)GridResp.Value;
240
241 if (responseData.ContainsKey("error"))
242 {
243 return null;
244 }
245
246 RegionProfileData simData = new RegionProfileData();
247 simData.regionLocX = Convert.ToUInt32((string)responseData["region_locx"]);
248 simData.regionLocY = Convert.ToUInt32((string)responseData["region_locy"]);
249 simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX * Constants.RegionSize), (simData.regionLocY * Constants.RegionSize));
250 simData.serverIP = (string)responseData["sim_ip"];
251 simData.serverPort = Convert.ToUInt32((string)responseData["sim_port"]);
252 simData.httpPort = Convert.ToUInt32((string)responseData["http_port"]);
253 simData.remotingPort = Convert.ToUInt32((string)responseData["remoting_port"]);
254 simData.httpServerURI = "http://" + simData.serverIP + ":" + simData.httpPort.ToString() + "/";
255 simData.serverURI = (string)responseData["server_uri"];
256 simData.UUID = new LLUUID((string)responseData["region_UUID"]);
257 simData.regionName = (string)responseData["region_name"];
258
259 return simData;
260 }
219 } 261 }
220} 262}