123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- using System;
- using System.Collections;
- using System.IO;
- using System.Reflection;
- using System.Net;
- using System.Text;
- using OpenSim.Server.Base;
- using OpenSim.Server.Handlers.Base;
- using OpenSim.Services.Interfaces;
- using OpenSim.Framework;
- using OpenSim.Framework.Servers.HttpServer;
- using OpenMetaverse;
- using OpenMetaverse.StructuredData;
- using Nwc.XmlRpc;
- using Nini.Config;
- using log4net;
- namespace OpenSim.Server.Handlers.Land
- {
- public class LandHandlers
- {
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
- private ILandService m_LocalService;
- public LandHandlers(ILandService service)
- {
- m_LocalService = service;
- }
- public XmlRpcResponse GetLandData(XmlRpcRequest request, IPEndPoint remoteClient)
- {
- Hashtable requestData = (Hashtable)request.Params[0];
- ulong regionHandle = Convert.ToUInt64(requestData["region_handle"]);
- uint x = Convert.ToUInt32(requestData["x"]);
- uint y = Convert.ToUInt32(requestData["y"]);
- m_log.DebugFormat("[LAND HANDLER]: Got request for land data at {0}, {1} for region {2}", x, y, regionHandle);
- byte regionAccess;
- LandData landData = m_LocalService.GetLandData(UUID.Zero, regionHandle, x, y, out regionAccess);
- Hashtable hash = new Hashtable();
- if (landData != null)
- {
-
- hash["AABBMax"] = landData.AABBMax.ToString();
- hash["AABBMin"] = landData.AABBMin.ToString();
- hash["Area"] = landData.Area.ToString();
- hash["AuctionID"] = landData.AuctionID.ToString();
- hash["Description"] = landData.Description;
- hash["Flags"] = landData.Flags.ToString();
- hash["GlobalID"] = landData.GlobalID.ToString();
- hash["Name"] = landData.Name;
- hash["OwnerID"] = landData.OwnerID.ToString();
- hash["SalePrice"] = landData.SalePrice.ToString();
- hash["SnapshotID"] = landData.SnapshotID.ToString();
- hash["UserLocation"] = landData.UserLocation.ToString();
- hash["RegionAccess"] = regionAccess.ToString();
- }
- XmlRpcResponse response = new XmlRpcResponse();
- response.Value = hash;
- return response;
- }
- }
- }
|