public void OnPlacesQueryRequest(UUID QueryID, UUID TransactionID, string QueryText, uint QueryFlags, byte Category, string SimName, IClientAPI client) { if (QueryFlags == 64) //Agent Owned { //Get all the parcels LandData[] LandData = directoryService.GetParcelByOwner(client.AgentId); client.SendPlacesQuery((from land in LandData let region = m_Scenes[0].GridService.GetRegionByUUID(UUID.Zero, land.RegionID) where region != null select new ExtendedLandData { LandData = land, RegionType = region.RegionType, RegionName = region.RegionName, GlobalPosX = region.RegionLocX + land.UserLocation.X, GlobalPosY = region.RegionLocY + land.UserLocation.Y }).ToArray(), QueryID, TransactionID); } if (QueryFlags == 256) //Group Owned { //Find all the group owned land LandData[] LandData = directoryService.GetParcelByOwner(QueryID); List <ExtendedLandData> parcels = (from land in LandData let region = m_Scenes[0].GridService.GetRegionByUUID(UUID.Zero, land.RegionID) where region != null select new ExtendedLandData { LandData = land, RegionType = region.RegionType, RegionName = region.RegionName, GlobalPosX = region.RegionLocX + land.UserLocation.X, GlobalPosY = region.RegionLocY + land.UserLocation.Y }).ToList(); //Send if we have any parcels if (parcels.Count != 0) { client.SendPlacesQuery(parcels.ToArray(), QueryID, TransactionID); } } }
public void OnPlacesQueryRequest(UUID QueryID, UUID TransactionID, string QueryText, uint QueryFlags, byte Category, string SimName, IClientAPI client) { if (QueryFlags == 64) //Agent Owned { //Get all the parcels LandData[] LandData = directoryService.GetParcelByOwner(client.AgentId); List <ExtendedLandData> parcels = new List <ExtendedLandData>(); foreach (LandData land in LandData) { //Find the region so we can add the meters correctly OpenSim.Services.Interfaces.GridRegion region = m_Scenes[0].GridService.GetRegionByUUID(UUID.Zero, land.RegionID); if (region != null) { ExtendedLandData parcel = new ExtendedLandData(); parcel.LandData = land; parcel.RegionType = region.RegionType; parcel.RegionName = region.RegionName; parcel.GlobalPosX = region.RegionLocX + land.UserLocation.X; parcel.GlobalPosY = region.RegionLocY + land.UserLocation.Y; parcels.Add(parcel); } } client.SendPlacesQuery(parcels.ToArray(), QueryID, TransactionID); } if (QueryFlags == 256) //Group Owned { //Find all the group owned land LandData[] LandData = directoryService.GetParcelByOwner(QueryID); List <ExtendedLandData> parcels = new List <ExtendedLandData>(); foreach (LandData land in LandData) { //Find the region from the grid service so that we can add the meters correctly OpenSim.Services.Interfaces.GridRegion region = m_Scenes[0].GridService.GetRegionByUUID(UUID.Zero, land.RegionID); if (region != null) { ExtendedLandData parcel = new ExtendedLandData(); parcel.LandData = land; parcel.RegionType = region.RegionType; parcel.RegionName = region.RegionName; parcel.GlobalPosX = region.RegionLocX + land.UserLocation.X; parcel.GlobalPosY = region.RegionLocY + land.UserLocation.Y; parcels.Add(parcel); } } //Send if we have any parcels if (parcels.Count != 0) { client.SendPlacesQuery(parcels.ToArray(), QueryID, TransactionID); } } }
public void OnPlacesQueryRequest(UUID QueryID, UUID TransactionID, string QueryText, uint QueryFlags, byte Category, string SimName, IClientAPI client) { if (QueryFlags == 64) //Agent Owned { //Get all the parcels client.SendPlacesQuery(directoryService.GetParcelByOwner(client.AgentId).ToArray(), QueryID, TransactionID); } if (QueryFlags == 256) //Group Owned { //Find all the group owned land List <ExtendedLandData> parcels = directoryService.GetParcelByOwner(QueryID); //Send if we have any parcels if (parcels.Count != 0) { client.SendPlacesQuery(parcels.ToArray(), QueryID, TransactionID); } } }
public byte[] GetParcelByOwner(OSDMap request) { UUID OwnerID = request["OwnerID"].AsUUID(); LandData[] parcels = DirectoryServiceConnector.GetParcelByOwner(OwnerID); OSDMap result = new OSDMap(); OSDArray array = new OSDArray(); foreach (LandData land in parcels) { array.Add(land.ToOSD()); } result["Parcels"] = array; UTF8Encoding encoding = new UTF8Encoding(); return(encoding.GetBytes(OSDParser.SerializeJsonString(request))); }