30 using System.Collections;
31 using System.Collections.Generic;
33 using System.Reflection;
35 using OpenSim.Framework;
37 using OpenSim.Services.Interfaces;
42 namespace OpenSim.Services.Connectors
46 private static readonly ILog m_log =
48 MethodBase.GetCurrentMethod().DeclaringType);
58 Initialise(gridServices);
63 m_GridService = gridServices;
66 public virtual LandData GetLandData(UUID scopeID, ulong regionHandle, uint x, uint y, out byte regionAccess)
69 Hashtable hash =
new Hashtable();
70 hash[
"region_handle"] = regionHandle.ToString();
71 hash[
"x"] = x.ToString();
72 hash[
"y"] = y.ToString();
74 IList paramList =
new ArrayList();
80 uint xpos = 0, ypos = 0;
81 Util.RegionHandleToWorldLoc(regionHandle, out xpos, out ypos);
82 GridRegion info = m_GridService.GetRegionByPosition(scopeID, (int)xpos, (
int)ypos);
85 XmlRpcRequest request =
new XmlRpcRequest(
"land_data", paramList);
86 XmlRpcResponse response = request.Send(info.ServerURI, 10000);
89 m_log.ErrorFormat(
"[LAND CONNECTOR]: remote call returned an error: {0}", response.FaultString);
93 hash = (Hashtable)response.Value;
97 landData.AABBMax = Vector3.Parse((string)hash[
"AABBMax"]);
98 landData.AABBMin = Vector3.Parse((string)hash[
"AABBMin"]);
99 landData.Area = Convert.ToInt32(hash[
"Area"]);
100 landData.AuctionID = Convert.ToUInt32(hash[
"AuctionID"]);
101 landData.Description = (string)hash[
"Description"];
102 landData.Flags = Convert.ToUInt32(hash[
"Flags"]);
103 landData.GlobalID =
new UUID((
string)hash[
"GlobalID"]);
104 landData.Name = (string)hash[
"Name"];
105 landData.OwnerID =
new UUID((
string)hash[
"OwnerID"]);
106 landData.SalePrice = Convert.ToInt32(hash[
"SalePrice"]);
107 landData.SnapshotID =
new UUID((
string)hash[
"SnapshotID"]);
108 landData.UserLocation = Vector3.Parse((string)hash[
"UserLocation"]);
109 if (hash[
"RegionAccess"] != null)
110 regionAccess = (byte)Convert.ToInt32((
string)hash[
"RegionAccess"]);
111 m_log.DebugFormat(
"[LAND CONNECTOR]: Got land data for parcel {0}", landData.Name);
116 "[LAND CONNECTOR]: Got exception while parsing land-data: {0} {1}",
117 e.Message, e.StackTrace);
122 m_log.WarnFormat(
"[LAND CONNECTOR]: Couldn't find region with handle {0}", regionHandle);
127 "[LAND CONNECTOR]: Couldn't contact region {0}: {1} {2}", regionHandle, e.Message, e.StackTrace);
virtual void Initialise(IGridService gridServices)
LandServicesConnector(IGridService gridServices)
Details of a Parcel of land
virtual LandData GetLandData(UUID scopeID, ulong regionHandle, uint x, uint y, out byte regionAccess)
OpenSim.Services.Interfaces.GridRegion GridRegion